Commit 3c8cf8ca authored by Florian Fainelli's avatar Florian Fainelli Committed by Ralf Baechle

MIPS: RB532: Use physical addresses for gpio and device controller registers

This patch fixes the misuse of virtual addresses for the GPIO and third
device controller which would lead to problems while accessing ioremap'd
registers.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3cd4e067
...@@ -47,8 +47,8 @@ struct mpmc_device dev3; ...@@ -47,8 +47,8 @@ struct mpmc_device dev3;
static struct resource rb532_gpio_reg0_res[] = { static struct resource rb532_gpio_reg0_res[] = {
{ {
.name = "gpio_reg0", .name = "gpio_reg0",
.start = (u32)(IDT434_REG_BASE + GPIOBASE), .start = REGBASE + GPIOBASE,
.end = (u32)(IDT434_REG_BASE + GPIOBASE + sizeof(struct rb532_gpio_reg)), .end = REGBASE + GPIOBASE + sizeof(struct rb532_gpio_reg) - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
} }
}; };
...@@ -56,8 +56,8 @@ static struct resource rb532_gpio_reg0_res[] = { ...@@ -56,8 +56,8 @@ static struct resource rb532_gpio_reg0_res[] = {
static struct resource rb532_dev3_ctl_res[] = { static struct resource rb532_dev3_ctl_res[] = {
{ {
.name = "dev3_ctl", .name = "dev3_ctl",
.start = (u32)(IDT434_REG_BASE + DEV3BASE), .start = REGBASE + DEV3BASE,
.end = (u32)(IDT434_REG_BASE + DEV3BASE + sizeof(struct dev_reg)), .end = REGBASE + DEV3BASE + sizeof(struct dev_reg) - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
} }
}; };
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/genhd.h> #include <linux/genhd.h>
#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(0x18000000)) #define REGBASE 0x18000000
#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
#define DEV0BASE 0x010000 #define DEV0BASE 0x010000
#define DEV0MASK 0x010004 #define DEV0MASK 0x010004
#define DEV0C 0x010008 #define DEV0C 0x010008
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment