diff options
author | Florian Fainelli <florian@openwrt.org> | 2011-11-16 14:10:36 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-12-07 17:03:04 -0500 |
commit | d61fcfe2bbb27d4da18c609cf279627ae1b74151 (patch) | |
tree | c6448dc370db842e9f4980e9cf00a25d77ce62f9 /arch/mips/bcm63xx/cpu.c | |
parent | 04712f3ff6e3a42ef658b55b0f99478f4f0682e3 (diff) |
MIPS: BCM63xx: Fix SDRAM size computation for BCM6345
Instead of hardcoding the amount of available RAM, read the number of
effective multiples of 8MB from SDRAM_MBASE_REG.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3008/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm63xx/cpu.c')
-rw-r--r-- | arch/mips/bcm63xx/cpu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c index 80941687b9dd..8f0d6c7725ea 100644 --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c | |||
@@ -170,8 +170,10 @@ static unsigned int detect_memory_size(void) | |||
170 | unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0; | 170 | unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0; |
171 | u32 val; | 171 | u32 val; |
172 | 172 | ||
173 | if (BCMCPU_IS_6345()) | 173 | if (BCMCPU_IS_6345()) { |
174 | return (8 * 1024 * 1024); | 174 | val = bcm_sdram_readl(SDRAM_MBASE_REG); |
175 | return (val * 8 * 1024 * 1024); | ||
176 | } | ||
175 | 177 | ||
176 | if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { | 178 | if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { |
177 | val = bcm_sdram_readl(SDRAM_CFG_REG); | 179 | val = bcm_sdram_readl(SDRAM_CFG_REG); |