Changeset 30890
- Timestamp:
- 2012-03-11T20:05:59+01:00 (6 years ago)
- Location:
- trunk/target/linux/ramips/files/arch/mips
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x.h
r30887 r30890 16 16 #include <linux/init.h> 17 17 #include <linux/io.h> 18 19 enum rt305x_soc_type { 20 RT305X_SOC_UNKNOWN = 0, 21 RT305X_SOC_RT3050, 22 RT305X_SOC_RT3052, 23 RT305X_SOC_RT3352, 24 }; 25 26 extern enum rt305x_soc_type rt305x_soc; 27 28 static inline int soc_is_rt3050(void) 29 { 30 return rt305x_soc == RT305X_SOC_RT3050; 31 } 32 33 static inline int soc_is_rt3052(void) 34 { 35 return rt305x_soc == RT305X_SOC_RT3052; 36 } 37 38 static inline int soc_is_rt305x(void) 39 { 40 return soc_is_rt3050() || soc_is_rt3052(); 41 } 42 43 static inline int soc_is_rt3352(void) 44 { 45 return rt305x_soc == RT305X_SOC_RT3352; 46 } 18 47 19 48 #define RT305X_MEM_SIZE_MIN (2 * 1024 * 1024) -
trunk/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
r30889 r30890 57 57 #define SYSC_REG_IA_ADDRESS 0x310 /* Illegal Access Address */ 58 58 #define SYSC_REG_IA_TYPE 0x314 /* Illegal Access Type */ 59 60 #define RT3052_CHIP_NAME0 0x30335452 61 #define RT3052_CHIP_NAME1 0x20203235 62 63 #define RT3352_CHIP_NAME0 0x33335452 64 #define RT3352_CHIP_NAME1 0x20203235 59 65 60 66 #define CHIP_ID_ID_MASK 0xff -
trunk/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
r30888 r30890 16 16 #include <linux/module.h> 17 17 18 #include <asm/mipsregs.h> 19 18 20 #include <asm/mach-ralink/common.h> 19 21 #include <asm/mach-ralink/ramips_gpio.h> … … 23 25 void __iomem * rt305x_sysc_base; 24 26 void __iomem * rt305x_memc_base; 27 enum rt305x_soc_type rt305x_soc; 25 28 26 29 void __init ramips_soc_prom_init(void) 27 30 { 28 31 void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE); 32 const char *name = "unknown"; 29 33 u32 n0; 30 34 u32 n1; … … 33 37 n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); 34 38 n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); 39 40 if (n0 == RT3052_CHIP_NAME0 && n1 == RT3052_CHIP_NAME1) { 41 unsigned long icache_sets; 42 43 icache_sets = (read_c0_config1() >> 22) & 7; 44 if (icache_sets == 1) { 45 rt305x_soc = RT305X_SOC_RT3050; 46 name = "RT3050"; 47 } else { 48 rt305x_soc = RT305X_SOC_RT3052; 49 name = "RT3052"; 50 } 51 } else if (n0 == RT3352_CHIP_NAME0 && n1 == RT3352_CHIP_NAME1) { 52 rt305x_soc = RT305X_SOC_RT3352; 53 name = "RT3352"; 54 } else { 55 panic("rt305x: unknown SoC, n0:%08x n1:%08x\n", n0, n1); 56 } 57 35 58 id = __raw_readl(sysc + SYSC_REG_CHIP_ID); 36 59 37 60 snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN, 38 "Ralink %c%c%c%c%c%c%c%c id:%u rev:%u", 39 (char) (n0 & 0xff), (char) ((n0 >> 8) & 0xff), 40 (char) ((n0 >> 16) & 0xff), (char) ((n0 >> 24) & 0xff), 41 (char) (n1 & 0xff), (char) ((n1 >> 8) & 0xff), 42 (char) ((n1 >> 16) & 0xff), (char) ((n1 >> 24) & 0xff), 61 "Ralink %s id:%u rev:%u", 62 name, 43 63 (id >> CHIP_ID_ID_SHIFT) & CHIP_ID_ID_MASK, 44 64 (id & CHIP_ID_REV_MASK));
Note: See TracChangeset
for help on using the changeset viewer.