All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 7/7] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE
Date: Mon,  6 Aug 2012 09:46:39 +0200	[thread overview]
Message-ID: <1344239199-11445-7-git-send-email-monstr@monstr.eu> (raw)
In-Reply-To: <1344239199-11445-1-git-send-email-monstr@monstr.eu>

Prepare for device-tree driven configuration.

Signed-off-by: Michal Simek <monstr@monstr.eu>

---
v2: Move bi_flashsize and bi_flashoffset from other patch
---
 arch/microblaze/lib/board.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index b450367..674b573 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -136,9 +136,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 ())) {
-		bd->bi_flashsize = flash_size;
-		bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
+	flash_size = flash_init();
+	if (bd->bi_flashstart && flash_size > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
 		print_size (flash_size, "");
 		/*
@@ -149,13 +148,16 @@ 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');
 # else	/* !CONFIG_SYS_FLASH_CHECKSUM */
 		print_size (flash_size, "\n");
 # endif /* CONFIG_SYS_FLASH_CHECKSUM */
+		bd->bi_flashsize = flash_size;
+		bd->bi_flashoffset = bd->bi_flashstart + flash_size;
 	} else {
 		puts ("Flash init FAILED");
 		bd->bi_flashstart = 0;
-- 
1.7.0.4

  parent reply	other threads:[~2012-08-06  7:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06  7:46 [U-Boot] [PATCH v2 1/7] microblaze: Add support for device tree driven board configuration Michal Simek
2012-08-06  7:46 ` [U-Boot] [PATCH v2 2/7] microblaze: board: Remove compilation warning Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 3/7] microblaze: intc: Registering interrupt should return value Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-08  8:27     ` Michal Simek
2012-08-08 17:47       ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 4/7] microblaze: intc: Coding style cleanup Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 5/7] microblaze: timer: Prepare for device-tree initialization Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-08  8:27     ` Michal Simek
2012-08-06  7:46 ` [U-Boot] [PATCH v2 6/7] microblaze: Clean microblaze initialization Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-06  7:46 ` Michal Simek [this message]
2012-08-07 20:10   ` [U-Boot] [PATCH v2 7/7] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE Stephan Linz
2012-08-07 20:10 ` [U-Boot] [PATCH v2 1/7] microblaze: Add support for device tree driven board configuration Stephan Linz
2012-08-10  7:16   ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344239199-11445-7-git-send-email-monstr@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.