diff options
author | Tom Rini <trini@konsulko.com> | 2022-07-23 13:04:56 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-04 16:18:47 -0400 |
commit | 9a56ab96aa3206001c89151eb2755479f708f084 (patch) | |
tree | f34f024e11ae18f3c902736f83094ca44789426e /board | |
parent | b72713dc0bb76a7629dab3746694633089e51339 (diff) | |
download | u-boot-9a56ab96aa3206001c89151eb2755479f708f084.zip u-boot-9a56ab96aa3206001c89151eb2755479f708f084.tar.gz u-boot-9a56ab96aa3206001c89151eb2755479f708f084.tar.bz2 |
powerpc: Move CONFIG_SYS_DDR_SIZE to CONFIG_SYS_SDRAM_SIZE
We have a number of CONFIG_SYS_xxx_SIZE options to describe the amount
main memory available. Rework CONFIG_SYS_DDR_SIZE, which described a
size in number of MiB to use CONFIG_SYS_SDRAM_SIZE which is most often
used as a number of bytes. Use shifts of this option when required.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mpc837xerdb/mpc837xerdb.c | 4 | ||||
-rw-r--r-- | board/gdsys/mpc8308/sdram.c | 2 | ||||
-rw-r--r-- | board/ids/ids8313/ids8313.c | 4 | ||||
-rw-r--r-- | board/keymile/km83xx/km83xx.c | 5 |
4 files changed, 7 insertions, 8 deletions
diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 84671f6..2650d30 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -97,7 +97,7 @@ int dram_init(void) int fixed_sdram(void) { immap_t *im = (immap_t *) CONFIG_SYS_IMMR; - u32 msize = CONFIG_SYS_DDR_SIZE * 1024 * 1024; + u32 msize = CONFIG_SYS_SDRAM_SIZE; u32 msize_log2 = __ilog2(msize); im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xfffff000; @@ -127,7 +127,7 @@ int fixed_sdram(void) im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN; udelay(2000); - return CONFIG_SYS_DDR_SIZE; + return CONFIG_SYS_SDRAM_SIZE >> 20; } #endif /*!CONFIG_SYS_SPD_EEPROM */ diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c index bfd55f5..47b8804 100644 --- a/board/gdsys/mpc8308/sdram.c +++ b/board/gdsys/mpc8308/sdram.c @@ -34,7 +34,7 @@ DECLARE_GLOBAL_DATA_PTR; static long fixed_sdram(void) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; - u32 msize = CONFIG_SYS_DDR_SIZE * 1024 * 1024; + u32 msize = CONFIG_SYS_SDRAM_SIZE; u32 msize_log2 = __ilog2(msize); out_be32(&im->sysconf.ddrlaw[0].bar, diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index 45c77a2..48aea71 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -56,7 +56,7 @@ int checkboard(void) int fixed_sdram(unsigned long config) { immap_t *im = (immap_t *)CONFIG_SYS_IMMR; - u32 msize = CONFIG_SYS_DDR_SIZE << 20; + u32 msize = CONFIG_SYS_SDRAM_SIZE; #ifndef CONFIG_SYS_RAMBOOT u32 msize_log2 = __ilog2(msize); @@ -109,7 +109,7 @@ int fixed_sdram(unsigned long config) static int setup_sdram(void) { - u32 msize = CONFIG_SYS_DDR_SIZE << 20; + u32 msize = CONFIG_SYS_SDRAM_SIZE; long int size_01, size_02; size_01 = fixed_sdram(CONFIG_SYS_DDR_CONFIG); diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 8a0b175..6a7b848 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -141,12 +141,11 @@ static int fixed_sdram(void) udelay(200); setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); - msize = CONFIG_SYS_DDR_SIZE << 20; disable_addr_trans(); - msize = get_ram_size(CONFIG_SYS_SDRAM_BASE, msize); + msize = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE); enable_addr_trans(); msize /= (1024 * 1024); - if (CONFIG_SYS_DDR_SIZE != msize) { + if (CONFIG_SYS_SDRAM_SIZE >> 20 != msize) { for (ddr_size = msize << 20, ddr_size_log2 = 0; (ddr_size > 1); ddr_size = ddr_size >> 1, ddr_size_log2++) |