linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.23]ata_piix: SATA 2port controller port map fix
@ 2007-10-11 23:05 Jason Gaston
  2007-10-15 19:40 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gaston @ 2007-10-11 23:05 UTC (permalink / raw)
  To: jgarzik, jason.d.gaston; +Cc: linux-ide, linux-kernel, htejun

This patch adds a port map for ICH9 and ICH8 SATA controllers that have only 2 ports available in that mode.

Signed-off-by:  Jason Gaston <jason.d.gaston@intel.com>

--- linux-2.6.23/drivers/ata/ata_piix.c.orig	2007-10-09 13:31:38.000000000 -0700
+++ linux-2.6.23/drivers/ata/ata_piix.c	2007-10-11 15:55:19.000000000 -0700
@@ -131,6 +131,7 @@
 	ich8_sata_ahci		= 9,
 	piix_pata_mwdma		= 10,	/* PIIX3 MWDMA only */
 	tolapai_sata_ahci	= 11,
+	ich9_2port_sata		= 12,
 
 	/* constants for mapping table */
 	P0			= 0,  /* port 0 */
@@ -239,19 +240,19 @@
 	/* SATA Controller 1 IDE (ICH8) */
 	{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller 2 IDE (ICH8) */
-	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
 	/* Mobile SATA Controller IDE (ICH8M) */
 	{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller IDE (ICH9) */
 	{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller IDE (ICH9) */
-	{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
 	/* SATA Controller IDE (ICH9) */
-	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
-	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
-	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
 	{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller IDE (Tolapai) */
@@ -456,6 +457,18 @@
         },
 };
 
+static const struct piix_map_db ich9_2port_map_db = {
+        .mask = 0x3,
+        .port_enable = 0x3,
+        .map = {
+                /* PM   PS   SM   SS       MAP */
+                {  P0,  NA,  P1,  NA }, /* 00b */
+                {  RV,  RV,  RV,  RV }, /* 01b */
+                {  RV,  RV,  RV,  RV }, /* 10b */
+                {  RV,  RV,  RV,  RV },
+        },
+};
+
 static const struct piix_map_db *piix_map_db_table[] = {
 	[ich5_sata]		= &ich5_map_db,
 	[ich6_sata]		= &ich6_map_db,
@@ -463,6 +476,7 @@
 	[ich6m_sata_ahci]	= &ich6m_map_db,
 	[ich8_sata_ahci]	= &ich8_map_db,
 	[tolapai_sata_ahci]	= &tolapai_map_db,
+	[ich9_2port_sata]	= &ich9_2port_map_db,
 };
 
 static struct ata_port_info piix_port_info[] = {
@@ -587,6 +601,17 @@
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &piix_sata_ops,
 	},
+
+	/* ich9_2port_sata: 12: */
+	{
+		.sht		= &piix_sht,
+		.flags		= PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
+				  PIIX_FLAG_AHCI,
+		.pio_mask	= 0x1f,	/* pio0-4 */
+		.mwdma_mask	= 0x07, /* mwdma0-2 */
+		.udma_mask	= ATA_UDMA6,
+		.port_ops	= &piix_sata_ops,
+	},
 };
 
 static struct pci_bits piix_enable_bits[] = {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.23]ata_piix: SATA 2port controller port map fix
  2007-10-11 23:05 [PATCH 2.6.23]ata_piix: SATA 2port controller port map fix Jason Gaston
@ 2007-10-15 19:40 ` Jeff Garzik
  2007-10-15 21:33   ` Gaston, Jason D
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2007-10-15 19:40 UTC (permalink / raw)
  To: Jason Gaston; +Cc: linux-ide, linux-kernel, htejun

Jason Gaston wrote:
> This patch adds a port map for ICH9 and ICH8 SATA controllers that have only 2 ports available in that mode.
> 
> Signed-off-by:  Jason Gaston <jason.d.gaston@intel.com>
> 
> --- linux-2.6.23/drivers/ata/ata_piix.c.orig	2007-10-09 13:31:38.000000000 -0700
> +++ linux-2.6.23/drivers/ata/ata_piix.c	2007-10-11 15:55:19.000000000 -0700
> @@ -131,6 +131,7 @@
>  	ich8_sata_ahci		= 9,
>  	piix_pata_mwdma		= 10,	/* PIIX3 MWDMA only */
>  	tolapai_sata_ahci	= 11,
> +	ich9_2port_sata		= 12,
>  
>  	/* constants for mapping table */
>  	P0			= 0,  /* port 0 */
> @@ -239,19 +240,19 @@
>  	/* SATA Controller 1 IDE (ICH8) */
>  	{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
>  	/* SATA Controller 2 IDE (ICH8) */
> -	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
> +	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
>  	/* Mobile SATA Controller IDE (ICH8M) */
>  	{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
>  	/* SATA Controller IDE (ICH9) */
>  	{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
>  	/* SATA Controller IDE (ICH9) */
> -	{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
> +	{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
>  	/* SATA Controller IDE (ICH9) */
> -	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
> +	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
>  	/* SATA Controller IDE (ICH9M) */
> -	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
> +	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
>  	/* SATA Controller IDE (ICH9M) */
> -	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
> +	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
>  	/* SATA Controller IDE (ICH9M) */
>  	{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
>  	/* SATA Controller IDE (Tolapai) */
> @@ -456,6 +457,18 @@
>          },
>  };
>  
> +static const struct piix_map_db ich9_2port_map_db = {
> +        .mask = 0x3,
> +        .port_enable = 0x3,
> +        .map = {
> +                /* PM   PS   SM   SS       MAP */
> +                {  P0,  NA,  P1,  NA }, /* 00b */
> +                {  RV,  RV,  RV,  RV }, /* 01b */
> +                {  RV,  RV,  RV,  RV }, /* 10b */
> +                {  RV,  RV,  RV,  RV },
> +        },
> +};

this was full of spaces, and should be converted to tabs (I did this 
manually)

In the future, make sure to run your patch through 
scripts/checkpatch.pl.  Some of that script's complaints are a bit 
insane, but most are good.

>  static const struct piix_map_db *piix_map_db_table[] = {
>  	[ich5_sata]		= &ich5_map_db,
>  	[ich6_sata]		= &ich6_map_db,
> @@ -463,6 +476,7 @@
>  	[ich6m_sata_ahci]	= &ich6m_map_db,
>  	[ich8_sata_ahci]	= &ich8_map_db,
>  	[tolapai_sata_ahci]	= &tolapai_map_db,
> +	[ich9_2port_sata]	= &ich9_2port_map_db,
>  };
>  
>  static struct ata_port_info piix_port_info[] = {
> @@ -587,6 +601,17 @@
>  		.udma_mask	= ATA_UDMA6,
>  		.port_ops	= &piix_sata_ops,
>  	},
> +
> +	/* ich9_2port_sata: 12: */

changed this to

	[ich9_2port_sata] =

since we have started using the (C99? gcc?) method of initializing 
piix_port_info[] array entries based on the given index, rather than 
simply noting the index in a comment and depending on the order of other 
entries not to change.

	Jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 2.6.23]ata_piix: SATA 2port controller port map fix
  2007-10-15 19:40 ` Jeff Garzik
@ 2007-10-15 21:33   ` Gaston, Jason D
  0 siblings, 0 replies; 3+ messages in thread
From: Gaston, Jason D @ 2007-10-15 21:33 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel, htejun

>this was full of spaces, and should be converted to tabs (I did this
>manually)
>
>In the future, make sure to run your patch through
>scripts/checkpatch.pl.  Some of that script's complaints are a bit
>insane, but most are good.
>
>>  static const struct piix_map_db *piix_map_db_table[] = {
>>  	[ich5_sata]		= &ich5_map_db,
>>  	[ich6_sata]		= &ich6_map_db,
>> @@ -463,6 +476,7 @@
>>  	[ich6m_sata_ahci]	= &ich6m_map_db,
>>  	[ich8_sata_ahci]	= &ich8_map_db,
>>  	[tolapai_sata_ahci]	= &tolapai_map_db,
>> +	[ich9_2port_sata]	= &ich9_2port_map_db,
>>  };
>>
>>  static struct ata_port_info piix_port_info[] = {
>> @@ -587,6 +601,17 @@
>>  		.udma_mask	= ATA_UDMA6,
>>  		.port_ops	= &piix_sata_ops,
>>  	},
>> +
>> +	/* ich9_2port_sata: 12: */
>
>changed this to
>
>	[ich9_2port_sata] =
>
>since we have started using the (C99? gcc?) method of initializing
>piix_port_info[] array entries based on the given index, rather than
>simply noting the index in a comment and depending on the order of
other
>entries not to change.
>
>	Jeff

Thank you Jeff!  I guess it is time to switch email clients, as this one
keeps trashing my file import.  I thought I had it worked out, guess
not.  

Thanks again,

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-15 21:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 23:05 [PATCH 2.6.23]ata_piix: SATA 2port controller port map fix Jason Gaston
2007-10-15 19:40 ` Jeff Garzik
2007-10-15 21:33   ` Gaston, Jason D

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).