summaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files/arch/mips/ralink
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-11 19:05:56 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-11 19:05:56 +0000
commit5a2708d1926dfdbbe91f5d12fab43eff55ea971f (patch)
treee6992194aa267fc8e67bdb1985860631c687d7c0 /target/linux/ramips/files/arch/mips/ralink
parent9fb8ca891c66f6f2eff5d3003c9ca3b306fb062a (diff)
ramips: replace RALINK_SOC_* macros with global variables
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30888 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink')
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/common/prom.c17
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/common/setup.c5
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c4
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c4
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c4
5 files changed, 24 insertions, 10 deletions
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 d3f884b84..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 <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;
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 5f7cf14a7..0d6b8d8c9 100644
--- a/target/linux/ramips/files/arch/mips/ralink/common/setup.c
+++ b/target/linux/ramips/files/arch/mips/ralink/common/setup.c
@@ -19,7 +19,6 @@
#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/machine.h>
-#include <ralink_soc.h>
unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
@@ -34,13 +33,13 @@ static void __init detect_mem_size(void)
void *base;
base = (void *) KSEG1ADDR(detect_mem_size);
- for (size = RALINK_SOC_MEM_SIZE_MIN; size < RALINK_SOC_MEM_SIZE_MAX;
+ for (size = ramips_mem_size_min; size < ramips_mem_size_max;
size <<= 1 ) {
if (!memcmp(base, base + size, 1024))
break;
}
- add_memory_region(RALINK_SOC_SDRAM_BASE, size, BOOT_MEM_RAM);
+ add_memory_region(ramips_mem_base, size, BOOT_MEM_RAM);
}
void __init ramips_early_serial_setup(int line, unsigned base, unsigned freq,
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c
index 633e83d8c..c51ad98b3 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c
@@ -42,6 +42,10 @@ void __init ramips_soc_prom_init(void)
(char) ((n1 >> 16) & 0xff), (char) ((n1 >> 24) & 0xff),
(id >> CHIP_ID_ID_SHIFT) & CHIP_ID_ID_MASK,
(id & CHIP_ID_REV_MASK));
+
+ ramips_mem_base = RT2880_SDRAM_BASE;
+ ramips_mem_size_min = RT288X_MEM_SIZE_MIN;
+ ramips_mem_size_max = RT288X_MEM_SIZE_MAX;
}
static struct ramips_gpio_chip rt288x_gpio_chips[] = {
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
index fa0d0f6cc..956867830 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
@@ -42,6 +42,10 @@ void __init ramips_soc_prom_init(void)
(char) ((n1 >> 16) & 0xff), (char) ((n1 >> 24) & 0xff),
(id >> CHIP_ID_ID_SHIFT) & CHIP_ID_ID_MASK,
(id & CHIP_ID_REV_MASK));
+
+ ramips_mem_base = RT305X_SDRAM_BASE;
+ ramips_mem_size_min = RT305X_MEM_SIZE_MIN;
+ ramips_mem_size_max = RT305X_MEM_SIZE_MAX;
}
static struct ramips_gpio_chip rt305x_gpio_chips[] = {
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c b/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c
index 8f5994892..9f9141266 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c
@@ -41,6 +41,10 @@ void __init ramips_soc_prom_init(void)
(char) ((n1 >> 16) & 0xff), (char) ((n1 >> 24) & 0xff),
(id >> RT3883_REVID_VER_ID_SHIFT) & RT3883_REVID_VER_ID_MASK,
(id & RT3883_REVID_ECO_ID_MASK));
+
+ ramips_mem_base = RT3883_SDRAM_BASE;
+ ramips_mem_size_min = RT3883_MEM_SIZE_MIN;
+ ramips_mem_size_max = RT3883_MEM_SIZE_MAX;
}
static struct ramips_gpio_chip rt3883_gpio_chips[] = {