diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-08-31 18:53:26 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-08-31 18:53:26 +0000 |
commit | f4afb9a4f951ae34bda05969a179496bad27c869 (patch) | |
tree | ee43976eb76ed024560a55701353697e84a4e9f1 /target/linux/ramips/files/arch/mips/ralink/common/setup.c | |
parent | 3cc0bc90387d7cea119bee68a6f9c08295267c8c (diff) | |
download | master-31e0f0ae-f4afb9a4f951ae34bda05969a179496bad27c869.tar.gz master-31e0f0ae-f4afb9a4f951ae34bda05969a179496bad27c869.tar.bz2 master-31e0f0ae-f4afb9a4f951ae34bda05969a179496bad27c869.zip |
share memory size detection code
SVN-Revision: 17454
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink/common/setup.c')
-rw-r--r-- | target/linux/ramips/files/arch/mips/ralink/common/setup.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/common/setup.c b/target/linux/ramips/files/arch/mips/ralink/common/setup.c index 6440ccb01a..86e951ca20 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/setup.c @@ -13,12 +13,30 @@ #include <linux/init.h> #include <linux/io.h> +#include <asm/bootinfo.h> #include <asm/addrspace.h> + #include <asm/mach-ralink/common.h> +#include <ralink_soc.h> + +static void __init detect_mem_size(void) +{ + unsigned long size; + + for (size = RALINK_SOC_MEM_SIZE_MIN; size < RALINK_SOC_MEM_SIZE_MAX; + size <<= 1 ) { + if (!memcmp(detect_mem_size, + detect_mem_size + size, 1024)) + break; + } + + add_memory_region(RALINK_SOC_SDRAM_BASE, size, BOOT_MEM_RAM); +} void __init plat_mem_setup(void) { set_io_port_base(KSEG1); + detect_mem_size(); ramips_soc_setup(); } |