mbox series

[v2,0/6] can: mcan: Add MCAN support for FSD SoC

Message ID 20221109100928.109478-1-vivek.2311@samsung.com
Headers show
Series can: mcan: Add MCAN support for FSD SoC | expand

Message

Vivek Yadav Nov. 9, 2022, 10:09 a.m. UTC
Add support for MCAN instances present on the FSD platform.
Also add support for handling error correction code (ECC) for MCAN message
RAM.

Sriranjani P (2):
  dt-bindings: Document the SYSREG specific compatibles found on FSD SoC
  arm64: dts: fsd: add sysreg device node

Vivek Yadav (4):
  dt-bindings: can: mcan: Add ECC functionality to message ram
  arm64: dts: fsd: Add MCAN device node
  can: m_can: Add ECC functionality for message RAM
  arm64: dts: fsd: Add support for error correction code for message RAM

 .../devicetree/bindings/arm/tesla-sysreg.yaml | 50 +++++++++++
 .../bindings/net/can/bosch,m_can.yaml         | 31 +++++++
 MAINTAINERS                                   |  1 +
 arch/arm64/boot/dts/tesla/fsd-evb.dts         | 16 ++++
 arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi    | 28 +++++++
 arch/arm64/boot/dts/tesla/fsd.dtsi            | 82 +++++++++++++++++++
 drivers/net/can/m_can/m_can.c                 | 48 ++++++++++-
 drivers/net/can/m_can/m_can.h                 | 17 ++++
 drivers/net/can/m_can/m_can_platform.c        | 76 ++++++++++++++++-
 9 files changed, 343 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/tesla-sysreg.yaml

Comments

Krzysztof Kozlowski Nov. 9, 2022, 11:08 a.m. UTC | #1
On 09/11/2022 11:09, Vivek Yadav wrote:
> From: Sriranjani P <sriranjani.p@samsung.com>
> 

Use subject prefixes matching the subsystem (git log --oneline -- ...).

> Describe the compatible properties for SYSREG controllers found on
> FSD SoC.

This is ARM SoC patch, split it from the patchset.

> 
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Signed-off-by: Pankaj Kumar Dubey <pankaj.dubey@samsung.com>
> Signed-off-by: Ravi Patel <ravi.patel@samsung.com>
> Signed-off-by: Vivek Yadav <vivek.2311@samsung.com>
> Cc: devicetree@vger.kernel.org
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>

Drop the Cc list from commit log. It's not helpful.

> Signed-off-by: Sriranjani P <sriranjani.p@samsung.com>
> ---
>  .../devicetree/bindings/arm/tesla-sysreg.yaml | 50 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> 
> diff --git a/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> new file mode 100644
> index 000000000000..bbcc6dd75918
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml

arm is only for top level stuff. This goes to soc under tesla or samsung
directory.

> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/tesla-sysreg.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Tesla Full Self-Driving platform's system registers
> +
> +maintainers:
> +  - Alim Akhtar <alim.akhtar@samsung.com>
> +
> +description: |
> +  This is a system control registers block, providing multiple low level
> +  platform functions like board detection and identification, software
> +  interrupt generation.
> +
> +properties:
> +  compatible:
> +    oneOf:

No need for oneOf.

> +      - items:
> +          - enum:
> +              - tesla,sysreg_fsys0
> +              - tesla,sysreg_peric
Vivek Yadav Nov. 10, 2022, 11:18 a.m. UTC | #2
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: 09 November 2022 16:39
> To: Vivek Yadav <vivek.2311@samsung.com>; rcsekar@samsung.com;
> krzysztof.kozlowski+dt@linaro.org; wg@grandegger.com;
> mkl@pengutronix.de; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; pankaj.dubey@samsung.com;
> ravi.patel@samsung.com; alim.akhtar@samsung.com; linux-fsd@tesla.com;
> robh+dt@kernel.org
> Cc: linux-can@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> samsung-soc@vger.kernel.org; devicetree@vger.kernel.org;
> aswani.reddy@samsung.com; sriranjani.p@samsung.com
> Subject: Re: [PATCH v2 1/6] dt-bindings: Document the SYSREG specific
> compatibles found on FSD SoC
> 
> On 09/11/2022 11:09, Vivek Yadav wrote:
> > From: Sriranjani P <sriranjani.p@samsung.com>
> >
> 
> Use subject prefixes matching the subsystem (git log --oneline -- ...).
> 
Okay, I will add the correct prefixes.
> > Describe the compatible properties for SYSREG controllers found on FSD
> > SoC.
> 
> This is ARM SoC patch, split it from the patchset.
>
I understand this patch is not to be subset of CAN patches, I will send these patches separately.
These patches will be used by EQos patches. As per reference, I am adding the Address link.
https://lore.kernel.org/all/20221104120517.77980-1-sriranjani.p@samsung.com/
 
