diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2008-04-16 19:14:33 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-16 19:14:33 -0400 |
commit | b4dcaea36b0376456c97698deba0089d2d67cbe7 (patch) | |
tree | 9dd0a07edf2f15b2a8caeade081915e9f770f256 | |
parent | fabd3a223a96de1a91b2148655f2ed09ca9d1c20 (diff) |
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: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | arch/mips/au1000/common/platform.c | 2 | ||||
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 7 | ||||
-rw-r--r-- | include/asm-mips/mach-db1x00/db1200.h | 4 | ||||
-rw-r--r-- | include/asm-mips/mach-pb1x00/pb1200.h | 4 |
4 files changed, 9 insertions, 8 deletions
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c index 841904cdef4d..39d681265297 100644 --- a/arch/mips/au1000/common/platform.c +++ b/arch/mips/au1000/common/platform.c | |||
@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resources[] = { | |||
189 | static struct resource au1200_ide0_resources[] = { | 189 | static struct resource au1200_ide0_resources[] = { |
190 | [0] = { | 190 | [0] = { |
191 | .start = AU1XXX_ATA_PHYS_ADDR, | 191 | .start = AU1XXX_ATA_PHYS_ADDR, |
192 | .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN, | 192 | .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN - 1, |
193 | .flags = IORESOURCE_MEM, | 193 | .flags = IORESOURCE_MEM, |
194 | }, | 194 | }, |
195 | [1] = { | 195 | [1] = { |
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index f84411b6609a..85c016bdfd38 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -586,13 +586,14 @@ static int au_ide_probe(struct device *dev) | |||
586 | goto out; | 586 | goto out; |
587 | } | 587 | } |
588 | 588 | ||
589 | if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { | 589 | if (!request_mem_region(res->start, res->end - res->start + 1, |
590 | pdev->name)) { | ||
590 | pr_debug("%s: request_mem_region failed\n", DRV_NAME); | 591 | pr_debug("%s: request_mem_region failed\n", DRV_NAME); |
591 | ret = -EBUSY; | 592 | ret = -EBUSY; |
592 | goto out; | 593 | goto out; |
593 | } | 594 | } |
594 | 595 | ||
595 | ahwif->regbase = (u32)ioremap(res->start, res->end-res->start); | 596 | ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1); |
596 | if (ahwif->regbase == 0) { | 597 | if (ahwif->regbase == 0) { |
597 | ret = -ENOMEM; | 598 | ret = -ENOMEM; |
598 | goto out; | 599 | goto out; |
@@ -677,7 +678,7 @@ static int au_ide_remove(struct device *dev) | |||
677 | iounmap((void *)ahwif->regbase); | 678 | iounmap((void *)ahwif->regbase); |
678 | 679 | ||
679 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 680 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
680 | release_mem_region(res->start, res->end - res->start); | 681 | release_mem_region(res->start, res->end - res->start + 1); |
681 | 682 | ||
682 | return 0; | 683 | return 0; |
683 | } | 684 | } |
diff --git a/include/asm-mips/mach-db1x00/db1200.h b/include/asm-mips/mach-db1x00/db1200.h index a6bdac61ab49..d2e28e64932e 100644 --- a/include/asm-mips/mach-db1x00/db1200.h +++ b/include/asm-mips/mach-db1x00/db1200.h | |||
@@ -173,8 +173,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | |||
173 | #define AU1XXX_SMC91111_IRQ DB1200_ETH_INT | 173 | #define AU1XXX_SMC91111_IRQ DB1200_ETH_INT |
174 | 174 | ||
175 | #define AU1XXX_ATA_PHYS_ADDR (0x18800000) | 175 | #define AU1XXX_ATA_PHYS_ADDR (0x18800000) |
176 | #define AU1XXX_ATA_PHYS_LEN (0x100) | 176 | #define AU1XXX_ATA_REG_OFFSET (5) |
177 | #define AU1XXX_ATA_REG_OFFSET (5) | 177 | #define AU1XXX_ATA_PHYS_LEN (16 << AU1XXX_ATA_REG_OFFSET) |
178 | #define AU1XXX_ATA_INT DB1200_IDE_INT | 178 | #define AU1XXX_ATA_INT DB1200_IDE_INT |
179 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; | 179 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; |
180 | #define AU1XXX_ATA_RQSIZE 128 | 180 | #define AU1XXX_ATA_RQSIZE 128 |
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h index 72213e3d02c7..edaa489b58f1 100644 --- a/include/asm-mips/mach-pb1x00/pb1200.h +++ b/include/asm-mips/mach-pb1x00/pb1200.h | |||
@@ -186,8 +186,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | |||
186 | #define AU1XXX_SMC91111_IRQ PB1200_ETH_INT | 186 | #define AU1XXX_SMC91111_IRQ PB1200_ETH_INT |
187 | 187 | ||
188 | #define AU1XXX_ATA_PHYS_ADDR (0x0C800000) | 188 | #define AU1XXX_ATA_PHYS_ADDR (0x0C800000) |
189 | #define AU1XXX_ATA_PHYS_LEN (0x100) | 189 | #define AU1XXX_ATA_REG_OFFSET (5) |
190 | #define AU1XXX_ATA_REG_OFFSET (5) | 190 | #define AU1XXX_ATA_PHYS_LEN (16 << AU1XXX_ATA_REG_OFFSET) |
191 | #define AU1XXX_ATA_INT PB1200_IDE_INT | 191 | #define AU1XXX_ATA_INT PB1200_IDE_INT |
192 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; | 192 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; |
193 | #define AU1XXX_ATA_RQSIZE 128 | 193 | #define AU1XXX_ATA_RQSIZE 128 |