1 #include <linux/kernel.h>
3 #include <linux/rockchip/cpu.h>
5 unsigned long rockchip_soc_id;
6 EXPORT_SYMBOL(rockchip_soc_id);
8 static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf)
14 else if (cpu_is_rk319x())
16 else if (cpu_is_rk3188())
18 else if (cpu_is_rk3066b())
20 else if (cpu_is_rk3026())
22 else if (cpu_is_rk30xx())
24 else if (cpu_is_rk2928())
26 else if (cpu_is_rk312x())
31 if (rockchip_get_cpu_version())
32 return sprintf(buf, "%sv%lu\n", type,
33 rockchip_get_cpu_version());
35 return sprintf(buf, "%s\n", type);
38 static struct device_attribute type_attr = __ATTR_RO(type);
40 static ssize_t soc_show(struct device *dev, struct device_attribute *attr, char *buf)
46 else if (soc_is_rk3190())
48 else if (soc_is_rk3188plus())
50 else if (soc_is_rk3188())
52 else if (soc_is_rk3168())
54 else if (soc_is_rk3028())
56 else if (soc_is_rk3066b())
58 else if (soc_is_rk3028a())
60 else if (soc_is_rk3026())
62 else if (soc_is_rk2928g())
64 else if (soc_is_rk2928l())
66 else if (soc_is_rk2926())
68 else if (soc_is_rk3066())
70 else if (soc_is_rk3068())
72 else if (soc_is_rk3000())
74 else if (soc_is_rk3126() || soc_is_rk3126b())
76 else if (soc_is_rk3128())
81 return sprintf(buf, "%s\n", soc);
84 static struct device_attribute soc_attr = __ATTR_RO(soc);
86 static int __init rockchip_cpu_lateinit(void)
90 err = device_create_file(cpu_subsys.dev_root, &type_attr);
91 err = device_create_file(cpu_subsys.dev_root, &soc_attr);
95 late_initcall(rockchip_cpu_lateinit);