diff options
Diffstat (limited to 'arch/mips/ath25/ar2315.c')
-rw-r--r-- | arch/mips/ath25/ar2315.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/ath25/ar2315.c b/arch/mips/ath25/ar2315.c index 3ba8e757add6..52805b725a67 100644 --- a/arch/mips/ath25/ar2315.c +++ b/arch/mips/ath25/ar2315.c @@ -24,6 +24,8 @@ #include <asm/reboot.h> #include <asm/time.h> +#include <ath25_platform.h> + #include "devices.h" #include "ar2315.h" #include "ar2315_regs.h" @@ -249,6 +251,7 @@ void __init ar2315_plat_mem_setup(void) { void __iomem *sdram_base; u32 memsize, memcfg; + u32 devid; u32 config; /* Detect memory size */ @@ -264,6 +267,25 @@ void __init ar2315_plat_mem_setup(void) ar2315_rst_base = ioremap_nocache(AR2315_RST_BASE, AR2315_RST_SIZE); + /* Detect the hardware based on the device ID */ + devid = ar2315_rst_reg_read(AR2315_SREV) & AR2315_REV_CHIP; + switch (devid) { + case 0x91: /* Need to check */ + ath25_soc = ATH25_SOC_AR2318; + break; + case 0x90: + ath25_soc = ATH25_SOC_AR2317; + break; + case 0x87: + ath25_soc = ATH25_SOC_AR2316; + break; + case 0x86: + default: + ath25_soc = ATH25_SOC_AR2315; + break; + } + ath25_board.devid = devid; + /* Clear any lingering AHB errors */ config = read_c0_config(); write_c0_config(config & ~0x3); |