Commit 82afabfeb8ae6a27c7b396011ea99f4712aa73fa

Authored by Heiko Schocher
Committed by Wolfgang Denk
1 parent e492c90c26

mgsuvd: update board configuration

initialize the UPIOx controller.

Signed-off-by: Heiko Schocher <hs@denx.de>

Showing 2 changed files with 27 additions and 8 deletions Side-by-side Diff

board/mgsuvd/mgsuvd.c
... ... @@ -134,6 +134,17 @@
134 134 return (size);
135 135 }
136 136  
  137 +/*
  138 + * Early board initalization.
  139 + */
  140 +int board_early_init_r(void)
  141 +{
  142 + /* setup the UPIOx */
  143 + *(char *)(CFG_PIGGY_BASE + 0x02) = 0xc0;
  144 + *(char *)(CFG_PIGGY_BASE + 0x03) = 0x35;
  145 + return 0;
  146 +}
  147 +
137 148 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
138 149 /*
139 150 * update "memory" property in the blob
140 151  
141 152  
142 153  
143 154  
144 155  
... ... @@ -179,31 +190,31 @@
179 190 }
180 191 /* BRG */
181 192 brg_data[0] = cpu_to_be32(bd->bi_busfreq);
182   - nodeoffset = fdt_path_offset (blob, "/soc866/cpm");
  193 + nodeoffset = fdt_path_offset (blob, "/soc/cpm");
183 194 if (nodeoffset >= 0) {
184 195 ret = fdt_setprop(blob, nodeoffset, "brg-frequency", brg_data,
185 196 sizeof(brg_data));
186 197 if (ret < 0)
187   - printf("ft_blob_update): cannot set /soc866/cpm/brg-frequency "
  198 + printf("ft_blob_update): cannot set /soc/cpm/brg-frequency "
188 199 "property err:%s\n", fdt_strerror(ret));
189 200 }
190 201 else {
191 202 /* memory node is required in dts */
192   - printf("ft_blob_update(): cannot find /localbus node "
  203 + printf("ft_blob_update(): cannot find /soc/cpm node "
193 204 "err:%s\n", fdt_strerror(nodeoffset));
194 205 }
195 206 /* MAC Adresse */
196   - nodeoffset = fdt_path_offset (blob, "/soc866/cpm/ethernet");
  207 + nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
197 208 if (nodeoffset >= 0) {
198 209 ret = fdt_setprop(blob, nodeoffset, "mac-address", bd->bi_enetaddr,
199 210 sizeof(uchar) * 6);
200 211 if (ret < 0)
201   - printf("ft_blob_update): cannot set /soc866/cpm/scc/mac-address "
  212 + printf("ft_blob_update): cannot set /soc/cpm/scc/mac-address "
202 213 "property err:%s\n", fdt_strerror(ret));
203 214 }
204 215 else {
205 216 /* memory node is required in dts */
206   - printf("ft_blob_update(): cannot find /localbus node "
  217 + printf("ft_blob_update(): cannot find /soc/cpm/ethernet node "
207 218 "err:%s\n", fdt_strerror(nodeoffset));
208 219 }
209 220 }
include/configs/mgsuvd.h
... ... @@ -36,6 +36,9 @@
36 36 #define CONFIG_MPC866 1 /* This is a MPC866 CPU */
37 37 #define CONFIG_MGSUVD 1 /* ...on a mgsuvd board */
38 38  
  39 +/* Do boardspecific init */
  40 +#define CONFIG_BOARD_EARLY_INIT_R 1
  41 +
39 42 #define CONFIG_8xx_GCLK_FREQ 66000000
40 43  
41 44 #define CFG_SMC_UCODE_PATCH 1 /* Relocate SMC1 */
42 45  
... ... @@ -299,8 +302,13 @@
299 302 * 64 Refresh cycle in ms per number of rows
300 303 */
301 304 #define CFG_PTA_PER_CLK ((4096 * 64 * 1000) / (4 * 64))
302   -/* HS HS noch zu setzen */
303 305  
  306 +/* GPIO/PIGGY on CS3 initialization values
  307 +*/
  308 +#define CFG_PIGGY_BASE (0x30000000)
  309 +#define CFG_OR3_PRELIM (0xfe000d24)
  310 +#define CFG_BR3_PRELIM (0x30000401)
  311 +
304 312 /*
305 313 * Internal Definitions
306 314 *
... ... @@ -318,7 +326,7 @@
318 326 #define CONFIG_OF_BOARD_SETUP 1
319 327  
320 328 #define OF_CPU "PowerPC,866@0"
321   -#define OF_SOC "soc@f0000000"
  329 +#define OF_SOC "soc@fff00000"
322 330 #define OF_TBCLK (bd->bi_busfreq / 4)
323 331 #define OF_STDOUT_PATH "/soc/cpm/serial@a80"
324 332