diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-02-07 06:14:21 -0500 |
---|---|---|
committer | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-10-19 15:46:33 -0400 |
commit | 099a4809133dc6548d37cc143ab0cb9c2eba97bb (patch) | |
tree | c3541f5b5b4fc1cf54ad58bbf04564a9f6eae63b /arch/arm/kernel/smp_scu.c | |
parent | 2e874ea342146130206f8b39f2103f33690a7547 (diff) |
ARM: smp_scu: data endian fixes
The smp_scu driver needs to use the relaxed readl/write accessors
to avoid any issues with the endian mode the processor core is in.
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Diffstat (limited to 'arch/arm/kernel/smp_scu.c')
-rw-r--r-- | arch/arm/kernel/smp_scu.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index 5bc1a63284e3..1aafa0d785eb 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | unsigned int __init scu_get_core_count(void __iomem *scu_base) | 29 | unsigned int __init scu_get_core_count(void __iomem *scu_base) |
30 | { | 30 | { |
31 | unsigned int ncores = __raw_readl(scu_base + SCU_CONFIG); | 31 | unsigned int ncores = readl_relaxed(scu_base + SCU_CONFIG); |
32 | return (ncores & 0x03) + 1; | 32 | return (ncores & 0x03) + 1; |
33 | } | 33 | } |
34 | 34 | ||
@@ -42,19 +42,19 @@ void scu_enable(void __iomem *scu_base) | |||
42 | #ifdef CONFIG_ARM_ERRATA_764369 | 42 | #ifdef CONFIG_ARM_ERRATA_764369 |
43 | /* Cortex-A9 only */ | 43 | /* Cortex-A9 only */ |
44 | if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) { | 44 | if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) { |
45 | scu_ctrl = __raw_readl(scu_base + 0x30); | 45 | scu_ctrl = readl_relaxed(scu_base + 0x30); |
46 | if (!(scu_ctrl & 1)) | 46 | if (!(scu_ctrl & 1)) |
47 | __raw_writel(scu_ctrl | 0x1, scu_base + 0x30); | 47 | writel_relaxed(scu_ctrl | 0x1, scu_base + 0x30); |
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | 51 | scu_ctrl = readl_relaxed(scu_base + SCU_CTRL); |
52 | /* already enabled? */ | 52 | /* already enabled? */ |
53 | if (scu_ctrl & 1) | 53 | if (scu_ctrl & 1) |
54 | return; | 54 | return; |
55 | 55 | ||
56 | scu_ctrl |= 1; | 56 | scu_ctrl |= 1; |
57 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); | 57 | writel_relaxed(scu_ctrl, scu_base + SCU_CTRL); |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * Ensure that the data accessed by CPU0 before the SCU was | 60 | * Ensure that the data accessed by CPU0 before the SCU was |
@@ -80,9 +80,9 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode) | |||
80 | if (mode > 3 || mode == 1 || cpu > 3) | 80 | if (mode > 3 || mode == 1 || cpu > 3) |
81 | return -EINVAL; | 81 | return -EINVAL; |
82 | 82 | ||
83 | val = __raw_readb(scu_base + SCU_CPU_STATUS + cpu) & ~0x03; | 83 | val = readb_relaxed(scu_base + SCU_CPU_STATUS + cpu) & ~0x03; |
84 | val |= mode; | 84 | val |= mode; |
85 | __raw_writeb(val, scu_base + SCU_CPU_STATUS + cpu); | 85 | writeb_relaxed(val, scu_base + SCU_CPU_STATUS + cpu); |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |