Commit b4dcaea3 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Bartlomiej Zolnierkiewicz

Pb1200/DBAu1200: fix bad IDE resource size

The header files for the Pb1200/DBAu1200 boards have wrong definition for the
IDE interface's decoded range length -- it should be 512 bytes according to
what the IDE driver does.  In addition, the IDE platform device claims 1 byte
too many for its memory resource -- fix the platform code and the IDE driver
in accordance.
Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent fabd3a22
...@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resources[] = { ...@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resources[] = {
static struct resource au1200_ide0_resources[] = { static struct resource au1200_ide0_resources[] = {
[0] = { [0] = {
.start = AU1XXX_ATA_PHYS_ADDR, .start = AU1XXX_ATA_PHYS_ADDR,
.end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN, .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
......
...@@ -586,13 +586,14 @@ static int au_ide_probe(struct device *dev) ...@@ -586,13 +586,14 @@ static int au_ide_probe(struct device *dev)
goto out; goto out;
} }
if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { if (!request_mem_region(res->start, res->end - res->start + 1,
pdev->name)) {
pr_debug("%s: request_mem_region failed\n", DRV_NAME); pr_debug("%s: request_mem_region failed\n", DRV_NAME);
ret = -EBUSY; ret = -EBUSY;
goto out; goto out;
} }
ahwif->regbase = (u32)ioremap(res->start, res->end-res->start); ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1);
if (ahwif->regbase == 0) { if (ahwif->regbase == 0) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -677,7 +678,7 @@ static int au_ide_remove(struct device *dev) ...@@ -677,7 +678,7 @@ static int au_ide_remove(struct device *dev)
iounmap((void *)ahwif->regbase); iounmap((void *)ahwif->regbase);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(res->start, res->end - res->start); release_mem_region(res->start, res->end - res->start + 1);
return 0; return 0;
} }
......
...@@ -173,8 +173,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; ...@@ -173,8 +173,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT #define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
#define AU1XXX_ATA_PHYS_ADDR (0x18800000) #define AU1XXX_ATA_PHYS_ADDR (0x18800000)
#define AU1XXX_ATA_PHYS_LEN (0x100)
#define AU1XXX_ATA_REG_OFFSET (5) #define AU1XXX_ATA_REG_OFFSET (5)
#define AU1XXX_ATA_PHYS_LEN (16 << AU1XXX_ATA_REG_OFFSET)
#define AU1XXX_ATA_INT DB1200_IDE_INT #define AU1XXX_ATA_INT DB1200_IDE_INT
#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
#define AU1XXX_ATA_RQSIZE 128 #define AU1XXX_ATA_RQSIZE 128
......
...@@ -186,8 +186,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; ...@@ -186,8 +186,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT #define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
#define AU1XXX_ATA_PHYS_ADDR (0x0C800000) #define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
#define AU1XXX_ATA_PHYS_LEN (0x100)
#define AU1XXX_ATA_REG_OFFSET (5) #define AU1XXX_ATA_REG_OFFSET (5)
#define AU1XXX_ATA_PHYS_LEN (16 << AU1XXX_ATA_REG_OFFSET)
#define AU1XXX_ATA_INT PB1200_IDE_INT #define AU1XXX_ATA_INT PB1200_IDE_INT
#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
#define AU1XXX_ATA_RQSIZE 128 #define AU1XXX_ATA_RQSIZE 128
......
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