diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-11 19:05:53 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-11 19:05:53 +0000 |
commit | 9fb8ca891c66f6f2eff5d3003c9ca3b306fb062a (patch) | |
tree | 118e6872dc0a7554fe29faba0ebfd5c06d9a2f58 /target/linux/ramips/files/arch/mips/ralink | |
parent | 86b5f9e15f37d932d9bba3b7ef81ade0085c40dd (diff) |
ramips: introduce ramips_soc_prom_init and move SoC detection into that
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30887 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink')
7 files changed, 17 insertions, 15 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 fdbcb7979..d3f884b84 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/prom.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/prom.c @@ -143,6 +143,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, 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 53b1a6911..633e83d8c 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c @@ -23,15 +23,16 @@ void __iomem * rt288x_sysc_base; void __iomem * rt288x_memc_base; -void __init rt288x_detect_sys_type(void) +void __init ramips_soc_prom_init(void) { + void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT2880_SYSC_BASE); u32 n0; u32 n1; u32 id; - n0 = rt288x_sysc_rr(SYSC_REG_CHIP_NAME0); - n1 = rt288x_sysc_rr(SYSC_REG_CHIP_NAME1); - id = rt288x_sysc_rr(SYSC_REG_CHIP_ID); + n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); + n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); + id = __raw_readl(sysc + SYSC_REG_CHIP_ID); snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN, "Ralink %c%c%c%c%c%c%c%c id:%u rev:%u", diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c index 65e187d3a..be474b529 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c @@ -52,7 +52,6 @@ void __init ramips_soc_setup(void) rt288x_sysc_base = ioremap_nocache(RT2880_SYSC_BASE, RT2880_SYSC_SIZE); rt288x_memc_base = ioremap_nocache(RT2880_MEMC_BASE, RT2880_MEMC_SIZE); - rt288x_detect_sys_type(); rt288x_clocks_init(); clk = clk_get(NULL, "cpu"); 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 5916888f0..fa0d0f6cc 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c @@ -23,15 +23,16 @@ void __iomem * rt305x_sysc_base; void __iomem * rt305x_memc_base; -void __init rt305x_detect_sys_type(void) +void __init ramips_soc_prom_init(void) { + void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE); u32 n0; u32 n1; u32 id; - n0 = rt305x_sysc_rr(SYSC_REG_CHIP_NAME0); - n1 = rt305x_sysc_rr(SYSC_REG_CHIP_NAME1); - id = rt305x_sysc_rr(SYSC_REG_CHIP_ID); + n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); + n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); + id = __raw_readl(sysc + SYSC_REG_CHIP_ID); snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN, "Ralink %c%c%c%c%c%c%c%c id:%u rev:%u", diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c index 6913006f7..5a069db45 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c @@ -52,7 +52,6 @@ void __init ramips_soc_setup(void) rt305x_sysc_base = ioremap_nocache(RT305X_SYSC_BASE, PAGE_SIZE); rt305x_memc_base = ioremap_nocache(RT305X_MEMC_BASE, PAGE_SIZE); - rt305x_detect_sys_type(); rt305x_clocks_init(); clk = clk_get(NULL, "cpu"); 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 6e75b390f..8f5994892 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt3883/rt3883.c @@ -22,15 +22,16 @@ void __iomem * rt3883_sysc_base; void __iomem * rt3883_memc_base; -void __init rt3883_detect_sys_type(void) +void __init ramips_soc_prom_init(void) { + void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT3883_SYSC_BASE); u32 n0; u32 n1; u32 id; - n0 = rt3883_sysc_rr(RT3883_SYSC_REG_CHIPID0_3); - n1 = rt3883_sysc_rr(RT3883_SYSC_REG_CHIPID4_7); - id = rt3883_sysc_rr(RT3883_SYSC_REG_REVID); + n0 = __raw_readl(sysc + RT3883_SYSC_REG_CHIPID0_3); + n1 = __raw_readl(sysc + RT3883_SYSC_REG_CHIPID4_7); + id = __raw_readl(sysc + RT3883_SYSC_REG_REVID); snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN, "Ralink %c%c%c%c%c%c%c%c ver:%u eco:%u", diff --git a/target/linux/ramips/files/arch/mips/ralink/rt3883/setup.c b/target/linux/ramips/files/arch/mips/ralink/rt3883/setup.c index f4c7296fa..6e037a729 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt3883/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt3883/setup.c @@ -52,7 +52,6 @@ void __init ramips_soc_setup(void) rt3883_sysc_base = ioremap_nocache(RT3883_SYSC_BASE, PAGE_SIZE); rt3883_memc_base = ioremap_nocache(RT3883_MEMC_BASE, PAGE_SIZE); - rt3883_detect_sys_type(); rt3883_clocks_init(); clk = clk_get(NULL, "cpu"); |