> >
> > Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> > Signed-off-by: Pankaj Kumar Dubey <pankaj.dubey@samsung.com>
> > Signed-off-by: Ravi Patel <ravi.patel@samsung.com>
> > Signed-off-by: Vivek Yadav <vivek.2311@samsung.com>
> > Cc: devicetree@vger.kernel.org
> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> > Cc: Rob Herring <robh+dt@kernel.org>
> 
> Drop the Cc list from commit log. It's not helpful.
> 
Okay, I will remove.
> > Signed-off-by: Sriranjani P <sriranjani.p@samsung.com>
> > ---
> >  .../devicetree/bindings/arm/tesla-sysreg.yaml | 50
> +++++++++++++++++++
> >  MAINTAINERS                                   |  1 +
> >  2 files changed, 51 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > new file mode 100644
> > index 000000000000..bbcc6dd75918
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> 
> arm is only for top level stuff. This goes to soc under tesla or samsung
> directory.
> 
Okay, this is specific to Samsung fsd SoC, I will be moving this file to arm/samsung in next patch series. Hope that is fine.
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2
> > +---
> > +$id:
> > +https://protect2.fireeye.com/v1/url?k=1ad2834a-7b59967c-1ad30805-
> 000b
> > +abff9b5d-1f65584e412e916c&q=1&e=a870a282-632a-4896-ae53-
> 3ecb50f02be5&
> > +u=http%3A%2F%2Fdevicetree.org%2Fschemas%2Farm%2Ftesla-
> sysreg.yaml%23
> > +$schema:
> > +https://protect2.fireeye.com/v1/url?k=13876e33-720c7b05-1386e57c-
> 000b
> > +abff9b5d-edae3ff711999305&q=1&e=a870a282-632a-4896-ae53-
> 3ecb50f02be5&
> > +u=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23
> > +
> > +title: Tesla Full Self-Driving platform's system registers
> > +
> > +maintainers:
> > +  - Alim Akhtar <alim.akhtar@samsung.com>
> > +
> > +description: |
> > +  This is a system control registers block, providing multiple low
> > +level
> > +  platform functions like board detection and identification,
> > +software
> > +  interrupt generation.
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> 
> No need for oneOf.
> 
Removing this results into dt_binding_check error, so this is required.
> > +      - items:
> > +          - enum:
> > +              - tesla,sysreg_fsys0
> > +              - tesla,sysreg_peric
> 
> From where did you get underscores in compatibles?
> 
I have seen in MCAN Driver <drivers/net/can/m_can/m_can_platform.c> and also too many other yaml files.
Do you have any ref standard guideline of compatible which says underscore is not allowed.
> > +          - const: syscon
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    soc {
> > +      #address-cells = <2>;
> > +      #size-cells = <2>;
> > +
> > +      sysreg_fsys0: system-controller@15030000 {
> > +            compatible = "tesla,sysreg_fsys0", "syscon";
> 
> Use 4 spaces for example indentation.
> 
Okay I will make it 4 spaces indentation.
> > +            reg = <0x0 0x15030000 0x0 0x1000>;
> > +      };
> > +
> > +      sysreg_peric: system-controller@14030000 {
> > +            compatible = "tesla,sysreg_peric", "syscon";
> > +            reg = <0x0 0x14030000 0x0 0x1000>;
> > +      };
> 
> One example is enough, they are the same.
kay  I will remove 1 example.
> > +    };
> > diff --git a/MAINTAINERS b/MAINTAINERS index
> > a198da986146..56995e7d63ad 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -2943,6 +2943,7 @@ M:	linux-fsd@tesla.com
> >  L:	linux-arm-kernel@lists.infradead.org (moderated for non-
> subscribers)
> >  L:	linux-samsung-soc@vger.kernel.org
> >  S:	Maintained
> > +F:	Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> >  F:	arch/arm64/boot/dts/tesla*
> >
> >  ARM/TETON BGA MACHINE SUPPORT
> 
> Best regards,
> Krzysztof

