Skip to content

Commit

Permalink
ARC: boot log: don't assume SWAPE instruction support
Browse files Browse the repository at this point in the history
This came to light when helping a customer with oldish ARC750 core who
were getting instruction errors because of lack of SWAPE but boot log
was incorrectly printing it as being present

Signed-off-by: Vineet Gupta <[email protected]>
  • Loading branch information
vineetgarc committed Oct 28, 2016
1 parent 73e284d commit a024fd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arc/include/asm/arcregs.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ struct cpuinfo_arc {
unsigned int vec_base;
struct cpuinfo_arc_ccm iccm, dccm;
struct {
unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, pad1:3,
unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, swape:1, pad1:2,
fpu_sp:1, fpu_dp:1, pad2:6,
debug:1, ap:1, smart:1, rtt:1, pad3:4,
timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
Expand Down
5 changes: 4 additions & 1 deletion arch/arc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ static void read_arc_build_cfg_regs(void)
cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR) ? 1 : 0; /* 1,3 */
cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR) ? 1 : 0;
cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR) > 1 ? 1 : 0; /* 2 */
cpu->extn.swape = (cpu->core.family >= 0x34) ? 1 :
IS_ENABLED(CONFIG_ARC_HAS_SWAPE);

READ_BCR(ARC_REG_XY_MEM_BCR, cpu->extn_xymem);

/* Read CCM BCRs for boot reporting even if not enabled in Kconfig */
Expand Down Expand Up @@ -250,7 +253,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
IS_AVAIL1(cpu->extn.swap, "swap "),
IS_AVAIL1(cpu->extn.minmax, "minmax "),
IS_AVAIL1(cpu->extn.crc, "crc "),
IS_AVAIL2(1, "swape", CONFIG_ARC_HAS_SWAPE));
IS_AVAIL2(cpu->extn.swape, "swape", CONFIG_ARC_HAS_SWAPE));

if (cpu->bpu.ver)
n += scnprintf(buf + n, len - n,
Expand Down

0 comments on commit a024fd9

Please sign in to comment.