diff options
author | Renaud Barbier <renaud.barbier@ge.com> | 2014-02-13 16:02:54 +0000 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-14 21:22:43 +0100 |
commit | 3df00bd62dc7534aea831ca6b417388728b3383d (patch) | |
tree | a681afe6f600d632f792b5576e178bf683b2d026 /arch/ppc/mach-mpc85xx | |
parent | 9bdef9e7f2955728dddc189b03d587e42c950ce3 (diff) | |
download | barebox-3df00bd62dc7534aea831ca6b417388728b3383d.tar.gz barebox-3df00bd62dc7534aea831ca6b417388728b3383d.tar.xz |
ppc: mpc85xx: fix memory size calculation
Fix the chip select configuration register offset increment and summing
of bank size so that, for chip select index greater than 0, barebox can
determine the total memory size from enabled banks.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/ppc/mach-mpc85xx')
-rw-r--r-- | arch/ppc/mach-mpc85xx/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/ppc/mach-mpc85xx/cpu.c b/arch/ppc/mach-mpc85xx/cpu.c index 17a1c4cb37..e5c01fc8f6 100644 --- a/arch/ppc/mach-mpc85xx/cpu.c +++ b/arch/ppc/mach-mpc85xx/cpu.c @@ -68,14 +68,14 @@ phys_size_t fsl_get_effective_memsize(void) sdram_size = 0; for (ix = 0; ix < CFG_CHIP_SELECTS_PER_CTRL; ix++) { - if (in_be32(regs + DDR_OFF(CS0_CONFIG) + (ix * 8)) & + if (in_be32(regs + DDR_OFF(CS0_CONFIG) + (ix * 4)) & SDRAM_CFG_MEM_EN) { reg = in_be32(regs + DDR_OFF(CS0_BNDS) + (ix * 8)); /* start address */ san = (reg & 0x0fff00000) >> 16; /* end address */ ean = (reg & 0x00000fff); - sdram_size = ((ean - san + 1) << 24); + sdram_size += ((ean - san + 1) << 24); } } |