| .. | .. |
|---|
| 81 | 81 | |
|---|
| 82 | 82 | kfree(efuse_buf); |
|---|
| 83 | 83 | |
|---|
| 84 | + dev_info(dev, "SoC\t\t: %lx\n", rockchip_soc_id); |
|---|
| 85 | + |
|---|
| 86 | +#ifdef CONFIG_NO_GKI |
|---|
| 84 | 87 | system_serial_low = crc32(0, buf, 8); |
|---|
| 85 | 88 | system_serial_high = crc32(system_serial_low, buf + 8, 8); |
|---|
| 86 | 89 | |
|---|
| 87 | | - dev_info(dev, "SoC\t\t: %lx\n", rockchip_soc_id); |
|---|
| 88 | 90 | dev_info(dev, "Serial\t\t: %08x%08x\n", |
|---|
| 89 | 91 | system_serial_high, system_serial_low); |
|---|
| 92 | +#endif |
|---|
| 90 | 93 | |
|---|
| 91 | 94 | return 0; |
|---|
| 92 | 95 | } |
|---|
| .. | .. |
|---|
| 105 | 108 | }, |
|---|
| 106 | 109 | }; |
|---|
| 107 | 110 | |
|---|
| 111 | +static void rockchip_set_cpu_version_from_os_reg(u32 reg) |
|---|
| 112 | +{ |
|---|
| 113 | + void __iomem *r = ioremap(reg, 0x4); |
|---|
| 114 | + |
|---|
| 115 | + if (r) { |
|---|
| 116 | + rockchip_set_cpu_version(readl_relaxed(r) & GENMASK(2, 0)); |
|---|
| 117 | + iounmap(r); |
|---|
| 118 | + } |
|---|
| 119 | +} |
|---|
| 120 | + |
|---|
| 108 | 121 | static void px30_init(void) |
|---|
| 109 | 122 | { |
|---|
| 110 | 123 | void __iomem *base; |
|---|
| .. | .. |
|---|
| 120 | 133 | rockchip_soc_id = ROCKCHIP_SOC_PX30S; |
|---|
| 121 | 134 | iounmap(base); |
|---|
| 122 | 135 | } |
|---|
| 136 | +} |
|---|
| 137 | + |
|---|
| 138 | +#define RV1106_OS_REG1 0xff020204 |
|---|
| 139 | +static void rv1103_init(void) |
|---|
| 140 | +{ |
|---|
| 141 | + rockchip_soc_id = ROCKCHIP_SOC_RV1103; |
|---|
| 142 | + rockchip_set_cpu_version_from_os_reg(RV1106_OS_REG1); |
|---|
| 143 | +} |
|---|
| 144 | + |
|---|
| 145 | +static void rv1106_init(void) |
|---|
| 146 | +{ |
|---|
| 147 | + rockchip_soc_id = ROCKCHIP_SOC_RV1106; |
|---|
| 148 | + rockchip_set_cpu_version_from_os_reg(RV1106_OS_REG1); |
|---|
| 123 | 149 | } |
|---|
| 124 | 150 | |
|---|
| 125 | 151 | static void rv1109_init(void) |
|---|
| .. | .. |
|---|
| 176 | 202 | #define RK3308_GRF_CHIP_ID 0x800 |
|---|
| 177 | 203 | base = ioremap(RK3308_GRF_PHYS, SZ_4K); |
|---|
| 178 | 204 | if (base) { |
|---|
| 179 | | - if (readl_relaxed(base + RK3308_GRF_CHIP_ID) == 0x3308) |
|---|
| 205 | + u32 v = readl_relaxed(base + RK3308_GRF_CHIP_ID); |
|---|
| 206 | + |
|---|
| 207 | + if (v == 0x3308) |
|---|
| 180 | 208 | rockchip_soc_id = ROCKCHIP_SOC_RK3308B; |
|---|
| 209 | + if (v == 0x3308c) |
|---|
| 210 | + rockchip_soc_id = ROCKCHIP_SOC_RK3308BS; |
|---|
| 181 | 211 | iounmap(base); |
|---|
| 182 | 212 | } |
|---|
| 183 | 213 | } |
|---|
| .. | .. |
|---|
| 214 | 244 | rk356x_set_cpu_version(); |
|---|
| 215 | 245 | } |
|---|
| 216 | 246 | |
|---|
| 217 | | -int __init rockchip_soc_id_init(void) |
|---|
| 247 | +int rockchip_soc_id_init(void) |
|---|
| 218 | 248 | { |
|---|
| 219 | 249 | if (rockchip_soc_id) |
|---|
| 220 | 250 | return 0; |
|---|
| .. | .. |
|---|
| 228 | 258 | rk3126_init(); |
|---|
| 229 | 259 | } else if (cpu_is_rk3308()) { |
|---|
| 230 | 260 | rk3308_init(); |
|---|
| 261 | + } else if (cpu_is_rv1103()) { |
|---|
| 262 | + rv1103_init(); |
|---|
| 263 | + } else if (cpu_is_rv1106()) { |
|---|
| 264 | + rv1106_init(); |
|---|
| 231 | 265 | } else if (cpu_is_rv1109()) { |
|---|
| 232 | 266 | rv1109_init(); |
|---|
| 233 | 267 | } else if (cpu_is_rv1126()) { |
|---|
| .. | .. |
|---|
| 244 | 278 | |
|---|
| 245 | 279 | return 0; |
|---|
| 246 | 280 | } |
|---|
| 281 | +EXPORT_SYMBOL(rockchip_soc_id_init); |
|---|
| 247 | 282 | #ifndef MODULE |
|---|
| 248 | 283 | pure_initcall(rockchip_soc_id_init); |
|---|
| 249 | 284 | #endif |
|---|