Commit 45a212c4d73452beac30d4e405a9657b07d7edb3

Authored by Wolfgang Denk
1 parent bd3143f040

Add support for new TQM5200 revisions

- Support for TQM5200S (short version without graphic controller)
- Support for modules with 'N' type S29GL128N Spansion flashes
  (requires changes to flash layout)
- Support for MPC5200B cpu (mostly support for second SDRAM bank)

Showing 8 changed files with 150 additions and 19 deletions Side-by-side Diff

... ... @@ -2,6 +2,12 @@
2 2 Changes since U-Boot 1.1.4:
3 3 ======================================================================
4 4  
  5 +* Add support for new TQM5200 revisions
  6 + - Support for TQM5200S (short version without graphic controller)
  7 + - Support for modules with 'N' type S29GL128N Spansion flashes
  8 + (requires changes to flash layout)
  9 + - Support for MPC5200B cpu (mostly support for second SDRAM bank)
  10 +
5 11 * Fix support for PS/2 keyboard on TQM85xx boards
6 12 The PS/2 keyobard driver for the TQM85xx modules only supports the
7 13 internal DUART of the MPC85xx CPU. Since the MPC8560 doesn't
... ... @@ -27,8 +27,8 @@
27 27 LIST_5xxx=" \
28 28 BC3450 cpci5200 EVAL5200 icecube_5100 \
29 29 icecube_5200 lite5200b mcc200 o2dnt \
30   - pf5200 PM520 Total5100 Total5200 \
31   - Total5200_Rev2 TQM5200 \
  30 + pf5200 PM520 TB5200 Total5100 \
  31 + Total5200 Total5200_Rev2 TQM5200 TQM5200_B \
32 32 "
33 33  
34 34 #########################################################################
... ... @@ -7,7 +7,7 @@
7 7 #
8 8 # This program is free software; you can redistribute it and/or
9 9 # modify it under the terms of the GNU General Public License as
10   -# published by the Free Software Foundation; either version 2 of
  10 +# published by the Free Software Foundatio; either version 2 of
11 11 # the License, or (at your option) any later version.
12 12 #
13 13 # This program is distributed in the hope that it will be useful,
14 14  
... ... @@ -360,7 +360,12 @@
360 360 @echo "... with automatic CS configuration"
361 361 @./mkconfig -a spieval ppc mpc5xxx tqm5200
362 362  
  363 +TB5200_B_config \
363 364 TB5200_config: unconfig
  365 + @[ -z "$(findstring _B,$@)" ] || \
  366 + { echo "#define CONFIG_TQM5200_B" >>include/config.h ; \
  367 + echo "... with MPC5200B processor" ; \
  368 + }
364 369 @echo "#define CONFIG_CS_AUTOCONF">>include/config.h
365 370 @echo "... with automatic CS configuration"
366 371 @./mkconfig -a TB5200 ppc mpc5xxx tqm5200
... ... @@ -401,6 +406,7 @@
401 406  
402 407 TQM5200_config \
403 408 TQM5200_STK100_config \
  409 +TQM5200_B_config \
404 410 MiniFAP_config: unconfig
405 411 @ >include/config.h
406 412 @[ -z "$(findstring MiniFAP,$@)" ] || \
... ... @@ -410,6 +416,10 @@
410 416 @[ -z "$(findstring STK100,$@)" ] || \
411 417 { echo "#define CONFIG_STK52XX_REV100" >>include/config.h ; \
412 418 echo "... on a STK52XX.100 base board" ; \
  419 + }
  420 + @[ -z "$(findstring B,$@)" ] || \
  421 + { echo "#define CONFIG_TQM5200_B" >>include/config.h ; \
  422 + echo "... with MPC5200B processor" ; \
413 423 }
414 424 @echo "#define CONFIG_CS_AUTOCONF">>include/config.h ;
415 425 @echo "... with automatic CS configuration" ;
board/tqm5200/cmd_stk52xx.c
... ... @@ -22,7 +22,7 @@
22 22 */
23 23  
24 24 /*
25   - * SKT52XX specific functions
  25 + * STK52XX specific functions
26 26 */
27 27 /*#define DEBUG*/
28 28  
... ... @@ -1209,7 +1209,7 @@
1209 1209 fkt , 4, 1, cmd_fkt,
1210 1210 "fkt - Function test routines\n",
1211 1211 "led number on/off\n"
1212   - " - 'number's like printed on SKT52XX board\n"
  1212 + " - 'number's like printed on STK52XX board\n"
