devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC
@ 2023-03-02 10:52 William Qiu
  2023-03-02 10:52 ` [PATCH v1 1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets William Qiu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: William Qiu @ 2023-03-02 10:52 UTC (permalink / raw)
  To: devicetree, linux-spi, linux-kernel
  Cc: Rob Herring, Krzysztof Kozlowski, Philipp Zabel, Mark Brown,
	William Qiu, Ziv Xu

Hi,

This patchset adds initial rudimentary support for the StarFive
Quad SPI controller driver. And this driver will be used in
StarFive's VisionFive 2 board.The first patch constrain
minItems/maxItems of resets for JH7110 QSPI and Patch 2 adds
support for StarFive JH7110 QSPI.

The patch series is based on v6.2.

William Qiu (2):
  dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of
    resets
  spi: cadence-quadspi: Add support for StarFive JH7110 QSPI

 .../bindings/spi/cdns,qspi-nor.yaml           | 37 +++++++++++++++++--
 drivers/spi/Kconfig                           |  2 +-
 drivers/spi/spi-cadence-quadspi.c             | 21 ++++++++++-
 3 files changed, 54 insertions(+), 6 deletions(-)

--
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets
  2023-03-02 10:52 [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC William Qiu
@ 2023-03-02 10:52 ` William Qiu
  2023-03-02 10:52 ` [PATCH v1 2/2] spi: cadence-quadspi: Add support for StarFive JH7110 QSPI William Qiu
  2023-03-06 13:32 ` [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: William Qiu @ 2023-03-02 10:52 UTC (permalink / raw)
  To: devicetree, linux-spi, linux-kernel
  Cc: Rob Herring, Krzysztof Kozlowski, Philipp Zabel, Mark Brown,
	William Qiu, Ziv Xu

The QSPI controller needs three reset items to work properly on JH7110 SoC,
so there is need to change the maxItems's value to 3 and add minItems
whose value is equal to 2. Other platforms do not have this constraint.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
---
 .../bindings/spi/cdns,qspi-nor.yaml           | 37 +++++++++++++++++--
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index 4707294d8f59..14821cb6db48 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -19,6 +19,33 @@ allOf:
     then:
       required:
         - power-domains
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: starfive,jh7110-qspi
+    then:
+      properties:
+        resets:
+          minItems: 2
+          maxItems: 3
+
+        reset-names:
+          minItems: 2
+          maxItems: 3
+          items:
+            enum: [ qspi, qspi-ocp, rstc_ref ]
+
+    else:
+      properties:
+        resets:
+          maxItems: 2
+
+        reset-names:
+          minItems: 1
+          maxItems: 2
+          items:
+            enum: [ qspi, qspi-ocp ]
 
 properties:
   compatible:
@@ -30,6 +57,7 @@ properties:
               - intel,lgm-qspi
               - xlnx,versal-ospi-1.0
               - intel,socfpga-qspi
+              - starfive,jh7110-qspi
           - const: cdns,qspi-nor
       - const: cdns,qspi-nor
 
@@ -79,13 +107,14 @@ properties:
     maxItems: 1
 
   resets:
-    maxItems: 2
+    minItems: 2
+    maxItems: 3
 
   reset-names:
-    minItems: 1
-    maxItems: 2
+    minItems: 2
+    maxItems: 3
     items:
-      enum: [ qspi, qspi-ocp ]
+      enum: [ qspi, qspi-ocp, rstc_ref ]
 
 required:
   - compatible
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] spi: cadence-quadspi: Add support for StarFive JH7110 QSPI
  2023-03-02 10:52 [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC William Qiu
  2023-03-02 10:52 ` [PATCH v1 1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets William Qiu
@ 2023-03-02 10:52 ` William Qiu
  2023-03-06 13:32 ` [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: William Qiu @ 2023-03-02 10:52 UTC (permalink / raw)
  To: devicetree, linux-spi, linux-kernel
  Cc: Rob Herring, Krzysztof Kozlowski, Philipp Zabel, Mark Brown,
	William Qiu, Ziv Xu

Add QSPI reset operation in device probe and add RISCV support to
QUAD SPI Kconfig.

Co-developed-by: Ziv Xu <ziv.xu@starfivetech.com>
Signed-off-by: Ziv Xu <ziv.xu@starfivetech.com>
Signed-off-by: William Qiu <william.qiu@starfivetech.com>
---
 drivers/spi/Kconfig               |  2 +-
 drivers/spi/spi-cadence-quadspi.c | 21 ++++++++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 3b1c0878bb85..c64edea53af6 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -230,7 +230,7 @@ config SPI_CADENCE
 
 config SPI_CADENCE_QUADSPI
 	tristate "Cadence Quad SPI controller"
-	depends on OF && (ARM || ARM64 || X86 || COMPILE_TEST)
+	depends on OF && (ARM || ARM64 || X86 || RISCV || COMPILE_TEST)
 	help
 	  Enable support for the Cadence Quad SPI Flash controller.
 
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 676313e1bdad..d9795e108ec5 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1583,7 +1583,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi)
 static int cqspi_probe(struct platform_device *pdev)
 {
 	const struct cqspi_driver_platdata *ddata;
-	struct reset_control *rstc, *rstc_ocp;
+	struct reset_control *rstc, *rstc_ocp, *rstc_ref;
 	struct device *dev = &pdev->dev;
 	struct spi_master *master;
 	struct resource *res_ahb;
@@ -1673,6 +1673,17 @@ static int cqspi_probe(struct platform_device *pdev)
 		goto probe_reset_failed;
 	}
 
+	if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi")) {
+		rstc_ref = devm_reset_control_get_optional_exclusive(dev, "rstc_ref");
+		if (IS_ERR(rstc_ref)) {
+			ret = PTR_ERR(rstc_ref);
+			dev_err(dev, "Cannot get QSPI REF reset.\n");
+			goto probe_reset_failed;
+		}
+		reset_control_assert(rstc_ref);
+		reset_control_deassert(rstc_ref);
+	}
+
 	reset_control_assert(rstc);
 	reset_control_deassert(rstc);
 
@@ -1825,6 +1836,10 @@ static const struct cqspi_driver_platdata versal_ospi = {
 	.get_dma_status = cqspi_get_versal_dma_status,
 };
 
+static const struct cqspi_driver_platdata jh7110_qspi = {
+	.quirks = CQSPI_DISABLE_DAC_MODE,
+};
+
 static const struct of_device_id cqspi_dt_ids[] = {
 	{
 		.compatible = "cdns,qspi-nor",
@@ -1850,6 +1865,10 @@ static const struct of_device_id cqspi_dt_ids[] = {
 		.compatible = "intel,socfpga-qspi",
 		.data = &socfpga_qspi,
 	},
+	{
+		.compatible = "starfive,jh7110-qspi",
+		.data = &jh7110_qspi,
+	},
 	{ /* end of table */ }
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC
  2023-03-02 10:52 [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC William Qiu
  2023-03-02 10:52 ` [PATCH v1 1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets William Qiu
  2023-03-02 10:52 ` [PATCH v1 2/2] spi: cadence-quadspi: Add support for StarFive JH7110 QSPI William Qiu
@ 2023-03-06 13:32 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-03-06 13:32 UTC (permalink / raw)
  To: devicetree, linux-spi, linux-kernel, William Qiu
  Cc: Rob Herring, Krzysztof Kozlowski, Philipp Zabel, Ziv Xu

On Thu, 02 Mar 2023 18:52:19 +0800, William Qiu wrote:
> This patchset adds initial rudimentary support for the StarFive
> Quad SPI controller driver. And this driver will be used in
> StarFive's VisionFive 2 board.The first patch constrain
> minItems/maxItems of resets for JH7110 QSPI and Patch 2 adds
> support for StarFive JH7110 QSPI.
> 
> The patch series is based on v6.2.
> 
> [...]

Applied to

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

Thanks!

[1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets
      commit: 13f1033e07588b7d1151d22d7ee3ca8f16181de7
[2/2] spi: cadence-quadspi: Add support for StarFive JH7110 QSPI
      commit: 47fef94afeae2a125607b6b45145594713471320

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-06 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02 10:52 [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC William Qiu
2023-03-02 10:52 ` [PATCH v1 1/2] dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets William Qiu
2023-03-02 10:52 ` [PATCH v1 2/2] spi: cadence-quadspi: Add support for StarFive JH7110 QSPI William Qiu
2023-03-06 13:32 ` [PATCH v1 0/2] Add Quad SPI driver for StarFive JH7110 SoC Mark Brown

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).