From: wdenk Date: Thu, 27 Dec 2001 23:39:02 +0000 (+0000) Subject: Add support for AMX860 EDO RAM extension module X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea636e52ffb78c665667d9b7c5338844e4cb2248;p=users%2Frw%2Fppcboot.git Add support for AMX860 EDO RAM extension module --- diff --git a/board/westel/amx860/amx860.c b/board/westel/amx860/amx860.c index 53ecf09..022543b 100644 --- a/board/westel/amx860/amx860.c +++ b/board/westel/amx860/amx860.c @@ -77,11 +77,23 @@ long int initdram (int board_type) upmconfig(UPMA, (uint *) edo_60ns, sizeof(edo_60ns)/sizeof(uint)); +#ifndef CONFIG_AMX_RAM_EXT memctl->memc_mptpr = 0x0400; /* divide by 16 */ +#else + memctl->memc_mptpr = 0x0200; +#endif memctl->memc_mamr = 0x30a21114; memctl->memc_or2 = 0xffc00800; +#ifndef CONFIG_AMX_RAM_EXT memctl->memc_br2 = 0x81; return (4 << 20); +#else + memctl->memc_or1 = 0xff000800; + memctl->memc_br1 = 0x00000081; + memctl->memc_br2 = 0x01000081; + + return (20 << 20); +#endif } diff --git a/board/westel/amx860/flash.c b/board/westel/amx860/flash.c index a973e06..5ca3e72 100644 --- a/board/westel/amx860/flash.c +++ b/board/westel/amx860/flash.c @@ -113,7 +113,7 @@ unsigned long flash_init (void) memctl->memc_br1, memctl->memc_or1); /* Remap FLASH according to real size */ - memctl->memc_or0 = (CFG_OR0_PRELIM & ~OR_AM_MSK) | (-size_b0 & OR_AM_MSK); + memctl->memc_or0 = CFG_OR_TIMING_FLASH | (-size_b0 & OR_AM_MSK); memctl->memc_br0 = (CFG_FLASH_BASE & BR_BA_MSK) | BR_MS_GPCM | BR_V; DEBUGF("## BR0: 0x%08x OR0: 0x%08x\n", @@ -142,10 +142,8 @@ unsigned long flash_init (void) &flash_info[0]); #endif -#ifndef CONFIG_AMX_RAM_EXT /* can't have RAM extension _and_ 2nd flash bank */ if (size_b1) { - memctl->memc_or1 = (CFG_OR1_PRELIM & ~OR_AM_MSK) | - (-size_b1 & OR_AM_MSK); + memctl->memc_or1 = CFG_OR_TIMING_FLASH | (-size_b1 & OR_AM_MSK); memctl->memc_br1 = ((CFG_FLASH_BASE + size_b0) & BR_BA_MSK) | BR_MS_GPCM | BR_V; @@ -168,18 +166,18 @@ unsigned long flash_init (void) &flash_info[1]); # endif -# ifdef CFG_ENV_IS_IN_FLASH +# ifdef CFG_ENV_IS_IN_FLASH /* ENV protection ON by default */ flash_protect(FLAG_PROTECT_SET, CFG_ENV_ADDR, CFG_ENV_ADDR+CFG_ENV_SECT_SIZE-1, &flash_info[1]); -# endif - } else -#endif /* CONFIG_AMX_RAM_EXT */ - { +#endif + } else { +#ifndef CONFIG_AMX_RAM_EXT memctl->memc_br1 = 0; /* invalidate bank */ memctl->memc_or1 = 0; /* invalidate bank */ +#endif DEBUGF("## DISABLE BR1: 0x%08x OR1: 0x%08x\n", memctl->memc_br1, memctl->memc_or1);