aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/arm
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-09-09 17:45:51 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-09-21 16:27:35 +0100
commit204cb1ec9f2456725492d44d724d3c9d6ba865f1 (patch)
tree0ae90057fdf24822d8c1822dafc714a03987ce11 /xen/arch/arm
parent45b187020098a9872b05a96c86d3f65d2404ec0c (diff)
downloadxen-204cb1ec9f2456725492d44d724d3c9d6ba865f1.tar.gz
xen-204cb1ec9f2456725492d44d724d3c9d6ba865f1.tar.bz2
xen-204cb1ec9f2456725492d44d724d3c9d6ba865f1.zip
xen/arm: replace io{read,write}{l,b} with {read,write}{l,b}
We appear to have invented the io versions ourselves for Xen on ARM, while x86 has the plain read/write. (and so does Linux FWIW) read/write are used in common driver code (specifically ns16550) so instead of keeping our own variant around lets replace it with the more standard ones. At the same time resync with Linux making the "based on" comment in both sets of io.h somewhat true (they don't look to have been very based on before...). Our io.h is now consistent with Linux v3.11. Note that iowrite and write take their arguments in the opposite order. Also make asm-arm/io.h useful and include it where necessary instead of picking up the include from mm.h. Remove the include from mm.h Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
Diffstat (limited to 'xen/arch/arm')
-rw-r--r--xen/arch/arm/platforms/exynos5.c7
-rw-r--r--xen/arch/arm/platforms/midway.c5
-rw-r--r--xen/arch/arm/platforms/omap5.c13
-rw-r--r--xen/arch/arm/platforms/vexpress.c5
4 files changed, 17 insertions, 13 deletions
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index d9eedc86ce..36d2325463 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -25,6 +25,7 @@
#include <xen/vmap.h>
#include <asm/platforms/exynos5.h>
#include <asm/platform.h>
+#include <asm/io.h>
static int exynos5_init_time(void)
{
@@ -41,8 +42,8 @@ static int exynos5_init_time(void)
}
/* Enable timer on Exynos 5250 should probably be done by u-boot */
- reg = ioreadl(mct + EXYNOS5_MCT_G_TCON);
- iowritel(mct + EXYNOS5_MCT_G_TCON, reg | EXYNOS5_MCT_G_TCON_START);
+ reg = readl(mct + EXYNOS5_MCT_G_TCON);
+ writel(reg | EXYNOS5_MCT_G_TCON_START, mct + EXYNOS5_MCT_G_TCON);
iounmap(mct);
@@ -77,7 +78,7 @@ static void exynos5_reset(void)
return;
}
- iowritel(pmu + EXYNOS5_SWRESET, 1);
+ writel(1, pmu + EXYNOS5_SWRESET);
iounmap(pmu);
}
diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
index 7a3dfe1899..a48fc84141 100644
--- a/xen/arch/arm/platforms/midway.c
+++ b/xen/arch/arm/platforms/midway.c
@@ -21,6 +21,7 @@
#include <xen/vmap.h>
#include <asm/platforms/midway.h>
#include <asm/platform.h>
+#include <asm/io.h>
static void midway_reset(void)
{
@@ -36,8 +37,8 @@ static void midway_reset(void)
return;
}
- iowritel(pmu + (MW_SREG_PWR_REQ & ~PAGE_MASK), MW_PWR_HARD_RESET);
- iowritel(pmu + (MW_SREG_A15_PWR_CTRL & ~PAGE_MASK), 1);
+ writel(MW_PWR_HARD_RESET, pmu + (MW_SREG_PWR_REQ & ~PAGE_MASK));
+ writel(1, pmu + (MW_SREG_A15_PWR_CTRL & ~PAGE_MASK));
iounmap(pmu);
}
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index c10cf00006..a40d0169f0 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -23,6 +23,7 @@
#include <asm/platforms/omap5.h>
#include <xen/mm.h>
#include <xen/vmap.h>
+#include <asm/io.h>
static uint16_t num_den[8][2] = {
{ 0, 0 }, /* not used */
@@ -59,7 +60,7 @@ static int omap5_init_time(void)
return -ENOMEM;
}
- sys_clksel = ioreadl(ckgen_prm_base + OMAP5_CM_CLKSEL_SYS) &
+ sys_clksel = readl(ckgen_prm_base + OMAP5_CM_CLKSEL_SYS) &
~SYS_CLKSEL_MASK;
iounmap(ckgen_prm_base);
@@ -72,7 +73,7 @@ static int omap5_init_time(void)
return -ENOMEM;
}
- frac1 = ioreadl(rt_ct_base + INCREMENTER_NUMERATOR_OFFSET);
+ frac1 = readl(rt_ct_base + INCREMENTER_NUMERATOR_OFFSET);
num = frac1 & ~NUMERATOR_DENUMERATOR_MASK;
if ( num_den[sys_clksel][0] != num )
{
@@ -80,7 +81,7 @@ static int omap5_init_time(void)
frac1 |= num_den[sys_clksel][0];
}
- frac2 = ioreadl(rt_ct_base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
+ frac2 = readl(rt_ct_base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
den = frac2 & ~NUMERATOR_DENUMERATOR_MASK;
if ( num_den[sys_clksel][1] != num )
{
@@ -88,9 +89,9 @@ static int omap5_init_time(void)
frac2 |= num_den[sys_clksel][1];
}
- iowritel(rt_ct_base + INCREMENTER_NUMERATOR_OFFSET, frac1);
- iowritel(rt_ct_base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET,
- frac2 | PRM_FRAC_INCREMENTER_DENUMERATOR_RELOAD);
+ writel(frac1, rt_ct_base + INCREMENTER_NUMERATOR_OFFSET);
+ writel(frac2 | PRM_FRAC_INCREMENTER_DENUMERATOR_RELOAD,
+ rt_ct_base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
iounmap(rt_ct_base);
diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index 298c141844..22c0c13e98 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -21,6 +21,7 @@
#include <asm/platform.h>
#include <xen/mm.h>
#include <xen/vmap.h>
+#include <asm/io.h>
#define DCC_SHIFT 26
#define FUNCTION_SHIFT 20
@@ -110,10 +111,10 @@ static void vexpress_reset(void)
}
/* switch to slow mode */
- iowritel(sp810, 0x3);
+ writel(0x3, sp810);
dsb(); isb();
/* writing any value to SCSYSSTAT reg will reset the system */
- iowritel(sp810 + 4, 0x1);
+ writel(0x1, sp810 + 4);
dsb(); isb();
iounmap(sp810);