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#include <common.h>
33#include <mpc8xx.h>
34
35
36
37static long int dram_size (long int, long int *, long int);
38
39
40
41#define _NOT_USED_ 0xFFFFCC25
42
43const uint sdram_table[] = {
44
45
46
47 0xCFFFCC24, 0x0FFFCC04, 0X0CAFCC04, 0X03AFCC08,
48 0x3FBFCC27,
49 _NOT_USED_, _NOT_USED_, _NOT_USED_,
50
51
52
53
54 0xCFFFCC24, 0x0FFFCC04, 0x0CAFCC84, 0x03AFCC88,
55 0x3FBFCC27,
56 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
57 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
58 _NOT_USED_, _NOT_USED_, _NOT_USED_,
59
60
61
62
63 0xCFFFCC24, 0x0FFFCC04, 0x0CFFCC04, 0x03FFCC00,
64 0x3FFFCC27,
65 _NOT_USED_, _NOT_USED_, _NOT_USED_,
66
67
68
69
70 0xCFFFCC24, 0x0FFFCC04, 0x0CFFCC80, 0x03FFCC8C,
71 0x0CFFCC00, 0x33FFCC27,
72 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
73 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
74 _NOT_USED_, _NOT_USED_,
75
76
77
78
79 0xC0FFCC24, 0x03FFCC24, 0x0FFFCC24, 0x0FFFCC24,
80 0x3FFFCC27,
81 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
82 _NOT_USED_, _NOT_USED_, _NOT_USED_,
83
84
85
86
87 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_
88};
89
90
91
92
93
94
95
96
97int checkboard (void)
98{
99 puts ("Board: RPXlite\n");
100 return (0);
101}
102
103
104
105phys_size_t initdram (int board_type)
106{
107 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
108 volatile memctl8xx_t *memctl = &immap->im_memctl;
109 long int size10;
110
111 upmconfig (UPMA, (uint *) sdram_table,
112 sizeof (sdram_table) / sizeof (uint));
113
114
115 memctl->memc_mptpr = CONFIG_SYS_MPTPR;
116
117 memctl->memc_mar = 0x00000000;
118
119
120 memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM;
121 memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM;
122
123 memctl->memc_mamr = CONFIG_SYS_MAMR_10COL & (~(MAMR_PTAE));
124
125 udelay (200);
126
127
128
129 memctl->memc_mcr = 0x80002230;
130 udelay (1);
131
132 memctl->memc_mamr |= MAMR_PTAE;
133
134 udelay (1000);
135
136
137
138
139
140 size10 = dram_size (CONFIG_SYS_MAMR_10COL, SDRAM_BASE_PRELIM,
141 SDRAM_MAX_SIZE);
142
143 return (size10);
144}
145
146
147
148
149
150
151
152
153
154
155
156static long int dram_size (long int mamr_value, long int *base,
157 long int maxsize)
158{
159 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
160 volatile memctl8xx_t *memctl = &immap->im_memctl;
161
162 memctl->memc_mamr = mamr_value;
163
164 return (get_ram_size (base, maxsize));
165}
166