1213 1213 "fkt can\n"
1214 1214 " - loopback plug for X83 required\n"
1215 1215 "fkt rs232 number\n"
board/tqm5200/tqm5200.c
1 1 /*
2   - * (C) Copyright 2003-2004
  2 + * (C) Copyright 2003-2006
3 3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 4 *
5 5 * (C) Copyright 2004
6 6 * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
7 7 *
8   - * (C) Copyright 2004-2005
  8 + * (C) Copyright 2004-2006
9 9 * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
10 10 *
11 11 * See file CREDITS for list of people who contributed to this
... ... @@ -30,6 +30,7 @@
30 30 #include <common.h>
31 31 #include <mpc5xxx.h>
32 32 #include <pci.h>
  33 +#include <asm/processor.h>
33 34  
34 35 #ifdef CONFIG_VIDEO_SM501
35 36 #include <sm501.h>
... ... @@ -101,6 +102,8 @@
101 102 {
102 103 ulong dramsize = 0;
103 104 ulong dramsize2 = 0;
  105 + uint svr, pvr;
  106 +
104 107 #ifndef CFG_RAMBOOT
105 108 ulong test1, test2;
106 109  
107 110  
108 111  
... ... @@ -190,11 +193,31 @@
190 193 } else {
191 194 dramsize2 = 0;
192 195 }
193   -
194 196 #endif /* CFG_RAMBOOT */
195 197  
196   -/* return dramsize + dramsize2; */
  198 + /*
  199 + * On MPC5200B we need to set the special configuration delay in the
  200 + * DDR controller. Please refer to Freescale's AN3221 "MPC5200B SDRAM
  201 + * Initialization and Configuration", 3.3.1 SDelay--MBAR + 0x0190:
  202 + *
  203 + * "The SDelay should be written to a value of 0x00000004. It is
  204 + * required to account for changes caused by normal wafer processing
  205 + * parameters."
  206 + */
  207 + svr = get_svr();
  208 + pvr = get_pvr();
  209 + if ((SVR_MJREV(svr) >= 2) &&
  210 + (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) {
  211 +
  212 + *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
  213 + __asm__ volatile ("sync");
  214 + }
  215 +
  216 +#if defined(CONFIG_TQM5200_B)
  217 + return dramsize + dramsize2;
  218 +#else
197 219 return dramsize;
  220 +#endif /* CONFIG_TQM5200_B */
198 221 }
199 222  
200 223 #elif defined(CONFIG_MGT5100)
201 224  
... ... @@ -255,7 +278,11 @@
255 278 return 0;
256 279 #endif
257 280 #if defined (CONFIG_TQM5200)
  281 +#if defined(CONFIG_TQM5200_B)
  282 + puts ("Board: TQM5200 or TQM5200S (TQ-Components GmbH)\n");
  283 +#else
258 284 puts ("Board: TQM5200 (TQ-Components GmbH)\n");
  285 +#endif /* CONFIG_TQM5200_B */
