[OpenWrt-Devel] [PATCH 3/9] sunxi: spi flash dts changes

Oskari Lemmela oskari at lemmela.net
Mon Jan 14 12:54:23 EST 2019


Backport A64 SPI flash DTS changes to 4.14 kernel.

Add Openwrt specific flash partitions to Sopine.

Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
---
 ...80-arm64-allwinner-a64-add-SPI-nodes.patch | 83 +++++++++++++++++++
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch | 41 +++++++++
 ...a64-sopine-Add-Sopine-flash-partitio.patch | 51 ++++++++++++
 ...a64-sopine-Add-Sopine-flash-partitio.patch | 51 ++++++++++++
 4 files changed, 226 insertions(+)
 create mode 100644 target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
 create mode 100644 target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
 create mode 100644 target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch

diff --git a/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
new file mode 100644
index 0000000000..0608f13629
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
@@ -0,0 +1,83 @@
+From b518bb159032aac33503fd4cf98706dc84cc1266 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens at rwth-aachen.de>
+Date: Thu, 31 Aug 2017 01:06:37 +0200
+Subject: [PATCH] arm64: allwinner: a64: add SPI nodes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The A64 SPI controllers are register compatible to the h3/h5 SPI
+controllers.
+
+The A64 has two SPI controllers, each with a single chip select.
+The handles for the DMA channels (23/24 for SPI0/SPI1) are omitted,
+as the A64 DMA support is currently missing.
+
+Signed-off-by: Stefan Brüns <stefan.bruens at rwth-aachen.de>
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+---
+ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 41 +++++++++++++++++++
+ 1 file changed, 41 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+index 8c8db1b057df..20aba7b186aa 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+@@ -325,6 +325,16 @@
+ 				drive-strength = <40>;
+ 			};
+ 
++			spi0_pins: spi0 {
++				pins = "PC0", "PC1", "PC2", "PC3";
++				function = "spi0";
++			};
++
++			spi1_pins: spi1 {
++				pins = "PD0", "PD1", "PD2", "PD3";
++				function = "spi1";
++			};
++
+ 			uart0_pins_a: uart0 at 0 {
+ 				pins = "PB8", "PB9";
+ 				function = "uart0";
+@@ -449,6 +459,37 @@
+ 			#size-cells = <0>;
+ 		};
+ 
++
++		spi0: spi at 01c68000 {
++			compatible = "allwinner,sun8i-h3-spi";
++			reg = <0x01c68000 0x1000>;
++			interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
++			clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
++			clock-names = "ahb", "mod";
++			pinctrl-names = "default";
++			pinctrl-0 = <&spi0_pins>;
++			resets = <&ccu RST_BUS_SPI0>;
++			status = "disabled";
++			num-cs = <1>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++		};
++
++		spi1: spi at 01c69000 {
++			compatible = "allwinner,sun8i-h3-spi";
++			reg = <0x01c69000 0x1000>;
++			interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
++			clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
++			clock-names = "ahb", "mod";
++			pinctrl-names = "default";
++			pinctrl-0 = <&spi1_pins>;
++			resets = <&ccu RST_BUS_SPI1>;
++			status = "disabled";
++			num-cs = <1>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++		};
++
+ 		gic: interrupt-controller at 1c81000 {
+ 			compatible = "arm,gic-400";
+ 			reg = <0x01c81000 0x1000>,
+-- 
+2.17.1
+
diff --git a/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch b/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
new file mode 100644
index 0000000000..c975823447
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
@@ -0,0 +1,41 @@
+From 4661c3afefe900ff7b5004aca0a2c927cfa37f3b Mon Sep 17 00:00:00 2001
+From: Emmanuel Vadot <manu at freebsd.org>
+Date: Mon, 21 May 2018 13:54:13 +0200
+Subject: [PATCH] arm64: dts: allwinner: sun50i: a64: Add spi flash node for
+ sopine
+
+The Sopine and Pine64-LTS have a winbond w25q128 spi flash on spi0.
+Add a node for it.
+
+Signed-off-by: Emmanuel Vadot <manu at freebsd.org>
+Signed-off-by: Maxime Ripard <maxime.ripard at bootlin.com>
+---
+ arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+index 43418bd881d8..b94f93c04acb 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+@@ -66,6 +66,18 @@
+ 	};
+ };
+ 
++&spi0  {
++	status = "okay";
++
++	flash at 0 {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		compatible = "jedec,spi-nor";
++		reg = <0>;
++		spi-max-frequency = <40000000>;
++	};
++};
++
+ #include "axp803.dtsi"
+ 
+ &reg_aldo2 {
+-- 
+2.17.1
+
diff --git a/target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch b/target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
new file mode 100644
index 0000000000..200cf9555e
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
@@ -0,0 +1,51 @@
+From 7d87d3dafc4b1ea5659eb71ee6c5fd5308490d1f Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela <oskari at lemmela.net>
+Date: Mon, 31 Dec 2018 07:44:49 +0200
+Subject: [PATCH] arm64: allwinner: a64-sopine: Add Sopine flash partitions.
+
+First 896kB to u-boot. Enough space for SPL, u-boot and ATF.
+Next 128kB to u-boot environment and rest to firmware.
+
+Firmware partition is compatible FIT image dynamic splitting.
+
+Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
+---
+ .../boot/dts/allwinner/sun50i-a64-sopine.dtsi | 22 +++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+index 6723b8695e0b..3e879fefe3d5 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+@@ -78,6 +78,28 @@
+ 		compatible = "jedec,spi-nor";
+ 		reg = <0>;
+ 		spi-max-frequency = <40000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition at 0 {
++				label = "u-boot";
++				reg = <0x000000 0x0E0000>;
++			};
++
++			partition at e0000 {
++				label = "u-boot-env";
++				reg = <0x0E0000 0x020000>;
++			};
++
++			partition at 100000 {
++				compatible = "denx,fit";
++				label = "firmware";
++				reg = <0x100000 0xF00000>;
++			};
++		};
+ 	};
+ };
+ 
+-- 
+2.17.1
+
diff --git a/target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch b/target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
new file mode 100644
index 0000000000..200cf9555e
--- /dev/null
+++ b/target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
@@ -0,0 +1,51 @@
+From 7d87d3dafc4b1ea5659eb71ee6c5fd5308490d1f Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela <oskari at lemmela.net>
+Date: Mon, 31 Dec 2018 07:44:49 +0200
+Subject: [PATCH] arm64: allwinner: a64-sopine: Add Sopine flash partitions.
+
+First 896kB to u-boot. Enough space for SPL, u-boot and ATF.
+Next 128kB to u-boot environment and rest to firmware.
+
+Firmware partition is compatible FIT image dynamic splitting.
+
+Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
+---
+ .../boot/dts/allwinner/sun50i-a64-sopine.dtsi | 22 +++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+index 6723b8695e0b..3e879fefe3d5 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+@@ -78,6 +78,28 @@
+ 		compatible = "jedec,spi-nor";
+ 		reg = <0>;
+ 		spi-max-frequency = <40000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition at 0 {
++				label = "u-boot";
++				reg = <0x000000 0x0E0000>;
++			};
++
++			partition at e0000 {
++				label = "u-boot-env";
++				reg = <0x0E0000 0x020000>;
++			};
++
++			partition at 100000 {
++				compatible = "denx,fit";
++				label = "firmware";
++				reg = <0x100000 0xF00000>;
++			};
++		};
+ 	};
+ };
+ 
+-- 
+2.17.1
+
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list