* [PATCH] Pb1200/DBAu1200: fix bad IDE resource size
@ 2008-04-15 16:44 Sergei Shtylyov
2008-04-15 21:09 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-04-15 16:44 UTC (permalink / raw)
To: linux-mips, linux-ide; +Cc: ralf, bzolnier
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>
---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...
arch/mips/au1000/common/platform.c | 2 +-
drivers/ide/mips/au1xxx-ide.c | 7 ++++---
include/asm-mips/mach-db1x00/db1200.h | 4 ++--
include/asm-mips/mach-pb1x00/pb1200.h | 4 ++--
4 files changed, 9 insertions(+), 8 deletions(-)
Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resour
static struct resource au1200_ide0_resources[] = {
[0] = {
.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,
},
[1] = {
Index: linux-2.6/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- linux-2.6.orig/drivers/ide/mips/au1xxx-ide.c
+++ linux-2.6/drivers/ide/mips/au1xxx-ide.c
@@ -591,13 +591,14 @@ static int au_ide_probe(struct device *d
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);
ret = -EBUSY;
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) {
ret = -ENOMEM;
goto out;
@@ -682,7 +683,7 @@ static int au_ide_remove(struct device *
iounmap((void *)ahwif->regbase);
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;
}
Index: linux-2.6/include/asm-mips/mach-db1x00/db1200.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-db1x00/db1200.h
+++ linux-2.6/include/asm-mips/mach-db1x00/db1200.h
@@ -173,8 +173,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_
#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
#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_DDMA_REQ DSCR_CMD0_DMA_REQ1;
#define AU1XXX_ATA_RQSIZE 128
Index: linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-pb1x00/pb1200.h
+++ linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
@@ -186,8 +186,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_
#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
#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_DDMA_REQ DSCR_CMD0_DMA_REQ1;
#define AU1XXX_ATA_RQSIZE 128
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Pb1200/DBAu1200: fix bad IDE resource size
2008-04-15 16:44 [PATCH] Pb1200/DBAu1200: fix bad IDE resource size Sergei Shtylyov
@ 2008-04-15 21:09 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-04-15 21:09 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-mips, linux-ide, ralf
On Tuesday 15 April 2008, Sergei Shtylyov wrote:
> 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>
>
> ---
> I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...
Well, since I've been already merging the other au1xxx-ide patches
to IDE tree I've also applied this one while at it...
> arch/mips/au1000/common/platform.c | 2 +-
> drivers/ide/mips/au1xxx-ide.c | 7 ++++---
> include/asm-mips/mach-db1x00/db1200.h | 4 ++--
> include/asm-mips/mach-pb1x00/pb1200.h | 4 ++--
> 4 files changed, 9 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-15 21:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 16:44 [PATCH] Pb1200/DBAu1200: fix bad IDE resource size Sergei Shtylyov
2008-04-15 21:09 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).