259 286 #endif
260 287 #if defined (CONFIG_STK52XX)
261 288 puts (" on a STK52XX baseboard\n");
common/cmd_reginfo.c
... ... @@ -328,7 +328,7 @@
328 328 (*(volatile ulong*)MPC5XXX_ADDECR & 0x02000000) ? 1 : 0);
329 329 printf ("\tSDRAMCS0: %08X\n",
330 330 *(volatile ulong*)MPC5XXX_SDRAM_CS0CFG);
331   - printf ("\tSDRAMCS0: %08X\n",
  331 + printf ("\tSDRAMCS1: %08X\n",
332 332 *(volatile ulong*)MPC5XXX_SDRAM_CS1CFG);
333 333 #endif /* CONFIG_MPC5200 */
334 334 return 0;
include/configs/TB5200.h
... ... @@ -147,6 +147,7 @@
147 147  
148 148 #undef CONFIG_BOOTARGS
149 149  
  150 +#if defined(CONFIG_TQM5200_B)
150 151 #define CONFIG_EXTRA_ENV_SETTINGS \
151 152 "netdev=eth0\0" \
152 153 "rootpath=/opt/eldk/ppc_6xx\0" \
... ... @@ -162,6 +163,29 @@
162 163 "bootm ${kernel_addr}\0" \
163 164 "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0" \
164 165 "bootfile=/tftpboot/tqm5200/uImage\0" \
  166 + "load=tftp 200000 ${u-boot}\0" \
  167 + "u-boot=/tftpboot/tqm5200/u-boot.bin\0" \
  168 + "update=protect off FC000000 FC07FFFF;" \
  169 + "erase FC000000 FC07FFFF;" \
  170 + "cp.b 200000 FC000000 ${filesize};" \
  171 + "protect on FC000000 FC07FFFF\0" \
  172 + ""
  173 +#else
  174 +#define CONFIG_EXTRA_ENV_SETTINGS \
  175 + "netdev=eth0\0" \
  176 + "rootpath=/opt/eldk/ppc_6xx\0" \
  177 + "ramargs=setenv bootargs root=/dev/ram rw\0" \
  178 + "nfsargs=setenv bootargs root=/dev/nfs rw " \
  179 + "nfsroot=${serverip}:${rootpath}\0" \
  180 + "addip=setenv bootargs ${bootargs} " \
  181 + "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  182 + ":${hostname}:${netdev}:off panic=1\0" \
  183 + "flash_self=run ramargs addip;" \
  184 + "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  185 + "flash_nfs=run nfsargs addip;" \
  186 + "bootm ${kernel_addr}\0" \
  187 + "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0" \
  188 + "bootfile=/tftpboot/tqm5200/uImage\0" \
165 189 "load=tftp 200000 $(u-boot)\0" \
166 190 "u-boot=/tftpboot/tqm5200/u-boot.bin\0" \
167 191 "update=protect off FC000000 FC05FFFF;" \
... ... @@ -169,6 +193,7 @@
169 193 "cp.b 200000 FC000000 ${filesize};" \
170 194 "protect on FC000000 FC05FFFF\0" \
171 195 ""
  196 +#endif /* CONFIG_TQM5200_B */
172 197  
173 198 #define CONFIG_BOOTCOMMAND "run net_nfs"
174 199  
... ... @@ -228,7 +253,7 @@
228 253 */
229 254 #define CFG_FLASH_BASE TEXT_BASE /* 0xFC000000 */
230 255  
231   -/* use CFI flash driver if no module variant is spezified */
  256 +/* use CFI flash driver */
232 257 #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */
233 258 #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */
234 259 #define CFG_FLASH_BANKS_LIST { CFG_BOOTCS_START }
235 260  
236 261  
237 262  
238 263  
239 264  
240 265  
... ... @@ -240,31 +265,46 @@
240 265 #if !defined(CFG_LOWBOOT)
241 266 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00760000 + 0x00800000)
242 267 #else /* CFG_LOWBOOT */
  268 +#if defined(CONFIG_TQM5200_B)
  269 +#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00080000)
  270 +#else
243 271 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00060000)
  272 +#endif /* CONFIG_TQM5200_B */
