diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-07-24 09:14:42 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-07-25 08:12:15 -0400 |
commit | 72c5839515260dce966cd24f54436e6583288e6c (patch) | |
tree | f6a65a5899490397eaa8c6a609452d365f05273d /drivers/irqchip | |
parent | ecb3c2bbf233d0c8d6e48009afa52c45c0204857 (diff) |
arm64: gicv3: Allow GICv3 compilation with older binutils
GICv3 introduces new system registers accessible with the full msr/mrs
syntax (e.g. mrs x0, Sop0_op1_CRm_CRn_op2). However, only recent
binutils understand the new syntax. This patch introduces msr_s/mrs_s
assembly macros which generate the equivalent instructions above and
converts the existing GICv3 code (both drivers/irqchip/ and
arch/arm64/kernel/).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Olof Johansson <olof@lixom.net>
Tested-by: Olof Johansson <olof@lixom.net>
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 81519bae0453..57eaa5a0b1e3 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -108,39 +108,39 @@ static u64 gic_read_iar(void) | |||
108 | { | 108 | { |
109 | u64 irqstat; | 109 | u64 irqstat; |
110 | 110 | ||
111 | asm volatile("mrs %0, " __stringify(ICC_IAR1_EL1) : "=r" (irqstat)); | 111 | asm volatile("mrs_s %0, " __stringify(ICC_IAR1_EL1) : "=r" (irqstat)); |
112 | return irqstat; | 112 | return irqstat; |
113 | } | 113 | } |
114 | 114 | ||
115 | static void gic_write_pmr(u64 val) | 115 | static void gic_write_pmr(u64 val) |
116 | { | 116 | { |
117 | asm volatile("msr " __stringify(ICC_PMR_EL1) ", %0" : : "r" (val)); | 117 | asm volatile("msr_s " __stringify(ICC_PMR_EL1) ", %0" : : "r" (val)); |
118 | } | 118 | } |
119 | 119 | ||
120 | static void gic_write_ctlr(u64 val) | 120 | static void gic_write_ctlr(u64 val) |
121 | { | 121 | { |
122 | asm volatile("msr " __stringify(ICC_CTLR_EL1) ", %0" : : "r" (val)); | 122 | asm volatile("msr_s " __stringify(ICC_CTLR_EL1) ", %0" : : "r" (val)); |
123 | isb(); | 123 | isb(); |
124 | } | 124 | } |
125 | 125 | ||
126 | static void gic_write_grpen1(u64 val) | 126 | static void gic_write_grpen1(u64 val) |
127 | { | 127 | { |
128 | asm volatile("msr " __stringify(ICC_GRPEN1_EL1) ", %0" : : "r" (val)); | 128 | asm volatile("msr_s " __stringify(ICC_GRPEN1_EL1) ", %0" : : "r" (val)); |
129 | isb(); | 129 | isb(); |
130 | } | 130 | } |
131 | 131 | ||
132 | static void gic_write_sgi1r(u64 val) | 132 | static void gic_write_sgi1r(u64 val) |
133 | { | 133 | { |
134 | asm volatile("msr " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val)); | 134 | asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val)); |
135 | } | 135 | } |
136 | 136 | ||
137 | static void gic_enable_sre(void) | 137 | static void gic_enable_sre(void) |
138 | { | 138 | { |
139 | u64 val; | 139 | u64 val; |
140 | 140 | ||
141 | asm volatile("mrs %0, " __stringify(ICC_SRE_EL1) : "=r" (val)); | 141 | asm volatile("mrs_s %0, " __stringify(ICC_SRE_EL1) : "=r" (val)); |
142 | val |= ICC_SRE_EL1_SRE; | 142 | val |= ICC_SRE_EL1_SRE; |
143 | asm volatile("msr " __stringify(ICC_SRE_EL1) ", %0" : : "r" (val)); | 143 | asm volatile("msr_s " __stringify(ICC_SRE_EL1) ", %0" : : "r" (val)); |
144 | isb(); | 144 | isb(); |
145 | 145 | ||
146 | /* | 146 | /* |
@@ -150,7 +150,7 @@ static void gic_enable_sre(void) | |||
150 | * | 150 | * |
151 | * Kindly inform the luser. | 151 | * Kindly inform the luser. |
152 | */ | 152 | */ |
153 | asm volatile("mrs %0, " __stringify(ICC_SRE_EL1) : "=r" (val)); | 153 | asm volatile("mrs_s %0, " __stringify(ICC_SRE_EL1) : "=r" (val)); |
154 | if (!(val & ICC_SRE_EL1_SRE)) | 154 | if (!(val & ICC_SRE_EL1_SRE)) |
155 | pr_err("GIC: unable to set SRE (disabled at EL2), panic ahead\n"); | 155 | pr_err("GIC: unable to set SRE (disabled at EL2), panic ahead\n"); |
156 | } | 156 | } |