3 * Stefano Babic, DENX Gmbh, sbabic@denx.de
6 * Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
9 * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
12 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
13 * Marius Groeger <mgroeger@sysgo.de>
15 * See file CREDITS for list of people who contributed to this
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
35 #include <asm/arch/pxa-regs.h>
36 #include <asm/arch/pxa.h>
40 DECLARE_GLOBAL_DATA_PTR;
42 #define RH_A_PSM (1 << 8) /* power switching mode */
43 #define RH_A_NPS (1 << 9) /* no power switching */
45 extern struct serial_device serial_ffuart_device;
46 extern struct serial_device serial_btuart_device;
47 extern struct serial_device serial_stuart_device;
50 #define BOOT_CONSOLE "serial_stuart"
52 #define BOOT_CONSOLE "serial_ffuart"
54 /* ------------------------------------------------------------------------- */
57 * Miscelaneous platform dependent initialisations
60 int usb_board_init(void)
62 writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
63 ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
66 writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
68 while (readl(UHCHR) & UHCHR_FSBIR)
71 writel(readl(UHCHR) & ~UHCHR_SSE, UHCHR);
72 writel((UHCHIE_UPRIE | UHCHIE_RWIE), UHCHIE);
74 /* Clear any OTG Pin Hold */
75 if (readl(PSSR) & PSSR_OTGPH)
76 writel(readl(PSSR) | PSSR_OTGPH, PSSR);
78 writel(readl(UHCRHDA) & ~(RH_A_NPS), UHCRHDA);
79 writel(readl(UHCRHDA) | RH_A_PSM, UHCRHDA);
81 /* Set port power control mask bits, only 3 ports. */
82 writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
87 void usb_board_init_fail(void)
92 void usb_board_stop(void)
94 writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
96 writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
98 writel(readl(UHCCOMS) | 1, UHCCOMS);
101 writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
106 int board_init (void)
108 /* We have RAM, disable cache */
112 /* arch number of ConXS Board */
113 gd->bd->bi_arch_number = 776;
115 /* adress of boot parameters */
116 gd->bd->bi_boot_params = 0xa000003c;
121 int board_late_init(void)
123 #if defined(CONFIG_SERIAL_MULTI)
124 char *console=getenv("boot_console");
126 if ((console == NULL) || (strcmp(console,"serial_btuart") &&
127 strcmp(console,"serial_stuart") &&
128 strcmp(console,"serial_ffuart"))) {
129 console = BOOT_CONSOLE;
131 setenv("stdout",console);
132 setenv("stdin", console);
133 setenv("stderr",console);
138 struct serial_device *default_serial_console (void)
140 return &serial_ffuart_device;
146 gd->ram_size = PHYS_SDRAM_1_SIZE;
150 void dram_init_banksize(void)
152 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
153 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
156 #ifdef CONFIG_DRIVER_DM9000
157 int board_eth_init(bd_t *bis)
159 return dm9000_initialize(bis);