Skip to content

Commit

Permalink
MIPS: RB532: Use physical addresses for gpio and device controller re…
Browse files Browse the repository at this point in the history
…gisters

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: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Florian Fainelli authored and Ralf Baechle committed Oct 11, 2008
1 parent 3cd4e06 commit 3c8cf8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions arch/mips/rb532/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ struct mpmc_device dev3;
static struct resource rb532_gpio_reg0_res[] = {
{
.name = "gpio_reg0",
.start = (u32)(IDT434_REG_BASE + GPIOBASE),
.end = (u32)(IDT434_REG_BASE + GPIOBASE + sizeof(struct rb532_gpio_reg)),
.start = REGBASE + GPIOBASE,
.end = REGBASE + GPIOBASE + sizeof(struct rb532_gpio_reg) - 1,
.flags = IORESOURCE_MEM,
}
};

static struct resource rb532_dev3_ctl_res[] = {
{
.name = "dev3_ctl",
.start = (u32)(IDT434_REG_BASE + DEV3BASE),
.end = (u32)(IDT434_REG_BASE + DEV3BASE + sizeof(struct dev_reg)),
.start = REGBASE + DEV3BASE,
.end = REGBASE + DEV3BASE + sizeof(struct dev_reg) - 1,
.flags = IORESOURCE_MEM,
}
};
Expand Down
3 changes: 2 additions & 1 deletion include/asm-mips/mach-rc32434/rb.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#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 DEV0MASK 0x010004
#define DEV0C 0x010008
Expand Down

0 comments on commit 3c8cf8c

Please sign in to comment.