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#include <common.h>
27#include <netdev.h>
28
29#include <asm/arch/imx-regs.h>
30
31DECLARE_GLOBAL_DATA_PTR;
32
33#define FCLK_SPEED 1
34
35#if FCLK_SPEED==0
36#define M_MDIV 0xC3
37#define M_PDIV 0x4
38#define M_SDIV 0x1
39#elif FCLK_SPEED==1
40#define M_MDIV 0xA1
41#define M_PDIV 0x3
42#define M_SDIV 0x1
43#endif
44
45#define USB_CLOCK 1
46
47#if USB_CLOCK==0
48#define U_M_MDIV 0xA1
49#define U_M_PDIV 0x3
50#define U_M_SDIV 0x1
51#elif USB_CLOCK==1
52#define U_M_MDIV 0x48
53#define U_M_PDIV 0x3
54#define U_M_SDIV 0x2
55#endif
56
57#if 0
58
59static inline void delay (unsigned long loops)
60{
61 __asm__ volatile ("1:\n"
62 "subs %0, %1, #1\n"
63 "bne 1b":"=r" (loops):"0" (loops));
64}
65
66#endif
67
68
69
70
71
72void SetAsynchMode (void)
73{
74 __asm__ ("mrc p15,0,r0,c1,c0,0 \n"
75 "mov r2, #0xC0000000 \n"
76 "orr r0,r2,r0 \n" "mcr p15,0,r0,c1,c0,0 \n");
77}
78
79static u32 mc9328sid;
80
81int board_init (void)
82{
83 volatile unsigned int tmp;
84
85 mc9328sid = SIDR;
86
87 GPCR = 0x000003AB;
88
89
90
91
92 MPCTL0 = 0x04632410;
93
94
95
96
97 CSCR = 0xAF000403;
98
99 CSCR |= 0x00200000;
100 CSCR &= 0xFFFF7FFF;
101
102
103
104 CS4U = 0x00000F00;
105 CS4L = 0x00001501;
106
107 GIUS (0) &= 0xFF3FFFFF;
108 GPR (0) &= 0xFF3FFFFF;
109
110 tmp = *(unsigned int *) (0x1500000C);
111 tmp = *(unsigned int *) (0x1500000C);
112
113 SetAsynchMode ();
114
115 gd->bd->bi_arch_number = MACH_TYPE_MX1ADS;
116
117 gd->bd->bi_boot_params = 0x08000100;
118
119 icache_enable ();
120 dcache_enable ();
121
122
123 PCDR = 0x00000055;
124
125
126
127
128
129
130
131
132
133 return 0;
134}
135
136int board_late_init (void)
137{
138
139 setenv ("stdout", "serial");
140 setenv ("stderr", "serial");
141
142 switch (mc9328sid) {
143 case 0x0005901d:
144 printf ("MX1ADS board with MC9328 MX1 (0L44N), Silicon ID 0x%08x \n\n",
145 mc9328sid);
146 break;
147 case 0x04d4c01d:
148 printf ("MX1ADS board with MC9328 MXL (1L45N), Silicon ID 0x%08x \n\n",
149 mc9328sid);
150 break;
151 case 0x00d4c01d:
152 printf ("MX1ADS board with MC9328 MXL (2L45N), Silicon ID 0x%08x \n\n",
153 mc9328sid);
154 break;
155
156 default:
157 printf ("MX1ADS board with UNKNOWN MC9328 cpu, Silicon ID 0x%08x \n",
158 mc9328sid);
159 break;
160 }
161 return 0;
162}
163
164int dram_init (void)
165{
166 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
167 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
168
169 return 0;
170}
171
172#ifdef CONFIG_CMD_NET
173int board_eth_init(bd_t *bis)
174{
175 int rc = 0;
176#ifdef CONFIG_CS8900
177 rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
178#endif
179 return rc;
180}
181#endif
182