* SATA_SIL: Add a work-around for IXP4xx CPU.
@ 2009-11-11 0:04 Krzysztof Halasa
2009-12-15 8:19 ` Tejun Heo
0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Halasa @ 2009-11-11 0:04 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, lkml
IXP4xx CPUs can't read from 8 and 16-bit PCI MMIO registers, we have to read
from normal IO regions instead.
Tested on SIL3512, and specifically not tested on 4-port SIL3114.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -757,7 +757,22 @@ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;
+#ifdef CONFIG_ARCH_IXP4XX
+ /* IXP4xx CPUs can't perform 8 and 16-bit MMIO reads,
+ use normal IO from/to regions 0-5 instead.
+ region 0: channel 0 (and 2) task file regs
+ region 1: channel 0 (and 2) auxiliary status
+ region 2: channel 1 (and 3) task file regs
+ region 3: channel 1 (and 3) auxiliary status
+ region 4: bus master DMA command and status for all channels
+ region 5: the normal MMIO
+
+ Channels 2 and 3 are present only on SIL3114, device selection
+ is done with ATA_DEV1 bit in ATA_REG_DEVICE. FIXME - untested */
+ rc = pcim_iomap_regions(pdev, 0x3F, DRV_NAME);
+#else
rc = pcim_iomap_regions(pdev, 1 << SIL_MMIO_BAR, DRV_NAME);
+#endif
if (rc == -EBUSY)
pcim_pin_device(pdev);
if (rc)
@@ -777,10 +792,16 @@ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ata_port *ap = host->ports[i];
struct ata_ioports *ioaddr = &ap->ioaddr;
+#ifdef CONFIG_ARCH_IXP4XX
+ ioaddr->cmd_addr = host->iomap[(i % 2) * 2];
+ ioaddr->altstatus_addr = host->iomap[1 + (i % 2) * 2] + 2;
+ ioaddr->bmdma_addr = host->iomap[4] + sil_port[i % 2].bmdma;
+#else
ioaddr->cmd_addr = mmio_base + sil_port[i].tf;
- ioaddr->altstatus_addr =
- ioaddr->ctl_addr = mmio_base + sil_port[i].ctl;
+ ioaddr->altstatus_addr = mmio_base + sil_port[i].ctl;
ioaddr->bmdma_addr = mmio_base + sil_port[i].bmdma;
+#endif
+ ioaddr->ctl_addr = mmio_base + sil_port[i].ctl;
ioaddr->scr_addr = mmio_base + sil_port[i].scr;
ata_sff_std_ports(ioaddr);
--
Krzysztof Halasa
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SATA_SIL: Add a work-around for IXP4xx CPU.
2009-11-11 0:04 SATA_SIL: Add a work-around for IXP4xx CPU Krzysztof Halasa
@ 2009-12-15 8:19 ` Tejun Heo
2009-12-15 23:03 ` Krzysztof Halasa
0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2009-12-15 8:19 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: Jeff Garzik, linux-ide, lkml
Hello,
On 11/11/2009 09:04 AM, Krzysztof Halasa wrote:
> IXP4xx CPUs can't read from 8 and 16-bit PCI MMIO registers, we have to read
> from normal IO regions instead.
>
> Tested on SIL3512, and specifically not tested on 4-port SIL3114.
>
> Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Hmmm... Given that there are some platforms which have problem with
mmio and sil3112/4 can do everything via io accesses, it would be nice
to generalize this so that there's CONFIG_SATA_SIL_NO_MMIO which is
selected by affected platforms. Are you interested in doing it?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SATA_SIL: Add a work-around for IXP4xx CPU.
2009-12-15 8:19 ` Tejun Heo
@ 2009-12-15 23:03 ` Krzysztof Halasa
2009-12-15 23:09 ` Jeff Garzik
2009-12-16 0:39 ` Tejun Heo
0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Halasa @ 2009-12-15 23:03 UTC (permalink / raw)
To: Tejun Heo; +Cc: Jeff Garzik, linux-ide, lkml
Tejun Heo <tj@kernel.org> writes:
> Hmmm... Given that there are some platforms which have problem with
> mmio and sil3112/4 can do everything via io accesses, it would be nice
> to generalize this so that there's CONFIG_SATA_SIL_NO_MMIO which is
> selected by affected platforms. Are you interested in doing it?
Unfortunately I no longer have access to that SIL3512 miniPCI card so
I wouln't be able to test on IXP425. Perhaps it's not a problem, testing
on i386 (probably with disabled MMIO BAR) should be enough.
OTOH IIRC SIL3x12 needs to use the MMIO write to start BM DMA, otherwise
the AT-style 64 KB limits apply. I think IXP4xx would benefit from only
ioread8() going through normal IO.
Do you know what platforms have the MMIO problems? What kind of problems
are there, inability to use MMIO at all? (IXP4xx can't do 8/16-bit MMIO
reads).
--
Krzysztof Halasa
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SATA_SIL: Add a work-around for IXP4xx CPU.
2009-12-15 23:03 ` Krzysztof Halasa
@ 2009-12-15 23:09 ` Jeff Garzik
2009-12-16 0:39 ` Tejun Heo
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2009-12-15 23:09 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: Tejun Heo, linux-ide, lkml
On 12/15/2009 06:03 PM, Krzysztof Halasa wrote:
> Tejun Heo<tj@kernel.org> writes:
>
>> Hmmm... Given that there are some platforms which have problem with
>> mmio and sil3112/4 can do everything via io accesses, it would be nice
>> to generalize this so that there's CONFIG_SATA_SIL_NO_MMIO which is
>> selected by affected platforms. Are you interested in doing it?
>
> Unfortunately I no longer have access to that SIL3512 miniPCI card so
> I wouln't be able to test on IXP425. Perhaps it's not a problem, testing
> on i386 (probably with disabled MMIO BAR) should be enough.
>
> OTOH IIRC SIL3x12 needs to use the MMIO write to start BM DMA, otherwise
> the AT-style 64 KB limits apply. I think IXP4xx would benefit from only
> ioread8() going through normal IO.
>
> Do you know what platforms have the MMIO problems? What kind of problems
> are there, inability to use MMIO at all? (IXP4xx can't do 8/16-bit MMIO
> reads).
The inability to do 8/16-bit MMIO reads are a repeated sticking point
with embedded scenarios. That's it.
I keep meaning to give the docs a hard look, and see if we can combine
multiple taskfile register reads/writes into a single 32-bit one. That
would solve all these problems, without having to resort to the use of
standard BARs.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SATA_SIL: Add a work-around for IXP4xx CPU.
2009-12-15 23:03 ` Krzysztof Halasa
2009-12-15 23:09 ` Jeff Garzik
@ 2009-12-16 0:39 ` Tejun Heo
1 sibling, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2009-12-16 0:39 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: Jeff Garzik, linux-ide, lkml
Hello,
On 12/16/2009 08:03 AM, Krzysztof Halasa wrote:
> Tejun Heo <tj@kernel.org> writes:
>
>> Hmmm... Given that there are some platforms which have problem with
>> mmio and sil3112/4 can do everything via io accesses, it would be nice
>> to generalize this so that there's CONFIG_SATA_SIL_NO_MMIO which is
>> selected by affected platforms. Are you interested in doing it?
>
> Unfortunately I no longer have access to that SIL3512 miniPCI card so
> I wouln't be able to test on IXP425. Perhaps it's not a problem, testing
> on i386 (probably with disabled MMIO BAR) should be enough.
>
> OTOH IIRC SIL3x12 needs to use the MMIO write to start BM DMA, otherwise
> the AT-style 64 KB limits apply. I think IXP4xx would benefit from only
> ioread8() going through normal IO.
>
> Do you know what platforms have the MMIO problems? What kind of problems
> are there, inability to use MMIO at all? (IXP4xx can't do 8/16-bit MMIO
> reads).
I don't remember exactly but similar subjects have come up multiple
times on the mailing list and elsewhere. ISTR a case where MMIO was
completely unavailable but I could be mistaken. At any rate, the most
common problem seems to be smaller MMIO accesses, so generalizing your
previous patch just a bit would help a lot.
ie. CONFIG_SATA_SIL_ONLY_32BIT_MMIO which is selected by platform.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-16 0:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11 0:04 SATA_SIL: Add a work-around for IXP4xx CPU Krzysztof Halasa
2009-12-15 8:19 ` Tejun Heo
2009-12-15 23:03 ` Krzysztof Halasa
2009-12-15 23:09 ` Jeff Garzik
2009-12-16 0:39 ` Tejun Heo
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).