* [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042
@ 2025-06-29 8:23 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:23 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv, Zixian Zeng
Add support SPI NOR flash memory controller for SG2042, using upstreamed
SG2044 SPI NOR driver.
Tested on SG2042 Pioneer Box, read, write operations.
Thanks Chen Wang who provided machine and guidance.
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
Changes in v3:
- Drop the patch which adds additional flash_info into gigadevice.c
- patch1: Because of the incompatibility, separate the SG2042 from the previous fallback mechanism to independent one.
- patch2: Newly add configurable options to spi-sg2044-nor driver.
- patch3: Fix reading bytes issue that causes the spi_nor_check_sfdp_signature() failure on SG2042.
- Link to v2: https://lore.kernel.org/r/20250525-sfg-spifmc-v2-0-a3732b6f5ab4@gmail.com
Changes in v2:
- patch1: Accept devicetree nodes whose compatible contains only
"sophgo,sg2044-spifmc-nor" to avoid breaking existing devicetrees.
- patch1: Improve the commit subject message.
- patch2: Dump the SFDP information to commit message.
- Link to v1: https://lore.kernel.org/r/20250523-sfg-spifmc-v1-0-4cf16cf3fd2a@gmail.com
---
Zixian Zeng (4):
spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
spi: spi-sg2044-nor: Add configurable chip info
spi: spi-sg2044-nor: Fix reading bytes issue on SG2042
riscv: dts: sophgo: Add SPI NOR node for SG2042
.../devicetree/bindings/spi/spi-sg2044-nor.yaml | 5 +---
.../riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 24 ++++++++++++++++++
arch/riscv/boot/dts/sophgo/sg2042.dtsi | 24 ++++++++++++++++++
drivers/spi/spi-sg2044-nor.c | 29 +++++++++++++++++++---
4 files changed, 75 insertions(+), 7 deletions(-)
---
base-commit: 880f18ee6772d4add69519cb7de2fcf9f4769cd6
change-id: 20250523-sfg-spifmc-7a910290e964
Best regards,
--
Zixian Zeng <sycamoremoon376@gmail.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-29 8:23 [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042 Zixian Zeng
@ 2025-06-29 8:23 ` Zixian Zeng
2025-06-29 9:29 ` Rob Herring (Arm)
2025-06-30 7:17 ` Krzysztof Kozlowski
2025-06-29 8:23 ` [PATCH v3 2/4] spi: spi-sg2044-nor: Add configurable chip info Zixian Zeng
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:23 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv, Zixian Zeng
SG2042 is not fully compatiable with SG2044,
So it is necessary to become independent const
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml b/Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml
index 66e54dedab140a167ad84c43f312f93af2bfa06a..1299097a210d5074cb23b644d4f102a2fb1a0e3a 100644
--- a/Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml
@@ -16,10 +16,7 @@ properties:
compatible:
oneOf:
- const: sophgo,sg2044-spifmc-nor
- - items:
- - enum:
- - sophgo,sg2042-spifmc-nor
- - const: sophgo,sg2044-spifmc-nor
+ - const: sophgo,sg2042-spifmc-nor
reg:
maxItems: 1
--
2.49.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/4] spi: spi-sg2044-nor: Add configurable chip info
2025-06-29 8:23 [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
@ 2025-06-29 8:23 ` Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 3/4] spi: spi-sg2044-nor: Fix reading bytes issue on SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042 Zixian Zeng
3 siblings, 0 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:23 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv, Zixian Zeng
Due to the differences in the SG2042 controller, a new configurable
chip_info structure is added to implement that.
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
drivers/spi/spi-sg2044-nor.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c
index a59aa3fc55d277653d01df9c83b3f0aa08edab46..09a5712822e32c9da818684e7010b70aa94ae347 100644
--- a/drivers/spi/spi-sg2044-nor.c
+++ b/drivers/spi/spi-sg2044-nor.c
@@ -84,12 +84,18 @@
#define SPIFMC_MAX_READ_SIZE 0x10000
+struct sg2044_spifmc_chip_info {
+ const u8 has_opt_reg;
+ const u32 rd_fifo_int_trigger_level;
+};
+
struct sg2044_spifmc {
struct spi_controller *ctrl;
void __iomem *io_base;
struct device *dev;
struct mutex lock;
struct clk *clk;
+ const struct sg2044_spifmc_chip_info *chip_info;
};
static int sg2044_spifmc_wait_int(struct sg2044_spifmc *spifmc, u8 int_type)
@@ -139,7 +145,7 @@ static ssize_t sg2044_spifmc_read_64k(struct sg2044_spifmc *spifmc,
reg = sg2044_spifmc_init_reg(spifmc);
reg |= (op->addr.nbytes + op->dummy.nbytes) << SPIFMC_TRAN_CSR_ADDR_BYTES_SHIFT;
- reg |= SPIFMC_TRAN_CSR_FIFO_TRG_LVL_8_BYTE;
+ reg |= spifmc->chip_info->rd_fifo_int_trigger_level;
reg |= SPIFMC_TRAN_CSR_WITH_CMD;
reg |= SPIFMC_TRAN_CSR_TRAN_MODE_RX;
@@ -335,7 +341,8 @@ static ssize_t sg2044_spifmc_trans_reg(struct sg2044_spifmc *spifmc,
reg |= SPIFMC_TRAN_CSR_TRAN_MODE_RX;
reg |= SPIFMC_TRAN_CSR_TRAN_MODE_TX;
- writel(SPIFMC_OPT_DISABLE_FIFO_FLUSH, spifmc->io_base + SPIFMC_OPT);
+ if (spifmc->chip_info->has_opt_reg)
+ writel(SPIFMC_OPT_DISABLE_FIFO_FLUSH, spifmc->io_base + SPIFMC_OPT);
} else {
/*
* If write values to the Status Register,
@@ -457,6 +464,11 @@ static int sg2044_spifmc_probe(struct platform_device *pdev)
ret = devm_mutex_init(dev, &spifmc->lock);
if (ret)
return ret;
+ spifmc->chip_info = device_get_match_data(&pdev->dev);
+ if (!spifmc->chip_info) {
+ dev_err(&pdev->dev, "Failed to get specific chip info\n");
+ return -EINVAL;
+ }
sg2044_spifmc_init(spifmc);
sg2044_spifmc_init_reg(spifmc);
@@ -468,8 +480,13 @@ static int sg2044_spifmc_probe(struct platform_device *pdev)
return 0;
}
+static const struct sg2044_spifmc_chip_info sg2044_chip_info = {
+ .has_opt_reg = true,
+ .rd_fifo_int_trigger_level = SPIFMC_TRAN_CSR_FIFO_TRG_LVL_8_BYTE,
+};
+
static const struct of_device_id sg2044_spifmc_match[] = {
- { .compatible = "sophgo,sg2044-spifmc-nor" },
+ { .compatible = "sophgo,sg2044-spifmc-nor", .data = &sg2044_chip_info },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sg2044_spifmc_match);
--
2.49.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/4] spi: spi-sg2044-nor: Fix reading bytes issue on SG2042
2025-06-29 8:23 [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 2/4] spi: spi-sg2044-nor: Add configurable chip info Zixian Zeng
@ 2025-06-29 8:23 ` Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042 Zixian Zeng
3 siblings, 0 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:23 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv, Zixian Zeng
SG2042 spi flash controller specification[1] states that:
> For Receive, an interrupt and DMA request are generated
> when the number of valid bytes in the FIFO is greater than
> or equal to the number of bytes defined by FFTrgLvl.
Auto-detecting flash with SFDP only requires reading 4 bytes
in spi_nor_check_sfdp_signature().
Because of that, no interrupt is triggered and a timeout happens instead.
Since we want to reuse this driver for SG2042, setting FFTrgLvl to a value
which is less than or equal to 4 should solve the issue.
Link: https://github.com/sophgo/sophgo-doc/blob/main/SG2042/TRM/source/SPI-flash.rst [1]
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
drivers/spi/spi-sg2044-nor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c
index 09a5712822e32c9da818684e7010b70aa94ae347..c1fe43e09c549328c0d046fc95bed130083dbbcb 100644
--- a/drivers/spi/spi-sg2044-nor.c
+++ b/drivers/spi/spi-sg2044-nor.c
@@ -485,8 +485,14 @@ static const struct sg2044_spifmc_chip_info sg2044_chip_info = {
.rd_fifo_int_trigger_level = SPIFMC_TRAN_CSR_FIFO_TRG_LVL_8_BYTE,
};
+static const struct sg2044_spifmc_chip_info sg2042_chip_info = {
+ .has_opt_reg = false,
+ .rd_fifo_int_trigger_level = SPIFMC_TRAN_CSR_FIFO_TRG_LVL_1_BYTE,
+};
+
static const struct of_device_id sg2044_spifmc_match[] = {
{ .compatible = "sophgo,sg2044-spifmc-nor", .data = &sg2044_chip_info },
+ { .compatible = "sophgo,sg2042-spifmc-nor", .data = &sg2042_chip_info },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sg2044_spifmc_match);
--
2.49.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042
2025-06-29 8:23 [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042 Zixian Zeng
` (2 preceding siblings ...)
2025-06-29 8:23 ` [PATCH v3 3/4] spi: spi-sg2044-nor: Fix reading bytes issue on SG2042 Zixian Zeng
@ 2025-06-29 8:23 ` Zixian Zeng
2025-06-29 8:37 ` Zixian Zeng
3 siblings, 1 reply; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:23 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv, Zixian Zeng
Add SPI-NOR controller and flash nodes to device tree for SG2042.
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
.../riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 24 ++++++++++++++++++++++
arch/riscv/boot/dts/sophgo/sg2042.dtsi | 24 ++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index ef3a602172b1e5bf3dcf54a8cacdad5172b7f50e..554ec14d58453a44a02a82da40a7aedb80d61dc9 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -138,6 +138,30 @@ &sd {
status = "okay";
};
+&spifmc0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <100000000>;
+ spi-tx-bus-width = <4>;
+ spi-rx-bus-width = <4>;
+ };
+};
+
+&spifmc1 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <100000000>;
+ spi-tx-bus-width = <4>;
+ spi-rx-bus-width = <4>;
+ };
+};
+
&uart0 {
pinctrl-0 = <&uart0_cfg>;
pinctrl-names = "default";
diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
index 85636d1798f11804546ed8606595ace1b4cb2a2f..0e1fcb54480af71147d0e71178a8eb08a31b75c3 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
+++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
@@ -48,6 +48,30 @@ soc: soc {
interrupt-parent = <&intc>;
ranges;
+ spifmc0: spi@7000180000 {
+ compatible = "sophgo,sg2042-spifmc-nor", "sophgo,sg2044-spifmc-nor";
+ reg = <0x70 0x00180000 0x0 0x1000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clkgen GATE_CLK_AHB_SF>;
+ interrupt-parent = <&intc>;
+ interrupts = <108 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rstgen RST_SF0>;
+ status = "disabled";
+ };
+
+ spifmc1: spi@7002180000 {
+ compatible = "sophgo,sg2042-spifmc-nor", "sophgo,sg2044-spifmc-nor";
+ reg = <0x70 0x02180000 0x0 0x1000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clkgen GATE_CLK_AHB_SF>;
+ interrupt-parent = <&intc>;
+ interrupts = <109 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rstgen RST_SF1>;
+ status = "disabled";
+ };
+
i2c0: i2c@7030005000 {
compatible = "snps,designware-i2c";
reg = <0x70 0x30005000 0x0 0x1000>;
--
2.49.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042
2025-06-29 8:23 ` [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042 Zixian Zeng
@ 2025-06-29 8:37 ` Zixian Zeng
0 siblings, 0 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-29 8:37 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li
Cc: linux-mtd, linux-kernel, sophgo, linux-spi, devicetree,
linux-riscv
On Sun, Jun 29, 2025 at 04:23:13PM +0800, Zixian Zeng wrote:
> Add SPI-NOR controller and flash nodes to device tree for SG2042.
>
> Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
> ---
> .../riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 24 ++++++++++++++++++++++
> arch/riscv/boot/dts/sophgo/sg2042.dtsi | 24 ++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> index ef3a602172b1e5bf3dcf54a8cacdad5172b7f50e..554ec14d58453a44a02a82da40a7aedb80d61dc9 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> @@ -138,6 +138,30 @@ &sd {
> status = "okay";
> };
>
> +&spifmc0 {
> + status = "okay";
> +
> + flash@0 {
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <100000000>;
> + spi-tx-bus-width = <4>;
> + spi-rx-bus-width = <4>;
> + };
> +};
> +
> +&spifmc1 {
> + status = "okay";
> +
> + flash@0 {
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <100000000>;
> + spi-tx-bus-width = <4>;
> + spi-rx-bus-width = <4>;
> + };
> +};
> +
> &uart0 {
> pinctrl-0 = <&uart0_cfg>;
> pinctrl-names = "default";
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> index 85636d1798f11804546ed8606595ace1b4cb2a2f..0e1fcb54480af71147d0e71178a8eb08a31b75c3 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> @@ -48,6 +48,30 @@ soc: soc {
> interrupt-parent = <&intc>;
> ranges;
>
> + spifmc0: spi@7000180000 {
> + compatible = "sophgo,sg2042-spifmc-nor", "sophgo,sg2044-spifmc-nor";
Sorry, This should be compatible = "sophgo,sg2042-spifmc-nor", binding
is changed in this patch series. My git branches are a bit messy, sorry
for taking your time for this issue.
> + reg = <0x70 0x00180000 0x0 0x1000000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + clocks = <&clkgen GATE_CLK_AHB_SF>;
> + interrupt-parent = <&intc>;
> + interrupts = <108 IRQ_TYPE_LEVEL_HIGH>;
> + resets = <&rstgen RST_SF0>;
> + status = "disabled";
> + };
> +
> + spifmc1: spi@7002180000 {
> + compatible = "sophgo,sg2042-spifmc-nor", "sophgo,sg2044-spifmc-nor";
Same as above, sincerely
Best regards,
Zixian
> + reg = <0x70 0x02180000 0x0 0x1000000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + clocks = <&clkgen GATE_CLK_AHB_SF>;
> + interrupt-parent = <&intc>;
> + interrupts = <109 IRQ_TYPE_LEVEL_HIGH>;
> + resets = <&rstgen RST_SF1>;
> + status = "disabled";
> + };
> +
> i2c0: i2c@7030005000 {
> compatible = "snps,designware-i2c";
> reg = <0x70 0x30005000 0x0 0x1000>;
>
> --
> 2.49.0
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
@ 2025-06-29 9:29 ` Rob Herring (Arm)
2025-06-30 7:17 ` Krzysztof Kozlowski
1 sibling, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-06-29 9:29 UTC (permalink / raw)
To: Zixian Zeng
Cc: Paul Walmsley, Tudor Ambarus, Krzysztof Kozlowski, sophgo,
Palmer Dabbelt, Mark Brown, Chen Wang, linux-mtd, Miquel Raynal,
linux-riscv, Conor Dooley, Pratyush Yadav, linux-spi, devicetree,
Michael Walle, Richard Weinberger, Albert Ou, Inochi Amaoto,
Alexandre Ghiti, Longbin Li, Vignesh Raghavendra, linux-kernel
On Sun, 29 Jun 2025 16:23:10 +0800, Zixian Zeng wrote:
> SG2042 is not fully compatiable with SG2044,
> So it is necessary to become independent const
>
> Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
> ---
> Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml: properties:compatible:oneOf: [{'const': 'sophgo,sg2044-spifmc-nor'}, {'const': 'sophgo,sg2042-spifmc-nor'}] should not be valid under {'items': {'propertyNames': {'const': 'const'}, 'required': ['const']}}
hint: Use 'enum' rather than 'oneOf' + 'const' entries
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250629-sfg-spifmc-v3-1-28db1f27e999@gmail.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
2025-06-29 9:29 ` Rob Herring (Arm)
@ 2025-06-30 7:17 ` Krzysztof Kozlowski
2025-06-30 11:47 ` Zixian Zeng
1 sibling, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-30 7:17 UTC (permalink / raw)
To: Zixian Zeng
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li, linux-mtd, linux-kernel, sophgo, linux-spi,
devicetree, linux-riscv
On Sun, Jun 29, 2025 at 04:23:10PM +0800, Zixian Zeng wrote:
> SG2042 is not fully compatiable with SG2044,
Typo, run spellcheck.
> So it is necessary to become independent const
No capital letters after ,. Anyway, explain why it is not fully
compatible.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-30 7:17 ` Krzysztof Kozlowski
@ 2025-06-30 11:47 ` Zixian Zeng
2025-06-30 11:55 ` Krzysztof Kozlowski
0 siblings, 1 reply; 11+ messages in thread
From: Zixian Zeng @ 2025-06-30 11:47 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li, linux-mtd, linux-kernel, sophgo, linux-spi,
devicetree, linux-riscv
On Mon, Jun 30, 2025 at 09:17:09AM +0200, Krzysztof Kozlowski wrote:
> On Sun, Jun 29, 2025 at 04:23:10PM +0800, Zixian Zeng wrote:
> > SG2042 is not fully compatiable with SG2044,
>
> Typo, run spellcheck.
>
Thanks for spotting that! I will add spellcheck to my patch checking script next.
> > So it is necessary to become independent const
>
> No capital letters after ,.
>
Ok, thanks
> Anyway, explain why it is not fully compatible.
>
I have asked the technical staff of SOPHGO, the SG2044 and SG2042 are indeed incompatible with each other in some places because of the hardware details, regarding the configuration of the OPT register and FFTrgLvl(fifo trigger level) bit setting.
> Best regards,
> Krzysztof
>
Best regards,
Zixian
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-30 11:47 ` Zixian Zeng
@ 2025-06-30 11:55 ` Krzysztof Kozlowski
2025-06-30 12:12 ` Zixian Zeng
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-30 11:55 UTC (permalink / raw)
To: Zixian Zeng
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li, linux-mtd, linux-kernel, sophgo, linux-spi,
devicetree, linux-riscv
On 30/06/2025 13:47, Zixian Zeng wrote:
> On Mon, Jun 30, 2025 at 09:17:09AM +0200, Krzysztof Kozlowski wrote:
>> On Sun, Jun 29, 2025 at 04:23:10PM +0800, Zixian Zeng wrote:
>>> SG2042 is not fully compatiable with SG2044,
>>
>> Typo, run spellcheck.
>>
> Thanks for spotting that! I will add spellcheck to my patch checking script next.
>
>>> So it is necessary to become independent const
>>
>> No capital letters after ,.
>>
> Ok, thanks
>
>> Anyway, explain why it is not fully compatible.
>>
> I have asked the technical staff of SOPHGO, the SG2044 and SG2042 are indeed incompatible with each other in some places because of the hardware details, regarding the configuration of the OPT register and FFTrgLvl(fifo trigger level) bit setting.
So when driver binds with sg2044, the device does not work? Or what
exactly does not work?
All this is supposed to be explained in the commit msg.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
2025-06-30 11:55 ` Krzysztof Kozlowski
@ 2025-06-30 12:12 ` Zixian Zeng
0 siblings, 0 replies; 11+ messages in thread
From: Zixian Zeng @ 2025-06-30 12:12 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Chen Wang, Inochi Amaoto,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Longbin Li, linux-mtd, linux-kernel, sophgo, linux-spi,
devicetree, linux-riscv
On Mon, Jun 30, 2025 at 01:55:58PM +0200, Krzysztof Kozlowski wrote:
> On 30/06/2025 13:47, Zixian Zeng wrote:
> > On Mon, Jun 30, 2025 at 09:17:09AM +0200, Krzysztof Kozlowski wrote:
> >> On Sun, Jun 29, 2025 at 04:23:10PM +0800, Zixian Zeng wrote:
> >>> SG2042 is not fully compatiable with SG2044,
> >>
> >> Typo, run spellcheck.
> >>
> > Thanks for spotting that! I will add spellcheck to my patch checking script next.
> >
> >>> So it is necessary to become independent const
> >>
> >> No capital letters after ,.
> >>
> > Ok, thanks
> >
> >> Anyway, explain why it is not fully compatible.
> >>
> > I have asked the technical staff of SOPHGO,
> > the SG2044 and SG2042 are indeed incompatible with each other in some places
> > because of the hardware details, regarding the configuration of the OPT register
> > and FFTrgLvl(fifo trigger level) bit setting.
>
> So when driver binds with sg2044, the device does not work? Or what
> exactly does not work?
>
> All this is supposed to be explained in the commit msg.
>
I got it, I think I had explained this in the driver patch[3/4].
If this reason is acceptable, I would like to ask whether
the explanation should be put in the binding patch commit msg [1/4]
instead of the driver patch commit msg [3/4]? or both?
Thank you.
> Best regards,
> Krzysztof
Best regards,
Zixian
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-06-30 12:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-29 8:23 [PATCH v3 0/4] spi: sophgo: Add SPI NOR controller for SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 1/4] spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042 Zixian Zeng
2025-06-29 9:29 ` Rob Herring (Arm)
2025-06-30 7:17 ` Krzysztof Kozlowski
2025-06-30 11:47 ` Zixian Zeng
2025-06-30 11:55 ` Krzysztof Kozlowski
2025-06-30 12:12 ` Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 2/4] spi: spi-sg2044-nor: Add configurable chip info Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 3/4] spi: spi-sg2044-nor: Fix reading bytes issue on SG2042 Zixian Zeng
2025-06-29 8:23 ` [PATCH v3 4/4] riscv: dts: sophgo: Add SPI NOR node for SG2042 Zixian Zeng
2025-06-29 8:37 ` Zixian Zeng
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).