X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/3218c675a1575f14d970e8b3081a12fb52dae483..HEAD:/target/linux/ramips/files/arch/mips/ralink/common/prom.c diff --git a/target/linux/ramips/files/arch/mips/ralink/common/prom.c b/target/linux/ramips/files/arch/mips/ralink/common/prom.c index fdbcb7979..26169d366 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/prom.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/prom.c @@ -18,26 +18,29 @@ #include #include -#include + +unsigned long ramips_mem_base; +unsigned long ramips_mem_size_min; +unsigned long ramips_mem_size_max; static inline void *to_ram_addr(void *addr) { u32 base; - base = KSEG0ADDR(RALINK_SOC_SDRAM_BASE); + base = KSEG0ADDR(ramips_mem_base); if (((u32) addr > base) && - ((u32) addr < (base + RALINK_SOC_MEM_SIZE_MAX))) + ((u32) addr < (base + ramips_mem_size_max))) return addr; - base = KSEG1ADDR(RALINK_SOC_SDRAM_BASE); + base = KSEG1ADDR(ramips_mem_base); if (((u32) addr > base) && - ((u32) addr < (base + RALINK_SOC_MEM_SIZE_MAX))) + ((u32) addr < (base + ramips_mem_size_max))) return addr; /* some U-Boot variants uses physical addresses */ - base = RALINK_SOC_SDRAM_BASE; + base = ramips_mem_base; if (((u32) addr > base) && - ((u32) addr < (base + RALINK_SOC_MEM_SIZE_MAX))) + ((u32) addr < (base + ramips_mem_size_max))) return (void *)KSEG0ADDR(addr); return NULL; @@ -143,6 +146,8 @@ void __init prom_init(void) char **envp; char **argv; + ramips_soc_prom_init(); + printk(KERN_DEBUG "prom: fw_arg0=%08x, fw_arg1=%08x, fw_arg2=%08x, fw_arg3=%08x\n", (unsigned int)fw_arg0, (unsigned int)fw_arg1,