Skip to content

Commit

Permalink
ARCv2: Enable unaligned access in early ASM code
Browse files Browse the repository at this point in the history
It is currently done in arc_init_IRQ() which might be too late
considering gcc 7.3.1 onwards (GNU 2018.03) generates unaligned
memory accesses by default

Cc: [email protected] analogdevicesinc#4.4+
Signed-off-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Vineet Gupta <[email protected]>
[vgupta: rewrote changelog]
  • Loading branch information
Eugeniy Paltsev authored and vineetgarc committed Feb 21, 2019
1 parent f17b5f0 commit 252f6e8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/arc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <asm/entry.h>
#include <asm/arcregs.h>
#include <asm/cache.h>
#include <asm/irqflags.h>

.macro CPU_EARLY_SETUP

Expand Down Expand Up @@ -47,6 +48,15 @@
sr r5, [ARC_REG_DC_CTRL]

1:

#ifdef CONFIG_ISA_ARCV2
; Unaligned access is disabled at reset, so re-enable early as
; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access
; by default
lr r5, [status32]
bset r5, r5, STATUS_AD_BIT
kflag r5
#endif
.endm

.section .init.text, "ax",@progbits
Expand Down

0 comments on commit 252f6e8

Please sign in to comment.