From 1e78042c77dcc255abd456398981549269c63238 Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Fri, 25 Apr 2008 04:31:23 +0800 Subject: [Blackfin] arch: take DDR DEVWD into consideration as well for BF548 Pointed-out-by: Michael Hennerich Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- arch/blackfin/kernel/setup.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'arch/blackfin/kernel/setup.c') diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index b0ae5cd44203..8efea004aecb 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -680,13 +680,20 @@ static inline int __init get_mem_size(void) return EBSZ_TO_MEG(bfin_read_EBIU_SDBCTL()); # endif # elif defined(EBIU_DDRCTL1) - switch (bfin_read_EBIU_DDRCTL1() & 0xc0000) { - case DEVSZ_64: return 64 / 8; - case DEVSZ_128: return 128 / 8; - case DEVSZ_256: return 256 / 8; - case DEVSZ_512: return 512 / 8; - default: return 0; + u32 ddrctl = bfin_read_EBIU_DDRCTL1(); + int ret = 0; + switch (ddrctl & 0xc0000) { + case DEVSZ_64: ret = 64 / 8; + case DEVSZ_128: ret = 128 / 8; + case DEVSZ_256: ret = 256 / 8; + case DEVSZ_512: ret = 512 / 8; + } + switch (ddrctl & 0x30000) { + case DEVWD_4: ret *= 2; + case DEVWD_8: ret *= 2; + case DEVWD_16: break; } + return ret; # endif #endif BUG(); -- cgit v1.2.2