2017-09-22 02:04:42

by Kalyan Kinthada

[permalink] [raw]
Subject: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

All armada-38x variants(380, 385, 388) SoCs have an issue
in i2c controller which violates the i2c repeated start timing.

This errata is fixed in the i2c-mv64xxx driver but enabled
only for devices with compatible string "marvell,mv78230-i2c".

This patch introduces a new compatible string
"marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
so that the workaound is enabled.

Signed-off-by: Kalyan Kinthada <[email protected]>
---
Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
index 5c30026921..fc100b6bdb 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
@@ -14,6 +14,7 @@ Required properties :
very rare, initial version of the SoC which
had broken offload support. Linux
auto-detects this and sets it appropriately.
+ - "marvell,armada-38x-i2c"
- interrupts : The interrupt number

Optional properties :
--
2.14.1


2017-09-22 07:30:54

by Gregory CLEMENT

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Kalyan,

On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:

> All armada-38x variants(380, 385, 388) SoCs have an issue
> in i2c controller which violates the i2c repeated start timing.


Did you had an issue with one of the SoC ?
If yes what was your setting ?
On my side I never managed to have this sort of issue on Armada 38x.

>
> This errata is fixed in the i2c-mv64xxx driver but enabled
> only for devices with compatible string "marvell,mv78230-i2c".

In this case why not just adding the "marvell,mv78230-i2c" as compatible
string in the appropriate device tree files ?

Gregory

>
> This patch introduces a new compatible string
> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
> so that the workaound is enabled.


>
> Signed-off-by: Kalyan Kinthada <[email protected]>
> ---
> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> index 5c30026921..fc100b6bdb 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> @@ -14,6 +14,7 @@ Required properties :
> very rare, initial version of the SoC which
> had broken offload support. Linux
> auto-detects this and sets it appropriately.
> + - "marvell,armada-38x-i2c"
> - interrupts : The interrupt number
>
> Optional properties :
> --
> 2.14.1
>

--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

2017-09-24 21:44:30

by Kalyan Kinthada

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Gregory,

I got this information from Armada-38x functional errata document.

I can add the "marvell,mv78230-i2c" compatible string to the appropriate device tree files
but the i2c-mv64xxx driver enables an additional feature (offload i2c transactions)
based on the compatible string "marvell,mv78230-i2c".

I am not sure if this feature (offload i2c transactions) should be enabled for Armada-38x devices.
That is the reason I felt for the need of a new compatible string specifically for Armada-38x SoCs.

Thanks,
Kalyan
________________________________________
From: Gregory CLEMENT <[email protected]>
Sent: Friday, 22 September 2017 7:30 p.m.
To: Kalyan Kinthada
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Chris Packham
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Kalyan,

On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:

> All armada-38x variants(380, 385, 388) SoCs have an issue
> in i2c controller which violates the i2c repeated start timing.


Did you had an issue with one of the SoC ?
If yes what was your setting ?
On my side I never managed to have this sort of issue on Armada 38x.

>
> This errata is fixed in the i2c-mv64xxx driver but enabled
> only for devices with compatible string "marvell,mv78230-i2c".

In this case why not just adding the "marvell,mv78230-i2c" as compatible
string in the appropriate device tree files ?

Gregory

>
> This patch introduces a new compatible string
> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
> so that the workaound is enabled.


>
> Signed-off-by: Kalyan Kinthada <[email protected]>
> ---
> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> index 5c30026921..fc100b6bdb 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
> @@ -14,6 +14,7 @@ Required properties :
> very rare, initial version of the SoC which
> had broken offload support. Linux
> auto-detects this and sets it appropriately.
> + - "marvell,armada-38x-i2c"
> - interrupts : The interrupt number
>
> Optional properties :
> --
> 2.14.1
>

--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

2017-09-26 11:55:55

by Gregory CLEMENT

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Kalyan,

Please try avoid top-posting.

On dim., sept. 24 2017, Kalyan Kinthada <[email protected]> wrote:

> Hi Gregory,
>
> I got this information from Armada-38x functional errata document.

OK but in any case just adding a new compatible was not enough you have
to update the driver in the same time, however for this case we won't
need it, see below.

>
> I can add the "marvell,mv78230-i2c" compatible string to the appropriate device tree files
> but the i2c-mv64xxx driver enables an additional feature (offload i2c transactions)
> based on the compatible string "marvell,mv78230-i2c".
>
> I am not sure if this feature (offload i2c transactions) should be enabled for Armada-38x devices.
> That is the reason I felt for the need of a new compatible string
> specifically for Armada-38x SoCs.

