diff mbox

[v2,06/23] ARM: Kirkwood: ioremap the cpu_config register before using it.

Message ID 1392459621-24003-7-git-send-email-andrew@lunn.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Lunn Feb. 15, 2014, 10:20 a.m. UTC
With the move to mach-mvebu and MULTI_V5, the global iomap for all
registers will be going away. So explicitly map the CPU configuration
register before using it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/mach-kirkwood/board-dt.c                 | 22 +++++++++++++++-------
 arch/arm/mach-kirkwood/include/mach/bridge-regs.h |  1 +
 2 files changed, 16 insertions(+), 7 deletions(-)

Comments

Ezequiel Garcia Feb. 16, 2014, 2:17 a.m. UTC | #1
Hi Andrew,

On Sat, Feb 15, 2014 at 11:20:04AM +0100, Andrew Lunn wrote:
[..]
>  
> +/*
> + * Disable propagation of mbus errors to the CPU local bus, as this
> + * causes mbus errors (which can occur for example for PCI aborts) to
> + * throw CPU aborts, which we're not set up to deal with.
> + */
> +void kirkwood_disable_mbus_error_propagation(void)
> +{
> +	void __iomem *cpu_config;
> +
> +	cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
> +	writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
> +}
> +

Any reason why this function above is not static __init?

And then: any reason why you're not unmapping the region?

(Sorry if this was already discussed)
diff mbox

Patch

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 64151a4a378f..91b61a971af2 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -191,15 +191,23 @@  eth_fixup_skip:
 	}
 }
 
+/*
+ * Disable propagation of mbus errors to the CPU local bus, as this
+ * causes mbus errors (which can occur for example for PCI aborts) to
+ * throw CPU aborts, which we're not set up to deal with.
+ */
+void kirkwood_disable_mbus_error_propagation(void)
+{
+	void __iomem *cpu_config;
+
+	cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
+	writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
+}
+
+
 static void __init kirkwood_dt_init(void)
 {
-	/*
-	 * Disable propagation of mbus errors to the CPU local bus,
-	 * as this causes mbus errors (which can occur for example
-	 * for PCI aborts) to throw CPU aborts, which we're not set
-	 * up to deal with.
-	 */
-	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+	kirkwood_disable_mbus_error_propagation();
 
 	BUG_ON(mvebu_mbus_dt_init());
 
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 8b9d1c9ff199..2bd12fde1781 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -14,6 +14,7 @@ 
 #include <mach/kirkwood.h>
 
 #define CPU_CONFIG		(BRIDGE_VIRT_BASE + 0x0100)
+#define CPU_CONFIG_PHYS		(BRIDGE_PHYS_BASE + 0x0100)
 #define CPU_CONFIG_ERROR_PROP	0x00000004
 
 #define CPU_CONTROL		(BRIDGE_VIRT_BASE + 0x0104)