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#include <common.h>
32#include <mpc8xx.h>
33
34
35static long int dram_size (long int, long int *, long int);
36
37
38#define _NOT_USED_ 0xFFFFCC25
39
40const uint sdram_table[] =
41{
42
43
44
45 0x0F03CC04, 0x00ACCC24, 0x1FF74C20,
46 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
47 _NOT_USED_,
48
49
50
51
52 0x0F03CC04, 0x00ACCC24, 0x00FFCC20, 0x00FFCC20,
53 0x01FFCC20, 0x1FF74C20,
54 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
55 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
56 _NOT_USED_, _NOT_USED_,
57
58
59
60
61 0x0F03CC02, 0x00AC0C24, 0x1FF74C25,
62 _NOT_USED_, _NOT_USED_, 0x0FA00C34,0x0FFFCC35,
63 _NOT_USED_,
64
65
66
67
68 0x0F03CC00, 0x00AC0C20, 0x00FFFC20, 0x00FFFC22,
69 0x01FFFC24, 0x1FF74C25,
70 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
71 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
72 _NOT_USED_, _NOT_USED_,
73
74
75
76
77 0x0FF0CC24, 0xFFFFCC24, _NOT_USED_, _NOT_USED_,
78 _NOT_USED_, _NOT_USED_, 0xEFFB8C34, 0x0FF74C34,
79 0x0FFACCB4, 0x0FF5CC34, 0x0FFFCC34, 0x0FFFCCB4,
80
81
82
83
84
85
86
87
88
89
90
91
92 0x0FEA8C34, 0x1FB54C34, 0xFFFFCC34, _NOT_USED_
93};
94
95
96
97
98
99int checkboard (void)
100{
101 puts ("Board: RPXlite_DW\n") ;
102 return (0) ;
103}
104
105
106
107phys_size_t initdram (int board_type)
108{
109 volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
110 volatile memctl8xx_t *memctl = &immap->im_memctl;
111 long int size9;
112
113 upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint));
114
115
116 memctl->memc_mptpr = CONFIG_SYS_MPTPR ;
117
118 memctl->memc_mar = 0x00000088;
119
120
121 memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM;
122 memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM;
123
124 memctl->memc_mamr = CONFIG_SYS_MAMR_9COL & (~(MAMR_PTAE));
125
126
127 udelay(200);
128
129
130
131 memctl->memc_mcr = 0x80002236;
132
133 udelay(1);
134
135 memctl->memc_mamr |= MAMR_PTAE;
136
137
138
139 udelay (1000);
140
141
142
143
144
145 size9 = dram_size (CONFIG_SYS_MAMR_9COL, SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
146
147
148
149
150
151 memctl->memc_or1 = ((-size9) & 0xFFFF0000) | CONFIG_SYS_OR_TIMING_SDRAM;
152
153 udelay (1000);
154
155 return (size9);
156}
157
158void rpxlite_init (void)
159{
160
161 *((uchar *) BCSR0) |= BCSR0_ENNVRAM;
162}
163
164
165
166
167
168
169
170
171static long int dram_size (long int mamr_value, long int *base,
172 long int maxsize)
173{
174 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
175 volatile memctl8xx_t *memctl = &immap->im_memctl;
176
177 memctl->memc_mamr = mamr_value;
178
179 return (get_ram_size (base, maxsize));
180}
181