Indeed the Armada-38x SoCs does not support hardware offloading (at
least according the datasheet). But it happens that in the earlier
version of the Armada XP the hardware offloading was buggy, so we
introduced a compatible for this case: marvell,mv78230-a0-i2c. This
compatible enable the errata fix but not the offloading feature. That
means that it is exactly the compatible you need for Armada 38x (and
Armada 39x and 375 I think).

Gregory

>
> Thanks,
> Kalyan
> ________________________________________
> From: Gregory CLEMENT <[email protected]>
> Sent: Friday, 22 September 2017 7:30 p.m.
> To: Kalyan Kinthada
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; Chris Packham
> Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding
>
> Hi Kalyan,
>
> On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:
>
>> All armada-38x variants(380, 385, 388) SoCs have an issue
>> in i2c controller which violates the i2c repeated start timing.
>
>
> Did you had an issue with one of the SoC ?
> If yes what was your setting ?
> On my side I never managed to have this sort of issue on Armada 38x.
>
>>
>> This errata is fixed in the i2c-mv64xxx driver but enabled
>> only for devices with compatible string "marvell,mv78230-i2c".
>
> In this case why not just adding the "marvell,mv78230-i2c" as compatible
> string in the appropriate device tree files ?
>
> Gregory
>
>>
>> This patch introduces a new compatible string
>> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
>> so that the workaound is enabled.
>
>
>>
>> Signed-off-by: Kalyan Kinthada <[email protected]>
>> ---
>> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>> index 5c30026921..fc100b6bdb 100644
>> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>> @@ -14,6 +14,7 @@ Required properties :
>> very rare, initial version of the SoC which
>> had broken offload support. Linux
>> auto-detects this and sets it appropriately.
>> + - "marvell,armada-38x-i2c"
>> - interrupts : The interrupt number
>>
>> Optional properties :
>> --
>> 2.14.1
>>
>
> --
> Gregory Clement, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

2017-09-26 23:10:38

by Kalyan Kinthada

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

On 27/09/17 00:55, Gregory CLEMENT wrote:
> Hi Kalyan,
>
> Please try avoid top-posting.
I am sorry. Fixed it now.
>
> On dim., sept. 24 2017, Kalyan Kinthada <[email protected]> wrote:
>
>> Hi Gregory,
>>
>> I got this information from Armada-38x functional errata document.
> OK but in any case just adding a new compatible was not enough you have
> to update the driver in the same time, however for this case we won't
> need it, see below.
>
>> I can add the "marvell,mv78230-i2c" compatible string to the appropriate device tree files
>> but the i2c-mv64xxx driver enables an additional feature (offload i2c transactions)
>> based on the compatible string "marvell,mv78230-i2c".
>>
>> I am not sure if this feature (offload i2c transactions) should be enabled for Armada-38x devices.
>> That is the reason I felt for the need of a new compatible string
>> specifically for Armada-38x SoCs.
> Indeed the Armada-38x SoCs does not support hardware offloading (at
> least according the datasheet). But it happens that in the earlier
> version of the Armada XP the hardware offloading was buggy, so we
> introduced a compatible for this case: marvell,mv78230-a0-i2c. This
> compatible enable the errata fix but not the offloading feature. That
> means that it is exactly the compatible you need for Armada 38x (and
> Armada 39x and 375 I think).

Ok. I will add "marvell,mv78230-a0-i2c" to the Armada-38x
device tree file. I will send a new patch with these changes.

Thanks for your time.

Regards,
Kalyan
>
> Gregory
>
>> Thanks,
>> Kalyan
>> ________________________________________
>> From: Gregory CLEMENT <[email protected]>
>> Sent: Friday, 22 September 2017 7:30 p.m.
>> To: Kalyan Kinthada
>> Cc: [email protected]; [email protected]; [email protected];
>> [email protected]; [email protected];
>> [email protected]; [email protected];
>> [email protected]; [email protected]; Chris Packham
>> Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding
>>
>> Hi Kalyan,
>>
>> On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:
>>
>>> All armada-38x variants(380, 385, 388) SoCs have an issue
>>> in i2c controller which violates the i2c repeated start timing.
>>
>> Did you had an issue with one of the SoC ?
>> If yes what was your setting ?
>> On my side I never managed to have this sort of issue on Armada 38x.
>>
>>> This errata is fixed in the i2c-mv64xxx driver but enabled
>>> only for devices with compatible string "marvell,mv78230-i2c".
>> In this case why not just adding the "marvell,mv78230-i2c" as compatible
>> string in the appropriate device tree files ?
>>
>> Gregory
>>
>>> This patch introduces a new compatible string
>>> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
>>> so that the workaound is enabled.
>>
>>> Signed-off-by: Kalyan Kinthada <[email protected]>
>>> ---
>>> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> index 5c30026921..fc100b6bdb 100644
>>> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> @@ -14,6 +14,7 @@ Required properties :
>>> very rare, initial version of the SoC which
>>> had broken offload support. Linux
>>> auto-detects this and sets it appropriately.
>>> + - "marvell,armada-38x-i2c"
>>> - interrupts : The interrupt number
>>>
>>> Optional properties :
>>> --
>>> 2.14.1
>>>
>> --
>> Gregory Clement, Free Electrons
>> Kernel, drivers, real-time and embedded Linux
>> development, consulting, training and support.
>> http://free-electrons.com