Thanks for reviewing the patches.
Krzysztof Kozlowski Nov. 10, 2022, 12:11 p.m. UTC | #3
On 10/11/2022 12:18, Vivek Yadav wrote:
>>> +maintainers:
>>> +  - Alim Akhtar <alim.akhtar@samsung.com>
>>> +
>>> +description: |
>>> +  This is a system control registers block, providing multiple low
>>> +level
>>> +  platform functions like board detection and identification,
>>> +software
>>> +  interrupt generation.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>
>> No need for oneOf.
>>
> Removing this results into dt_binding_check error, so this is required.

No, this is not required. You do not have more than one condition for oneOf.

>>> +      - items:
>>> +          - enum:
>>> +              - tesla,sysreg_fsys0
>>> +              - tesla,sysreg_peric
>>
>> From where did you get underscores in compatibles?
>>
> I have seen in MCAN Driver <drivers/net/can/m_can/m_can_platform.c> and also too many other yaml files.
> Do you have any ref standard guideline of compatible which says underscore is not allowed.

git grep compatible arch/arm64/boot/dts/exynos/ | grep _
git grep compatible arch/arm/boot/dts/exynos* | grep _

Both give 0 results. For few other SoCs there such cases but that's
really, really exception. Drop underscores.


Best regards,
Krzysztof
Vivek Yadav Nov. 11, 2022, 4:06 a.m. UTC | #4
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: 10 November 2022 17:42
> To: Vivek Yadav <vivek.2311@samsung.com>; rcsekar@samsung.com;
> krzysztof.kozlowski+dt@linaro.org; wg@grandegger.com;
> mkl@pengutronix.de; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; pankaj.dubey@samsung.com;
> ravi.patel@samsung.com; alim.akhtar@samsung.com; linux-fsd@tesla.com;
> robh+dt@kernel.org
> Cc: linux-can@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> samsung-soc@vger.kernel.org; devicetree@vger.kernel.org;
> aswani.reddy@samsung.com; sriranjani.p@samsung.com
> Subject: Re: [PATCH v2 1/6] dt-bindings: Document the SYSREG specific
> compatibles found on FSD SoC
> 
> On 10/11/2022 12:18, Vivek Yadav wrote:
> >>> +maintainers:
> >>> +  - Alim Akhtar <alim.akhtar@samsung.com>
> >>> +
> >>> +description: |
> >>> +  This is a system control registers block, providing multiple low
> >>> +level
> >>> +  platform functions like board detection and identification,
> >>> +software
> >>> +  interrupt generation.
> >>> +
> >>> +properties:
> >>> +  compatible:
> >>> +    oneOf:
> >>
> >> No need for oneOf.
> >>
> > Removing this results into dt_binding_check error, so this is required.
> 
> No, this is not required. You do not have more than one condition for oneOf.
> 
Oh, ok I got it. I was not removing "-" before items, which is resulting an error. I will update this in next patch series. Sorry for confusion.
> >>> +      - items:
> >>> +          - enum:
> >>> +              - tesla,sysreg_fsys0
> >>> +              - tesla,sysreg_peric
> >>
> >> From where did you get underscores in compatibles?
> >>
> > I have seen in MCAN Driver <drivers/net/can/m_can/m_can_platform.c>
> and also too many other yaml files.
> > Do you have any ref standard guideline of compatible which says
> underscore is not allowed.
> 
> git grep compatible arch/arm64/boot/dts/exynos/ | grep _ git grep
> compatible arch/arm/boot/dts/exynos* | grep _
> 
> Both give 0 results. For few other SoCs there such cases but that's really,
> really exception. Drop underscores.
> 
git grep compatible arch/arm64/boot/dts/ | grep _ | wc -l 
This gives me 456 location, am I missing anything here ?
Anyway I will replace with "-" in next patch series.
> 
> Best regards,
> Krzysztof
Thanks for review the patches.
Krzysztof Kozlowski Nov. 11, 2022, 7:54 a.m. UTC | #5
On 11/11/2022 05:06, Vivek Yadav wrote:
> 
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: 10 November 2022 17:42
>> To: Vivek Yadav <vivek.2311@samsung.com>; rcsekar@samsung.com;
>> krzysztof.kozlowski+dt@linaro.org; wg@grandegger.com;
>> mkl@pengutronix.de; davem@davemloft.net; edumazet@google.com;
>> kuba@kernel.org; pabeni@redhat.com; pankaj.dubey@samsung.com;
>> ravi.patel@samsung.com; alim.akhtar@samsung.com; linux-fsd@tesla.com;
>> robh+dt@kernel.org
>> Cc: linux-can@vger.kernel.org; netdev@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
>> samsung-soc@vger.kernel.org; devicetree@vger.kernel.org;
>> aswani.reddy@samsung.com; sriranjani.p@samsung.com
>> Subject: Re: [PATCH v2 1/6] dt-bindings: Document the SYSREG specific
>> compatibles found on FSD SoC
>>
>> On 10/11/2022 12:18, Vivek Yadav wrote:
>>>>> +maintainers:
>>>>> +  - Alim Akhtar <alim.akhtar@samsung.com>
>>>>> +
>>>>> +description: |
>>>>> +  This is a system control registers block, providing multiple low
>>>>> +level
>>>>> +  platform functions like board detection and identification,
>>>>> +software
>>>>> +  interrupt generation.
>>>>> +
>>>>> +properties:
>>>>> +  compatible:
>>>>> +    oneOf:
>>>>
>>>> No need for oneOf.
>>>>
>>> Removing this results into dt_binding_check error, so this is required.
>>
>> No, this is not required. You do not have more than one condition for oneOf.
>>
> Oh, ok I got it. I was not removing "-" before items, which is resulting an error. I will update this in next patch series. Sorry for confusion.
>>>>> +      - items:
>>>>> +          - enum:
>>>>> +              - tesla,sysreg_fsys0
>>>>> +              - tesla,sysreg_peric
>>>>
>>>> From where did you get underscores in compatibles?
>>>>
>>> I have seen in MCAN Driver <drivers/net/can/m_can/m_can_platform.c>
>> and also too many other yaml files.
>>> Do you have any ref standard guideline of compatible which says
>> underscore is not allowed.
>>
>> git grep compatible arch/arm64/boot/dts/exynos/ | grep _ git grep
>> compatible arch/arm/boot/dts/exynos* | grep _
>>
>> Both give 0 results. For few other SoCs there such cases but that's really,
>> really exception. Drop underscores.
>>
> git grep compatible arch/arm64/boot/dts/ | grep _ | wc -l 
> This gives me 456 location, am I missing anything here ?

