linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata_piix: reorganize controller IDs
@ 2007-11-19  4:14 Tejun Heo
  2007-11-19  4:16 ` [PATCH] ata_piix: only enable the first port on apple macbook pro Tejun Heo
  2007-11-24  1:21 ` [PATCH] ata_piix: reorganize controller IDs Jeff Garzik
  0 siblings, 2 replies; 6+ messages in thread
From: Tejun Heo @ 2007-11-19  4:14 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
for consistency and use automatically incremented values instead of
assigning fixed values to ease adding new controller IDs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
applied to #tj-upstream-fixes.

 drivers/ata/ata_piix.c |   62 ++++++++++++++++++++++++------------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 80b735b..77fea05 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -119,18 +119,18 @@ enum {
 	PIIX_80C_SEC		= (1 << 7) | (1 << 6),
 
 	/* controller IDs */
-	piix_pata_33		= 0,	/* PIIX4 at 33Mhz */
-	ich_pata_33		= 1,	/* ICH up to UDMA 33 only */
-	ich_pata_66		= 2,	/* ICH up to 66 Mhz */
-	ich_pata_100		= 3,	/* ICH up to UDMA 100 */
-	ich5_sata		= 5,
-	ich6_sata		= 6,
-	ich6_sata_ahci		= 7,
-	ich6m_sata_ahci		= 8,
-	ich8_sata_ahci		= 9,
-	piix_pata_mwdma		= 10,	/* PIIX3 MWDMA only */
-	tolapai_sata_ahci	= 11,
-	ich9_2port_sata		= 12,
+	piix_pata_mwdma		= 0,	/* PIIX3 MWDMA only */
+	piix_pata_33,			/* PIIX4 at 33Mhz */
+	ich_pata_33,			/* ICH up to UDMA 33 only */
+	ich_pata_66,			/* ICH up to 66 Mhz */
+	ich_pata_100,			/* ICH up to UDMA 100 */
+	ich5_sata,
+	ich6_sata,
+	ich6_sata_ahci,
+	ich6m_sata_ahci,
+	ich8_sata_ahci,
+	ich8_2port_sata,
+	tolapai_sata_ahci,
 
 	/* constants for mapping table */
 	P0			= 0,  /* port 0 */
@@ -239,19 +239,19 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	/* 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, ich9_2port_sata },
+	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_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, ich9_2port_sata },
+	{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
 	/* SATA Controller IDE (ICH9) */
-	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+	{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
-	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+	{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
-	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
 	/* SATA Controller IDE (ICH9M) */
 	{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller IDE (Tolapai) */
@@ -437,7 +437,7 @@ static const struct piix_map_db ich8_map_db = {
 	},
 };
 
-static const struct piix_map_db tolapai_map_db = {
+static const struct piix_map_db ich8_2port_map_db = {
 	.mask = 0x3,
 	.port_enable = 0x3,
 	.map = {
@@ -449,7 +449,7 @@ static const struct piix_map_db tolapai_map_db = {
 	},
 };
 
-static const struct piix_map_db ich9_2port_map_db = {
+static const struct piix_map_db tolapai_map_db = {
 	.mask = 0x3,
 	.port_enable = 0x3,
 	.map = {
@@ -467,11 +467,20 @@ static const struct piix_map_db *piix_map_db_table[] = {
 	[ich6_sata_ahci]	= &ich6_map_db,
 	[ich6m_sata_ahci]	= &ich6m_map_db,
 	[ich8_sata_ahci]	= &ich8_map_db,
+	[ich8_2port_sata]	= &ich8_2port_map_db,
 	[tolapai_sata_ahci]	= &tolapai_map_db,
-	[ich9_2port_sata]	= &ich9_2port_map_db,
 };
 
 static struct ata_port_info piix_port_info[] = {
+	[piix_pata_mwdma] = 	/* PIIX3 MWDMA only */
+	{
+		.sht		= &piix_sht,
+		.flags		= PIIX_PATA_FLAGS,
+		.pio_mask	= 0x1f,	/* pio0-4 */
+		.mwdma_mask	= 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
+		.port_ops	= &piix_pata_ops,
+	},
+
 	[piix_pata_33] =	/* PIIX4 at 33MHz */
 	{
 		.sht		= &piix_sht,
@@ -565,16 +574,7 @@ static struct ata_port_info piix_port_info[] = {
 		.port_ops	= &piix_sata_ops,
 	},
 
-	[piix_pata_mwdma] = 	/* PIIX3 MWDMA only */
-	{
-		.sht		= &piix_sht,
-		.flags		= PIIX_PATA_FLAGS,
-		.pio_mask	= 0x1f,	/* pio0-4 */
-		.mwdma_mask	= 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
-		.port_ops	= &piix_pata_ops,
-	},
-
-	[tolapai_sata_ahci] =
+	[ich8_2port_sata] =
 	{
 		.sht		= &piix_sht,
 		.flags		= PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
@@ -585,7 +585,7 @@ static struct ata_port_info piix_port_info[] = {
 		.port_ops	= &piix_sata_ops,
 	},
 
-	[ich9_2port_sata] =
+	[tolapai_sata_ahci] =
 	{
 		.sht		= &piix_sht,
 		.flags		= PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
-- 
1.5.2.4


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

* [PATCH] ata_piix: only enable the first port on apple macbook pro
  2007-11-19  4:14 [PATCH] ata_piix: reorganize controller IDs Tejun Heo
@ 2007-11-19  4:16 ` Tejun Heo
  2007-11-19  4:17   ` [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3 Tejun Heo
  2007-11-24  1:22   ` [PATCH] ata_piix: only enable the first port on apple macbook pro Jeff Garzik
  2007-11-24  1:21 ` [PATCH] ata_piix: reorganize controller IDs Jeff Garzik
  1 sibling, 2 replies; 6+ messages in thread
From: Tejun Heo @ 2007-11-19  4:16 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide; +Cc: tr

From: Thomas Rohwer <tr@tng.de>

ICH8M on apple macbook pro occasionally locks up completely during PCS
initialization if ports other than the first one are enabled.  Add a
separate controller ID and only enable the first port.

tj: commit description added and patch updated to fit with the
    previous controller ID update.

Signed-off-by: Thomas Rohwer <tr@tng.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
applied to #tj-upstream-fixes

 drivers/ata/ata_piix.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 77fea05..d5ff1d8 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -130,6 +130,7 @@ enum {
 	ich6m_sata_ahci,
 	ich8_sata_ahci,
 	ich8_2port_sata,
+	ich8m_apple_sata_ahci,		/* locks up on second port enable */
 	tolapai_sata_ahci,
 
 	/* constants for mapping table */
@@ -242,6 +243,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
 	/* Mobile SATA Controller IDE (ICH8M) */
 	{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+	/* Mobile SATA Controller IDE (ICH8M), Apple */
+	{ 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata_ahci },
 	/* SATA Controller IDE (ICH9) */
 	{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
 	/* SATA Controller IDE (ICH9) */
@@ -449,6 +452,18 @@ static const struct piix_map_db ich8_2port_map_db = {
 	},
 };
 
+static const struct piix_map_db ich8m_apple_map_db = {
+	.mask = 0x3,
+	.port_enable = 0x1,
+	.map = {
+		/* PM   PS   SM   SS       MAP */
+		{  P0,  NA,  NA,  NA }, /* 00b */
+		{  RV,  RV,  RV,  RV },
+		{  P0,  P2, IDE, IDE }, /* 10b */
+		{  RV,  RV,  RV,  RV },
+	},
+};
+
 static const struct piix_map_db tolapai_map_db = {
 	.mask = 0x3,
 	.port_enable = 0x3,
@@ -468,6 +483,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
 	[ich6m_sata_ahci]	= &ich6m_map_db,
 	[ich8_sata_ahci]	= &ich8_map_db,
 	[ich8_2port_sata]	= &ich8_2port_map_db,
+	[ich8m_apple_sata_ahci]	= &ich8m_apple_map_db,
 	[tolapai_sata_ahci]	= &tolapai_map_db,
 };
 
@@ -595,6 +611,18 @@ static struct ata_port_info piix_port_info[] = {
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &piix_sata_ops,
 	},
+
+	[ich8m_apple_sata_ahci] =
+	{
+		.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[] = {
-- 
1.5.2.4


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

* [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3
  2007-11-19  4:16 ` [PATCH] ata_piix: only enable the first port on apple macbook pro Tejun Heo
@ 2007-11-19  4:17   ` Tejun Heo
  2007-11-24  1:22     ` Jeff Garzik
  2007-11-24  1:22   ` [PATCH] ata_piix: only enable the first port on apple macbook pro Jeff Garzik
  1 sibling, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2007-11-19  4:17 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide; +Cc: tr

ICH8 and 9 use two SFF controllers to show 6 SATA ports.  The first
controllre hosts the first 4 ports while the second one hosts the last
2.  The PCS register of the first controller encompasses the first
four ports or all six ports depending on configuration while PCS of
the second controller controls the last two ports.  Using 0xf for the
first controller and 0x3 for the second controller always result in
the correct configuration.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
applied to #tj-upstream-fixes

 drivers/ata/ata_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d5ff1d8..671e796 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -430,7 +430,7 @@ static const struct piix_map_db ich6m_map_db = {
 
 static const struct piix_map_db ich8_map_db = {
 	.mask = 0x3,
-	.port_enable = 0x3,
+	.port_enable = 0xf,
 	.map = {
 		/* PM   PS   SM   SS       MAP */
 		{  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
-- 
1.5.2.4


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

* Re: [PATCH] ata_piix: reorganize controller IDs
  2007-11-19  4:14 [PATCH] ata_piix: reorganize controller IDs Tejun Heo
  2007-11-19  4:16 ` [PATCH] ata_piix: only enable the first port on apple macbook pro Tejun Heo
@ 2007-11-24  1:21 ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-11-24  1:21 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Tejun Heo wrote:
> Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
> for consistency and use automatically incremented values instead of
> assigning fixed values to ease adding new controller IDs.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> applied to #tj-upstream-fixes.
> 
>  drivers/ata/ata_piix.c |   62 ++++++++++++++++++++++++------------------------
>  1 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
> index 80b735b..77fea05 100644
> --- a/drivers/ata/ata_piix.c
> +++ b/drivers/ata/ata_piix.c
> @@ -119,18 +119,18 @@ enum {
>  	PIIX_80C_SEC		= (1 << 7) | (1 << 6),
>  
>  	/* controller IDs */
> -	piix_pata_33		= 0,	/* PIIX4 at 33Mhz */
> -	ich_pata_33		= 1,	/* ICH up to UDMA 33 only */
> -	ich_pata_66		= 2,	/* ICH up to 66 Mhz */
> -	ich_pata_100		= 3,	/* ICH up to UDMA 100 */
> -	ich5_sata		= 5,
> -	ich6_sata		= 6,
> -	ich6_sata_ahci		= 7,
> -	ich6m_sata_ahci		= 8,
> -	ich8_sata_ahci		= 9,
> -	piix_pata_mwdma		= 10,	/* PIIX3 MWDMA only */
> -	tolapai_sata_ahci	= 11,
> -	ich9_2port_sata		= 12,
> +	piix_pata_mwdma		= 0,	/* PIIX3 MWDMA only */
> +	piix_pata_33,			/* PIIX4 at 33Mhz */
> +	ich_pata_33,			/* ICH up to UDMA 33 only */
> +	ich_pata_66,			/* ICH up to 66 Mhz */
> +	ich_pata_100,			/* ICH up to UDMA 100 */
> +	ich5_sata,
> +	ich6_sata,
> +	ich6_sata_ahci,
> +	ich6m_sata_ahci,
> +	ich8_sata_ahci,
> +	ich8_2port_sata,
> +	tolapai_sata_ahci,

When using automatically filled values, please move to a separate and 
distinct enum...

ACK everything else

	Jeff




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

* Re: [PATCH] ata_piix: only enable the first port on apple macbook pro
  2007-11-19  4:16 ` [PATCH] ata_piix: only enable the first port on apple macbook pro Tejun Heo
  2007-11-19  4:17   ` [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3 Tejun Heo
@ 2007-11-24  1:22   ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-11-24  1:22 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, tr

Tejun Heo wrote:
> From: Thomas Rohwer <tr@tng.de>
> 
> ICH8M on apple macbook pro occasionally locks up completely during PCS
> initialization if ports other than the first one are enabled.  Add a
> separate controller ID and only enable the first port.
> 
> tj: commit description added and patch updated to fit with the
>     previous controller ID update.
> 
> Signed-off-by: Thomas Rohwer <tr@tng.de>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> applied to #tj-upstream-fixes

ACK



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

* Re: [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3
  2007-11-19  4:17   ` [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3 Tejun Heo
@ 2007-11-24  1:22     ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-11-24  1:22 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, tr

Tejun Heo wrote:
> ICH8 and 9 use two SFF controllers to show 6 SATA ports.  The first
> controllre hosts the first 4 ports while the second one hosts the last
> 2.  The PCS register of the first controller encompasses the first
> four ports or all six ports depending on configuration while PCS of
> the second controller controls the last two ports.  Using 0xf for the
> first controller and 0x3 for the second controller always result in
> the correct configuration.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> applied to #tj-upstream-fixes

ACK



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

end of thread, other threads:[~2007-11-24  1:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19  4:14 [PATCH] ata_piix: reorganize controller IDs Tejun Heo
2007-11-19  4:16 ` [PATCH] ata_piix: only enable the first port on apple macbook pro Tejun Heo
2007-11-19  4:17   ` [PATCH] ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3 Tejun Heo
2007-11-24  1:22     ` Jeff Garzik
2007-11-24  1:22   ` [PATCH] ata_piix: only enable the first port on apple macbook pro Jeff Garzik
2007-11-24  1:21 ` [PATCH] ata_piix: reorganize controller IDs Jeff Garzik

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