diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-11-09 19:38:23 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-01-17 09:17:26 -0500 |
commit | 7527feef06b13e9fd5b6d10a4bfc81b59ee56f27 (patch) | |
tree | 59b7eb57888f4c26f68e9430346650de19f002d7 /lib_blackfin/board.c | |
parent | dbda2c65e5fec92d0791367b53042983746ce95b (diff) | |
download | u-boot-7527feef06b13e9fd5b6d10a4bfc81b59ee56f27.zip u-boot-7527feef06b13e9fd5b6d10a4bfc81b59ee56f27.tar.gz u-boot-7527feef06b13e9fd5b6d10a4bfc81b59ee56f27.tar.bz2 |
Blackfin: support boards with no external memory
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lib_blackfin/board.c')
-rw-r--r-- | lib_blackfin/board.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index b414b2a..ed4e77b 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -130,17 +130,26 @@ void init_cplbtables(void) dcplb_add(0xFF800000, L1_DMEMORY); ++i; - icplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_IKERNEL); - dcplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_DKERNEL); - ++i; - - /* If the monitor crosses a 4 meg boundary, we'll need - * to lock two entries for it. - */ - if ((CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK) != ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK)) { - icplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL); - dcplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL); + if (CONFIG_MEM_SIZE) { + uint32_t mbase = CONFIG_SYS_MONITOR_BASE; + uint32_t mend = mbase + CONFIG_SYS_MONITOR_LEN; + mbase &= CPLB_PAGE_MASK; + mend &= CPLB_PAGE_MASK; + + icplb_add(mbase, SDRAM_IKERNEL); + dcplb_add(mbase, SDRAM_DKERNEL); ++i; + + /* + * If the monitor crosses a 4 meg boundary, we'll need + * to lock two entries for it. We assume it doesn't + * cross two 4 meg boundaries ... + */ + if (mbase != mend) { + icplb_add(mend, SDRAM_IKERNEL); + dcplb_add(mend, SDRAM_DKERNEL); + ++i; + } } icplb_add(0x20000000, SDRAM_INON_CHBL); |