sata_sil24 rewrite
PATCH 1/1 sata_sil24 rewrite
Hello, Jeff.
This patch contains rewritten sil24 driver. It uses recent NCQ
helpers but that part can be changed easily. Sadly, no NCQ/ATAPI yet. Changes from the original preview driver are...
* Shorter & better looking (well, at lesat in my opinion)
* No code duplication. I've read original sil24 driver carefully but couldn't really find anything which requires code duplication. Skipping ATAPI devices seems to be the only functional difference and it can be trivially done inside phy_reset.
* SATA phy reset instead of SRST.
* Disabled 64bit DMA enable, as I couldn't determine if it's gonna work or not.
* Error handling works.
Things to do.
* NCQ support. I couldn't find how to make sactive work. It can easily be added if only we know how to issue and complete NCQ commands.
* ATAPI support. Again this can be easiliy added only if we know how to issue ATAPI commands.
* Port multiplier. This one is difficult. We don't know how to do it on sil24 and don't have proper infrastructure in libata.
drivers/scsi/Kconfig +8 -0
@@ -481,6 +481,14 @@ config SCSI_SATA_SIL If unsure, say N. +config SCSI_SATA_SIL24 + tristate "Silicon Image 3124/3132 SATA support" + depends on SCSI_SATA && PCI && EXPERIMENTAL + help + This option enables support for Silicom Image 3124/3132 Serial ATA. + + If unuse, say N. + config SCSI_SATA_SIS tristate "SiS 964/180 SATA support" depends on SCSI_SATA && PCI && EXPERIMENTAL
drivers/scsi/Makefile +1 -0
@@ -128,6 +128,7 @@ obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o obj-$(CONFIG_SCSI_SATA_QSTOR) += libata.o sata_qstor.o obj-$(CONFIG_SCSI_SATA_SIL) += libata.o sata_sil.o +obj-$(CONFIG_SCSI_SATA_SIL24) += libata.o sata_sil24.o obj-$(CONFIG_SCSI_SATA_VIA) += libata.o sata_via.o obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o obj-$(CONFIG_SCSI_SATA_SIS) += libata.o sata_sis.o
drivers/scsi/sata_sil24.c new file +759 -0
759 lines not on this page · raw message
Re: [PATCH libata-dev-2.6:ncq+ncq helpers] sata_sil24 debug stuff
As usual, error trigger and debug message patch.
drivers/scsi/sata_sil24.c +40 -0
@@ -421,6 +421,46 @@ static int sil24_qc_issue(struct ata_questruct sil24_port_priv *pp = ap->private_data;dma_addr_t paddr = pp->cmd_block_dma + qc->tag *sizeof (*pp->cmd_block); +#if 0 +static unsigned err_cnt; + err_cnt++; +if (err_cnt >500 && err_cnt %30 ==0 ) { +struct sil24_cmd_block *cb = pp->cmd_block + qc->tag; +struct sil24_prb *prb = &cb->prb; +u8 *fis = prb->fis; +printk ("SIL24%u: FAILING %p: %08x %08x %08x %08x %08x\n" , + ap->id, qc->scsicmd, + ((unsigned *)fis)[0 ], ((unsigned *)fis)[1 ], + ((unsigned *)fis)[2 ], ((unsigned *)fis)[3 ], + ((unsigned *)fis)[4 ]); + fis[4 ] =0xff ; + fis[5 ] =0xff ; + fis[6 ] =0xff ; + fis[8 ] =0xff ; + fis[9 ] =0xff ; + fis[10 ] =0xff ; + } +#endif + +#if 0 + { +struct sil24_cmd_block *cb = pp->cmd_block + qc->tag; +struct sil24_prb *prb = &cb->prb; +u32 *fis = (u32 *)prb->fis; +printk ("SIL24%u: FIS %p: %08x %08x %08x %08x %08x\n" , + ap->id, qc->scsicmd, + fis[0 ], fis[1 ], fis[2 ], fis[3 ], fis[4 ]); + } +#endif + +#if 1 +static unsigned skip_cnt; + skip_cnt++; +if (skip_cnt >500 && skip_cnt %100 ==0 ) { +printk ("AHCI: SKIPPING %02u\n" , qc->tag); +return 0 ; + } +#endif writel ((u32 )paddr, pp->port +PORT_CMD_ACTIVATE );return 0 ; }