Skip to contentSkip to conversation

ARM: dts: at91: sama5d2_icp: add QSPI1 device

PATCH In review Eugen Hristev 2 participants 6 messages Aug 17, 2021 – Sep 7, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ARM: dts: at91: sama5d2_icp: add QSPI1 device

From: Mihai Sain <[email protected]>

Add support for sst26vf064b 64Mbit qspi-flash that is present on sama5d2_icp board.

[[email protected]: move u-boot properties to sama5d2_icp-u-boot.dtsi]
---
 arch/arm/dts/at91-sama5d2_icp-u-boot.dtsi | 16 +++++++++++++
 arch/arm/dts/at91-sama5d2_icp.dts         | 29 +++++++++++++++++++++++
 2 files changed, 45 insertions(+)
arch/arm/dts/at91-sama5d2_icp-u-boot.dtsi +16 -0
index 347fa813e9..68c27f229f 100644
@@ -28,3 +28,19 @@
 &pinctrl_mikrobus1_uart {
 	u-boot,dm-pre-reloc;
 };
+
+&pinctrl_qspi1_sck_cs_default {
+	u-boot,dm-pre-reloc;
+};
+
+&pinctrl_qspi1_dat_default {
+	u-boot,dm-pre-reloc;
+};
+
+&qspi1 {
+	u-boot,dm-pre-reloc;
+
+	flash@0 {
+		u-boot,dm-pre-reloc;
+	};
+};
arch/arm/dts/at91-sama5d2_icp.dts +29 -0
index f81fa60171..2c6e91c1c7 100644
@@ -33,6 +33,21 @@
 		};
 
 		apb {
+
+			qspi1: spi@f0024000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_qspi1_sck_cs_default &pinctrl_qspi1_dat_default>;
+				status = "okay";
+
+				flash@0 {
+					compatible = "jedec,spi-nor";
+					reg = <0>;
+					spi-max-frequency = <83000000>;
+					spi-rx-bus-width = <4>;
+					spi-tx-bus-width = <4>;
+				};
+			};
+
 			uart0: serial@f801c000 { /* mikrobus1 uart */
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_mikrobus1_uart>;
@@ -109,6 +124,20 @@
 						bias-pull-up;
 					};
 
+					pinctrl_qspi1_sck_cs_default: qspi1_sck_cs_default {
+						pinmux = <PIN_PA6__QSPI1_SCK>,
+							 <PIN_PA11__QSPI1_CS>;
+						bias-disable;
+					};
+
+					pinctrl_qspi1_dat_default: qspi1_dat_default {
+						pinmux = <PIN_PA7__QSPI1_IO0>,
+							 <PIN_PA8__QSPI1_IO1>,
+							 <PIN_PA9__QSPI1_IO2>,
+							 <PIN_PA10__QSPI1_IO3>;
+						bias-pull-up;
+					};
+
 					pinctrl_sdmmc0_default: sdmmc0_default {
 						pinmux = <PIN_PA1__SDMMC0_CMD>,
 							 <PIN_PA2__SDMMC0_DAT0>,
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/4 ARM: dts: at91: sama5d2_icp: cosmetic arrangement of the nodes

Reorder the nodes following the kernel rules: nodes in a range are sorted by ascending bus address, and when referenced by phandle, are ordered alphabetically.

---
 arch/arm/dts/at91-sama5d2_icp-u-boot.dtsi | 23 +++++++++++----------
 arch/arm/dts/at91-sama5d2_icp.dts         | 25 ++++++++++++-----------
 2 files changed, 25 insertions(+), 23 deletions(-)
arch/arm/dts/at91-sama5d2_icp-u-boot.dtsi +12 -11
index 68c27f229f..b45de978c2 100644
@@ -13,34 +13,35 @@
 	};
 };
 
