2022-01-21 22:35:42

by Alim Akhtar

[permalink] [raw]
Subject: [PATCH v2 0/3] Add FSD SPI support

Adds support for SPI controller found in Tesla FSD SoC

-Changes since v1
* Splited SPI changes from a larger inital patch set
* Rebased on Krzysztof's latest (v5) SPI schema changes
* Added tag

Note: This series is depended on [1] patches which adds
support of FSD SoC and on Krzysztof's v5 [2] of spi schema changes

[1] https://lkml.org/lkml/2022/1/18/498
[2] https://www.spinics.net/lists/kernel/msg4211991.html

Alim Akhtar (2):
spi: dt-bindings: samsung: Add fsd spi compatible
spi: s3c64xx: Add spi port configuration for Tesla FSD SoC

Aswani Reddy (1):
arm64: dts: fsd: Add SPI device nodes

.../devicetree/bindings/spi/samsung,spi.yaml | 1 +
arch/arm64/boot/dts/tesla/fsd.dtsi | 57 +++++++++++++++++++
drivers/spi/spi-s3c64xx.c | 13 +++++
3 files changed, 71 insertions(+)

--
2.25.1


2022-01-21 22:35:43

by Alim Akhtar

[permalink] [raw]
Subject: [PATCH v2 1/3] spi: dt-bindings: samsung: Add fsd spi compatible

Adds spi controller dt-binding compatible information for
Tesla Full Self-Driving (FSD) SoC.

Cc: [email protected]
Signed-off-by: Adithya K V <[email protected]>
Signed-off-by: Alim Akhtar <[email protected]>
---
Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
index 61c77088e8ee..bf9a76d931d2 100644
--- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml
+++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
@@ -21,6 +21,7 @@ properties:
- samsung,s3c6410-spi
- samsung,s5pv210-spi # for S5PV210 and S5PC110
- samsung,exynos5433-spi
+ - tesla,fsd-spi
- const: samsung,exynos7-spi
deprecated: true

--
2.25.1

2022-01-21 22:35:51

by Alim Akhtar

[permalink] [raw]
Subject: [PATCH v2 2/3] spi: s3c64xx: Add spi port configuration for Tesla FSD SoC

Adds compatible and port configuration for spi controller
for Tesla Full Self-Driving SoC.

Cc: [email protected]
Signed-off-by: Aswani Reddy <[email protected]>
Signed-off-by: Alim Akhtar <[email protected]>
---
drivers/spi/spi-s3c64xx.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 386550fca81c..423518bf0270 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1440,6 +1440,16 @@ static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = {
.quirks = S3C64XX_SPI_QUIRK_CS_AUTO,
};

+static struct s3c64xx_spi_port_config fsd_spi_port_config = {
+ .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f},
+ .rx_lvl_offset = 15,
+ .tx_st_done = 25,
+ .high_speed = true,
+ .clk_from_cmu = true,
+ .clk_ioclk = false,
+ .quirks = S3C64XX_SPI_QUIRK_CS_AUTO,
+};
+
static const struct platform_device_id s3c64xx_spi_driver_ids[] = {
{
.name = "s3c2443-spi",
@@ -1470,6 +1480,9 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = {
{ .compatible = "samsung,exynos5433-spi",
.data = (void *)&exynos5433_spi_port_config,
},
+ { .compatible = "tesla,fsd-spi",
+ .data = (void *)&fsd_spi_port_config,
+ },
{ },
};
MODULE_DEVICE_TABLE(of, s3c64xx_spi_dt_match);
--
2.25.1

2022-01-21 22:36:01

by Alim Akhtar

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: fsd: Add SPI device nodes

From: Aswani Reddy <[email protected]>

Adds device tree node for SPI IPs

Cc: [email protected]
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Aswani Reddy <[email protected]>
Signed-off-by: Alim Akhtar <[email protected]>
---
arch/arm64/boot/dts/tesla/fsd.dtsi | 57 ++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

diff --git a/arch/arm64/boot/dts/tesla/fsd.dtsi b/arch/arm64/boot/dts/tesla/fsd.dtsi
index bab63c9f79dc..86cf1446d1fc 100644
--- a/arch/arm64/boot/dts/tesla/fsd.dtsi
+++ b/arch/arm64/boot/dts/tesla/fsd.dtsi
@@ -29,6 +29,9 @@ aliases {
pinctrl0 = &pinctrl_fsys0;
pinctrl1 = &pinctrl_peric;
pinctrl2 = &pinctrl_pmu;
+ spi0 = &spi_0;
+ spi1 = &spi_1;
+ spi2 = &spi_2;
};

cpus {
@@ -667,6 +670,60 @@ pinctrl_fsys0: pinctrl@15020000 {
reg = <0x0 0x15020000 0x0 0x1000>;
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
};
+
+ spi_0: spi@14140000 {
+ compatible = "tesla,fsd-spi";
+ reg = <0x0 0x14140000 0x0 0x100>;
+ interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&pdma1 4>, <&pdma1 5>;
+ dma-names = "tx", "rx";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clock_peric PERIC_PCLK_SPI0>,
+ <&clock_peric PERIC_SCLK_SPI0>;
+ clock-names = "spi", "spi_busclk0";
+ samsung,spi-src-clk = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi0_bus>;
+ num-cs = <1>;
+ status = "disabled";
+ };
+
+ spi_1: spi@14150000 {
+ compatible = "tesla,fsd-spi";
+ reg = <0x0 0x14150000 0x0 0x100>;
+ interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&pdma1 6>, <&pdma1 7>;
+ dma-names = "tx", "rx";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clock_peric PERIC_PCLK_SPI1>,
+ <&clock_peric PERIC_SCLK_SPI1>;
+ clock-names = "spi", "spi_busclk0";
+ samsung,spi-src-clk = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi1_bus>;
+ num-cs = <1>;
+ status = "disabled";
+ };
+
+ spi_2: spi@14160000 {
+ compatible = "tesla,fsd-spi";
+ reg = <0x0 0x14160000 0x0 0x100>;
+ interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&pdma1 8>, <&pdma1 9>;
+ dma-names = "tx", "rx";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clock_peric PERIC_PCLK_SPI2>,
+ <&clock_peric PERIC_SCLK_SPI2>;
+ clock-names = "spi", "spi_busclk0";
+ samsung,spi-src-clk = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi2_bus>;
+ num-cs = <1>;
+ status = "disabled";
+ };
};
};

--
2.25.1

2022-01-22 02:10:32

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] spi: dt-bindings: samsung: Add fsd spi compatible

