Commit 5f535fe170e2cd90ee65922cbad1a5428d85a9e6

Authored by wdenk
1 parent b0639ca332

* Patches by Anders Larsen, 17 Sep 2003:

- fix spelling errors
  - set GD_FLG_DEVINIT flag only after device function pointers
    are valid
  - Allow CFG_ALT_MEMTEST on systems where address zero isn't
    writeable
  - enable 3.rd UART (ST-UART) on PXA(XScale) CPUs
  - trigger watchdog while waiting in serial driver

Showing 28 changed files with 76 additions and 37 deletions Side-by-side Diff

... ... @@ -2,6 +2,15 @@
2 2 Changes for U-Boot 1.0.0:
3 3 ======================================================================
4 4  
  5 +* Patches by Anders Larsen, 17 Sep 2003:
  6 + - fix spelling errors
  7 + - set GD_FLG_DEVINIT flag only after device function pointers
  8 + are valid
  9 + - Allow CFG_ALT_MEMTEST on systems where address zero isn't
  10 + writeable
  11 + - enable 3.rd UART (ST-UART) on PXA(XScale) CPUs
  12 + - trigger watchdog while waiting in serial driver
  13 +
5 14 * Add auto-update code for TRAB board using USB memory sticks,
6 15 support new configuration with more memory
7 16  
... ... @@ -1498,6 +1498,10 @@
1498 1498 - CFG_ALT_MEMTEST:
1499 1499 Enable an alternate, more extensive memory test.
1500 1500  
  1501 +- CFG_MEMTEST_SCRATCH:
  1502 + Scratch address used by the alternate memory test
  1503 + You only need to set this if address zero isn't writeable
  1504 +
1501 1505 - CFG_TFTP_LOADADDR:
1502 1506 Default load address for network file downloads
1503 1507  
board/at91rm9200dk/flash.c
... ... @@ -160,7 +160,7 @@
160 160 if (i == 0)
161 161 flashbase = PHYS_FLASH_1;
162 162 else
163   - panic ("configured to many flash banks!\n");
  163 + panic ("configured too many flash banks!\n");
164 164  
165 165 sector = 0;
166 166 start_address = flashbase;
board/cradle/flash.c
... ... @@ -59,7 +59,7 @@
59 59 flashbase = PHYS_FLASH_2;
60 60 break;
61 61 default:
62   - panic("configured to many flash banks!\n");
  62 + panic("configured too many flash banks!\n");
63 63 break;
64 64 }
65 65 for (j = 0; j < flash_info[i].sector_count; j++)
board/csb226/flash.c
... ... @@ -62,7 +62,7 @@
62 62 flashbase = PHYS_FLASH_1;
63 63 break;
64 64 default:
65   - panic("configured to many flash banks!\n");
  65 + panic("configured too many flash banks!\n");
66 66 break;
67 67 }
68 68 for (j = 0; j < flash_info[i].sector_count; j++) {
board/dnp1110/flash.c
... ... @@ -74,7 +74,7 @@
74 74 flash_get_offsets(PHYS_FLASH_1, &flash_info[i]);
75 75 break;
76 76 default:
77   - panic("configured to many flash banks!\n");
  77 + panic("configured too many flash banks!\n");
78 78 break;
79 79 }
80 80 size += flash_info[i].size;
board/ep7312/flash.c
... ... @@ -50,7 +50,7 @@
50 50 if (i == 0)
51 51 flashbase = PHYS_FLASH_1;
52 52 else
53   - panic ("configured to many flash banks!\n");
  53 + panic ("configured too many flash banks!\n");
54 54 for (j = 0; j < flash_info[i].sector_count; j++) {
55 55 flash_info[i].start[j] = flashbase + j * MAIN_SECT_SIZE;
56 56 }
... ... @@ -53,7 +53,7 @@
53 53 else if (i == 1)
54 54 flashbase = PHYS_FLASH_2;
55 55 else
56   - panic("configured to many flash banks!\n");
  56 + panic("configured too many flash banks!\n");
