Skip to contentSkip to conversation

Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

PATCH Superseded Wolfgang Denk 3 participants 7 messages Aug 11, 2010 – Sep 12, 2010 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

Traditionally many boards used local definitions for SRAM base address and size (like SRAM_BASE, SRAM_LEN and/or SRAM_SIZE), while the (now) "official" names are CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE.

The corresponding code in arch/powerpc/lib/board.c was board specific, and has never actually been maintained well. Replace this by feature- specific code and adapt the boards that actually use this.

NOTE: there is still a ton of boards using the old #defines, which therefor contain incorrect values in bi_sramstart and bi_sramsize.

All respective board maintainers are requested to clean up their respective configurations. Thanks.

Cc Josef Wagner <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Wolfgang Denk <[email protected]>
---
 arch/powerpc/lib/board.c |    9 +++------
 include/configs/CPC45.h  |    5 +++--
 include/configs/IP860.h  |    2 ++
 3 files changed, 8 insertions(+), 8 deletions(-)
arch/powerpc/lib/board.c +3 -6
index 0e00d86..6b1ff08 100644
@@ -519,15 +519,12 @@ void board_init_f (ulong bootflag)
 	bd->bi_memstart  = CONFIG_SYS_SDRAM_BASE;	/* start of  DRAM memory	*/
 	bd->bi_memsize   = gd->ram_size;	/* size  of  DRAM memory in bytes */
 
-#ifdef CONFIG_IP860
-	bd->bi_sramstart = SRAM_BASE;	/* start of  SRAM memory	*/
-	bd->bi_sramsize  = SRAM_SIZE;	/* size  of  SRAM memory	*/
-#elif defined CONFIG_MPC8220
+#ifdef CONFIG_SYS_SRAM_BASE
 	bd->bi_sramstart = CONFIG_SYS_SRAM_BASE;	/* start of  SRAM memory	*/
 	bd->bi_sramsize  = CONFIG_SYS_SRAM_SIZE;	/* size  of  SRAM memory	*/
 #else
-	bd->bi_sramstart = 0;		/* FIXME */ /* start of  SRAM memory	*/
-	bd->bi_sramsize  = 0;		/* FIXME */ /* size  of  SRAM memory	*/
+	bd->bi_sramstart = 0;
+	bd->bi_sramsize  = 0;
 #endif
 
 #if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \
include/configs/CPC45.h +3 -2
index 91d262a..c2e506c 100644
@@ -347,13 +347,12 @@
 #define BOOTFLAG_WARM		0x02	/* Software reboot			*/
 
 
-#define SRAM_BASE		0x80000000	/* SRAM base address	*/
-#define SRAM_END		0x801FFFFF
 
 /*----------------------------------------------------------------------*/
 /* CPC45 Memory Map							*/
 /*----------------------------------------------------------------------*/
 #define SRAM_BASE	0x80000000	/* SRAM base address		*/
+#define SRAM_END	0x801FFFFF
 #define ST16552_A_BASE	0x80200000	/* ST16552 channel A		*/
 #define ST16552_B_BASE	0x80400000	/* ST16552 channel A		*/
 #define BCSR_BASE	0x80600000	/* board control / status registers */
@@ -361,6 +360,8 @@
 #define PCMCIA_MEM_BASE 0x83000000	/* PCMCIA memory window base	*/
 #define PCMCIA_IO_BASE	0xFE000000	/* PCMCIA IO window base	*/
 
+#define	CONFIG_SYS_SRAM_BASE	SRAM_BASE
+#define	CONFIG_SYS_SRAM_SIZE	(SRAM_SIZE + SRAM_END + 1)
 
 /*---------------------------------------------------------------------*/
 /* CPC45 Control/Status Registers				       */
include/configs/IP860.h +2 -0
index be63ea5..ed6b7fd 100644
@@ -375,6 +375,8 @@ extern  unsigned long           ip860_get_clk_freq (void);
 #define SRAM_SIZE	(1 + (~(CONFIG_SYS_OR3 & BR_BA_MSK)))
 #define CONFIG_SYS_OR3_PRELIM	CONFIG_SYS_OR3			/* Make sure to map early */
 #define CONFIG_SYS_BR3_PRELIM	CONFIG_SYS_BR3			/* in case it's used for ENV */
+#define	CONFIG_SYS_SRAM_BASE	SRAM_BASE
+#define	CONFIG_SYS_SRAM_SIZE	SRAM_SIZE
 
 /*
  * BR4/OR4 - Board Control & Status (8 bit)
Signature · 1 line
1.7.2.1
#1 lore raw

PATCH 1/1 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

Quoted 8 lines · Wolfgang Denk

Traditionally many boards used local definitions for SRAM base address and size (like SRAM_BASE, SRAM_LEN and/or SRAM_SIZE), while the (now) "official" names are CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE.

The corresponding code in arch/powerpc/lib/board.c was board specific, and has never actually been maintained well. Replace this by feature- specific code and adapt the boards that actually use this.

Quoted 5 lines

NOTE: there is still a ton of boards using the old #defines, which therefor contain incorrect values in bi_sramstart and bi_sramsize.

All respective board maintainers are requested to clean up their respective configurations. ?Thanks.

#if defined(SRAM_BASE) || defined(SRAM_LEN) || defined(SRAM_SIZE)

# warning "your board config.h needs to update its SRAM define names
to CONFI_SYS_SRAM_xxx"
#endif
-mike
#2 lore raw

PATCH 1/1 4xx: add missing CONFIG_SYS_SRAM_SIZE definition

In reply to Wolfgang Denk

A number of boards define CONFIG_SYS_SRAM_BASE but fail to define CONFIG_SYS_SRAM_SIZE which is needed when cleaning up the code that prints this information with the bdinfo command.

Add the missing deinitions.

---
 include/configs/bubinga.h     |    1 +
 include/configs/canyonlands.h |    1 +
 include/configs/intip.h       |    1 +
 include/configs/luan.h        |    1 +
 include/configs/t3corp.h      |    1 +
 5 files changed, 5 insertions(+), 0 deletions(-)
include/configs/bubinga.h +1 -0
index 627060a..159a265 100644
@@ -179,6 +179,7 @@
  * (Set up by the startup code)
  */
 #define CONFIG_SYS_SRAM_BASE		0xFFF00000
+#define CONFIG_SYS_SRAM_SIZE		(256 << 10)
 #define CONFIG_SYS_FLASH_BASE		0xFFF80000
 
 /*-----------------------------------------------------------------------
include/configs/canyonlands.h +1 -0
index 6fe7639..e2c58a5 100644
@@ -111,6 +111,7 @@
 
 #define CONFIG_SYS_OCM_BASE		0xE3000000	/* OCM: 64k		*/
 #define CONFIG_SYS_SRAM_BASE		0xE8000000	/* SRAM: 256k		*/
+#define CONFIG_SYS_SRAM_SIZE		(256 << 10)
 #define CONFIG_SYS_LOCAL_CONF_REGS	0xEF000000
 
 #define CONFIG_SYS_PERIPHERAL_BASE	0xEF600000	/* internal peripherals */
include/configs/intip.h +1 -0
index 19f12fa..0c0bb37 100644
@@ -93,6 +93,7 @@
 
 #define CONFIG_SYS_OCM_BASE		0xE3000000	/* OCM: 64k */
 #define CONFIG_SYS_SRAM_BASE		0xE8000000	/* SRAM: 256k */
+#define CONFIG_SYS_SRAM_SIZE		(256 << 10)
 #define CONFIG_SYS_LOCAL_CONF_REGS	0xEF000000
 
 #define CONFIG_SYS_PERIPHERAL_BASE	0xEF600000	/* internal periph. */
include/configs/luan.h +1 -0
index b158b74..ccd9397 100644
@@ -53,6 +53,7 @@
 #define CONFIG_SYS_LARGE_FLASH		0xffc00000	/* 4MB flash address CS0 */
 #define CONFIG_SYS_SMALL_FLASH		0xff900000	/* 1MB flash address CS2 */
 #define CONFIG_SYS_SRAM_BASE		0xff800000	/* 1MB SRAM  address CS2 */
+#define CONFIG_SYS_SRAM_SIZE		(1 << 20)
 #define CONFIG_SYS_EPLD_BASE		0xff000000	/* EPLD and FRAM     CS1 */
 
 #define CONFIG_SYS_ISRAM_BASE	        0xf8000000	/* internal 8k SRAM (L2 cache) */
include/configs/t3corp.h +1 -0
index b38886b..41ee15b 100644
@@ -86,6 +86,7 @@
 
 #define CONFIG_SYS_OCM_BASE		0xE7000000	/* OCM: 64k */
 #define CONFIG_SYS_SRAM_BASE		0xE8000000	/* SRAM: 256k */
+#define CONFIG_SYS_SRAM_SIZE		(256 << 10)
 #define CONFIG_SYS_LOCAL_CONF_REGS	0xEF000000
 
 #define CONFIG_SYS_PERIPHERAL_BASE	0xEF600000	/* internal periph. */
Signature · 1 line
1.7.2.2
#3 lore raw

PATCH 1/1 4xx: add missing CONFIG_SYS_SRAM_SIZE definition

Hi Wolfgang,

Quoted 8 lines · On Saturday 11 September 2010 21:40:05 Wolfgang Denk wrote:

A number of boards define CONFIG_SYS_SRAM_BASE but fail to define CONFIG_SYS_SRAM_SIZE which is needed when cleaning up the code that prints this information with the bdinfo command.

Add the missing deinitions.

Feel free to pull this patch directly if needed.

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

author Applied
#4 lore raw

PATCH 1/1 4xx: add missing CONFIG_SYS_SRAM_SIZE definition

In reply to Wolfgang Denk
Quoted 8 lines · In message <[email protected]> you wrote:

A number of boards define CONFIG_SYS_SRAM_BASE but fail to define CONFIG_SYS_SRAM_SIZE which is needed when cleaning up the code that prints this information with the bdinfo command.

Add the missing deinitions.

Quoted 7 lines
---
 include/configs/bubinga.h     |    1 +
 include/configs/canyonlands.h |    1 +
 include/configs/intip.h       |    1 +
 include/configs/luan.h        |    1 +
 include/configs/t3corp.h      |    1 +
 5 files changed, 5 insertions(+), 0 deletions(-)

Applied to "next" branch.

#5 lore raw

PATCH v2 1/1 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

In reply to Wolfgang Denk

Traditionally many boards used local definitions for SRAM base address and size (like SRAM_BASE, SRAM_LEN and/or SRAM_SIZE), while the (now) "official" names are CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE.

The corresponding code in arch/powerpc/lib/board.c was board specific, and has never actually been maintained well. Replace this by feature- specific code and adapt the boards that actually use this.

NOTE: there is still a ton of boards using the old #defines, which therefor contain incorrect values in bi_sramstart and bi_sramsize.

All respective board maintainers are requested to clean up their respective configurations. Thanks.

Cc Josef Wagner <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
V2: fixed bug in CPC45 config file (did not compile)

 arch/powerpc/lib/board.c |    9 +++------
 include/configs/CPC45.h  |    5 +++--
 include/configs/IP860.h  |    2 ++
 3 files changed, 8 insertions(+), 8 deletions(-)
arch/powerpc/lib/board.c +3 -6
index 0e00d86..6b1ff08 100644
@@ -519,15 +519,12 @@ void board_init_f (ulong bootflag)
 	bd->bi_memstart  = CONFIG_SYS_SDRAM_BASE;	/* start of  DRAM memory	*/
 	bd->bi_memsize   = gd->ram_size;	/* size  of  DRAM memory in bytes */
 