244 273 #endif /* CFG_LOWBOOT */
245 274 #define CFG_MAX_FLASH_BANKS 1 /* max num of flash banks
246 275 (= chip selects) */
247   -#define CFG_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
248   -#define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
249 276  
250 277 /* Dynamic MTD partition support */
251 278 #define CONFIG_JFFS2_CMDLINE
252 279 #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  280 +#if defined(CONFIG_TQM5200_B)
  281 +#define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:768k(firmware)," \
  282 + "1280k(kernel)," \
  283 + "2m(initrd)," \
  284 + "4m(small-fs)," \
  285 + "16m(big-fs)," \
  286 + "8m(misc)"
  287 +#else
253 288 #define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
254 289 "1408k(kernel)," \
255 290 "2m(initrd)," \
256 291 "4m(small-fs)," \
257 292 "16m(big-fs)," \
258 293 "8m(misc)"
  294 +#endif /* CONFIG_TQM5200_B */
259 295  
260 296 /*
261 297 * Environment settings
262 298 */
263 299 #define CFG_ENV_IS_IN_FLASH 1
264 300 #define CFG_ENV_SIZE 0x10000
  301 +#if defined(CONFIG_TQM5200_B)
  302 +#define CFG_ENV_SECT_SIZE 0x40000
  303 +#else
265 304 #define CFG_ENV_SECT_SIZE 0x20000
266 305 #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
267   -#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  306 +#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  307 +#endif /* CONFIG_TQM5200_B */
268 308  
269 309 /*
270 310 * Memory map
271 311  
... ... @@ -292,7 +332,11 @@
292 332 # define CFG_RAMBOOT 1
293 333 #endif
294 334  
  335 +#if defined(CONFIG_TQM5200_B)
  336 +#define CFG_MONITOR_LEN (512 << 10) /* Reserve 512 kB for Monitor */
  337 +#else
295 338 #define CFG_MONITOR_LEN (384 << 10) /* Reserve 384 kB for Monitor */
  339 +#endif /* CONFIG_TQM5200_B */
296 340 #define CFG_MALLOC_LEN (256 << 10) /* Reserve 256 kB for malloc() */
297 341 #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
298 342  
include/configs/TQM5200.h
... ... @@ -2,7 +2,7 @@
2 2 * (C) Copyright 2003-2005
3 3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 4 *
5   - * (C) Copyright 2004-2005
  5 + * (C) Copyright 2004-2006
6 6 * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
7 7 *
8 8 * See file CREDITS for list of people who contributed to this
... ... @@ -191,6 +191,7 @@
191 191  
192 192 #undef CONFIG_BOOTARGS
193 193  
  194 +#if defined(CONFIG_TQM5200_B)
194 195 #define CONFIG_EXTRA_ENV_SETTINGS \
195 196 "netdev=eth0\0" \
196 197 "rootpath=/opt/eldk/ppc_6xx\0" \
197 198  
... ... @@ -208,11 +209,35 @@
208 209 "bootfile=/tftpboot/tqm5200/uImage\0" \
209 210 "load=tftp 200000 ${u-boot}\0" \
210 211 "u-boot=/tftpboot/tqm5200/u-boot.bin\0" \
  212 + "update=protect off FC000000 FC07FFFF;" \
  213 + "erase FC000000 FC07FFFF;" \
  214 + "cp.b 200000 FC000000 ${filesize};" \
  215 + "protect on FC000000 FC07FFFF\0" \
  216 + ""
  217 +#else
  218 +#define CONFIG_EXTRA_ENV_SETTINGS \
  219 + "netdev=eth0\0" \
  220 + "rootpath=/opt/eldk/ppc_6xx\0" \
  221 + "ramargs=setenv bootargs root=/dev/ram rw\0" \
  222 + "nfsargs=setenv bootargs root=/dev/nfs rw " \
  223 + "nfsroot=${serverip}:${rootpath}\0" \
  224 + "addip=setenv bootargs ${bootargs} " \
  225 + "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  226 + ":${hostname}:${netdev}:off panic=1\0" \
  227 + "flash_self=run ramargs addip;" \
  228 + "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  229 + "flash_nfs=run nfsargs addip;" \
  230 + "bootm ${kernel_addr}\0" \
  231 + "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0" \
  232 + "bootfile=/tftpboot/tqm5200/uImage\0" \
  233 + "load=tftp 200000 ${u-boot}\0" \
  234 + "u-boot=/tftpboot/tqm5200/u-boot.bin\0" \
