Commit 31a649234ee4051e96cf45285cdf2dbfa668d30c

Authored by wdenk
1 parent 89394047ba

* Add automatic update support for LWMON board

* Enable MSDOS/VFAT filesystem support for LWMON board

* Clear Block Lock-Bits when erasing flash on LWMON board.

* Fix return code of "fatload" command

* Disable debugging for TQM5200 board

Showing 6 changed files with 58 additions and 21 deletions Side-by-side Diff

... ... @@ -2,6 +2,14 @@
2 2 Changes since U-Boot 1.1.1:
3 3 ======================================================================
4 4  
  5 +* Add automatic update support for LWMON board
  6 +
  7 +* Clear Block Lock-Bits when erasing flash on LWMON board.
  8 +
  9 +* Fix return code of "fatload" command
  10 +
  11 +* Enable MSDOS/VFAT filesystem support for LWMON board
  12 +
5 13 * Patch by Martin Krause, 03 Aug 2004:
6 14 change timing for SM501 graphics controller on TQM5200 module
7 15  
... ... @@ -315,12 +315,12 @@
315 315 @[ -z "$(findstring AB,$@)" ] || \
316 316 { echo "#define CONFIG_TQM5200_AB" >>include/config.h ; \
317 317 echo "... with 64 MB Flash, 64 MB SDRAM, 32 kB EEPROM, 512 kB SRAM" ; \
318   - echo "... with Grafic Controller"; \
  318 + echo "... with Graphics Controller"; \
319 319 }
320 320 @[ -z "$(findstring AC,$@)" ] || \
321 321 { echo "#define CONFIG_TQM5200_AC" >>include/config.h ; \
322 322 echo "... with 4 MB Flash, 128 MB SDRAM" ; \
323   - echo "... with Grafic Controller"; \
  323 + echo "... with Graphics Controller"; \
324 324 }
325 325 @./mkconfig -a TQM5200 ppc mpc5xxx tqm5200
326 326  
... ... @@ -403,6 +403,26 @@
403 403 /* Disable interrupts which might cause a timeout here */
404 404 flag = disable_interrupts();
405 405  
  406 + *addr = 0x00600060; /* clear lock bit setup */
  407 + *addr = 0x00D000D0; /* clear lock bit confirm */
  408 +
  409 + udelay (1000);
  410 + /* This takes awfully long - up to 50 ms and more */
  411 + while (((status = *addr) & 0x00800080) != 0x00800080) {
  412 + if ((now=get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
  413 + printf ("Timeout\n");
  414 + *addr = 0x00FF00FF; /* reset to read mode */
  415 + return 1;
  416 + }
  417 +
  418 + /* show that we're waiting */
  419 + if ((now - last) > 1000) { /* every second */
  420 + putc ('.');
  421 + last = now;
  422 + }
  423 + udelay (1000); /* to trigger the watchdog */
  424 + }
  425 +
406 426 *addr = 0x00500050; /* clear status register */
407 427 *addr = 0x00200020; /* erase setup */
408 428 *addr = 0x00D000D0; /* erase confirm */
... ... @@ -427,6 +447,7 @@
427 447 putc ('.');
428 448 last = now;
429 449 }
  450 + udelay (1000); /* to trigger the watchdog */
430 451 }
431 452  
432 453 *addr = 0x00FF00FF; /* reset to read mode */
... ... @@ -86,7 +86,7 @@
86 86  
87 87 if (argc < 5) {
88 88 printf ("usage: fatload <interface> <dev[:part]> <addr> <filename> [bytes]\n");
89   - return (0);
  89 + return 1;
90 90 }
91 91 dev = (int)simple_strtoul (argv[2], &ep, 16);
92 92 dev_desc=get_dev(argv[1],dev);
93 93  
... ... @@ -114,14 +114,15 @@
114 114  
115 115 if(size==-1) {
116 116 printf("\n** Unable to read \"%s\" from %s %d:%d **\n",argv[4],argv[1],dev,part);
117   - } else {
118   - printf ("\n%ld bytes read\n", size);
119   -
120   - sprintf(buf, "%lX", size);
121   - setenv("filesize", buf);
  117 + return 1;
122 118 }
123 119  
124   - return size;
  120 + printf ("\n%ld bytes read\n", size);
  121 +
  122 + sprintf(buf, "%lX", size);
  123 + setenv("filesize", buf);
  124 +
  125 + return 0;
