linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ATA: Add FSL sata v2 controller support
@ 2011-01-19  9:07 Xulei
  2011-01-19  9:07 ` [PATCH 2/2] dts: Update sata controller compatible for p1022ds board Xulei
  2011-03-15 15:39 ` [PATCH 1/2] ATA: Add FSL sata v2 controller support Kumar Gala
  0 siblings, 2 replies; 4+ messages in thread
From: Xulei @ 2011-01-19  9:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-ide, kumar.gala, jgarzik, Xulei

In FSL sata v2 block, the snoop bit of PRDT Word3 description
information is at bit28 instead of bit22.

This patch adds FSL sata v2 probe and resolve this difference.

Signed-off-by: Lei Xu <B33228@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
---
 drivers/ata/sata_fsl.c |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index b0214d0..01a5400 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -6,7 +6,7 @@
  * Author: Ashish Kalra <ashish.kalra@freescale.com>
  * Li Yang <leoli@freescale.com>
  *
- * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
+ * Copyright (c) 2006-2007, 2011 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -158,7 +158,8 @@ enum {
 	    IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE,
 
 	EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31),
-	DATA_SNOOP_ENABLE = (1 << 22),
+	DATA_SNOOP_ENABLE_V1 = (1 << 22),
+	DATA_SNOOP_ENABLE_V2 = (1 << 28),
 };
 
 /*
@@ -256,6 +257,7 @@ struct sata_fsl_host_priv {
 	void __iomem *ssr_base;
 	void __iomem *csr_base;
 	int irq;
+	int data_snoop;
 };
 
 static inline unsigned int sata_fsl_tag(unsigned int tag,
@@ -308,7 +310,8 @@ static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
 }
 
 static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
-				     u32 *ttl, dma_addr_t cmd_desc_paddr)
+				     u32 *ttl, dma_addr_t cmd_desc_paddr,
+				     int data_snoop)
 {
 	struct scatterlist *sg;
 	unsigned int num_prde = 0;
@@ -358,8 +361,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
 
 		ttl_dwords += sg_len;
 		prd->dba = cpu_to_le32(sg_addr);
-		prd->ddc_and_ext =
-		    cpu_to_le32(DATA_SNOOP_ENABLE | (sg_len & ~0x03));
+		prd->ddc_and_ext = cpu_to_le32(data_snoop | (sg_len & ~0x03));
 
 		VPRINTK("sg_fill, ttl=%d, dba=0x%x, ddc=0x%x\n",
 			ttl_dwords, prd->dba, prd->ddc_and_ext);
@@ -374,7 +376,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
 		/* set indirect extension flag along with indirect ext. size */
 		prd_ptr_to_indirect_ext->ddc_and_ext =
 		    cpu_to_le32((EXT_INDIRECT_SEG_PRD_FLAG |
-				 DATA_SNOOP_ENABLE |
+				 data_snoop |
 				 (indirect_ext_segment_sz & ~0x03)));
 	}
 
@@ -417,7 +419,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
 
 	if (qc->flags & ATA_QCFLAG_DMAMAP)
 		num_prde = sata_fsl_fill_sg(qc, (void *)cd,
-					    &ttl_dwords, cd_paddr);
+					    &ttl_dwords, cd_paddr,
+					    host_priv->data_snoop);
 
 	if (qc->tf.protocol == ATA_PROT_NCQ)
 		desc_info |= FPDMA_QUEUED_CMD;
@@ -1336,6 +1339,11 @@ static int sata_fsl_probe(struct platform_device *ofdev,
 	}
 	host_priv->irq = irq;
 
+	if (of_device_is_compatible(ofdev->dev.of_node, "fsl,pq-sata-v2"))
+		host_priv->data_snoop = DATA_SNOOP_ENABLE_V2;
+	else
+		host_priv->data_snoop = DATA_SNOOP_ENABLE_V1;
+
 	/* allocate host structure */
 	host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
 
@@ -1418,6 +1426,9 @@ static struct of_device_id fsl_sata_match[] = {
 	{
 		.compatible = "fsl,pq-sata",
 	},
+	{
+		.compatible = "fsl,pq-sata-v2",
+	},
 	{},
 };
 
