add feature gpio
[lede.git] / target / linux / ramips / files / arch / mips / ralink / common / prom.c
index d3f884b84433ffb0c828912cd601e0c5ce7a1824..26169d366df430998032e23031df8efd2e73e786 100644 (file)
 
 #include <asm/mach-ralink/common.h>
 #include <asm/mach-ralink/machine.h>
-#include <ralink_soc.h>
+
+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;