1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#include <common.h>
35#include <asm/arch/pxa-regs.h>
36#include <netdev.h>
37#include <asm/io.h>
38
39DECLARE_GLOBAL_DATA_PTR;
40
41#define RH_A_PSM (1 << 8)
42#define RH_A_NPS (1 << 9)
43
44extern struct serial_device serial_ffuart_device;
45extern struct serial_device serial_btuart_device;
46extern struct serial_device serial_stuart_device;
47
48#if CONFIG_MK_POLARIS
49#define BOOT_CONSOLE "serial_stuart"
50#else
51#define BOOT_CONSOLE "serial_ffuart"
52#endif
53
54
55
56
57
58
59int usb_board_init(void)
60{
61 writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
62 ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
63 UHCHR);
64
65 writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
66
67 while (readl(UHCHR) & UHCHR_FSBIR)
68 ;
69
70 writel(readl(UHCHR) & ~UHCHR_SSE, UHCHR);
71 writel((UHCHIE_UPRIE | UHCHIE_RWIE), UHCHIE);
72
73
74 if (readl(PSSR) & PSSR_OTGPH)
75 writel(readl(PSSR) | PSSR_OTGPH, PSSR);
76
77 writel(readl(UHCRHDA) & ~(RH_A_NPS), UHCRHDA);
78 writel(readl(UHCRHDA) | RH_A_PSM, UHCRHDA);
79
80
81 writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
82
83 return 0;
84}
85
86void usb_board_init_fail(void)
87{
88 return;
89}
90
91void usb_board_stop(void)
92{
93 writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
94 udelay(11);
95 writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
96
97 writel(readl(UHCCOMS) | 1, UHCCOMS);
98 udelay(10);
99
100 writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
101
102 return;
103}
104
105int board_init (void)
106{
107
108 dcache_disable();
109 icache_disable();
110
111
112 gd->bd->bi_arch_number = 776;
113
114
115 gd->bd->bi_boot_params = 0xa000003c;
116
117 return 0;
118}
119
120int board_late_init(void)
121{
122#if defined(CONFIG_SERIAL_MULTI)
123 char *console=getenv("boot_console");
124
125 if ((console == NULL) || (strcmp(console,"serial_btuart") &&
126 strcmp(console,"serial_stuart") &&
127 strcmp(console,"serial_ffuart"))) {
128 console = BOOT_CONSOLE;
129 }
130 setenv("stdout",console);
131 setenv("stdin", console);
132 setenv("stderr",console);
133#endif
134 return 0;
135}
136
137struct serial_device *default_serial_console (void)
138{
139 return &serial_ffuart_device;
140}
141
142extern void pxa_dram_init(void);
143int dram_init(void)
144{
145 pxa_dram_init();
146 gd->ram_size = PHYS_SDRAM_1_SIZE;
147 return 0;
148}
149
150void dram_init_banksize(void)
151{
152 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
153 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
154}
155
156#ifdef CONFIG_DRIVER_DM9000
157int board_eth_init(bd_t *bis)
158{
159 return dm9000_initialize(bis);
160}
161#endif
162