diff mbox

ATA: Add FSL sata v2 controller support

Message ID 1295248259-14752-1-git-send-email-B33228@freescale.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Xulei Jan. 17, 2011, 7:10 a.m. UTC
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: Xulei <B33228@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 arch/powerpc/boot/dts/p1022ds.dts |    4 ++--
 drivers/ata/sata_fsl.c            |   24 ++++++++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)

Comments

Sergei Shtylyov Jan. 17, 2011, 11:47 a.m. UTC | #1
Hello.

On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>

    AFAIK, full name is required.

> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
[...]

> 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>;

    Please put this into the separate patch and push thru the PPC tree.

> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index b0214d0..a56399a 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
[...]
> @@ -417,7 +420,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);

    Please align these lines uniformly.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Aggrwal Poonam-B10812 Jan. 17, 2011, 11:58 a.m. UTC | #2
> -----Original Message-----
> From: linuxppc-dev-bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org
> [mailto:linuxppc-dev-
> bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org] On Behalf Of
> Sergei Shtylyov
> Sent: Monday, January 17, 2011 5:18 PM
> To: Xu Lei-B33228
> Cc: jgarzik@pobox.com; Gala Kumar-B11780; linuxppc-dev@lists.ozlabs.org;
> linux-ide@vger.kernel.org
> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
> 
> Hello.
> 
> On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>
> 
>     AFAIK, full name is required.
> 
> > Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> [...]
> 
> > 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";

Can we fix this compatibity at run time by u-boot?

> >   			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>;
> 
>     Please put this into the separate patch and push thru the PPC tree.
> 
> > diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index
> > b0214d0..a56399a 100644
> > --- a/drivers/ata/sata_fsl.c
> > +++ b/drivers/ata/sata_fsl.c
> [...]
> > @@ -417,7 +420,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);
> 
>     Please align these lines uniformly.
> 
> WBR, Sergei
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gala Jan. 17, 2011, 2:57 p.m. UTC | #3
On Jan 17, 2011, at 5:58 AM, Aggrwal Poonam-B10812 wrote:

> 
> 
>> -----Original Message-----
>> From: linuxppc-dev-bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org
>> [mailto:linuxppc-dev-
>> bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org] On Behalf Of
>> Sergei Shtylyov
>> Sent: Monday, January 17, 2011 5:18 PM
>> To: Xu Lei-B33228
>> Cc: jgarzik@pobox.com; Gala Kumar-B11780; linuxppc-dev@lists.ozlabs.org;
>> linux-ide@vger.kernel.org
>> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
>> 
>> Hello.
>> 
>> On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>
>> 
>>    AFAIK, full name is required.
>> 
>>> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>> [...]
>> 
>>> 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";
> 
> Can we fix this compatibity at run time by u-boot?

We can, but its not reason not to update the .dts as well.

- k

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zang Roy-R61911 Jan. 18, 2011, 3:01 a.m. UTC | #4
> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov@mvista.com]
> Sent: Monday, January 17, 2011 19:48 PM
> To: Xu Lei-B33228
> Cc: linuxppc-dev@lists.ozlabs.org; Gala Kumar-B11780; jgarzik@pobox.com;
> linux-ide@vger.kernel.org; Zang Roy-R61911
> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
> 
> Hello.
> 
> On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>
> 
[snip]

> > 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>;
> 
>     Please put this into the separate patch and push thru the PPC tree.
I agree to put to them to separate patches, but should we 
pull in the separate patches to one candidate tree to make
the function work?
Thanks.
Roy

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Jan. 18, 2011, 11:27 a.m. UTC | #5
Hello.

On 18-01-2011 6:01, Zang Roy-R61911 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: Xulei<B33228@freescale.com>

> [snip]

>>> 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>;

>>      Please put this into the separate patch and push thru the PPC tree.

> I agree to put to them to separate patches, but should we
> pull in the separate patches to one candidate tree to make
> the function work?

    I don't understand. What is "candidate tree"?

> Thanks.
> Roy

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zang Roy-R61911 Jan. 18, 2011, 11:43 a.m. UTC | #6
> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov@mvista.com]
> Sent: Tuesday, January 18, 2011 19:27 PM
> To: Zang Roy-R61911
> Cc: Sergei Shtylyov; Xu Lei-B33228; linuxppc-dev@lists.ozlabs.org; Gala Kumar-
> B11780; jgarzik@pobox.com; linux-ide@vger.kernel.org
> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
> 
> Hello.
> 
> On 18-01-2011 6:01, Zang Roy-R61911 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: Xulei<B33228@freescale.com>
> 
> > [snip]
> 
> >>> 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>;
> 
> >>      Please put this into the separate patch and push thru the PPC tree.
> 
> > I agree to put to them to separate patches, but should we
> > pull in the separate patches to one candidate tree to make
> > the function work?
> 
>     I don't understand. What is "candidate tree"?

Powerpc or ide git repository for upstream to mainline.
It is odd that patches for one function in different trees.
Thanks.
Roy

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Jan. 18, 2011, 12:33 p.m. UTC | #7
Hello.

On 18-01-2011 14:43, Zang Roy-R61911 wrote:

>> On 18-01-2011 6:01, Zang Roy-R61911 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: Xulei<B33228@freescale.com>

>>> [snip]

>>>>> 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>;

>>>>       Please put this into the separate patch and push thru the PPC tree.

>>> I agree to put to them to separate patches, but should we
>>> pull in the separate patches to one candidate tree to make
>>> the function work?

>>      I don't understand. What is "candidate tree"?

> Powerpc or ide git repository for upstream to mainline.

    s/ide/libata/

> It is odd that patches for one function in different trees.

    The libata tree doesn't need to be concerned with PPC board specific 
device trees. Although it's up to the maintainer... just cross post the patch, 
and let the corresponding maintainers fogure it out.

> Thanks.
> Roy

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Garzik Jan. 19, 2011, 1:10 a.m. UTC | #8
On 01/17/2011 06:47 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>
>
> AFAIK, full name is required.
>
>> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> [...]
>
>> 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>;
>
> Please put this into the separate patch and push thru the PPC tree.

I think it's OK to send 100% of this via the PPC tree.  The sata_fsl.c 
patch for data_snoop variability directly keys off a call to 
platform-specific detail (of_device_is_compatible call).

Acked-by: Jeff Garzik <jgarzik@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kumar Gala Jan. 19, 2011, 5:23 a.m. UTC | #9
On Jan 18, 2011, at 7:10 PM, Jeff Garzik wrote:

> On 01/17/2011 06:47 AM, Sergei Shtylyov wrote:
>> Hello.
>> 
>> On 17-01-2011 10:10, 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: Xulei <B33228@freescale.com>
>> 
>> AFAIK, full name is required.
>> 
>>> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>> [...]
>> 
>>> 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>;
>> 
>> Please put this into the separate patch and push thru the PPC tree.
> 
> I think it's OK to send 100% of this via the PPC tree.  The sata_fsl.c patch for data_snoop variability directly keys off a call to platform-specific detail (of_device_is_compatible call).
> 
> Acked-by: Jeff Garzik <jgarzik@redhat.com>

With Jeff's ack I'll pull this in via the powerpc tree's.

Can we make the minor updates that Sergei has commented on.

- k
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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>;
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index b0214d0..a56399a 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;
@@ -359,7 +362,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));
+			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 +377,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 +420,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 +1340,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 +1427,9 @@  static struct of_device_id fsl_sata_match[] = {
 	{
 		.compatible = "fsl,pq-sata",
 	},
+	{
+		.compatible = "fsl,pq-sata-v2",
+	},
 	{},
 };