57 57 for (j = 0; j < flash_info[i].sector_count; j++)
58 58 {
59 59 if (j <= 7)
board/innokom/flash.c
... ... @@ -276,7 +276,7 @@
276 276 flashbase = PHYS_FLASH_1;
277 277 break;
278 278 default:
279   - panic("configured to many flash banks!\n");
  279 + panic("configured too many flash banks!\n");
280 280 break;
281 281 }
282 282 for (j = 0; j < flash_info[i].sector_count; j++) {
... ... @@ -86,7 +86,7 @@
86 86 if (i == 0)
87 87 flashbase = PHYS_FLASH_1;
88 88 else
89   - panic("configured to many flash banks!\n");
  89 + panic("configured too many flash banks!\n");
90 90 for (j = 0; j < flash_info[i].sector_count; j++)
91 91 {
92 92 if (j <= 7)
board/logodl/flash.c
... ... @@ -91,7 +91,7 @@
91 91 flashbase = PHYS_FLASH_2;
92 92 break;
93 93 default:
94   - panic("configured to many flash banks!\n");
  94 + panic("configured too many flash banks!\n");
95 95 break;
96 96 }
97 97 for (j = 0; j < flash_info[i].sector_count; j++)
board/lubbock/flash.c
... ... @@ -76,7 +76,7 @@
76 76 flash_get_offsets (PHYS_FLASH_2, &flash_info[i]);
77 77 break;
78 78 default:
79   - panic ("configured to many flash banks!\n");
  79 + panic ("configured too many flash banks!\n");
80 80 break;
81 81 }
82 82 size += flash_info[i].size;
... ... @@ -72,7 +72,7 @@
72 72 if (i==0)
73 73 flashbase = CFG_FLASH_BASE;
74 74 else
75   - panic("configured to many flash banks!\n");
  75 + panic("configured too many flash banks!\n");
76 76 for (j = 0; j < flash_info[i].sector_count; j++)
77 77 flash_info[i].start[j]=flashbase + j * SECT_SIZE;
78 78  
board/mpl/vcma9/flash.c
... ... @@ -80,7 +80,7 @@
80 80 if (i == 0)
81 81 flashbase = PHYS_FLASH_1;
82 82 else
83   - panic("configured to many flash banks!\n");
  83 + panic("configured too many flash banks!\n");
84 84 for (j = 0; j < flash_info[i].sector_count; j++)
85 85 {
86 86 if (j <= 3)
board/omap1510inn/flash.c
... ... @@ -72,7 +72,7 @@
72 72 flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
73 73 break;
74 74 default:
75   - panic ("configured to many flash banks!\n");
  75 + panic ("configured too many flash banks!\n");
76 76 break;
77 77 }
78 78 size += flash_info[i].size;
board/omap1610inn/flash.c
... ... @@ -96,7 +96,7 @@
96 96 flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
97 97 break;
98 98 default:
99   - panic ("configured to many flash banks!\n");
  99 + panic ("configured too many flash banks!\n");
100 100 break;
101 101 }
102 102 size += flash_info[i].size;
board/sc520_cdp/flash.c
... ... @@ -234,7 +234,7 @@
234 234 flashbase = SC520_FLASH_BANK2_BASE;
235 235 break;
236 236 default:
237   - panic("configured to many flash banks!\n");
  237 + panic("configured too many flash banks!\n");
238 238 }
239 239  
240 240 id = identify_flash(flashbase, 4);
board/sc520_cdp/flash_old.c
... ... @@ -101,7 +101,7 @@
101 101 flashbase = SC520_FLASH_BANK0_BASE;
102 102 break;
103 103 default:
104   - panic("configured to many flash banks!\n");
  104 + panic("configured too many flash banks!\n");