You mean entries like this:

arch/arm64/boot/dts/qcom/pmm8155au_1.dtsi:		compatible =
"qcom,pmm8155au", "qcom,spmi-pmic";

or this:

arch/arm64/boot/dts/microchip/sparx5_pcb135_board.dtsi:		compatible =
"gpio-leds";

or this:

arch/arm64/boot/dts/intel/socfpga_agilex.dtsi:			compatible = "fixed-clock";

And how many compatibles are with hyphen, not underscore?

Best regards,
Krzysztof
Rob Herring Nov. 16, 2022, 4:43 p.m. UTC | #6
On Thu, Nov 10, 2022 at 04:48:03PM +0530, Vivek Yadav wrote:
> 
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Sent: 09 November 2022 16:39
> > To: Vivek Yadav <vivek.2311@samsung.com>; rcsekar@samsung.com;
> > krzysztof.kozlowski+dt@linaro.org; wg@grandegger.com;
> > mkl@pengutronix.de; davem@davemloft.net; edumazet@google.com;
> > kuba@kernel.org; pabeni@redhat.com; pankaj.dubey@samsung.com;
> > ravi.patel@samsung.com; alim.akhtar@samsung.com; linux-fsd@tesla.com;
> > robh+dt@kernel.org
> > Cc: linux-can@vger.kernel.org; netdev@vger.kernel.org; linux-
> > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> > samsung-soc@vger.kernel.org; devicetree@vger.kernel.org;
> > aswani.reddy@samsung.com; sriranjani.p@samsung.com
> > Subject: Re: [PATCH v2 1/6] dt-bindings: Document the SYSREG specific
> > compatibles found on FSD SoC
> > 
> > On 09/11/2022 11:09, Vivek Yadav wrote:
> > > From: Sriranjani P <sriranjani.p@samsung.com>
> > >
> > 
> > Use subject prefixes matching the subsystem (git log --oneline -- ...).
> > 
> Okay, I will add the correct prefixes.
> > > Describe the compatible properties for SYSREG controllers found on FSD
> > > SoC.
> > 
> > This is ARM SoC patch, split it from the patchset.
> >
> I understand this patch is not to be subset of CAN patches, I will send these patches separately.
> These patches will be used by EQos patches. As per reference, I am adding the Address link.
> https://lore.kernel.org/all/20221104120517.77980-1-sriranjani.p@samsung.com/
>  
> > >
> > > Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> > > Signed-off-by: Pankaj Kumar Dubey <pankaj.dubey@samsung.com>
> > > Signed-off-by: Ravi Patel <ravi.patel@samsung.com>
> > > Signed-off-by: Vivek Yadav <vivek.2311@samsung.com>
> > > Cc: devicetree@vger.kernel.org
> > > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> > > Cc: Rob Herring <robh+dt@kernel.org>
> > 
> > Drop the Cc list from commit log. It's not helpful.
> > 
> Okay, I will remove.
> > > Signed-off-by: Sriranjani P <sriranjani.p@samsung.com>
> > > ---
> > >  .../devicetree/bindings/arm/tesla-sysreg.yaml | 50
> > +++++++++++++++++++
> > >  MAINTAINERS                                   |  1 +
> > >  2 files changed, 51 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > > b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > > new file mode 100644
> > > index 000000000000..bbcc6dd75918
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/arm/tesla-sysreg.yaml
> > 
> > arm is only for top level stuff. This goes to soc under tesla or samsung
> > directory.
> > 
> Okay, this is specific to Samsung fsd SoC, I will be moving this file to arm/samsung in next patch series. Hope that is fine.
> > > @@ -0,0 +1,50 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2
> > > +---
> > > +$id:
> > > +https://protect2.fireeye.com/v1/url?k=1ad2834a-7b59967c-1ad30805-
> > 000b
> > > +abff9b5d-1f65584e412e916c&q=1&e=a870a282-632a-4896-ae53-
> > 3ecb50f02be5&
> > > +u=http%3A%2F%2Fdevicetree.org%2Fschemas%2Farm%2Ftesla-
> > sysreg.yaml%23
> > > +$schema:
> > > +https://protect2.fireeye.com/v1/url?k=13876e33-720c7b05-1386e57c-
> > 000b
> > > +abff9b5d-edae3ff711999305&q=1&e=a870a282-632a-4896-ae53-
> > 3ecb50f02be5&
> > > +u=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23
> > > +
> > > +title: Tesla Full Self-Driving platform's system registers
> > > +
> > > +maintainers:
> > > +  - Alim Akhtar <alim.akhtar@samsung.com>
> > > +
> > > +description: |
> > > +  This is a system control registers block, providing multiple low
> > > +level
> > > +  platform functions like board detection and identification,
> > > +software
> > > +  interrupt generation.
> > > +
> > > +properties:
> > > +  compatible:
> > > +    oneOf:
> > 
> > No need for oneOf.
> > 
> Removing this results into dt_binding_check error, so this is required.
> > > +      - items:
> > > +          - enum:
> > > +              - tesla,sysreg_fsys0
> > > +              - tesla,sysreg_peric
> > 
> > From where did you get underscores in compatibles?
> > 
> I have seen in MCAN Driver <drivers/net/can/m_can/m_can_platform.c> and also too many other yaml files.
> Do you have any ref standard guideline of compatible which says underscore is not allowed.

Section 2.3.1 defining 'compatible' in the DT spec:

The compatible string should consist only of lowercase letters, digits  
and dashes, and should start with a letter. A single comma is typically 
only used following a vendor prefix. Underscores should not be used.