lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <a436b3f9-8bdd-8999-b033-9b25c9b67d98@birger-koblitz.de>
Date:   Mon, 1 Aug 2022 08:17:09 +0200
From:   Birger Koblitz <mail@...ger-koblitz.de>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Cc:     linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
        bert@...t.com, Sander Vanheule <sander@...nheule.net>
Subject: [PATCH 1/7] spi: realteak-rtl: Add support for RTL93xx SoCs

The Realtek RTL930x and RTL931x SoCs are new generations of the
RTL838x and RTL839x Ethernet Router SoCs, providing only 2 instead
of 4 CS lines for SPI, however with quad IO capabilities instead of
merely dual IO.

We introduce device capability flags for the various SoCs stating
their number of CS lines and their multi-IO capabilities and add
compatibles for the RTL9300 and RTL9310 SoC families.

Signed-off-by: Birger Koblitz <mail@...ger-koblitz.de>
---
  drivers/spi/spi-realtek-rtl.c | 16 +++++++++++-----
  1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-realtek-rtl.c b/drivers/spi/spi-realtek-rtl.c
index 866b0477dbd7..927bd44744a8 100644
--- a/drivers/spi/spi-realtek-rtl.c
+++ b/drivers/spi/spi-realtek-rtl.c
@@ -29,6 +29,9 @@ struct rtspi {

  #define REG(x)		(rtspi->base + x)

+/* SoC-specific features */
+#define SPI_CSMAX_3			0x1
+#define SPI_QUAD_SUPPORTED		0x2

  static void rt_set_cs(struct spi_device *spi, bool active)
  {
@@ -185,13 +188,16 @@ static int realtek_rtl_spi_probe(struct platform_device *pdev)


  static const struct of_device_id realtek_rtl_spi_of_ids[] = {
-	{ .compatible = "realtek,rtl8380-spi" },
-	{ .compatible = "realtek,rtl8382-spi" },
-	{ .compatible = "realtek,rtl8391-spi" },
-	{ .compatible = "realtek,rtl8392-spi" },
-	{ .compatible = "realtek,rtl8393-spi" },
+	{ .compatible = "realtek,rtl8380-spi", .data = (void *)SPI_CSMAX_3, },
+	{ .compatible = "realtek,rtl8382-spi", .data = (void *)SPI_CSMAX_3, },
+	{ .compatible = "realtek,rtl8391-spi", .data = (void *)SPI_CSMAX_3, },
+	{ .compatible = "realtek,rtl8392-spi", .data = (void *)SPI_CSMAX_3, },
+	{ .compatible = "realtek,rtl8393-spi", .data = (void *)SPI_CSMAX_3, },
+	{ .compatible = "realtek,rtl9300-spi", .data = (void *)SPI_QUAD_SUPPORTED, },
+	{ .compatible = "realtek,rtl9310-spi", .data = (void *)SPI_QUAD_SUPPORTED, },
  	{ /* sentinel */ }
  };
+
  MODULE_DEVICE_TABLE(of, realtek_rtl_spi_of_ids);

  static struct platform_driver realtek_rtl_spi_driver = {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