On 20/01/2022 20:24, Alim Akhtar wrote:
> Adds spi controller dt-binding compatible information for
> Tesla Full Self-Driving (FSD) SoC.
>
> Cc: [email protected]
> Signed-off-by: Adithya K V <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>
> ---
> Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 +
> 1 file changed, 1 insertion(+)

I think you forgot to mention - in cover letter - that this depends on
my Samsung SPI bindings conversion to dtschema.

I'll be sending v6 of it after merge window, with minor changes.

>
> diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
> index 61c77088e8ee..bf9a76d931d2 100644
> --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml
> +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
> @@ -21,6 +21,7 @@ properties:
> - samsung,s3c6410-spi
> - samsung,s5pv210-spi # for S5PV210 and S5PC110
> - samsung,exynos5433-spi
> + - tesla,fsd-spi
> - const: samsung,exynos7-spi
> deprecated: true
>
>


Best regards,
Krzysztof

2022-01-22 02:11:38

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] spi: s3c64xx: Add spi port configuration for Tesla FSD SoC

On 20/01/2022 20:24, Alim Akhtar wrote:
> Adds compatible and port configuration for spi controller
> for Tesla Full Self-Driving SoC.
>
> Cc: [email protected]
> Signed-off-by: Aswani Reddy <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>
> ---
> drivers/spi/spi-s3c64xx.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>


Best regards,
Krzysztof

2022-01-22 02:11:42

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] spi: dt-bindings: samsung: Add fsd spi compatible

On 20/01/2022 20:24, Alim Akhtar wrote:
> Adds spi controller dt-binding compatible information for
> Tesla Full Self-Driving (FSD) SoC.
>
> Cc: [email protected]
> Signed-off-by: Adithya K V <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>
> ---
> Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 +
> 1 file changed, 1 insertion(+)
>

Reviewed-by: Krzysztof Kozlowski <[email protected]>


Best regards,
Krzysztof

2022-01-23 15:03:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] spi: dt-bindings: samsung: Add fsd spi compatible

On Sat, 22 Jan 2022 at 11:28, Andi Shyti <[email protected]> wrote:
>
> Hi Krzysztof and Alim,
>
> On Fri, Jan 21, 2022 at 07:33:15PM +0100, Krzysztof Kozlowski wrote:
> > On 20/01/2022 20:24, Alim Akhtar wrote:
> > > Adds spi controller dt-binding compatible information for
> > > Tesla Full Self-Driving (FSD) SoC.
> > >
> > > Cc: [email protected]
> > > Signed-off-by: Adithya K V <[email protected]>
> > > Signed-off-by: Alim Akhtar <[email protected]>
> > > ---
> > > Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 +
> > > 1 file changed, 1 insertion(+)
> >
> > I think you forgot to mention - in cover letter - that this depends on
> > my Samsung SPI bindings conversion to dtschema.
>
> It's written in the cover letter:
>
> "Note: This series is depended on [1] patches which adds
> support of FSD SoC and on Krzysztof's v5 [2] of spi schema
> changes"

