Patchwork [U-Boot,v3] scb9328: Add ARM relocation support

login
register
mail settings
Submitter Torsten Koschorrek
Date July 9, 2011, 3:30 p.m.
Message ID <4E1873FE.4000405@synertronixx.de>
Download mbox | patch
Permalink /patch/103982/
State Superseded
Headers show

Comments

Torsten Koschorrek - July 9, 2011, 3:30 p.m.
This patch fixes compiler errors due to missing definitions of
CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR.

It also does some cleanup: CONFIG_SYS_TEXT_BASE was moved to scb9328.h,
obsolete config.mk was removed. The scb9328 board has 1 DRAM bank, so don't
ask for more banks. CONFIG_NR_DRAM_BANKS will ever be 1.

Signed-off-by: Torsten Koschorrek <koschorrek@synertronixx.de>
---
Changes for v2:
     - config.mk removed
     - cleanups in dram_init_banksize()
Changes for v3:
     - checkpatch errors fixed

  board/scb9328/config.mk   |   10 ----------
  board/scb9328/scb9328.c   |   24 +++++++++---------------
  include/configs/scb9328.h |    5 +++++
  3 files changed, 14 insertions(+), 25 deletions(-)
  delete mode 100644 board/scb9328/config.mk
Stefano Babic - July 12, 2011, 5:59 p.m.
On 07/09/2011 05:30 PM, Torsten Koschorrek wrote:
> This patch fixes compiler errors due to missing definitions of
> CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR.
> 
> It also does some cleanup: CONFIG_SYS_TEXT_BASE was moved to scb9328.h,
> obsolete config.mk was removed. The scb9328 board has 1 DRAM bank, so don't
> ask for more banks. CONFIG_NR_DRAM_BANKS will ever be 1.
> 
> Signed-off-by: Torsten Koschorrek <koschorrek@synertronixx.de>

Hi Torsten,

your patch does not apply on the current u-boot maainline. Can you check
please and repost ?

Applying: scb9328: Add ARM relocation support
error: patch failed: board/scb9328/scb9328.c:39
error: board/scb9328/scb9328.c: patch does not apply
error: patch failed: include/configs/scb9328.h:126
error: include/configs/scb9328.h: patch does not apply
Patch failed at 0001 scb9328: Add ARM relocation support

Best regards,
Stefano Babic

Patch

diff --git a/board/scb9328/config.mk b/board/scb9328/config.mk
deleted file mode 100644
index 7c5e067..0000000
--- a/board/scb9328/config.mk
+++ /dev/null
@@ -1,10 +0,0 @@ 
-#
-# This config file is used for compilation of scb93328 sources
-#
-# You might change location of U-Boot in memory by setting right CONFIG_SYS_TEXT_BASE.
-# This allows for example having one copy located at the end of ram and stored
-# in flash device and later on while developing use other location to test
-# the code in RAM device only.
-#
-
-CONFIG_SYS_TEXT_BASE = 0x08f00000
diff --git a/board/scb9328/scb9328.c b/board/scb9328/scb9328.c
index 428e8c9..2e31e8c 100644
--- a/board/scb9328/scb9328.c
+++ b/board/scb9328/scb9328.c
@@ -39,23 +39,17 @@  int board_init (void)

  int dram_init (void)
  {
-#if ( CONFIG_NR_DRAM_BANKS > 0 )
+	/* dram_init must store complete ramsize in gd->ram_size */
+	gd->ram_size = get_ram_size((volatile void *)SCB9328_SDRAM_1,
+				    SCB9328_SDRAM_1_SIZE);
+
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
  	gd->bd->bi_dram[0].start = SCB9328_SDRAM_1;
  	gd->bd->bi_dram[0].size = SCB9328_SDRAM_1_SIZE;
-#endif
-#if ( CONFIG_NR_DRAM_BANKS > 1 )
-	gd->bd->bi_dram[1].start = SCB9328_SDRAM_2;
-	gd->bd->bi_dram[1].size = SCB9328_SDRAM_2_SIZE;
-#endif
-#if ( CONFIG_NR_DRAM_BANKS > 2 )
-	gd->bd->bi_dram[2].start = SCB9328_SDRAM_3;
-	gd->bd->bi_dram[2].size = SCB9328_SDRAM_3_SIZE;
-#endif
-#if ( CONFIG_NR_DRAM_BANKS > 3 )
-	gd->bd->bi_dram[3].start = SCB9328_SDRAM_4;
-	gd->bd->bi_dram[3].size = SCB9328_SDRAM_4_SIZE;
-#endif
-	return 0;
  }

  /**
diff --git a/include/configs/scb9328.h b/include/configs/scb9328.h
index 6a92ec3..1b5d931 100644
--- a/include/configs/scb9328.h
+++ b/include/configs/scb9328.h
@@ -126,6 +126,11 @@ 
  #define SCB9328_SDRAM_1		0x08000000	/* SDRAM bank #1	   */
  #define SCB9328_SDRAM_1_SIZE	0x01000000	/* 16 MB		   */

+#define CONFIG_SYS_TEXT_BASE	0x10000000
+
+#define CONFIG_SYS_SDRAM_BASE	SCB9328_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR	(SCB9328_SDRAM_1 + 0xf00000)
+
  /*
   * Configuration for FLASH memory for the Synertronixx board
   */