]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: cadence: Remove cdns,is-dma DT property
authorMichal Simek <michal.simek@amd.com>
Mon, 10 Nov 2025 15:19:56 +0000 (16:19 +0100)
committerMichal Simek <michal.simek@amd.com>
Fri, 19 Dec 2025 07:25:27 +0000 (08:25 +0100)
cdns,is-dma is not documented property that's why setup CQSPI_DMA_MODE
quirk to enable DMA mode based on compatible string. And also change
compatible string for mini configurations also with recording compatible
string in the driver (Compatible string is already the part of existing DT
binding).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f109829793900e57558d98ed22caf80c1a72b232.1762787994.git.michal.simek@amd.com
arch/arm/dts/versal-mini-ospi.dtsi
arch/arm/dts/versal-net-mini-ospi.dtsi
drivers/spi/cadence_qspi.c
drivers/spi/cadence_qspi.h

index eec2a08e7c70b49627e716ed6dc0efd95b45b527..8429dc585d5110899febbcec5376af5726eb05a1 100644 (file)
@@ -29,7 +29,7 @@
        };
 
        ospi: spi@f1010000 {
-               compatible = "cdns,qspi-nor";
+               compatible = "xlnx,versal-ospi-1.0", "cdns,qspi-nor";
                status = "okay";
                reg = <0 0xf1010000 0 0x10000 0 0xc0000000 0 0x20000000>;
                clock-names = "ref_clk", "pclk";
@@ -38,7 +38,6 @@
                num-cs = <1>;
                cdns,fifo-depth = <256>;
                cdns,fifo-width = <4>;
-               cdns,is-dma = <1>;
                cdns,trigger-address = <0xc0000000>;
                #address-cells = <1>;
                #size-cells = <0>;
index 1c94b352dc97b07f83ef8b465ccc0a271a65cd8f..78404960f2f3bdec6be4c838df2f689ed01c36d8 100644 (file)
@@ -43,7 +43,7 @@
        };
 
        ospi: spi@f1010000 {
-               compatible = "cdns,qspi-nor";
+               compatible = "xlnx,versal-ospi-1.0", "cdns,qspi-nor";
                status = "okay";
                reg = <0 0xf1010000 0 0x10000>, <0 0xc0000000 0 0x20000000>;
                clock-names = "ref_clk", "pclk";
@@ -52,7 +52,6 @@
                num-cs = <1>;
                cdns,fifo-depth = <256>;
                cdns,fifo-width = <4>;
-               cdns,is-dma = <1>;
                cdns,is-stig-pgm = <1>;
                cdns,trigger-address = <0xc0000000>;
                #address-cells = <1>;
index 9b45cab9c04cb6113f831f01b180655ea54c0a16..892dc3557a5e36eb2b8fea044b55c738a060734d 100644 (file)
@@ -29,6 +29,7 @@
 
 /* Quirks */
 #define CQSPI_DISABLE_STIG_MODE                BIT(0)
+#define CQSPI_DMA_MODE                 BIT(1)
 
 __weak int cadence_qspi_apb_dma_read(struct cadence_spi_priv *priv,
                                     const struct spi_mem_op *op)
@@ -210,7 +211,6 @@ static int cadence_spi_probe(struct udevice *bus)
 
        priv->regbase           = plat->regbase;
        priv->ahbbase           = plat->ahbbase;
-       priv->is_dma            = plat->is_dma;
        priv->is_decoded_cs     = plat->is_decoded_cs;
        priv->fifo_depth        = plat->fifo_depth;
        priv->fifo_width        = plat->fifo_width;
@@ -227,6 +227,11 @@ static int cadence_spi_probe(struct udevice *bus)
        priv->tslch_ns          = plat->tslch_ns;
        priv->quirks            = plat->quirks;
 
+       if (priv->quirks & CQSPI_DMA_MODE) {
+               priv->is_dma = true;
+               debug("Cadence QSPI: DMA mode enabled\n");
+       }
+
        if (IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE))
                xilinx_pm_request(PM_REQUEST_NODE, PM_DEV_OSPI,
                                  ZYNQMP_PM_CAPABILITY_ACCESS, ZYNQMP_PM_MAX_QOS,
@@ -412,8 +417,6 @@ static int cadence_spi_of_to_plat(struct udevice *bus)
        if (plat->ahbsize >= SZ_8M)
                priv->use_dac_mode = true;
 
-       plat->is_dma = dev_read_bool(bus, "cdns,is-dma");
-
        /* All other parameters are embedded in the child node */
        subnode = cadence_qspi_get_subnode(bus);
        if (!ofnode_valid(subnode)) {
@@ -473,6 +476,10 @@ static const struct cqspi_driver_platdata cdns_qspi = {
        .quirks = CQSPI_DISABLE_STIG_MODE,
 };
 
+static const struct cqspi_driver_platdata cdns_xilinx_qspi = {
+       .quirks = CQSPI_DMA_MODE,
+};
+
 static const struct udevice_id cadence_spi_ids[] = {
        {
                .compatible = "cdns,qspi-nor",
@@ -482,7 +489,12 @@ static const struct udevice_id cadence_spi_ids[] = {
                .compatible = "ti,am654-ospi"
        },
        {
-               .compatible = "amd,versal2-ospi"
+               .compatible = "amd,versal2-ospi",
+               .data = (ulong)&cdns_xilinx_qspi,
+       },
+       {
+               .compatible = "xlnx,versal-ospi-1.0",
+               .data = (ulong)&cdns_xilinx_qspi,
        },
        { }
 };
index 879e7f8dbfb8343bce58048bd0087b97ff6b0601..1e9081c2d17b01a622b99f666572f6386ad8fe20 100644 (file)
@@ -223,8 +223,6 @@ struct cadence_spi_plat {
        u32             tchsh_ns;
        u32             tslch_ns;
        u32             quirks;
-
-       bool            is_dma;
 };
 
 struct cadence_spi_priv {