Indeed, it is. I simply could not find the cover letter so I assumed
none was sent, but it just got hidden.

2022-01-23 15:04:37

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] arm64: dts: fsd: Add SPI device nodes

Hi Alim and Aswani,

On Fri, Jan 21, 2022 at 12:54:38AM +0530, Alim Akhtar wrote:
> From: Aswani Reddy <[email protected]>
>
> Adds device tree node for SPI IPs
>
> Cc: [email protected]
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Aswani Reddy <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Please, also allow me another nit-commnent for the next patches:
the tag section is in chronological order. I suppose that first
Aswani wrote the patch, then you sent it to the mailing list and
at the end Krzysztof has reviewed it, this means that the right
order is:

Signed-off-by: Aswani Reddy <[email protected]>
Signed-off-by: Alim Akhtar <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>

Thank you,
Andi

2022-01-23 15:05:12

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] spi: s3c64xx: Add spi port configuration for Tesla FSD SoC

Hi Alim,

> Adds compatible and port configuration for spi controller
> for Tesla Full Self-Driving SoC.

please next time be a bit clearer in the cover letter. I think
you want to say:

"This patch adds the compatible..."

But it's anyway recommended to use the imperative form:

"Add the compatible blah blah blah...."

> Cc: [email protected]
> Signed-off-by: Aswani Reddy <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>

Other than that, looks good to me:

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2022-01-23 15:11:31

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] spi: dt-bindings: samsung: Add fsd spi compatible

Hi Krzysztof and Alim,

On Fri, Jan 21, 2022 at 07:33:15PM +0100, Krzysztof Kozlowski wrote:
> On 20/01/2022 20:24, Alim Akhtar wrote:
> > Adds spi controller dt-binding compatible information for
> > Tesla Full Self-Driving (FSD) SoC.
> >
> > Cc: [email protected]
> > Signed-off-by: Adithya K V <[email protected]>
> > Signed-off-by: Alim Akhtar <[email protected]>
> > ---
> > Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 +
> > 1 file changed, 1 insertion(+)
>
> I think you forgot to mention - in cover letter - that this depends on
> my Samsung SPI bindings conversion to dtschema.

It's written in the cover letter:

"Note: This series is depended on [1] patches which adds
support of FSD SoC and on Krzysztof's v5 [2] of spi schema
changes"

Alim, you can also add:

Reviewed-by: Andi Shyti <[email protected]>

Thank you,
Andi

2022-01-24 19:38:20

by Alim Akhtar

[permalink] [raw]
Subject: RE: [PATCH v2 3/3] arm64: dts: fsd: Add SPI device nodes

Thanks Andi for review

>-----Original Message-----
>From: Andi Shyti [mailto:[email protected]]
>Sent: Saturday, January 22, 2022 4:13 PM
>To: Alim Akhtar <[email protected]>
>Cc: [email protected]; [email protected];
>[email protected]; [email protected]; [email protected];
>[email protected]; [email protected];
>[email protected]; [email protected]; [email protected]; linux-
>[email protected]; Aswani Reddy <[email protected]>; linux-
>[email protected]
>Subject: Re: [PATCH v2 3/3] arm64: dts: fsd: Add SPI device nodes
>
>Hi Alim and Aswani,
>
>On Fri, Jan 21, 2022 at 12:54:38AM +0530, Alim Akhtar wrote:
>> From: Aswani Reddy <[email protected]>
>>
>> Adds device tree node for SPI IPs
>>
>> Cc: [email protected]
>> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>> Signed-off-by: Aswani Reddy <[email protected]>
>> Signed-off-by: Alim Akhtar <[email protected]>
>
>Reviewed-by: Andi Shyti <[email protected]>
>
>Please, also allow me another nit-commnent for the next patches:
>the tag section is in chronological order. I suppose that first Aswani
wrote the
>patch, then you sent it to the mailing list and at the end Krzysztof has
>reviewed it, this means that the right order is:
>
> Signed-off-by: Aswani Reddy <[email protected]>
> Signed-off-by: Alim Akhtar <[email protected]>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>
Sure, will update it in the next version of the patch set.

>Thank you,
>Andi

2022-03-08 23:11:17

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/3] Add FSD SPI support

On Fri, 21 Jan 2022 00:54:35 +0530, Alim Akhtar wrote:
> Adds support for SPI controller found in Tesla FSD SoC
>
> -Changes since v1
> * Splited SPI changes from a larger inital patch set
> * Rebased on Krzysztof's latest (v5) SPI schema changes
> * Added tag
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: dt-bindings: samsung: Add fsd spi compatible
commit: 363d3c51bc5b3243b5b035a1f50d6d994a1b203f
[2/3] spi: s3c64xx: Add spi port configuration for Tesla FSD SoC
commit: 4ebb15a15799da4954f1d4926fcd3263ea46e417

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark