Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE
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.
--- 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
@@ -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 definedCONFIG_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
@@ -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
@@ -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
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_LENand/orSRAM_SIZE), while the (now) "official" names areCONFIG_SYS_SRAM_BASEandCONFIG_SYS_SRAM_SIZE.The corresponding code in
arch/powerpc/lib/board.cwas 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_sramstartandbi_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
PATCH 1/1 4xx: add missing CONFIG_SYS_SRAM_SIZE definition
In reply to Wolfgang DenkA 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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_BASEbut fail to defineCONFIG_SYS_SRAM_SIZEwhich is needed when cleaning up the code that prints this information with the bdinfo command.Add the missing deinitions.
Signed-off-by Wolfgang Denk <[email protected]>Cc Stefan Roese <[email protected]>
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
Wolfgang Denk
AppliedPATCH 1/1 4xx: add missing CONFIG_SYS_SRAM_SIZE definition
In reply to Wolfgang DenkQuoted 8 lines · In message <[email protected]> you wrote:
A number of boards define
CONFIG_SYS_SRAM_BASEbut fail to defineCONFIG_SYS_SRAM_SIZEwhich is needed when cleaning up the code that prints this information with the bdinfo command.Add the missing deinitions.
Signed-off-by Wolfgang Denk <[email protected]>Cc Stefan Roese <[email protected]>
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.
PATCH v2 1/1 Cleanup use of CONFIG_SYS_SRAM_BASE and CONFIG_SYS_SRAM_SIZE
In reply to Wolfgang DenkTraditionally 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.
---
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
@@ -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 definedCONFIG_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
@@ -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
@@ -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
Wolfgang Denk
AppliedPATCH 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_LENand/orSRAM_SIZE), while the (now) "official" names areCONFIG_SYS_SRAM_BASEandCONFIG_SYS_SRAM_SIZE.The corresponding code in
arch/powerpc/lib/board.cwas 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_sramstartandbi_sramsize.All respective board maintainers are requested to clean up their respective configurations. Thanks.
Signed-off-by Wolfgang Denk <[email protected]>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.