105 105 }
106 106  
107 107 for (j = 0; j < flash_info[i].sector_count; j++) {
board/sc520_spunk/flash.c
... ... @@ -239,7 +239,7 @@
239 239 flashbase = SC520_FLASH_BANK0_BASE;
240 240 break;
241 241 default:
242   - panic("configured to many flash banks!\n");
  242 + panic("configured too many flash banks!\n");
243 243 }
244 244  
245 245 id = identify_flash(flashbase, 2);
board/shannon/flash.c
... ... @@ -73,7 +73,7 @@
73 73 if (i == 0)
74 74 flashbase = PHYS_FLASH_1;
75 75 else
76   - panic("configured to many flash banks!\n");
  76 + panic("configured too many flash banks!\n");
77 77 for (j = 0; j < flash_info[i].sector_count; j++)
78 78 {
79 79  
board/shannon/shannon.c
... ... @@ -60,7 +60,7 @@
60 60 *(unsigned long *)temp = 0x00060006;
61 61  
62 62 }
63   -#endif /* CONFIG_INIT_CRITICAL */
  63 +#endif /* CONFIG_INFERNO */
64 64  
65 65 /* arch number for shannon */
66 66 gd->bd->bi_arch_number = 97;
board/smdk2410/flash.c
... ... @@ -80,7 +80,7 @@
80 80 if (i == 0)
81 81 flashbase = PHYS_FLASH_1;
82 82 else
83   - panic("configured to many flash banks!\n");
  83 + panic("configured too many flash banks!\n");
84 84 for (j = 0; j < flash_info[i].sector_count; j++)
85 85 {
86 86 if (j <= 3)
... ... @@ -555,7 +555,11 @@
555 555 vu_long temp;
556 556 vu_long anti_pattern;
557 557 vu_long num_words;
  558 +#if defined(CFG_MEMTEST_SCRATCH)
  559 + vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
  560 +#else
558 561 vu_long *dummy = NULL;
  562 +#endif
559 563 int j;
560 564 int iterations = 1;
561 565  
... ... @@ -436,6 +436,8 @@
436 436 console_setfile (stdin, inputdev);
437 437 }
438 438  
  439 + gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
  440 +
