Patchwork [U-Boot,12/12] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE

login
register
mail settings
Submitter Michal Simek
Date July 9, 2012, 9:20 a.m.
Message ID <1341825639-23475-12-git-send-email-monstr@monstr.eu>
Download mbox | patch
Permalink /patch/169730/
State Accepted
Delegated to: Michal Simek
Headers show

Comments

Michal Simek - July 9, 2012, 9:20 a.m.
Prepare for device-tree driven configuration.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/lib/board.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 1dee830..03ebc97 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -134,7 +134,8 @@  void board_init_f(ulong not_used)
 #if defined(CONFIG_CMD_FLASH)
 	puts ("Flash: ");
 	bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
-	if (0 < (flash_size = flash_init ())) {
+	flash_size = flash_init();
+	if (bd->bi_flashstart && flash_size > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
 		char *s;
 
@@ -147,7 +148,8 @@  void board_init_f(ulong not_used)
 		s = getenv ("flashchecksum");
 		if (s && (*s == 'y')) {
 			printf ("  CRC: %08X",
-				crc32 (0, (const unsigned char *) CONFIG_SYS_FLASH_BASE, flash_size)
+				crc32(0, (const u8 *)bd->bi_flashstart,
+							flash_size)
 			);
 		}
 		putc ('\n');
@@ -155,7 +157,7 @@  void board_init_f(ulong not_used)
 		print_size (flash_size, "\n");
 # endif /* CONFIG_SYS_FLASH_CHECKSUM */
 		bd->bi_flashsize = flash_size;
-		bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
+		bd->bi_flashoffset = bd->bi_flashstart + flash_size;
 	} else {
 		puts ("Flash init FAILED");
 		bd->bi_flashstart = 0;