Bugzilla – Attachment 50426 Details for
Bug 117068
10.0 RC1: Promise PATA on SATA patch needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Proper unified diff of promise pata support
sata-promise-pata (text/plain), 3.72 KB, created by
Jens Axboe
on 2005-09-20 14:30:17 UTC
(
hide
)
Description:
Proper unified diff of promise pata support
Filename:
MIME Type:
Creator:
Jens Axboe
Created:
2005-09-20 14:30:17 UTC
Size:
3.72 KB
patch
obsolete
>diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c >--- a/drivers/scsi/libata-core.c >+++ b/drivers/scsi/libata-core.c >@@ -3377,6 +3377,7 @@ static void ata_host_init(struct ata_por > ap->mwdma_mask = ent->mwdma_mask; > ap->udma_mask = ent->udma_mask; > ap->flags |= ent->host_flags; >+ ap->flags |= ent->port_flags[port_no]; > ap->ops = ent->port_ops; > ap->cbl = ATA_CBL_NONE; > ap->active_tag = ATA_TAG_POISON; >diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c >--- a/drivers/scsi/sata_promise.c >+++ b/drivers/scsi/sata_promise.c >@@ -79,6 +79,8 @@ static void pdc_eng_timeout(struct ata_p > static int pdc_port_start(struct ata_port *ap); > static void pdc_port_stop(struct ata_port *ap); > static void pdc_phy_reset(struct ata_port *ap); >+static void pdc_pata_phy_reset(struct ata_port *ap); >+static void pdc_pata_cbl_detect(struct ata_port *ap); > static void pdc_qc_prep(struct ata_queued_cmd *qc); > static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); > static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); >@@ -128,7 +130,7 @@ static struct ata_port_info pdc_port_inf > /* board_2037x */ > { > .sht = &pdc_ata_sht, >- .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | >+ .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY | > ATA_FLAG_SRST | ATA_FLAG_MMIO, > .pio_mask = 0x1f, /* pio0-4 */ > .mwdma_mask = 0x07, /* mwdma0-2 */ >@@ -253,7 +255,35 @@ static void pdc_reset_port(struct ata_po > static void pdc_phy_reset(struct ata_port *ap) > { > pdc_reset_port(ap); >- sata_phy_reset(ap); >+ if (ap->flags & ATA_FLAG_SATA) >+ sata_phy_reset(ap); >+ else >+ pdc_pata_phy_reset(ap); >+} >+ >+static void pdc_pata_cbl_detect(struct ata_port *ap) >+{ >+ u8 tmp; >+ void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; >+ >+ tmp = readb(mmio); >+ >+ if (tmp & 0x01) >+ { >+ ap->cbl = ATA_CBL_PATA40; >+ ap->udma_mask &= ATA_UDMA_MASK_40C; >+ } >+ else >+ ap->cbl = ATA_CBL_PATA80; >+} >+ >+static void pdc_pata_phy_reset(struct ata_port *ap) >+{ >+ pdc_pata_cbl_detect(ap); >+ >+ ata_port_probe(ap); >+ >+ ata_bus_reset(ap); > } > > static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) >@@ -559,6 +589,7 @@ static int pdc_ata_init_one (struct pci_ > unsigned int board_idx = (unsigned int) ent->driver_data; > int pci_dev_busy = 0; > int rc; >+ u8 tmp; > > if (!printed_version++) > printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); >@@ -619,6 +650,9 @@ static int pdc_ata_init_one (struct pci_ > probe_ent->port[0].scr_addr = base + 0x400; > probe_ent->port[1].scr_addr = base + 0x500; > >+ probe_ent->port_flags[0] = ATA_FLAG_SATA; >+ probe_ent->port_flags[1] = ATA_FLAG_SATA; >+ > /* notice 4-port boards */ > switch (board_idx) { > case board_20319: >@@ -629,9 +663,25 @@ static int pdc_ata_init_one (struct pci_ > > probe_ent->port[2].scr_addr = base + 0x600; > probe_ent->port[3].scr_addr = base + 0x700; >+ >+ probe_ent->port_flags[2] = ATA_FLAG_SATA; >+ probe_ent->port_flags[3] = ATA_FLAG_SATA; > break; > case board_2037x: >- probe_ent->n_ports = 2; >+ /* Some boards have also PATA port */ >+ tmp = readb(mmio_base + PDC_FLASH_CTL+1); >+ if (!(tmp & 0x80)) >+ { >+ probe_ent->n_ports = 3; >+ >+ pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); >+ >+ probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS; >+ >+ printk(KERN_INFO DRV_NAME " PATA port found\n"); >+ } >+ else >+ probe_ent->n_ports = 2; > break; > default: > BUG(); >diff --git a/include/linux/libata.h b/include/linux/libata.h >--- a/include/linux/libata.h >+++ b/include/linux/libata.h >@@ -205,6 +205,7 @@ struct ata_probe_ent { > unsigned long irq; > unsigned int irq_flags; > unsigned long host_flags; >+ unsigned long port_flags[ATA_MAX_PORTS]; > void __iomem *mmio_base; > void *private_data; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 117068
:
50328
| 50426