aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/setup.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-04-24 16:31:23 -0400
committerBryan Wu <cooloney@kernel.org>2008-04-24 16:31:23 -0400
commit1e78042c77dcc255abd456398981549269c63238 (patch)
treef35d050ea3b789306ed932f9f58a9dbf8a1f067d /arch/blackfin/kernel/setup.c
parent5d750b9e4f6ca7d366b4954517ff8be9ee07e1bf (diff)
[Blackfin] arch: take DDR DEVWD into consideration as well for BF548
Pointed-out-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/setup.c')
-rw-r--r--arch/blackfin/kernel/setup.c19
1 files changed, 13 insertions, 6 deletions
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)
680 return EBSZ_TO_MEG(bfin_read_EBIU_SDBCTL()); 680 return EBSZ_TO_MEG(bfin_read_EBIU_SDBCTL());
681# endif 681# endif
682# elif defined(EBIU_DDRCTL1) 682# elif defined(EBIU_DDRCTL1)
683 switch (bfin_read_EBIU_DDRCTL1() & 0xc0000) { 683 u32 ddrctl = bfin_read_EBIU_DDRCTL1();
684 case DEVSZ_64: return 64 / 8; 684 int ret = 0;
685 case DEVSZ_128: return 128 / 8; 685 switch (ddrctl & 0xc0000) {
686 case DEVSZ_256: return 256 / 8; 686 case DEVSZ_64: ret = 64 / 8;
687 case DEVSZ_512: return 512 / 8; 687 case DEVSZ_128: ret = 128 / 8;
688 default: return 0; 688 case DEVSZ_256: ret = 256 / 8;
689 case DEVSZ_512: ret = 512 / 8;
690 }
691 switch (ddrctl & 0x30000) {
692 case DEVWD_4: ret *= 2;
693 case DEVWD_8: ret *= 2;
694 case DEVWD_16: break;
689 } 695 }
696 return ret;
690# endif 697# endif
691#endif 698#endif
692 BUG(); 699 BUG();