-#ifdef CONFIG_IP860
-	bd->bi_sramstart = SRAM_BASE;	/* start of  SRAM memory	*/
-	bd->bi_sramsize  = SRAM_SIZE;	/* size  of  SRAM memory	*/
-#elif defined CONFIG_MPC8220
+#ifdef CONFIG_SYS_SRAM_BASE
 	bd->bi_sramstart = CONFIG_SYS_SRAM_BASE;	/* start of  SRAM memory	*/
 	bd->bi_sramsize  = CONFIG_SYS_SRAM_SIZE;	/* size  of  SRAM memory	*/
 #else
-	bd->bi_sramstart = 0;		/* FIXME */ /* start of  SRAM memory	*/
-	bd->bi_sramsize  = 0;		/* FIXME */ /* size  of  SRAM memory	*/
+	bd->bi_sramstart = 0;
+	bd->bi_sramsize  = 0;
 #endif
 
 #if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \
include/configs/CPC45.h +3 -2
index 91d262a..668cfa2 100644
@@ -347,13 +347,12 @@
 #define BOOTFLAG_WARM		0x02	/* Software reboot			*/
 
 
-#define SRAM_BASE		0x80000000	/* SRAM base address	*/
-#define SRAM_END		0x801FFFFF
 
 /*----------------------------------------------------------------------*/
 /* CPC45 Memory Map							*/
 /*----------------------------------------------------------------------*/
 #define SRAM_BASE	0x80000000	/* SRAM base address		*/
+#define SRAM_END	0x801FFFFF
 #define ST16552_A_BASE	0x80200000	/* ST16552 channel A		*/
 #define ST16552_B_BASE	0x80400000	/* ST16552 channel A		*/
 #define BCSR_BASE	0x80600000	/* board control / status registers */
@@ -361,6 +360,8 @@
 #define PCMCIA_MEM_BASE 0x83000000	/* PCMCIA memory window base	*/
 #define PCMCIA_IO_BASE	0xFE000000	/* PCMCIA IO window base	*/
 
+#define	CONFIG_SYS_SRAM_BASE	SRAM_BASE
+#define	CONFIG_SYS_SRAM_SIZE	(SRAM_END - SRAM_BASE + 1)
 
 /*---------------------------------------------------------------------*/
 /* CPC45 Control/Status Registers				       */
include/configs/IP860.h +2 -0
index be63ea5..ed6b7fd 100644
@@ -375,6 +375,8 @@ extern  unsigned long           ip860_get_clk_freq (void);
 #define SRAM_SIZE	(1 + (~(CONFIG_SYS_OR3 & BR_BA_MSK)))
 #define CONFIG_SYS_OR3_PRELIM	CONFIG_SYS_OR3			/* Make sure to map early */
 #define CONFIG_SYS_BR3_PRELIM	CONFIG_SYS_BR3			/* in case it's used for ENV */
+#define	CONFIG_SYS_SRAM_BASE	SRAM_BASE
+#define	CONFIG_SYS_SRAM_SIZE	SRAM_SIZE
 
 /*
  * BR4/OR4 - Board Control & Status (8 bit)
Signature · 1 line
1.7.2.2
author Applied
#6 lore raw

PATCH v2 1/1 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE

Quoted 19 lines · In message <[email protected]> you wrote:

Traditionally many boards used local definitions for SRAM base address and size (like SRAM_BASE, SRAM_LEN and/or SRAM_SIZE), while the (now) "official" names are CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE.

The corresponding code in arch/powerpc/lib/board.c was board specific, and has never actually been maintained well. Replace this by feature- specific code and adapt the boards that actually use this.

NOTE: there is still a ton of boards using the old #defines, which therefor contain incorrect values in bi_sramstart and bi_sramsize.

All respective board maintainers are requested to clean up their respective configurations. Thanks.

Cc Josef Wagner <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Wolfgang Denk <[email protected]>
Quoted 7 lines

---
V2: fixed bug in CPC45 config file (did not compile)

 arch/powerpc/lib/board.c |    9 +++------
 include/configs/CPC45.h  |    5 +++--
 include/configs/IP860.h  |    2 ++
 3 files changed, 8 insertions(+), 8 deletions(-)

Applied to "next" branch.