ia64/linux-2.6.18-xen.hg

changeset 558:1e8c3287b395

Add support for SB700 storage controllers.
Signed-off-by: Travis Betak <travis.betak@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed May 21 11:11:00 2008 +0100 (2008-05-21)
parents 8792274adfd0
children 446c39a967fc
files drivers/ide/pci/atiixp.c drivers/pci/quirks.c drivers/scsi/ahci.c include/linux/libata.h include/linux/pci_ids.h
line diff
     1.1 --- a/drivers/ide/pci/atiixp.c	Wed May 21 11:00:28 2008 +0100
     1.2 +++ b/drivers/ide/pci/atiixp.c	Wed May 21 11:11:00 2008 +0100
     1.3 @@ -348,6 +348,7 @@ static struct pci_device_id atiixp_pci_t
     1.4  	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
     1.5  	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
     1.6  	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
     1.7 +	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
     1.8  	{ 0, },
     1.9  };
    1.10  MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
     2.1 --- a/drivers/pci/quirks.c	Wed May 21 11:00:28 2008 +0100
     2.2 +++ b/drivers/pci/quirks.c	Wed May 21 11:11:00 2008 +0100
     2.3 @@ -873,6 +873,25 @@ static void __init quirk_disable_pxb(str
     2.4  }
     2.5  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82454NX,	quirk_disable_pxb );
     2.6  
     2.7 +static void __devinit quirk_sb600_sata(struct pci_dev *pdev)
     2.8 +{
     2.9 +	/* set sb600/sb700/sb800 sata to ahci mode */
    2.10 +	u8 tmp;
    2.11 +
    2.12 +	pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp);
    2.13 +	if (tmp == 0x01) {
    2.14 +		pci_read_config_byte(pdev, 0x40, &tmp);
    2.15 +		pci_write_config_byte(pdev, 0x40, tmp|1);
    2.16 +		pci_write_config_byte(pdev, 0x9, 1);
    2.17 +		pci_write_config_byte(pdev, 0xa, 6);
    2.18 +		pci_write_config_byte(pdev, 0x40, tmp);
    2.19 +
    2.20 +		pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
    2.21 +		dev_info(&pdev->dev, "set SATA to AHCI mode\n");
    2.22 +	}
    2.23 +}
    2.24 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_sb600_sata);
    2.25 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
    2.26  
    2.27  /*
    2.28   *	Serverworks CSB5 IDE does not fully support native mode
     3.1 --- a/drivers/scsi/ahci.c	Wed May 21 11:00:28 2008 +0100
     3.2 +++ b/drivers/scsi/ahci.c	Wed May 21 11:11:00 2008 +0100
     3.3 @@ -78,6 +78,7 @@ enum {
     3.4  
     3.5  	board_ahci		= 0,
     3.6  	board_ahci_vt8251	= 1,
     3.7 +	board_ahci_sb700	= 2,
     3.8  
     3.9  	/* global controller registers */
    3.10  	HOST_CAP		= 0x00, /* host capabilities */
    3.11 @@ -283,6 +284,16 @@ static const struct ata_port_info ahci_p
    3.12  		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
    3.13  		.port_ops	= &ahci_ops,
    3.14  	},
    3.15 +	{
    3.16 +		.sht            = &ahci_sht,
    3.17 +		.host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
    3.18 +				  ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
    3.19 +				  ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
    3.20 +				  ATA_FLAG_IPM,
    3.21 +		.pio_mask       = 0x1f, /* pio0-4 */
    3.22 +		.udma_mask      = 0x7f,
    3.23 +		.port_ops       = &ahci_ops,
    3.24 +	},
    3.25  };
    3.26  
    3.27  static const struct pci_device_id ahci_pci_tbl[] = {
    3.28 @@ -363,6 +374,18 @@ static const struct pci_device_id ahci_p
    3.29  	  board_ahci }, /* ATI SB600 non-raid */
    3.30  	{ PCI_VENDOR_ID_ATI, 0x4381, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.31  	  board_ahci }, /* ATI SB600 raid */
    3.32 +	{ PCI_VENDOR_ID_ATI, 0x4390, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.33 +	  board_ahci_sb700 },
    3.34 +	{ PCI_VENDOR_ID_ATI, 0x4391, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.35 +	  board_ahci_sb700 },
    3.36 +	{ PCI_VENDOR_ID_ATI, 0x4392, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.37 +	  board_ahci_sb700 },
    3.38 +	{ PCI_VENDOR_ID_ATI, 0x4393, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.39 +	  board_ahci_sb700 },
    3.40 +	{ PCI_VENDOR_ID_ATI, 0x4394, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.41 +	  board_ahci_sb700 },
    3.42 +	{ PCI_VENDOR_ID_ATI, 0x4395, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
    3.43 +	  board_ahci_sb700 },
    3.44  
    3.45  	/* VIA */
    3.46  	{ PCI_VENDOR_ID_VIA, 0x3349, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
     4.1 --- a/include/linux/libata.h	Wed May 21 11:00:28 2008 +0100
     4.2 +++ b/include/linux/libata.h	Wed May 21 11:11:00 2008 +0100
     4.3 @@ -162,6 +162,12 @@ enum {
     4.4  	ATA_FLAG_SKIP_D2H_BSY	= (1 << 12), /* can't wait for the first D2H
     4.5  					      * Register FIS clearing BSY */
     4.6  	ATA_FLAG_DEBUGMSG	= (1 << 13),
     4.7 +	ATA_FLAG_IGN_SIMPLEX    = (1 << 15), /* ignore SIMPLEX */
     4.8 +	ATA_FLAG_NO_IORDY       = (1 << 16), /* controller lacks iordy */
     4.9 +	ATA_FLAG_ACPI_SATA      = (1 << 17), /* need native SATA ACPI layout */
    4.10 +	ATA_FLAG_AN             = (1 << 18), /* controller supports AN */
    4.11 +	ATA_FLAG_PMP            = (1 << 19), /* controller supports PMP */
    4.12 +	ATA_FLAG_IPM            = (1 << 20), /* driver can handle IPM */
    4.13  
    4.14  	/* The following flag belongs to ap->pflags but is kept in
    4.15  	 * ap->flags because it's referenced in many LLDs and will be
     5.1 --- a/include/linux/pci_ids.h	Wed May 21 11:00:28 2008 +0100
     5.2 +++ b/include/linux/pci_ids.h	Wed May 21 11:11:00 2008 +0100
     5.3 @@ -15,6 +15,8 @@
     5.4  #define PCI_CLASS_STORAGE_FLOPPY	0x0102
     5.5  #define PCI_CLASS_STORAGE_IPI		0x0103
     5.6  #define PCI_CLASS_STORAGE_RAID		0x0104
     5.7 +#define PCI_CLASS_STORAGE_SATA          0x0106
     5.8 +#define PCI_CLASS_STORAGE_SATA_AHCI     0x010601
     5.9  #define PCI_CLASS_STORAGE_SAS		0x0107
    5.10  #define PCI_CLASS_STORAGE_OTHER		0x0180
    5.11  
    5.12 @@ -363,6 +365,8 @@
    5.13  #define PCI_DEVICE_ID_ATI_IXP600_SATA	0x4380
    5.14  #define PCI_DEVICE_ID_ATI_IXP600_SRAID	0x4381
    5.15  #define PCI_DEVICE_ID_ATI_IXP600_IDE	0x438c
    5.16 +#define PCI_DEVICE_ID_ATI_IXP700_SATA	0x4390
    5.17 +#define PCI_DEVICE_ID_ATI_IXP700_IDE	0x439c
    5.18  
    5.19  #define PCI_VENDOR_ID_VLSI		0x1004
    5.20  #define PCI_DEVICE_ID_VLSI_82C592	0x0005