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 * SPDX-License-Identifier: GPL-2.0+
19 #include <asm/arch/pxa-regs.h>
20 #include <asm/arch/pxa.h>
21 #include <asm/arch/regs-mmc.h>
26 DECLARE_GLOBAL_DATA_PTR
;
28 #define RH_A_PSM (1 << 8) /* power switching mode */
29 #define RH_A_NPS (1 << 9) /* no power switching */
31 extern struct serial_device serial_ffuart_device
;
32 extern struct serial_device serial_btuart_device
;
33 extern struct serial_device serial_stuart_device
;
36 #define BOOT_CONSOLE "serial_stuart"
38 #define BOOT_CONSOLE "serial_ffuart"
40 /* ------------------------------------------------------------------------- */
43 * Miscelaneous platform dependent initialisations
46 int board_usb_init(int index
, enum usb_init_type init
)
48 writel((readl(UHCHR
) | UHCHR_PCPL
| UHCHR_PSPL
) &
49 ~(UHCHR_SSEP0
| UHCHR_SSEP1
| UHCHR_SSEP2
| UHCHR_SSE
),
52 writel(readl(UHCHR
) | UHCHR_FSBIR
, UHCHR
);
54 while (readl(UHCHR
) & UHCHR_FSBIR
)
57 writel(readl(UHCHR
) & ~UHCHR_SSE
, UHCHR
);
58 writel((UHCHIE_UPRIE
| UHCHIE_RWIE
), UHCHIE
);
60 /* Clear any OTG Pin Hold */
61 if (readl(PSSR
) & PSSR_OTGPH
)
62 writel(readl(PSSR
) | PSSR_OTGPH
, PSSR
);
64 writel(readl(UHCRHDA
) & ~(RH_A_NPS
), UHCRHDA
);
65 writel(readl(UHCRHDA
) | RH_A_PSM
, UHCRHDA
);
67 /* Set port power control mask bits, only 3 ports. */
68 writel(readl(UHCRHDB
) | (0x7<<17), UHCRHDB
);
73 int board_usb_cleanup(int index
, enum usb_init_type init
)
78 void usb_board_stop(void)
80 writel(readl(UHCHR
) | UHCHR_FHR
, UHCHR
);
82 writel(readl(UHCHR
) & ~UHCHR_FHR
, UHCHR
);
84 writel(readl(UHCCOMS
) | 1, UHCCOMS
);
87 writel(readl(CKEN
) & ~CKEN10_USBHOST
, CKEN
);
94 /* We have RAM, disable cache */
98 /* arch number of ConXS Board */
99 gd
->bd
->bi_arch_number
= 776;
101 /* adress of boot parameters */
102 gd
->bd
->bi_boot_params
= 0xa000003c;
107 int board_late_init(void)
109 char *console
=getenv("boot_console");
111 if ((console
== NULL
) || (strcmp(console
,"serial_btuart") &&
112 strcmp(console
,"serial_stuart") &&
113 strcmp(console
,"serial_ffuart"))) {
114 console
= BOOT_CONSOLE
;
116 setenv("stdout",console
);
117 setenv("stdin", console
);
118 setenv("stderr",console
);
125 gd
->ram_size
= PHYS_SDRAM_1_SIZE
;
129 void dram_init_banksize(void)
131 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
132 gd
->bd
->bi_dram
[0].size
= PHYS_SDRAM_1_SIZE
;
135 #ifdef CONFIG_DRIVER_DM9000
136 int board_eth_init(bd_t
*bis
)
138 return dm9000_initialize(bis
);
142 #ifdef CONFIG_CMD_MMC
143 int board_mmc_init(bd_t
*bis
)