2024-01-25 15:28:26

by Tudor Ambarus

[permalink] [raw]
Subject: [PATCH 0/7] ARM: dts: samsung: specify the SPI fifosize

Hi,

The "samsung,spi-fifosize" was introduced in the following patch set:
https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#t

I expect Mark will provide an immutable tag for the bindings so that it
can be merged into the samsung tree. We'll avoid this way using the
property into the device trees without having it defined into the
bindings.

These patches close the circle and break the dependency between the SPI
of_alias ID and the SPI driver. The SPI of_alias ID was used as an index
into the fifo_lvl_mask to determine the FIFO depth of the SPI node.
Changing the alias ID into the device tree would make the driver choose
a wrong FIFO size configuration, if not accessing past the fifo_lvl_mask
array boundaries. Not specifying an SPI alias would make the driver fail
to probe, which was wrong too. Thus I updated the driver and I provided
alternatives to either infer the FIFO size from the compatible, where
the SoC uses the same FIFO size for all the instances of the IP, or by
using the "samsung,spi-fifosize" dt property, where the SoC uses
different FIFO sizes for the instances of the IP. This patch set takes
care of the second case and adds "samsung,spi-fifosize" for all the SoCs
that need it.

Cheers,
ta

Tudor Ambarus (7):
ARM: dts: samsung: s5pv210: specify the SPI fifosize
ARM: dts: samsung: exynos3250: specify the SPI fifosize
ARM: dts: samsung: exynos4: specify the SPI fifosize
ARM: dts: samsung: exynos5250: specify the SPI fifosize
ARM: dts: samsung: exynos5450: specify the SPI fifosize
ARM: dts: samsung: exynos5433: specify the SPI fifosize
ARM: dts: samsung: exynosautov9: specify the SPI fifosize

arch/arm/boot/dts/samsung/exynos3250.dtsi | 2 ++
arch/arm/boot/dts/samsung/exynos4.dtsi | 3 +++
arch/arm/boot/dts/samsung/exynos5250.dtsi | 3 +++
arch/arm/boot/dts/samsung/exynos5420.dtsi | 3 +++
arch/arm/boot/dts/samsung/s5pv210.dtsi | 2 ++
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 5 +++++
arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 12 ++++++++++++
7 files changed, 30 insertions(+)

--
2.43.0.429.g432eaa2c6b-goog



2024-01-25 15:29:27

by Tudor Ambarus

[permalink] [raw]
Subject: [PATCH 6/7] ARM: dts: samsung: exynos5433: specify the SPI fifosize

Up to now the SPI alias was used as an index into an array defined in
the SPI driver to determine the SPI FIFO size. Drop the dependency on
the SPI alias and specify the SPI FIFO size directly into the SPI node.

The FIFO sizes were determined based on the SPI aliases that are defined
in exynos5433-tm2-common.dtsi.

Signed-off-by: Tudor Ambarus <[email protected]>
---
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 7fbbec04bff0..b5c898703e3b 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -1468,6 +1468,7 @@ spi_0: spi@14d20000 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_bus>;
num-cs = <1>;
+ samsung,spi-fifosize = <256>;
status = "disabled";
};

@@ -1487,6 +1488,7 @@ spi_1: spi@14d30000 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_bus>;
num-cs = <1>;
+ samsung,spi-fifosize = <64>;
status = "disabled";
};

@@ -1506,6 +1508,7 @@ spi_2: spi@14d40000 {
pinctrl-names = "default";
pinctrl-0 = <&spi2_bus>;
num-cs = <1>;
+ samsung,spi-fifosize = <64>;
status = "disabled";
};

@@ -1525,6 +1528,7 @@ spi_3: spi@14d50000 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_bus>;
num-cs = <1>;
+ samsung,spi-fifosize = <64>;
status = "disabled";
};

@@ -1544,6 +1548,7 @@ spi_4: spi@14d00000 {
pinctrl-names = "default";
pinctrl-0 = <&spi4_bus>;
num-cs = <1>;
+ samsung,spi-fifosize = <64>;
status = "disabled";
};

--
2.43.0.429.g432eaa2c6b-goog


2024-01-25 15:53:28

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/7] ARM: dts: samsung: specify the SPI fifosize

On Thu, Jan 25, 2024 at 03:16:23PM +0000, Tudor Ambarus wrote:

> These patches close the circle and break the dependency between the SPI
> of_alias ID and the SPI driver. The SPI of_alias ID was used as an index
> into the fifo_lvl_mask to determine the FIFO depth of the SPI node.
> Changing the alias ID into the device tree would make the driver choose
> a wrong FIFO size configuration, if not accessing past the fifo_lvl_mask
> array boundaries. Not specifying an SPI alias would make the driver fail
> to probe, which was wrong too. Thus I updated the driver and I provided

Specifying a specific compatible is just good practice, it makes the DT
much more robust for when we discover new things about the hardware and
reduces the surface of the ABI.


Attachments:
(No filename) (771.00 B)
signature.asc (499.00 B)
Download all attachments

2024-01-25 15:57:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 0/7] ARM: dts: samsung: specify the SPI fifosize

On 25/01/2024 16:16, Tudor Ambarus wrote:
> Hi,
>
> The "samsung,spi-fifosize" was introduced in the following patch set:
> https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#t
>
> I expect Mark will provide an immutable tag for the bindings so that it
> can be merged into the samsung tree. We'll avoid this way using the
> property into the device trees without having it defined into the
> bindings.

No need. Any merge back to DTS branch would anyway question my pull
request to arm soc, so I am not going to do this, unless absolutely
necessary.

I'll take the DTS once binding is merged to ASoC, so everything will be
fine as long linux-next is fine.

Best regards,
Krzysztof


2024-02-01 10:33:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 0/7] ARM: dts: samsung: specify the SPI fifosize

On 25/01/2024 16:16, Tudor Ambarus wrote:
> Hi,
>
> The "samsung,spi-fifosize" was introduced in the following patch set:
> https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#t
>

Judging by Rob's statement the bindings were not accepted, so I drop
this series for now.

Best regards,
Krzysztof