-&sdmmc0 {
+&pinctrl_mikrobus1_uart {
 	u-boot,dm-pre-reloc;
 };
 
-&uart0 { /* mikrobus1 uart */
+&pinctrl_qspi1_sck_cs_default {
 	u-boot,dm-pre-reloc;
 };
 
-&pinctrl_sdmmc0_default {
+&pinctrl_qspi1_dat_default {
 	u-boot,dm-pre-reloc;
 };
 
-&pinctrl_mikrobus1_uart {
+&pinctrl_sdmmc0_default {
 	u-boot,dm-pre-reloc;
 };
 
-&pinctrl_qspi1_sck_cs_default {
+&qspi1 {
 	u-boot,dm-pre-reloc;
+
+	flash@0 {
+		u-boot,dm-pre-reloc;
+	};
 };
 
-&pinctrl_qspi1_dat_default {
+&sdmmc0 {
 	u-boot,dm-pre-reloc;
 };
 
-&qspi1 {
+&uart0 { /* mikrobus1 uart */
 	u-boot,dm-pre-reloc;
-
-	flash@0 {
-		u-boot,dm-pre-reloc;
-	};
 };
+
arch/arm/dts/at91-sama5d2_icp.dts +13 -12
index 2c6e91c1c7..44522197ff 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+ OR MIT
 /*
  * at91-sama5d2_icp.dts - Device Tree file for SAMA5D2 ICP board
- *			SAMA5D2 Industrial Connectivity Board
+ *			SAMA5D2 Industrial Connectivity Platform
  *
  *  Copyright (c) 2018, Microchip Technology Inc.
  *                2018, Eugen Hristev <[email protected]>
@@ -48,16 +48,16 @@
 				};
 			};
 
-			uart0: serial@f801c000 { /* mikrobus1 uart */
+			macb0: ethernet@f8008000 {
 				pinctrl-names = "default";
-				pinctrl-0 = <&pinctrl_mikrobus1_uart>;
+				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq &pinctrl_macb0_rst>;
+				phy-mode = "internal";
 				status = "okay";
 			};
 
-			macb0: ethernet@f8008000 {
+			uart0: serial@f801c000 { /* mikrobus1 uart */
 				pinctrl-names = "default";
-				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq &pinctrl_macb0_rst>;
-				phy-mode = "internal";
+				pinctrl-0 = <&pinctrl_mikrobus1_uart>;
 				status = "okay";
 			};
 
@@ -85,6 +85,7 @@
 					pagesize = <16>;
 				};
 			};
+
 			pioA: gpio@fc038000 {
 				status = "okay";
 				pinctrl {
@@ -124,6 +125,12 @@
 						bias-pull-up;
 					};
 
+					pinctrl_mikrobus1_uart: mikrobus1_uart {
+						pinmux = <PIN_PB26__URXD0>,
+							 <PIN_PB27__UTXD0>;
+						bias-disable;
+					};
+
 					pinctrl_qspi1_sck_cs_default: qspi1_sck_cs_default {
 						pinmux = <PIN_PA6__QSPI1_SCK>,
 							 <PIN_PA11__QSPI1_CS>;
@@ -148,12 +155,6 @@
 							 <PIN_PA13__SDMMC0_CD>;
 						bias-disable;
 					};
-
-					pinctrl_mikrobus1_uart: mikrobus1_uart {
-						pinmux = <PIN_PB26__URXD0>,
-							 <PIN_PB27__UTXD0>;
-						bias-disable;
-					};
 				};
 			};
 		};
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/4 ARM: dts: at91: sama5d2: fix dtc warning for ohci and ehci

In reply to Eugen Hristev

Fixed the following DTC build warning (reproducible with W=1)

arch/arm/dts/at91-sama5d2_icp.dtb: Warning (unit_address_format): /ahb/ohci@00400000: unit name should not have leading 0s arch/arm/dts/at91-sama5d2_icp.dtb: Warning (unit_address_format): /ahb/ehci@00500000: unit name should not have leading 0s

---
 arch/arm/dts/at91-sama5d27_som1_ek.dts | 4 ++--
 arch/arm/dts/at91-sama5d2_ptc_ek.dts   | 4 ++--
 arch/arm/dts/at91-sama5d2_xplained.dts | 4 ++--
 arch/arm/dts/sama5d2.dtsi              | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/dts/at91-sama5d27_som1_ek.dts +2 -2
index ee851a1bef..efd1a5d197 100644
@@ -68,7 +68,7 @@
 	};
 
 	ahb {
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <&pioA 42 0>;
 			pinctrl-names = "default";
@@ -76,7 +76,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/at91-sama5d2_ptc_ek.dts +2 -2
index cd3711a02a..f45fb1ef26 100644
@@ -76,7 +76,7 @@
 			status = "okay";
 		};
 
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <0
 					   &pioA PIN_PB12 GPIO_ACTIVE_HIGH
@@ -87,7 +87,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/at91-sama5d2_xplained.dts +2 -2
index b733c4d4ce..e7c91c5fec 100644
@@ -25,7 +25,7 @@
 	};
 
 	ahb {
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <&pioA 42 0>;
 			pinctrl-names = "default";
@@ -33,7 +33,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/sama5d2.dtsi +2 -2
index 6fb2cb25f9..d8a125b073 100644
@@ -32,7 +32,7 @@
 		#size-cells = <1>;
 		u-boot,dm-pre-reloc;
 
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00400000 0x100000>;
 			clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
@@ -40,7 +40,7 @@
 			status = "disabled";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00500000 0x100000>;
 			clocks = <&utmi>, <&uhphs_clk>;
Signature · 1 line
2.25.1
Reviewed-by on v1 3/4
#3 lore raw

Re: [PATCH 3/4] ARM: dts: at91: sama5d2: fix dtc warning for ohci and ehci

Hello,

Am Tue, Aug 17, 2021 at 01:29:24PM +0300 schrieb Eugen Hristev:

Quoted 93 lines

Fixed the following DTC build warning (reproducible with W=1)

arch/arm/dts/at91-sama5d2_icp.dtb: Warning (unit_address_format): /ahb/ohci@00400000: unit name should not have leading 0s arch/arm/dts/at91-sama5d2_icp.dtb: Warning (unit_address_format): /ahb/ehci@00500000: unit name should not have leading 0s

---
 arch/arm/dts/at91-sama5d27_som1_ek.dts | 4 ++--
 arch/arm/dts/at91-sama5d2_ptc_ek.dts   | 4 ++--
 arch/arm/dts/at91-sama5d2_xplained.dts | 4 ++--
 arch/arm/dts/sama5d2.dtsi              | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/dts/at91-sama5d27_som1_ek.dts +2 -2
index ee851a1bef..efd1a5d197 100644
@@ -68,7 +68,7 @@
 	};
 
 	ahb {
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <&pioA 42 0>;
 			pinctrl-names = "default";
@@ -76,7 +76,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/at91-sama5d2_ptc_ek.dts +2 -2
index cd3711a02a..f45fb1ef26 100644
@@ -76,7 +76,7 @@
 			status = "okay";
 		};
 
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <0
 					   &pioA PIN_PB12 GPIO_ACTIVE_HIGH
@@ -87,7 +87,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/at91-sama5d2_xplained.dts +2 -2
index b733c4d4ce..e7c91c5fec 100644
@@ -25,7 +25,7 @@
 	};
 
 	ahb {
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			num-ports = <3>;
 			atmel,vbus-gpio = <&pioA 42 0>;
 			pinctrl-names = "default";
@@ -33,7 +33,7 @@
 			status = "okay";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			status = "okay";
 		};
 
arch/arm/dts/sama5d2.dtsi +1 -1
index 6fb2cb25f9..d8a125b073 100644
@@ -32,7 +32,7 @@
 		#size-cells = <1>;
 		u-boot,dm-pre-reloc;
 
-		usb1: ohci@00400000 {
+		usb1: ohci@400000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00400000 0x100000>;
 			clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;

arch/arm/dts/sama5d2.dtsi line 46

Quoted 8 lines
arch/arm/dts/sama5d2.dtsi +1 -1
@@ -40,7 +40,7 @@
 			status = "disabled";
 		};
 
-		usb2: ehci@00500000 {
+		usb2: ehci@500000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00500000 0x100000>;
 			clocks = <&utmi>, <&uhphs_clk>;

Greets
Alex

#4 lore raw

PATCH 4/4 configs: sama5d2: add qspi config for QSPI1

In reply to Eugen Hristev

From: Mihai Sain <[email protected]>

Add new config for storing environment from QSPI1.

[[email protected]: cleanup and add MAINTAINERS entry]
---
 board/atmel/sama5d2_icp/MAINTAINERS     |   1 +
 configs/sama5d2_icp_qspiflash_defconfig | 103 ++++++++++++++++++++++++
 2 files changed, 104 insertions(+)
 create mode 100644 configs/sama5d2_icp_qspiflash_defconfig
board/atmel/sama5d2_icp/MAINTAINERS +1 -0
index db984b6ae4..4a65c65ec3 100644
@@ -4,4 +4,5 @@ S:     Maintained
 F:     board/atmel/sama5d2_icp/
 F:     include/configs/sama5d2_icp.h
 F:     configs/sama5d2_icp_mmc_defconfig
+F:     configs/sama5d2_icp_qspiflash_defconfig
 
configs/sama5d2_icp_qspiflash_defconfig new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.25.1