diff mbox

[U-Boot,03/11] MIPS: board.c: fix init of flash data in bd_info

Message ID 1322143076-20349-4-git-send-email-daniel.schwierzeck@googlemail.com
State Accepted
Commit 71919cf15337c62b9ab389875a6a0855f0ed4461
Delegated to: Marek Vasut
Headers show

Commit Message

Daniel Schwierzeck Nov. 24, 2011, 1:57 p.m. UTC
Boards with CONFIG_SYS_NO_FLASH should not forced to define
CONFIG_SYS_FLASH_BASE. In this case the flash data in bd_info
should be initialized with 0 like the other archs do.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 arch/mips/lib/board.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Comments

Marek Vasut Nov. 25, 2011, 8:40 a.m. UTC | #1
> Boards with CONFIG_SYS_NO_FLASH should not forced to define
> CONFIG_SYS_FLASH_BASE. In this case the flash data in bd_info
> should be initialized with 0 like the other archs do.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
>  arch/mips/lib/board.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
> index aac7690..bcf12c5 100644
> --- a/arch/mips/lib/board.c
> +++ b/arch/mips/lib/board.c
> @@ -301,15 +301,19 @@ void board_init_r(gd_t *id, ulong dest_addr)
>  	/* configure available FLASH banks */
>  	size = flash_init();
>  	display_flash_config(size);
> +	bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
>  	bd->bi_flashsize = size;
> -#endif
> 
> -	bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
>  #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
>  	bd->bi_flashoffset = monitor_flash_len;	/* reserved area for U-Boot */
>  #else
>  	bd->bi_flashoffset = 0;
>  #endif
> +#else
> +	bd->bi_flashstart = 0;
> +	bd->bi_flashsize = 0;
> +	bd->bi_flashoffset = 0;
> +#endif
> 
>  #ifdef CONFIG_CMD_NAND
>  	puts("NAND:  ");

Acked-by: Marek Vasut <marek.vasut@gmail.com>
diff mbox

Patch

diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index aac7690..bcf12c5 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -301,15 +301,19 @@  void board_init_r(gd_t *id, ulong dest_addr)
 	/* configure available FLASH banks */
 	size = flash_init();
 	display_flash_config(size);
+	bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
 	bd->bi_flashsize = size;
-#endif
 
-	bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
 #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
 	bd->bi_flashoffset = monitor_flash_len;	/* reserved area for U-Boot */
 #else
 	bd->bi_flashoffset = 0;
 #endif
+#else
+	bd->bi_flashstart = 0;
+	bd->bi_flashsize = 0;
+	bd->bi_flashoffset = 0;
+#endif
 
 #ifdef CONFIG_CMD_NAND
 	puts("NAND:  ");