- UID
- 1029342
- 性别
- 男
|
启动uboot的时候总是出现
*** Warning - bad CRC, using default environment
不知到怎么回事,检查一下于那代码看看
236 void start_armboot (void)
237 {
238 init_fnc_t **init_fnc_ptr;
239 char *s;
240 #ifndef CFG_NO_FLASH
241 ulong size;
242 #endif
243 #if defined(CONFIG_VFD) || defined(CONFIG_LCD)
244 unsigned long addr;
245 #endif
246
247 /* Pointer is writable since we allocated a register for it */
248 gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));
249 /* compiler optimization barrier needed for GCC >= 3.4 */
250 __asm__ __volatile__("": : :"memory");
251
252 memset ((void*)gd, 0, sizeof (gd_t));
253 gd->bd = (bd_t*)((char*)gd - sizeof(bd_t));
254 memset (gd->bd, 0, sizeof (bd_t));
255
256 monitor_flash_len = _bss_start - _armboot_start;
257
258 for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
259 if ((*init_fnc_ptr)() != 0) {
260 hang ();
261 }
262 }
263
264 #ifndef CFG_NO_FLASH
265 /* configure available FLASH banks */
266 size = flash_init ();
267 display_flash_config (size);
268 #endif /* CFG_NO_FLASH */
269
270 #ifdef CONFIG_VFD
271 # ifndef PAGE_SIZE
272 # define PAGE_SIZE 4096
273 # endif
274 /*
275 * reserve memory for VFD display (always full pages)
276 */
277 /* bss_end is defined in the board-specific linker script */
278 addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
279 size = vfd_setmem (addr);
280 gd->fb_base = addr;
281 #endif /* CONFIG_VFD */
282
283 #ifdef CONFIG_LCD
284 # ifndef PAGE_SIZE
285 # define PAGE_SIZE 4096
286 # endif
287 /*
288 * reserve memory for LCD display (always full pages)
289 */
290 /* bss_end is defined in the board-specific linker script */
291 addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
292 size = lcd_setmem (addr);
293 gd->fb_base = addr;
294 #endif /* CONFIG_LCD */
295
296 /* armboot_start is defined in the board-specific linker script */
297 mem_malloc_init (_armboot_start - CFG_MALLOC_LEN);
298
299 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
300 puts ("NAND: ");
301 nand_init(); /* go init the NAND */
302 #endif
303
304 #ifdef CONFIG_HAS_DATAFLASH
305 AT91F_DataflashInit();
306 dataflash_print_info();
307 #endif
308
309 /* initialize environment */
310 env_relocate ();
311
312 #ifdef CONFIG_VFD
313 /* must do this after the framebuffer is allocated */
314 drv_vfd_init();
315 #endif /* CONFIG_VFD */
316
317 /* IP Address */
318 gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
319
320 /* MAC Address */
321 {
322 int i;
323 ulong reg;
324 char *s, *e;
325 char tmp[64];
326
327 i = getenv_r ("ethaddr", tmp, sizeof (tmp));
328 s = (i > 0) ? tmp : NULL;
329
330 for (reg = 0; reg < 6; ++reg) {
331 gd->bd->bi_enetaddr[reg] = s ? simple_strtoul (s, &e, 16) : 0;
332 if (s)
333 s = (*e) ? e + 1 : e;
334 }
335
336 #ifdef CONFIG_HAS_ETH1
337 i = getenv_r ("eth1addr", tmp, sizeof (tmp));
338 s = (i > 0) ? tmp : NULL;
339
340 for (reg = 0; reg < 6; ++reg) {
341 gd->bd->bi_enet1addr[reg] = s ? simple_strtoul (s, &e, 16) : 0;
342 if (s)
343 s = (*e) ? e + 1 : e;
344 }
345 #endif
346 }
347
348 devices_init (); /* get the devices list going. */
349
350 #ifdef CONFIG_CMC_PU2
351 load_sernum_ethaddr ();
352 #endif /* CONFIG_CMC_PU2 */
353
354 jumptable_init ();
355
356 console_init_r (); /* fully init console as a device */
357
358 #if defined(CONFIG_MISC_INIT_R)
359 /* miscellaneous platform dependent initialisations */
360 misc_init_r ();
361 #endif
362
363 /* enable exceptions */
364 enable_interrupts ();
366 /* Perform network card initialisation if necessary */
367 #ifdef CONFIG_DRIVER_CS8900
368 cs8900_get_enetaddr (gd->bd->bi_enetaddr);
369 #endif
370
371 #if defined(CONFIG_DRIVER_SMC91111) || defined (CONFIG_DRIVER_LAN91C96) |
|