Commit e25a0656bac63c5fcd20ef4313dc09c409fc512d
Committed by
Stefano Babic
1 parent
5d69269dee
Exists in
v2017.01-smarct4x
and in
29 other branches
mx7: Distinguish between dual and solo versions
Read the number of cores in the fuses to distinguish between the dual and solo versions. Tested on a mx7d sabresd and on a mx7solo warp7. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Showing 3 changed files with 21 additions and 0 deletions Side-by-side Diff
arch/arm/cpu/armv7/mx7/soc.c
... | ... | @@ -165,12 +165,30 @@ |
165 | 165 | return val; |
166 | 166 | } |
167 | 167 | |
168 | +static bool is_mx7d(void) | |
169 | +{ | |
170 | + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; | |
171 | + struct fuse_bank *bank = &ocotp->bank[1]; | |
172 | + struct fuse_bank1_regs *fuse = | |
173 | + (struct fuse_bank1_regs *)bank->fuse_regs; | |
174 | + int val; | |
175 | + | |
176 | + val = readl(&fuse->tester4); | |
177 | + if (val & 1) | |
178 | + return false; | |
179 | + else | |
180 | + return true; | |
181 | +} | |
182 | + | |
168 | 183 | u32 get_cpu_rev(void) |
169 | 184 | { |
170 | 185 | struct mxc_ccm_anatop_reg *ccm_anatop = (struct mxc_ccm_anatop_reg *) |
171 | 186 | ANATOP_BASE_ADDR; |
172 | 187 | u32 reg = readl(&ccm_anatop->digprog); |
173 | 188 | u32 type = (reg >> 16) & 0xff; |
189 | + | |
190 | + if (!is_mx7d()) | |
191 | + type = MXC_CPU_MX7S; | |
174 | 192 | |
175 | 193 | reg &= 0xff; |
176 | 194 | return (type << 12) | reg; |
arch/arm/imx-common/cpu.c
... | ... | @@ -137,6 +137,8 @@ |
137 | 137 | const char *get_imx_type(u32 imxtype) |
138 | 138 | { |
139 | 139 | switch (imxtype) { |
140 | + case MXC_CPU_MX7S: | |
141 | + return "7SOLO"; /* Single-core version of the mx7 */ | |
140 | 142 | case MXC_CPU_MX7D: |
141 | 143 | return "7D"; /* Dual-core version of the mx7 */ |
142 | 144 | case MXC_CPU_MX6QP: |
arch/arm/include/asm/arch-imx/cpu.h