439 441 #ifndef CFG_CONSOLE_INFO_QUIET
440 442 /* Print information */
441 443 printf ("In: ");
... ... @@ -480,6 +482,8 @@
480 482 /* Called after the relocation - use desired console functions */
481 483 int console_init_r (void)
482 484 {
  485 + DECLARE_GLOBAL_DATA_PTR;
  486 +
483 487 device_t *inputdev = NULL, *outputdev = NULL;
484 488 int i, items = ListNumItems (devlist);
485 489  
... ... @@ -513,6 +517,8 @@
513 517 if (inputdev != NULL) {
514 518 console_setfile (stdin, inputdev);
515 519 }
  520 +
  521 + gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
516 522  
517 523 #ifndef CFG_CONSOLE_INFO_QUIET
518 524 /* Print information */
... ... @@ -158,8 +158,6 @@
158 158  
159 159 int devices_init (void)
160 160 {
161   - DECLARE_GLOBAL_DATA_PTR;
162   -
163 161 #ifndef CONFIG_ARM /* already relocated for current ARM implementation */
164 162 ulong relocation_offset = gd->reloc_off;
165 163 int i;
... ... @@ -194,8 +192,6 @@
194 192 drv_logbuff_init ();
195 193 #endif
196 194 drv_system_init ();
197   -
198   - gd-> flags |= GD_FLG_DEVINIT; /* device initialization done */
199 195  
200 196 return (0);
201 197 }
... ... @@ -595,7 +595,7 @@
595 595 int i;
596 596 USB_PRINTF("New Device %d\n",dev_index);
597 597 if(dev_index==USB_MAX_DEVICE) {
598   - printf("ERROR, to many USB Devices max=%d\n",USB_MAX_DEVICE);
  598 + printf("ERROR, too many USB Devices, max=%d\n",USB_MAX_DEVICE);
599 599 return NULL;
600 600 }
601 601 usb_dev[dev_index].devnum=dev_index+1; /* default Address is 0, real addresses start with 1 */
... ... @@ -83,7 +83,7 @@
83 83 {
84 84 extern void reset_cpu (ulong addr);
85 85  
86   - printf ("reseting ...\n");
  86 + printf ("resetting ...\n");
87 87  
88 88 udelay (50000); /* wait 50 ms */
89 89 disable_interrupts ();
... ... @@ -29,6 +29,7 @@
29 29 */
30 30  
31 31 #include <common.h>
  32 +#include <watchdog.h>
32 33 #include <asm/arch/pxa-regs.h>
33 34  
34 35 void serial_setbrg (void)
... ... @@ -38,7 +39,7 @@
38 39 unsigned int quot = 0;
39 40  
40 41 if (gd->baudrate == 1200)
41   - quot = 192;
  42 + quot = 768;
42 43 else if (gd->baudrate == 9600)
43 44 quot = 96;
44 45 else if (gd->baudrate == 19200)
... ... @@ -53,7 +54,6 @@
53 54 hang ();
54 55  
55 56 #ifdef CONFIG_FFUART
56   -
57 57 CKEN |= CKEN6_FFUART;
58 58  
59 59 FFIER = 0; /* Disable for now */
60 60  
... ... @@ -82,9 +82,21 @@
82 82 BTIER = IER_UUE; /* Enable BFUART */
83 83  
84 84 #elif defined(CONFIG_STUART)
85   -#error "Bad: not implemented yet!"
  85 + CKEN |= CKEN5_STUART;
  86 +
  87 + STIER = 0;
  88 + STFCR = 0;
  89 +
  90 + /* set baud rate */
  91 + STLCR = LCR_DLAB;
  92 + STDLL = quot & 0xff;
  93 + STDLH = quot >> 8;
  94 + STLCR = LCR_WLS0 | LCR_WLS1;
  95 +
  96 + STIER = IER_UUE; /* Enable STUART */
  97 +
86 98 #else
87   -#error "Bad: you didn't configured serial ..."
  99 +#error "Bad: you didn't configure serial ..."
88 100 #endif
89 101 }
90 102  
91 103  
92 104  
... ... @@ -109,13 +121,17 @@
109 121 {
110 122 #ifdef CONFIG_FFUART
111 123 /* wait for room in the tx FIFO on FFUART */
112   - while ((FFLSR & LSR_TEMT) == 0);
113   -
  124 + while ((FFLSR & LSR_TEMT) == 0)
  125 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
114 126 FFTHR = c;
115 127 #elif defined(CONFIG_BTUART)
116   - while ((BTLSR & LSR_TEMT ) == 0 );
  128 + while ((BTLSR & LSR_TEMT ) == 0 )
  129 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
117 130 BTTHR = c;
118 131 #elif defined(CONFIG_STUART)
  132 + while ((STLSR & LSR_TEMT ) == 0 )
  133 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
  134 + STTHR = c;
119 135 #endif
120 136  
121 137 /* If \n, also do \r */
... ... @@ -135,6 +151,7 @@
135 151 #elif defined(CONFIG_BTUART)
136 152 return BTLSR & LSR_DR;
137 153 #elif defined(CONFIG_STUART)
  154 + return STLSR & LSR_DR;
138 155 #endif
139 156 }
140 157  
141 158  
142 159  
... ... @@ -146,14 +163,17 @@
146 163 int serial_getc (void)
147 164 {
148 165 #ifdef CONFIG_FFUART
149   - while (!(FFLSR & LSR_DR));
150   -
  166 + while (!(FFLSR & LSR_DR))
  167 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
151 168 return (char) FFRBR & 0xff;
152 169 #elif defined(CONFIG_BTUART)
153   - while (!(BTLSR & LSR_DR));
154   -
  170 + while (!(BTLSR & LSR_DR))
  171 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
155 172 return (char) BTRBR & 0xff;
156 173 #elif defined(CONFIG_STUART)
  174 + while (!(STLSR & LSR_DR))
  175 + WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
  176 + return (char) STRBR & 0xff;
157 177 #endif
158 178 }
159 179