summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-30 15:04:22 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-30 15:04:22 +0000
commitab3bd08a257d4b92384de2720b7294b444578ba5 (patch)
tree65ef68d6c3861b5b5d84d3876cde0941694f2c88 /arch/arm/plat-mxc
parent9c6568501cbf731a910db2fcb7d094977dcb154c (diff)
parent2eca047b289307594d0d6ce62c8237fa9c5b9b5e (diff)
Merge branch 'for-rmk-rc' of git://pasiphae.extern.pengutronix.de/git/imx/linux-2.6
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/gpio.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/io.h20
2 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index 733e0acac916..de5c4747453f 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -188,7 +188,7 @@ static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset)
struct mxc_gpio_port *port =
container_of(chip, struct mxc_gpio_port, chip);
- return (__raw_readl(port->base + GPIO_DR) >> offset) & 1;
+ return (__raw_readl(port->base + GPIO_PSR) >> offset) & 1;
}
static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
diff --git a/arch/arm/plat-mxc/include/mach/io.h b/arch/arm/plat-mxc/include/mach/io.h
index 65b6810124c1..5d4cb1196441 100644
--- a/arch/arm/plat-mxc/include/mach/io.h
+++ b/arch/arm/plat-mxc/include/mach/io.h
@@ -14,6 +14,26 @@
/* Allow IO space to be anywhere in the memory */
#define IO_SPACE_LIMIT 0xffffffff
+#ifdef CONFIG_ARCH_MX3
+#define __arch_ioremap __mx3_ioremap
+#define __arch_iounmap __iounmap
+
+static inline void __iomem *
+__mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
+{
+ if (mtype == MT_DEVICE) {
+ /* Access all peripherals below 0x80000000 as nonshared device
+ * but leave l2cc alone.
+ */
+ if ((phys_addr < 0x80000000) && ((phys_addr < L2CC_BASE_ADDR) ||
+ (phys_addr >= L2CC_BASE_ADDR + L2CC_SIZE)))
+ mtype = MT_DEVICE_NONSHARED;
+ }
+
+ return __arm_ioremap(phys_addr, size, mtype);
+}
+#endif
+
/* io address mapping macro */
#define __io(a) ((void __iomem *)(a))