125 126 }
126 127  
127 128  
include/configs/TQM5200.h
... ... @@ -27,8 +27,6 @@
27 27 #ifndef __CONFIG_H
28 28 #define __CONFIG_H
29 29  
30   -#define DEBUG 1
31   -
32 30 /*
33 31 * High Level Configuration Options
34 32 * (easy to change)
... ... @@ -64,7 +62,7 @@
64 62 */
65 63 #define CONFIG_PCI 0
66 64 #define CONFIG_PCI_PNP 1
67   -#define CONFIG_PCI_SCAN_SHOW 1
  65 +/* #define CONFIG_PCI_SCAN_SHOW 1 */
68 66  
69 67 #define CONFIG_PCI_MEM_BUS 0x40000000
70 68 #define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
include/configs/lwmon.h
... ... @@ -78,12 +78,24 @@
78 78  
79 79 #define CONFIG_BOOTCOMMAND "run flash_self"
80 80  
  81 +/*
  82 + * Keyboard commands:
  83 + * # = 0x28 = ENTER : enable bootmessages on LCD
  84 + * 2 = 0x3A+0x3C = F1 + F3 : enable update mode
  85 + * 3 = 0x3C+0x3F = F3 + F6 : enable test mode
  86 + */
81 87 #define CONFIG_EXTRA_ENV_SETTINGS \
82 88 "kernel_addr=40080000\0" \
83 89 "ramdisk_addr=40280000\0" \
84   - "magic_keys=#33\0" \" \
  90 + "magic_keys=#233\0" \" \
85 91 "key_magic#=28\0" \
86 92 "key_cmd#=setenv addfb setenv 'bootargs $bootargs console=tty0'\0" \
  93 + "key_magic2=3A+3C\0" \
  94 + "key_cmd2=echo *** Entering Update Mode ***;" \
  95 + "if fatload ide 0:3 10000 update.scr;" \
  96 + "then autoscr 10000;" \
  97 + "else echo *** UPDATE FAILED ***;" \
  98 + "fi\0" \
87 99 "key_magic3=3C+3F\0" \
88 100 "key_cmd3=echo *** Entering Test Mode ***;" \
89 101 "setenv add_misc 'setenv bootargs $bootargs testmode'\0" \
... ... @@ -153,6 +165,7 @@
153 165 CFG_CMD_ASKENV | \
154 166 CFG_CMD_DHCP | \
155 167 CFG_CMD_DATE | \
  168 + CFG_CMD_FAT | \
156 169 CFG_CMD_I2C | \
157 170 CFG_CMD_EEPROM | \
158 171 CFG_CMD_IDE | \
159 172  
... ... @@ -276,18 +289,12 @@
276 289 */
277 290 #define CFG_FLASH_BUFFER_SIZE (2*32)
278 291  
279   -#if 1
280   -/* Put environment in flash which is much faster to boot */
  292 +/* Put environment in flash which is much faster to boot than using the EEPROM */
281 293 #define CFG_ENV_IS_IN_FLASH 1
282 294 #define CFG_ENV_ADDR 0x40040000 /* Address of Environment Sector */
283 295 #define CFG_ENV_SIZE 0x2000 /* Total Size of Environment */
284 296 #define CFG_ENV_SECT_SIZE 0x40000 /* we have BIG sectors only :-( */
285   -#else
286   -/* Environment in EEPROM */
287   -#define CFG_ENV_IS_IN_EEPROM 1
288   -#define CFG_ENV_OFFSET 0
289   -#define CFG_ENV_SIZE 2048
290   -#endif
  297 +
291 298 /*-----------------------------------------------------------------------
292 299 * I2C/EEPROM Configuration
293 300 */
... ... @@ -487,6 +494,8 @@
487 494  
488 495 /* Offset for alternate registers */
489 496 #define CFG_ATA_ALT_OFFSET 0x0100
  497 +
  498 +#define CONFIG_SUPPORT_VFAT /* enable VFAT support */
490 499  
491 500 /*-----------------------------------------------------------------------
492 501 *