* [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi
@ 2025-02-12 19:12 Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 1/2] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible Denzeel Oliva
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Denzeel Oliva @ 2025-02-12 19:12 UTC (permalink / raw)
To: andi.shyti, broonie, robh, krzk+dt, conor+dt, alim.akhtar,
peter.griffin, andre.draszik, tudor.ambarus, linux-spi,
linux-samsung-soc, devicetree, linux-kernel, linux-arm-kernel
Cc: Denzeel Oliva
The Exynos990 SPI controller shares similarities with
the GS101 (Google Tensor) SPI implementation,
but introduces specific hardware requirements such as
32-bit register access and variable FIFO depths depending on
the SPI node where it will have to be specified in DT (Device Tree).
Denzeel Oliva (2):
spi: dt-bindings: samsung: add samsung,exynos990-spi compatible
spi: s3c64xx: add support exynos990-spi to new port config data
.../devicetree/bindings/spi/samsung,spi.yaml | 1 +
drivers/spi/spi-s3c64xx.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
--
2.48.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v1 1/2] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible
2025-02-12 19:12 [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Denzeel Oliva
@ 2025-02-12 19:12 ` Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
2025-02-13 7:05 ` [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Tudor Ambarus
2 siblings, 0 replies; 7+ messages in thread
From: Denzeel Oliva @ 2025-02-12 19:12 UTC (permalink / raw)
To: andi.shyti, broonie, robh, krzk+dt, conor+dt, alim.akhtar,
peter.griffin, andre.draszik, tudor.ambarus, linux-spi,
linux-samsung-soc, devicetree, linux-kernel, linux-arm-kernel
Cc: Denzeel Oliva
Add "samsung,exynos990-spi" dedicated compatible for the SPI controller
on Exynos990 SoC. This ensures proper representation of the hardware
in the device tree.
Signed-off-by: Denzeel Oliva <wachiturroxd150@gmail.com>
---
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 3c206a64d..1d3c95bd2 100644
--- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml
+++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
@@ -24,6 +24,7 @@ properties:
- samsung,exynos4210-spi
- samsung,exynos5433-spi
- samsung,exynos850-spi
+ - samsung,exynos990-spi
- samsung,exynosautov9-spi
- tesla,fsd-spi
- items:
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data
2025-02-12 19:12 [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 1/2] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible Denzeel Oliva
@ 2025-02-12 19:12 ` Denzeel Oliva
2025-02-13 7:10 ` Tudor Ambarus
2025-02-13 7:05 ` [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Tudor Ambarus
2 siblings, 1 reply; 7+ messages in thread
From: Denzeel Oliva @ 2025-02-12 19:12 UTC (permalink / raw)
To: andi.shyti, broonie, robh, krzk+dt, conor+dt, alim.akhtar,
peter.griffin, andre.draszik, tudor.ambarus, linux-spi,
linux-samsung-soc, devicetree, linux-kernel, linux-arm-kernel
Cc: Denzeel Oliva
Exynos990 uses the same version of USI SPI (v2.1) as the GS101.
Removed fifo_lvl_mask and rx_lvl_offset, and changed to the new data
configuration port.
The difference from other new port configuration data is that fifo_depth
is only specified in fifo-depth in DT.
Exynos 990 data for SPI:
- The depth of the FIFO is not the same size on all nodes.
A depth of 64 bytes is used on most nodes,
while a depth of 256 bytes is used on 3 specific nodes (SPI 8/9/10).
- The Exynos 990 only allows access to 32-bit registers.
If access is attempted with a different size, an error interrupt
is generated. Therefore, it is necessary to perform write accesses to
registers in 32-bit blocks.
Signed-off-by: Denzeel Oliva <wachiturroxd150@gmail.com>
---
drivers/spi/spi-s3c64xx.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 389275dbc..790034d2d 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1586,6 +1586,20 @@ static const struct s3c64xx_spi_port_config exynos850_spi_port_config = {
.quirks = S3C64XX_SPI_QUIRK_CS_AUTO,
};
+static const struct s3c64xx_spi_port_config exynos990_spi_port_config = {
+ /* fifo-depth must be specified in the device tree. */
+ .fifo_depth = 0,
+ .rx_fifomask = S3C64XX_SPI_ST_RX_FIFO_RDY_V2,
+ .tx_fifomask = S3C64XX_SPI_ST_TX_FIFO_RDY_V2,
+ .tx_st_done = 25,
+ .clk_div = 4,
+ .high_speed = true,
+ .clk_from_cmu = true,
+ .has_loopback = true,
+ .use_32bit_io = true,
+ .quirks = S3C64XX_SPI_QUIRK_CS_AUTO,
+};
+
static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = {
/* fifo_lvl_mask is deprecated. Use {rx, tx}_fifomask instead. */
.fifo_lvl_mask = { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff, 0x7f,
@@ -1664,6 +1678,9 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = {
{ .compatible = "samsung,exynos850-spi",
.data = &exynos850_spi_port_config,
},
+ { .compatible = "samsung,exynos990-spi",
+ .data = &exynos990_spi_port_config,
+ },
{ .compatible = "samsung,exynosautov9-spi",
.data = &exynosautov9_spi_port_config,
},
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi
2025-02-12 19:12 [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 1/2] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
@ 2025-02-13 7:05 ` Tudor Ambarus
2025-02-13 19:47 ` Denzeel Oliva
2 siblings, 1 reply; 7+ messages in thread
From: Tudor Ambarus @ 2025-02-13 7:05 UTC (permalink / raw)
To: Denzeel Oliva, andi.shyti, broonie, robh, krzk+dt, conor+dt,
alim.akhtar, peter.griffin, andre.draszik, linux-spi,
linux-samsung-soc, devicetree, linux-kernel, linux-arm-kernel
Hi!
On 2/12/25 7:12 PM, Denzeel Oliva wrote:
> The Exynos990 SPI controller shares similarities with
> the GS101 (Google Tensor) SPI implementation,
> but introduces specific hardware requirements such as
> 32-bit register access and variable FIFO depths depending on
gs101 mandates 32-bit accesses too.
> the SPI node where it will have to be specified in DT (Device Tree).
gs101 has some USI nodes that can work only in uart mode and indeed the
fifosize there is 256. Does downstream define SPI nodes with 256 bytes
FIFOs? Can you please point me the the downstream code?
Cheers,
ta
>
> Denzeel Oliva (2):
> spi: dt-bindings: samsung: add samsung,exynos990-spi compatible
> spi: s3c64xx: add support exynos990-spi to new port config data
>
> .../devicetree/bindings/spi/samsung,spi.yaml | 1 +
> drivers/spi/spi-s3c64xx.c | 17 +++++++++++++++++
> 2 files changed, 18 insertions(+)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data
2025-02-12 19:12 ` [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
@ 2025-02-13 7:10 ` Tudor Ambarus
0 siblings, 0 replies; 7+ messages in thread
From: Tudor Ambarus @ 2025-02-13 7:10 UTC (permalink / raw)
To: Denzeel Oliva, andi.shyti, broonie, robh, krzk+dt, conor+dt,
alim.akhtar, peter.griffin, andre.draszik, linux-spi,
linux-samsung-soc, devicetree, linux-kernel, linux-arm-kernel
On 2/12/25 7:12 PM, Denzeel Oliva wrote:
> +static const struct s3c64xx_spi_port_config exynos990_spi_port_config = {
> + /* fifo-depth must be specified in the device tree. */
> + .fifo_depth = 0,
have you tried testing without specifying the fifo_depth in DT?
You'll probably hit a divide by zero at:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/spi/spi-s3c64xx.c#n664
I assume the controller can work with 0 sized FIFO depth, and if so, the
driver has to be updated to allow 0 sized FIFOs.
btw, how did you test the set?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi
2025-02-13 7:05 ` [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Tudor Ambarus
@ 2025-02-13 19:47 ` Denzeel Oliva
2025-02-14 6:14 ` Tudor Ambarus
0 siblings, 1 reply; 7+ messages in thread
From: Denzeel Oliva @ 2025-02-13 19:47 UTC (permalink / raw)
To: Tudor Ambarus
Cc: alim.akhtar, andi.shyti, andre.draszik, broonie, conor+dt,
devicetree, krzk+dt, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-spi, peter.griffin, robh,
wachiturroxd150
On Thu, Feb 13, 2025 at 07:05:22AM +0000, Tudor Ambarus wrote:
> gs101 mandates 32-bit accesses too.
Also in exynos990 [0]
> > the SPI node where it will have to be specified in DT (Device Tree).
>
> gs101 has some USI nodes that can work only in uart mode and indeed the
> fifosize there is 256. Does downstream define SPI nodes with 256 bytes
> FIFOs? Can you please point me the the downstream code?
>
Yes, Exynos990 has SPI nodes with 256-byte FIFOs, and you can see this in
the downstream kernel. Here are some relevant references:
- SPI8: [1]
- SPI9: [2]
- SPI10: [3]
Best regards,
Denzeel
[0] https://github.com/pascua28/android_kernel_samsung_s20fe/blob/3be539e9cd22b89ba3cc8282945a0c46ff27341d/drivers/spi/spi-s3c64xx.c#L767
[1] https://github.com/pascua28/android_kernel_samsung_s20fe/blob/3be539e9cd22b89ba3cc8282945a0c46ff27341d/arch/arm64/boot/dts/exynos/exynos9830-usi.dtsi#L1641
[2] https://github.com/pascua28/android_kernel_samsung_s20fe/blob/3be539e9cd22b89ba3cc8282945a0c46ff27341d/arch/arm64/boot/dts/exynos/exynos9830-usi.dtsi#L1662
[3] https://github.com/pascua28/android_kernel_samsung_s20fe/blob/3be539e9cd22b89ba3cc8282945a0c46ff27341d/arch/arm64/boot/dts/exynos/exynos9830-usi.dtsi#L1683
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi
2025-02-13 19:47 ` Denzeel Oliva
@ 2025-02-14 6:14 ` Tudor Ambarus
0 siblings, 0 replies; 7+ messages in thread
From: Tudor Ambarus @ 2025-02-14 6:14 UTC (permalink / raw)
To: Denzeel Oliva
Cc: alim.akhtar, andi.shyti, andre.draszik, broonie, conor+dt,
devicetree, krzk+dt, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-spi, peter.griffin, robh
On 2/13/25 7:47 PM, Denzeel Oliva wrote:
> Yes, Exynos990 has SPI nodes with 256-byte FIFOs, and you can see this in
> the downstream kernel. Here are some relevant references:
thanks for the references!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-14 6:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 19:12 [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 1/2] spi: dt-bindings: samsung: add samsung,exynos990-spi compatible Denzeel Oliva
2025-02-12 19:12 ` [PATCH v1 2/2] spi: s3c64xx: add support exynos990-spi to new port config data Denzeel Oliva
2025-02-13 7:10 ` Tudor Ambarus
2025-02-13 7:05 ` [PATCH v1 0/2] spi: s3c64xx: add support for samsung,exynos990-spi Tudor Ambarus
2025-02-13 19:47 ` Denzeel Oliva
2025-02-14 6:14 ` Tudor Ambarus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).