Commit 3b0be1a4 authored by Paul Mundt's avatar Paul Mundt

sh: Fix an off-by-1 in SH7780 PCIC memory resource mapping.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 8e042210
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
static struct resource sh7785_pci_resources[] = { static struct resource sh7785_pci_resources[] = {
{ {
.name = "SH7785_IO", .name = "PCI IO",
.start = 0x1000, .start = 0x1000,
.end = SZ_4M - 1, .end = SZ_4M - 1,
.flags = IORESOURCE_IO, .flags = IORESOURCE_IO,
...@@ -338,8 +338,8 @@ static int __init sh7780_pci_init(void) ...@@ -338,8 +338,8 @@ static int __init sh7780_pci_init(void)
/* /*
* Setup the memory BARs * Setup the memory BARs
*/ */
for (i = 0; i < chan->nr_resources; i++) { for (i = 1; i < chan->nr_resources; i++) {
struct resource *res = chan->resources + (i + 1); struct resource *res = chan->resources + i;
resource_size_t size; resource_size_t size;
if (unlikely(res->flags & IORESOURCE_IO)) if (unlikely(res->flags & IORESOURCE_IO))
...@@ -361,8 +361,8 @@ static int __init sh7780_pci_init(void) ...@@ -361,8 +361,8 @@ static int __init sh7780_pci_init(void)
* keeps things pretty simple. * keeps things pretty simple.
*/ */
__raw_writel(((roundup_pow_of_two(size) / SZ_256K) - 1) << 18, __raw_writel(((roundup_pow_of_two(size) / SZ_256K) - 1) << 18,
chan->reg_base + SH7780_PCIMBMR(i)); chan->reg_base + SH7780_PCIMBMR(i - 1));
__raw_writel(res->start, chan->reg_base + SH7780_PCIMBR(i)); __raw_writel(res->start, chan->reg_base + SH7780_PCIMBR(i - 1));
} }
/* /*
......
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