2017-09-27 01:15:24

by Chris Packham

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Gregory,

On 27/09/17 00:56, Gregory CLEMENT wrote:
> Hi Kalyan,
>
> Please try avoid top-posting.
>
> On dim., sept. 24 2017, Kalyan Kinthada <[email protected]> wrote:
>
>> Hi Gregory,
>>
>> I got this information from Armada-38x functional errata document.
>
> OK but in any case just adding a new compatible was not enough you have
> to update the driver in the same time, however for this case we won't
> need it, see below.
>
>>
>> I can add the "marvell,mv78230-i2c" compatible string to the appropriate device tree files
>> but the i2c-mv64xxx driver enables an additional feature (offload i2c transactions)
>> based on the compatible string "marvell,mv78230-i2c".
>>
>> I am not sure if this feature (offload i2c transactions) should be enabled for Armada-38x devices.
>> That is the reason I felt for the need of a new compatible string
>> specifically for Armada-38x SoCs.
>
> Indeed the Armada-38x SoCs does not support hardware offloading (at
> least according the datasheet). But it happens that in the earlier
> version of the Armada XP the hardware offloading was buggy, so we
> introduced a compatible for this case: marvell,mv78230-a0-i2c. This
> compatible enable the errata fix but not the offloading feature. That
> means that it is exactly the compatible you need for Armada 38x (and
> Armada 39x and 375 I think).

The "mv78230-a0-i2c" dt-binding has the following note

Note: Only use "marvell,mv78230-a0-i2c" for a
very rare, initial version of the SoC which
had broken offload support. Linux
auto-detects this and sets it appropriately.

