diff options
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink/common')
-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 6440ccb01..86e951ca2 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(); } |