211 235 "update=protect off FC000000 FC05FFFF;" \
212 236 "erase FC000000 FC05FFFF;" \
213 237 "cp.b 200000 FC000000 ${filesize};" \
214 238 "protect on FC000000 FC05FFFF\0" \
215 239 ""
  240 +#endif /* CONFIG_TQM5200_B */
216 241  
217 242 #define CONFIG_BOOTCOMMAND "run net_nfs"
218 243  
... ... @@ -285,7 +310,7 @@
285 310 */
286 311 #define CFG_FLASH_BASE TEXT_BASE /* 0xFC000000 */
287 312  
288   -/* use CFI flash driver if no module variant is spezified */
  313 +/* use CFI flash driver */
289 314 #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */
290 315 #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */
291 316 #define CFG_FLASH_BANKS_LIST { CFG_BOOTCS_START }
292 317  
293 318  
294 319  
295 320  
296 321  
297 322  
... ... @@ -297,31 +322,46 @@
297 322 #if !defined(CFG_LOWBOOT)
298 323 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00760000 + 0x00800000)
299 324 #else /* CFG_LOWBOOT */
  325 +#if defined(CONFIG_TQM5200_B)
  326 +#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00080000)
  327 +#else
300 328 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00060000)
  329 +#endif /* CONFIG_TQM5200_B */
301 330 #endif /* CFG_LOWBOOT */
302 331 #define CFG_MAX_FLASH_BANKS 1 /* max num of flash banks
303 332 (= chip selects) */
304   -#define CFG_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
305   -#define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
306 333  
307 334 /* Dynamic MTD partition support */
308 335 #define CONFIG_JFFS2_CMDLINE
309 336 #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  337 +#if defined(CONFIG_TQM5200_B)
  338 +#define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:768k(firmware)," \
  339 + "1280k(kernel)," \
  340 + "2m(initrd)," \
  341 + "4m(small-fs)," \
  342 + "16m(big-fs)," \
  343 + "8m(misc)"
  344 +#else
310 345 #define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
311 346 "1408k(kernel)," \
312 347 "2m(initrd)," \
313 348 "4m(small-fs)," \
314 349 "16m(big-fs)," \
315 350 "8m(misc)"
  351 +#endif /* CONFIG_TQM5200_B */
316 352  
317 353 /*
318 354 * Environment settings
319 355 */
320 356 #define CFG_ENV_IS_IN_FLASH 1
321 357 #define CFG_ENV_SIZE 0x10000
  358 +#if defined(CONFIG_TQM5200_B)
  359 +#define CFG_ENV_SECT_SIZE 0x40000
  360 +#else
322 361 #define CFG_ENV_SECT_SIZE 0x20000
323 362 #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
324   -#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  363 +#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  364 +#endif /* CONFIG_TQM5200_B */
325 365  
326 366 /*
327 367 * Memory map
328 368  
... ... @@ -349,7 +389,11 @@
349 389 # define CFG_RAMBOOT 1
350 390 #endif
351 391  
  392 +#if defined(CONFIG_TQM5200_B)
  393 +#define CFG_MONITOR_LEN (512 << 10) /* Reserve 512 kB for Monitor */
  394 +#else
352 395 #define CFG_MONITOR_LEN (384 << 10) /* Reserve 384 kB for Monitor */
  396 +#endif /* CONFIG_TQM5200_B */
353 397 #define CFG_MALLOC_LEN (256 << 10) /* Reserve 256 kB for malloc() */
354 398 #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
355 399