-- 
1.7.0.4

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

* [PATCH 2/2] dts: Update sata controller compatible for p1022ds board
  2011-01-19  9:07 [PATCH 1/2] ATA: Add FSL sata v2 controller support Xulei
@ 2011-01-19  9:07 ` Xulei
  2011-03-15 15:39   ` Kumar Gala
  2011-03-15 15:39 ` [PATCH 1/2] ATA: Add FSL sata v2 controller support Kumar Gala
  1 sibling, 1 reply; 4+ messages in thread
From: Xulei @ 2011-01-19  9:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-ide, kumar.gala, jgarzik, Xulei

Update p1022 sata compatible to "fsl,p1022-sata", "fsl,pq-sata-v2".
p1022ds sata controller is v2 version comparing previous FSL sata
controller, for example, mpc8536.

Signed-off-by: Lei Xu <B33228@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 arch/powerpc/boot/dts/p1022ds.dts |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts
index 2bbecbb..9ad41dd 100644
--- a/arch/powerpc/boot/dts/p1022ds.dts
+++ b/arch/powerpc/boot/dts/p1022ds.dts
@@ -475,14 +475,14 @@
 		};
 
 		sata@18000 {
-			compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
+			compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
 			reg = <0x18000 0x1000>;
 			cell-index = <1>;
 			interrupts = <74 0x2>;
 		};
 
 		sata@19000 {
-			compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
+			compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
 			reg = <0x19000 0x1000>;
 			cell-index = <2>;
 			interrupts = <41 0x2>;
-- 
1.7.0.4

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

* Re: [PATCH 1/2] ATA: Add FSL sata v2 controller support
  2011-01-19  9:07 [PATCH 1/2] ATA: Add FSL sata v2 controller support Xulei
  2011-01-19  9:07 ` [PATCH 2/2] dts: Update sata controller compatible for p1022ds board Xulei
@ 2011-03-15 15:39 ` Kumar Gala
  1 sibling, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2011-03-15 15:39 UTC (permalink / raw)
  To: Xulei; +Cc: linux-ide, linuxppc-dev, jgarzik


On Jan 19, 2011, at 3:07 AM, Xulei wrote:

> In FSL sata v2 block, the snoop bit of PRDT Word3 description
> information is at bit28 instead of bit22.
> 
> This patch adds FSL sata v2 probe and resolve this difference.
> 
> Signed-off-by: Lei Xu <B33228@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> Acked-by: Jeff Garzik <jgarzik@redhat.com>
> ---
> drivers/ata/sata_fsl.c |   25 ++++++++++++++++++-------
> 1 files changed, 18 insertions(+), 7 deletions(-)

applied

- k

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

* Re: [PATCH 2/2] dts: Update sata controller compatible for p1022ds board
  2011-01-19  9:07 ` [PATCH 2/2] dts: Update sata controller compatible for p1022ds board Xulei
@ 2011-03-15 15:39   ` Kumar Gala
  0 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2011-03-15 15:39 UTC (permalink / raw)
  To: Xulei; +Cc: linux-ide, linuxppc-dev, jgarzik


On Jan 19, 2011, at 3:07 AM, Xulei wrote:

> Update p1022 sata compatible to "fsl,p1022-sata", "fsl,pq-sata-v2".
> p1022ds sata controller is v2 version comparing previous FSL sata
> controller, for example, mpc8536.
> 
> Signed-off-by: Lei Xu <B33228@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> arch/powerpc/boot/dts/p1022ds.dts |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)

applied

- k

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

end of thread, other threads:[~2011-03-15 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19  9:07 [PATCH 1/2] ATA: Add FSL sata v2 controller support Xulei
2011-01-19  9:07 ` [PATCH 2/2] dts: Update sata controller compatible for p1022ds board Xulei
2011-03-15 15:39   ` Kumar Gala
2011-03-15 15:39 ` [PATCH 1/2] ATA: Add FSL sata v2 controller support Kumar Gala

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