If we are going to re-use this binding for armada-38x we should probably
remove this note. Personally my preference would be an armada-38x
compatible string (or 370 if that's the common base of these SoCs). But
of course we'll go with whatever your preference is as maintainer.

>
> Gregory
>
>>
>> Thanks,
>> Kalyan
>> ________________________________________
>> From: Gregory CLEMENT <[email protected]>
>> Sent: Friday, 22 September 2017 7:30 p.m.
>> To: Kalyan Kinthada
>> Cc: [email protected]; [email protected]; [email protected];
>> [email protected]; [email protected];
>> [email protected]; [email protected];
>> [email protected]; [email protected]; Chris Packham
>> Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding
>>
>> Hi Kalyan,
>>
>> On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:
>>
>>> All armada-38x variants(380, 385, 388) SoCs have an issue
>>> in i2c controller which violates the i2c repeated start timing.
>>
>>
>> Did you had an issue with one of the SoC ?
>> If yes what was your setting ?
>> On my side I never managed to have this sort of issue on Armada 38x.
>>
>>>
>>> This errata is fixed in the i2c-mv64xxx driver but enabled
>>> only for devices with compatible string "marvell,mv78230-i2c".
>>
>> In this case why not just adding the "marvell,mv78230-i2c" as compatible
>> string in the appropriate device tree files ?
>>
>> Gregory
>>
>>>
>>> This patch introduces a new compatible string
>>> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
>>> so that the workaound is enabled.
>>
>>
>>>
>>> Signed-off-by: Kalyan Kinthada <[email protected]>
>>> ---
>>> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> index 5c30026921..fc100b6bdb 100644
>>> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>> @@ -14,6 +14,7 @@ Required properties :
>>> very rare, initial version of the SoC which
>>> had broken offload support. Linux
>>> auto-detects this and sets it appropriately.
>>> + - "marvell,armada-38x-i2c"
>>> - interrupts : The interrupt number
>>>
>>> Optional properties :
>>> --
>>> 2.14.1
>>>
>>
>> --
>> Gregory Clement, Free Electrons
>> Kernel, drivers, real-time and embedded Linux
>> development, consulting, training and support.
>> http://free-electrons.com
>


2017-09-27 07:33:14

by Gregory CLEMENT

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding

Hi Chris,

On mer., sept. 27 2017, Chris Packham <[email protected]> wrote:

> Hi Gregory,
>
> On 27/09/17 00:56, Gregory CLEMENT wrote:
>> Hi Kalyan,
>>
>> Please try avoid top-posting.
>>
>> On dim., sept. 24 2017, Kalyan Kinthada <[email protected]> wrote:
>>
>>> Hi Gregory,
>>>
>>> I got this information from Armada-38x functional errata document.
>>
>> OK but in any case just adding a new compatible was not enough you have
>> to update the driver in the same time, however for this case we won't
>> need it, see below.
>>
>>>
>>> I can add the "marvell,mv78230-i2c" compatible string to the appropriate device tree files
>>> but the i2c-mv64xxx driver enables an additional feature (offload i2c transactions)
>>> based on the compatible string "marvell,mv78230-i2c".
>>>
>>> I am not sure if this feature (offload i2c transactions) should be enabled for Armada-38x devices.
>>> That is the reason I felt for the need of a new compatible string
>>> specifically for Armada-38x SoCs.
>>
>> Indeed the Armada-38x SoCs does not support hardware offloading (at
>> least according the datasheet). But it happens that in the earlier
>> version of the Armada XP the hardware offloading was buggy, so we
>> introduced a compatible for this case: marvell,mv78230-a0-i2c. This
>> compatible enable the errata fix but not the offloading feature. That
>> means that it is exactly the compatible you need for Armada 38x (and
>> Armada 39x and 375 I think).
>
> The "mv78230-a0-i2c" dt-binding has the following note
>
> Note: Only use "marvell,mv78230-a0-i2c" for a
> very rare, initial version of the SoC which
> had broken offload support. Linux
> auto-detects this and sets it appropriately.
>
> If we are going to re-use this binding for armada-38x we should probably
> remove this note. Personally my preference would be an armada-38x

Updating the documentation is the right thing to do yes.


> compatible string (or 370 if that's the common base of these SoCs). But
> of course we'll go with whatever your preference is as maintainer.

If the IP is compatible then there is no reason to add a new one, else
we will end with a compatible for each SoC and the compatible property
will just loose its meaning.

But an other reason to reuse "marvell,mv78230-a0-i2c" is that thanks to
this you will benefit to this even with the old kernel by just updating
the device tree, else you will have to update both the kernel and the
dtb.


Gregory

>
>>
>> Gregory
>>
>>>
>>> Thanks,
>>> Kalyan
>>> ________________________________________
>>> From: Gregory CLEMENT <[email protected]>
>>> Sent: Friday, 22 September 2017 7:30 p.m.
>>> To: Kalyan Kinthada
>>> Cc: [email protected]; [email protected]; [email protected];
>>> [email protected]; [email protected];
>>> [email protected]; [email protected];
>>> [email protected]; [email protected]; Chris Packham
>>> Subject: Re: [PATCH] dt-bindings: i2c: Add armada-38x i2c binding
>>>
>>> Hi Kalyan,
>>>
>>> On ven., sept. 22 2017, Kalyan Kinthada <[email protected]> wrote:
>>>
>>>> All armada-38x variants(380, 385, 388) SoCs have an issue
>>>> in i2c controller which violates the i2c repeated start timing.
>>>
>>>
>>> Did you had an issue with one of the SoC ?
>>> If yes what was your setting ?
>>> On my side I never managed to have this sort of issue on Armada 38x.
>>>
>>>>
>>>> This errata is fixed in the i2c-mv64xxx driver but enabled
>>>> only for devices with compatible string "marvell,mv78230-i2c".
>>>
>>> In this case why not just adding the "marvell,mv78230-i2c" as compatible
>>> string in the appropriate device tree files ?
>>>
>>> Gregory
>>>
>>>>
>>>> This patch introduces a new compatible string
>>>> "marvell,armada-38x-i2c" for the i2c controller on armada-38x SoCs
>>>> so that the workaound is enabled.
>>>
>>>
>>>>
>>>> Signed-off-by: Kalyan Kinthada <[email protected]>
>>>> ---
>>>> Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>>> index 5c30026921..fc100b6bdb 100644
>>>> --- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
>>>> @@ -14,6 +14,7 @@ Required properties :
>>>> very rare, initial version of the SoC which
>>>> had broken offload support. Linux
>>>> auto-detects this and sets it appropriately.
>>>> + - "marvell,armada-38x-i2c"
>>>> - interrupts : The interrupt number
>>>>
>>>> Optional properties :
>>>> --
>>>> 2.14.1
>>>>
>>>
>>> --
>>> Gregory Clement, Free Electrons
>>> Kernel, drivers, real-time and embedded Linux
>>> development, consulting, training and support.
>>> http://free-electrons.com
>>
>

--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com