[U-Boot-Users] [PATCH] MIPS: Fix CFG_NO_FLASH support

Shinya Kuribayashi skuribay at ruby.dti.ne.jp
Mon Feb 18 15:30:16 CET 2008


Jean-Christophe PLAGNIOL-VILLARD wrote:
> @@ -352,13 +355,16 @@ void board_init_r (gd_t *id, ulong dest_addr)
>  	env_name_spec += gd->reloc_off;
>  #endif
>  
> +	bd = gd->bd;
> +
> +#ifndef CFG_NO_FLASH
>  	/* configure available FLASH banks */
>  	size = flash_init();
>  	display_flash_config (size);
> +	bd->bi_flashsize = size;
> +#endif
>  
> -	bd = gd->bd;
>  	bd->bi_flashstart = CFG_FLASH_BASE;
> -	bd->bi_flashsize = size;
>  #if CFG_MONITOR_BASE == CFG_FLASH_BASE
>  	bd->bi_flashoffset = monitor_flash_len;	/* reserved area for U-Boot */
>  #else

Hm, could we clean up further more?

diff --git a/lib_mips/board.c b/lib_mips/board.c
index 1645f2c..b9606e4 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -361,15 +361,15 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	/* configure available FLASH banks */
 	size = flash_init();
 	display_flash_config (size);
+	bd->bi_flashstart = CFG_FLASH_BASE;
 	bd->bi_flashsize = size;
-#endif
 
-	bd->bi_flashstart = CFG_FLASH_BASE;
 #if CFG_MONITOR_BASE == CFG_FLASH_BASE
 	bd->bi_flashoffset = monitor_flash_len;	/* reserved area for U-Boot */
 #else
 	bd->bi_flashoffset = 0;
 #endif
+#endif /* CFG_NO_FLASH */
 
 	/* initialize malloc() area */
 	mem_malloc_init();
_

And if possible, please split the patch into two; one is for board.c,
the other for qemu-mips.

  Shinya






More information about the U-Boot mailing list