View | Details | Raw Unified | Return to bug 176249
Collapse All | Expand All

(-)a/drivers/ata/sata_promise.c (-6 / +30 lines)
Lines 175-181 static const struct ata_port_info pdc_po Link Here
175
	/* board_2037x */
175
	/* board_2037x */
176
	{
176
	{
177
		.sht		= &pdc_ata_sht,
177
		.sht		= &pdc_ata_sht,
178
		.flags		= PDC_COMMON_FLAGS | ATA_FLAG_SATA,
178
		.flags		= PDC_COMMON_FLAGS /* | ATA_FLAG_SATA */,
179
		.pio_mask	= 0x1f, /* pio0-4 */
179
		.pio_mask	= 0x1f, /* pio0-4 */
180
		.mwdma_mask	= 0x07, /* mwdma0-2 */
180
		.mwdma_mask	= 0x07, /* mwdma0-2 */
181
		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
181
		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
Lines 371-393 static void pdc_reset_port(struct ata_po Link Here
371
static void pdc_sata_phy_reset(struct ata_port *ap)
354
static void pdc_sata_phy_reset(struct ata_port *ap)
372
{
355
{
373
	pdc_reset_port(ap);
356
	pdc_reset_port(ap);
374
	sata_phy_reset(ap);
357
	if (ap->flags & ATA_FLAG_SATA)
358
		sata_phy_reset(ap);
359
	else
360
		pdc_pata_phy_reset(ap);
375
}
361
}
376
362
377
static void pdc_pata_cbl_detect(struct ata_port *ap)
363
static void pdc_pata_cbl_detect(struct ata_port *ap)
378
{
364
{
379
	u8 tmp;
365
	u8 tmp;
380
	void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
366
	void __iomem *mmio =
367
		(void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
381
368
382
	tmp = readb(mmio);
369
	tmp = readb(mmio);
383
370
	
384
	if (tmp & 0x01) {
371
	if (tmp & 0x01) {
385
		ap->cbl = ATA_CBL_PATA40;
372
		ap->cbl = ATA_CBL_PATA40;
386
		ap->udma_mask &= ATA_UDMA_MASK_40C;
373
		ap->udma_mask &= ATA_UDMA_MASK_40C;
387
	} else
374
	} else
388
		ap->cbl = ATA_CBL_PATA80;
375
		ap->cbl = ATA_CBL_PATA80;
389
}
376
}
390
377
		
391
static void pdc_pata_phy_reset(struct ata_port *ap)
378
static void pdc_pata_phy_reset(struct ata_port *ap)
392
{
379
{
393
	pdc_pata_cbl_detect(ap);
380
	pdc_pata_cbl_detect(ap);
Lines 695-700 static int pdc_ata_init_one (struct pci_ Link Here
695
	unsigned int board_idx = (unsigned int) ent->driver_data;
682
	unsigned int board_idx = (unsigned int) ent->driver_data;
696
	int pci_dev_busy = 0;
683
	int pci_dev_busy = 0;
697
	int rc;
684
	int rc;
685
	u8 tmp;
698
686
699
	if (!printed_version++)
687
	if (!printed_version++)
700
		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
688
		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
Lines 759-764 static int pdc_ata_init_one (struct pci_ Link Here
759
	probe_ent->port[0].scr_addr = base + 0x400;
747
	probe_ent->port[0].scr_addr = base + 0x400;
760
	probe_ent->port[1].scr_addr = base + 0x500;
748
	probe_ent->port[1].scr_addr = base + 0x500;
761
749
750
	probe_ent->_port_flags[0] = ATA_FLAG_SATA;
751
	probe_ent->_port_flags[1] = ATA_FLAG_SATA;
752
	
762
	/* notice 4-port boards */
753
	/* notice 4-port boards */
763
	switch (board_idx) {
754
	switch (board_idx) {
764
	case board_40518:
755
	case board_40518:
Lines 773-785 static int pdc_ata_init_one (struct pci_ Link Here
773
764
774
		probe_ent->port[2].scr_addr = base + 0x600;
765
		probe_ent->port[2].scr_addr = base + 0x600;
775
		probe_ent->port[3].scr_addr = base + 0x700;
766
		probe_ent->port[3].scr_addr = base + 0x700;
767
	
768
		probe_ent->_port_flags[2] = ATA_FLAG_SATA;
769
		probe_ent->_port_flags[3] = ATA_FLAG_SATA;
776
		break;
770
		break;
777
	case board_2057x:
771
	case board_2057x:
778
		/* Override hotplug offset for SATAII150 */
772
		/* Override hotplug offset for SATAII150 */
779
		hp->hotplug_offset = PDC2_SATA_PLUG_CSR;
773
		hp->hotplug_offset = PDC2_SATA_PLUG_CSR;
780
		/* Fall through */
774
		/* Fall through */
781
	case board_2037x:
775
	case board_2037x:
782
		probe_ent->n_ports = 2;
776
		/* Some boards have also PATA port */
777
		tmp = readb(mmio_base + PDC_FLASH_CTL+1);
778
		if (!(tmp & 0x80))
779
		{
780
			probe_ent->n_ports = 3;
781
			
782
			pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
783
784
			probe_ent->_port_flags[2] = ATA_FLAG_SLAVE_POSS;
785
			
786
			printk(KERN_INFO DRV_NAME " PATA port found\n");
787
		}
788
		else
789
       			probe_ent->n_ports = 2;
783
		break;
790
		break;
784
	case board_20771:
791
	case board_20771:
785
		probe_ent->n_ports = 2;
792
		probe_ent->n_ports = 2;
(-)a/drivers/ata/libata-core.c (-2 / +2 lines)
Lines 5293-5305 void ata_port_init(struct ata_port *ap, Link Here
5293
		ap->pio_mask = ent->pinfo2->pio_mask;
5310
		ap->pio_mask = ent->pinfo2->pio_mask;
5294
		ap->mwdma_mask = ent->pinfo2->mwdma_mask;
5311
		ap->mwdma_mask = ent->pinfo2->mwdma_mask;
5295
		ap->udma_mask = ent->pinfo2->udma_mask;
5312
		ap->udma_mask = ent->pinfo2->udma_mask;
5296
		ap->flags |= ent->pinfo2->flags;
5313
		ap->flags |= ent->pinfo2->flags | ent->_port_flags[port_no];
5297
		ap->ops = ent->pinfo2->port_ops;
5314
		ap->ops = ent->pinfo2->port_ops;
5298
	} else {
5315
	} else {
5299
		ap->pio_mask = ent->pio_mask;
5316
		ap->pio_mask = ent->pio_mask;
5300
		ap->mwdma_mask = ent->mwdma_mask;
5317
		ap->mwdma_mask = ent->mwdma_mask;
5301
		ap->udma_mask = ent->udma_mask;
5318
		ap->udma_mask = ent->udma_mask;
5302
		ap->flags |= ent->port_flags;
5319
		ap->flags |= ent->port_flags | ent->_port_flags[port_no];
5303
		ap->ops = ent->port_ops;
5320
		ap->ops = ent->port_ops;
5304
	}
5321
	}
5305
	ap->hw_sata_spd_limit = UINT_MAX;
5322
	ap->hw_sata_spd_limit = UINT_MAX;
(-)a/include/linux/libata.h (+1 lines)
Lines 372-377 struct ata_probe_ent { Link Here
372
	unsigned int		irq_flags;
378
	unsigned int		irq_flags;
373
	unsigned long		port_flags;
379
	unsigned long		port_flags;
374
	unsigned long		_host_flags;
380
	unsigned long		_host_flags;
381
	unsigned long		_port_flags[ATA_MAX_PORTS];
375
	void __iomem		*mmio_base;
382
	void __iomem		*mmio_base;
376
	void			*private_data;
383
	void			*private_data;

Return to bug 176249