[PATCH] arm: dts: add nand device in sun7i-a20-haoyu-marsboard.dts

Conley Lee posted 1 patch 1 month ago
.../allwinner/sun7i-a20-haoyu-marsboard.dts   | 67 +++++++++++++++++++
1 file changed, 67 insertions(+)
[PATCH] arm: dts: add nand device in sun7i-a20-haoyu-marsboard.dts
Posted by Conley Lee 1 month ago
The Haoyu MarsBoard-A20 comes with an 8G Hynix NAND flash,
and this commit adds this NAND device in the device tree.

Signed-off-by: Conley Lee <conleylee@foxmail.com>
---
 .../allwinner/sun7i-a20-haoyu-marsboard.dts   | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/arch/arm/boot/dts/allwinner/sun7i-a20-haoyu-marsboard.dts b/arch/arm/boot/dts/allwinner/sun7i-a20-haoyu-marsboard.dts
index 097e479c2..62d775c4f 100644
--- a/arch/arm/boot/dts/allwinner/sun7i-a20-haoyu-marsboard.dts
+++ b/arch/arm/boot/dts/allwinner/sun7i-a20-haoyu-marsboard.dts
@@ -118,6 +118,58 @@ gmac_txerr: gmac-txerr-pin {
 		pins = "PA17";
 		function = "gmac";
 	};
+
+	nand_pins_a: nand_base0@0 {
+		pins = "PC0", "PC1", "PC2",
+		"PC5", "PC8", "PC9", "PC10",
+		"PC11", "PC12", "PC13", "PC14",
+		"PC15", "PC16";
+		function = "nand0";
+		drive-strength = <10>;
+	};
+
+	nand_cs0_pins_a: nand_cs@0 {
+		pins = "PC4";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
+	nand_cs1_pins_a: nand_cs@1 {
+		pins = "PC3";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
+	nand_cs2_pins_a: nand_cs@2 {
+		pins = "PC17";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
+	nand_cs3_pins_a: nand_cs@3 {
+		pins = "PC18";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
+	nand_rb0_pins_a: nand_rb@0 {
+		pins = "PC6";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
+	nand_rb1_pins_a: nand_rb@1 {
+		pins = "PC7";
+		function = "nand0";
+		drive-strength = <10>;
+		bias-pull-up;
+	};
+
 };
 
 &reg_ahci_5v {
@@ -180,3 +232,18 @@ &usbphy {
 	usb2_vbus-supply = <&reg_usb2_vbus>;
 	status = "okay";
 };
+
+&nfc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&nand_pins_a>, <&nand_cs0_pins_a>, <&nand_rb0_pins_a>, <&nand_cs1_pins_a>, <&nand_rb1_pins_a>;
+	status = "okay";
+
+	nand@0 {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		reg = <0>;
+		allwinner,rb = <0>;
+		nand-ecc-mode = "hw";
+		nand-on-flash-bbt;
+	};
+};
-- 
2.25.1
Re: [PATCH] arm: dts: add nand device in sun7i-a20-haoyu-marsboard.dts
Posted by Maxime Ripard 1 month ago
On Mon, Sep 01, 2025 at 05:05:21PM +0800, Conley Lee wrote:
> The Haoyu MarsBoard-A20 comes with an 8G Hynix NAND flash,
> and this commit adds this NAND device in the device tree.
> 
> Signed-off-by: Conley Lee <conleylee@foxmail.com>

MLC NANDs are very unreliable, we must not enable them by default in the
current state of UBI / UBIFS.

Maxime
Re: [PATCH] arm: dts: add nand device in sun7i-a20-haoyu-marsboard.dts
Posted by Rob Herring (Arm) 1 month ago
On Mon, 01 Sep 2025 17:05:21 +0800, Conley Lee wrote:
> The Haoyu MarsBoard-A20 comes with an 8G Hynix NAND flash,
> and this commit adds this NAND device in the device tree.
> 
> Signed-off-by: Conley Lee <conleylee@foxmail.com>
> ---
>  .../allwinner/sun7i-a20-haoyu-marsboard.dts   | 67 +++++++++++++++++++
>  1 file changed, 67 insertions(+)
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


This patch series was applied (using b4) to base:
 Base: attempting to guess base-commit...
 Base: tags/next-20250829 (exact match)

If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/allwinner/' for tencent_57056C4B1E98EF5C0517A5685B2E4D060508@qq.com:

arch/arm/boot/dts/allwinner/sun7i-a20-haoyu-marsboard.dtb: pinctrl@1c20800 (allwinner,sun7i-a20-pinctrl): 'nand_base0@0', 'nand_cs@0', 'nand_cs@1', 'nand_cs@2', 'nand_cs@3', 'nand_rb@0', 'nand_rb@1' do not match any of the regexes: '^([rs]-)?(([a-z0-9]{3,}|[a-oq-z][a-z0-9]*?)?-)+?(p[a-ilm][0-9]*?-)??pins?$', '^pinctrl-[0-9]+$', '^vcc-p[a-ilm]-supply$'
	from schema $id: http://devicetree.org/schemas/pinctrl/allwinner,sun4i-a10-pinctrl.yaml#