[U-Boot] [PATCH 1/2] ARM: dts: at91: add dts files for at91sam9261ek

Wenyou Yang wenyou.yang at atmel.com
Mon Feb 27 03:29:42 UTC 2017


The device tree source files of at91sam9261ek boards are copied
from the Linux v4.10, do the changes as below.
 - Add the reg property for the pinctrl node.
 - Move the gpio (pioA, pioB, pioC) nodes as the pinctrl's slibling
   nodes, instead of the child nodes.
 - Fix the compilation warnings.

Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
---

 arch/arm/dts/Makefile          |   2 +
 arch/arm/dts/at91sam9261.dtsi  | 136 +++++++++++++-------------
 arch/arm/dts/at91sam9261ek.dts | 211 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 283 insertions(+), 66 deletions(-)
 create mode 100644 arch/arm/dts/at91sam9261ek.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 1444261a07..cc7f63254e 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -330,6 +330,8 @@ dtb-$(CONFIG_TARGET_AT91SAM9260EK) += \
 	at91sam9g20ek.dtb	\
 	at91sam9g20ek_2mmc.dtb
 
+dtb-$(CONFIG_TARGET_AT91SAM9261EK) += at91sam9261ek.dtb
+
 dtb-$(CONFIG_TARGET_AT91SAM9263EK) += at91sam9263ek.dtb
 
 dtb-$(CONFIG_TARGET_AT91SAM9M10G45EK) += at91sam9m10g45ek.dtb
diff --git a/arch/arm/dts/at91sam9261.dtsi b/arch/arm/dts/at91sam9261.dtsi
index 5e09de4eb9..f1f2fe804c 100644
--- a/arch/arm/dts/at91sam9261.dtsi
+++ b/arch/arm/dts/at91sam9261.dtsi
@@ -291,6 +291,10 @@
 				#size-cells = <1>;
 				compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
 				ranges = <0xfffff400 0xfffff400 0x600>;
+				reg = <0xfffff400 0x200
+				       0xfffff600 0x200
+				       0xfffff800 0x200
+				      >;
 
 				atmel,mux-mask =
 				      /*    A         B     */
@@ -302,8 +306,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 9  AT91_PERIPH_A AT91_PINCTRL_NONE>,
-							<AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
+							<AT91_PIOA 9  AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
+							<AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;
 					};
 				};
 
@@ -532,39 +536,39 @@
 							<AT91_PIOB 28 AT91_PERIPH_B AT91_PINCTRL_NONE>;
 					};
 				};
+			};
 
-				pioA: gpio at fffff400 {
-					compatible = "atmel,at91rm9200-gpio";
-					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
-					#gpio-cells = <2>;
-					gpio-controller;
-					interrupt-controller;
-					#interrupt-cells = <2>;
-					clocks = <&pioA_clk>;
-				};
+			pioA: gpio at fffff400 {
+				compatible = "atmel,at91rm9200-gpio";
+				reg = <0xfffff400 0x200>;
+				interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pioA_clk>;
+			};
 
-				pioB: gpio at fffff600 {
-					compatible = "atmel,at91rm9200-gpio";
-					reg = <0xfffff600 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
-					#gpio-cells = <2>;
-					gpio-controller;
-					interrupt-controller;
-					#interrupt-cells = <2>;
-					clocks = <&pioB_clk>;
-				};
+			pioB: gpio at fffff600 {
+				compatible = "atmel,at91rm9200-gpio";
+				reg = <0xfffff600 0x200>;
+				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pioB_clk>;
+			};
 
-				pioC: gpio at fffff800 {
-					compatible = "atmel,at91rm9200-gpio";
-					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
-					#gpio-cells = <2>;
-					gpio-controller;
-					interrupt-controller;
-					#interrupt-cells = <2>;
-					clocks = <&pioC_clk>;
-				};
+			pioC: gpio at fffff800 {
+				compatible = "atmel,at91rm9200-gpio";
+				reg = <0xfffff800 0x200>;
+				interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pioC_clk>;
 			};
 
 			pmc: pmc at fffffc00 {
@@ -589,7 +593,7 @@
 					clocks = <&main_osc>;
 				};
 
-				plla: pllack {
+				plla: pllack at 0 {
 					compatible = "atmel,at91rm9200-clk-pll";
 					#clock-cells = <0>;
 					interrupts-extended = <&pmc AT91_PMC_LOCKA>;
@@ -601,7 +605,7 @@
 								<190000000 240000000 2 1>;
 				};
 
-				pllb: pllbck {
+				pllb: pllbck at 1 {
 					compatible = "atmel,at91rm9200-clk-pll";
 					#clock-cells = <0>;
 					interrupts-extended = <&pmc AT91_PMC_LOCKB>;
@@ -635,25 +639,25 @@
 					interrupt-parent = <&pmc>;
 					clocks = <&slow_xtal>, <&main>, <&plla>, <&pllb>;
 
-					prog0: prog0 {
+					prog0: prog at 0 {
 						#clock-cells = <0>;
 						reg = <0>;
 						interrupts = <AT91_PMC_PCKRDY(0)>;
 					};
 
-					prog1: prog1 {
+					prog1: prog at 1 {
 						#clock-cells = <0>;
 						reg = <1>;
 						interrupts = <AT91_PMC_PCKRDY(1)>;
 					};
 
-					prog2: prog2 {
+					prog2: prog at 2 {
 						#clock-cells = <0>;
 						reg = <2>;
 						interrupts = <AT91_PMC_PCKRDY(2)>;
 					};
 
-					prog3: prog3 {
+					prog3: prog at 3 {
 						#clock-cells = <0>;
 						reg = <3>;
 						interrupts = <AT91_PMC_PCKRDY(3)>;
@@ -665,49 +669,49 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 
-					uhpck: uhpck {
+					uhpck: uhpck at 6 {
 						#clock-cells = <0>;
 						reg = <6>;
 						clocks = <&usb>;
 					};
 
-					udpck: udpck {
+					udpck: udpck at 7 {
 						#clock-cells = <0>;
 						reg = <7>;
 						clocks = <&usb>;
 					};
 
-					pck0: pck0 {
+					pck0: pck0 at 8 {
 						#clock-cells = <0>;
 						reg = <8>;
 						clocks = <&prog0>;
 					};
 
-					pck1: pck1 {
+					pck1: pck1 at 9 {
 						#clock-cells = <0>;
 						reg = <9>;
 						clocks = <&prog1>;
 					};
 
-					pck2: pck2 {
+					pck2: pck2 at 10 {
 						#clock-cells = <0>;
 						reg = <10>;
 						clocks = <&prog2>;
 					};
 
-					pck3: pck3 {
+					pck3: pck3 at 11 {
 						#clock-cells = <0>;
 						reg = <11>;
 						clocks = <&prog3>;
 					};
 
-					hclk0: hclk0 {
+					hclk0: hclk0 at 16 {
 						#clock-cells = <0>;
 						reg = <16>;
 						clocks = <&mck>;
 					};
 
-					hclk1: hclk1 {
+					hclk1: hclk1 at 17 {
 						#clock-cells = <0>;
 						reg = <17>;
 						clocks = <&mck>;
@@ -720,97 +724,97 @@
 					#size-cells = <0>;
 					clocks = <&mck>;
 
-					pioA_clk: pioA_clk {
+					pioA_clk: pioA_clk at 2 {
 						#clock-cells = <0>;
 						reg = <2>;
 					};
 
-					pioB_clk: pioB_clk {
+					pioB_clk: pioB_clk at 3 {
 						#clock-cells = <0>;
 						reg = <3>;
 					};
 
-					pioC_clk: pioC_clk {
+					pioC_clk: pioC_clk at 4 {
 						#clock-cells = <0>;
 						reg = <4>;
 					};
 
-					usart0_clk: usart0_clk {
+					usart0_clk: usart0_clk at 6 {
 						#clock-cells = <0>;
 						reg = <6>;
 					};
 
-					usart1_clk: usart1_clk {
+					usart1_clk: usart1_clk at 7 {
 						#clock-cells = <0>;
 						reg = <7>;
 					};
 
-					usart2_clk: usart2_clk {
+					usart2_clk: usart2_clk at 8 {
 						#clock-cells = <0>;
 						reg = <8>;
 					};
 
-					mci0_clk: mci0_clk {
+					mci0_clk: mci0_clk at 9 {
 						#clock-cells = <0>;
 						reg = <9>;
 					};
 
-					udc_clk: udc_clk {
+					udc_clk: udc_clk at 10 {
 						#clock-cells = <0>;
 						reg = <10>;
 					};
 
-					twi0_clk: twi0_clk {
+					twi0_clk: twi0_clk at 11 {
 						reg = <11>;
 						#clock-cells = <0>;
 					};
 
-					spi0_clk: spi0_clk {
+					spi0_clk: spi0_clk at 12 {
 						#clock-cells = <0>;
 						reg = <12>;
 					};
 
-					spi1_clk: spi1_clk {
+					spi1_clk: spi1_clk at 13 {
 						#clock-cells = <0>;
 						reg = <13>;
 					};
 
-					ssc0_clk: ssc0_clk {
+					ssc0_clk: ssc0_clk at 14 {
 						#clock-cells = <0>;
 						reg = <14>;
 					};
 
-					ssc1_clk: ssc1_clk {
+					ssc1_clk: ssc1_clk at 15 {
 						#clock-cells = <0>;
 						reg = <15>;
 					};
 
-					ssc2_clk: ssc2_clk {
+					ssc2_clk: ssc2_clk at 16 {
 						#clock-cells = <0>;
 						reg = <16>;
 					};
 
-					tc0_clk: tc0_clk {
+					tc0_clk: tc0_clk at 17 {
 						#clock-cells = <0>;
 						reg = <17>;
 					};
 
-					tc1_clk: tc1_clk {
+					tc1_clk: tc1_clk at 18 {
 						#clock-cells = <0>;
 						reg = <18>;
 					};
 
-					tc2_clk: tc2_clk {
+					tc2_clk: tc2_clk at 19 {
 						#clock-cells = <0>;
 						reg = <19>;
 					};
 
-					ohci_clk: ohci_clk {
+					ohci_clk: ohci_clk at 20 {
 						#clock-cells = <0>;
 						reg = <20>;
 					};
 
-					lcd_clk: lcd_clk {
+					lcd_clk: lcd_clk at 21 {
 						#clock-cells = <0>;
 						reg = <21>;
 					};
@@ -860,7 +864,7 @@
 		};
 	};
 
-	i2c at 0 {
+	i2c-gpio-0 {
 		compatible = "i2c-gpio";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_i2c_bitbang>;
diff --git a/arch/arm/dts/at91sam9261ek.dts b/arch/arm/dts/at91sam9261ek.dts
new file mode 100644
index 0000000000..55bd51f07f
--- /dev/null
+++ b/arch/arm/dts/at91sam9261ek.dts
@@ -0,0 +1,211 @@
+/*
+ * at91sam9261ek.dts - Device Tree file for Atmel at91sam9261 reference board
+ *
+ *  Copyright (C) 2013 Jean-Jacques Hiblot <jjhiblot at traphandler.com>
+ *
+ * Licensed under GPLv2 only.
+ */
+/dts-v1/;
+#include "at91sam9261.dtsi"
+
+/ {
+	model = "Atmel at91sam9261ek";
+	compatible = "atmel,at91sam9261ek", "atmel,at91sam9261", "atmel,at91sam9";
+
+	chosen {
+		bootargs = "rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw";
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory {
+		reg = <0x20000000 0x4000000>;
+	};
+
+	clocks {
+		slow_xtal {
+			clock-frequency = <32768>;
+		};
+
+		main_xtal {
+			clock-frequency = <18432000>;
+		};
+	};
+
+	ahb {
+		usb0: ohci at 00500000 {
+			status = "okay";
+		};
+
+		fb0: fb at 0x00600000 {
+			display = <&display0>;
+			atmel,power-control-gpio = <&pioA 12 GPIO_ACTIVE_LOW>;
+			status = "okay";
+
+			display0: display {
+				bits-per-pixel = <16>;
+				atmel,lcdcon-backlight;
+				atmel,dmacon = <0x1>;
+				atmel,lcdcon2 = <0x80008002>;
+				atmel,guard-time = <1>;
+				atmel,lcd-wiring-mode = "BRG";
+
+				display-timings {
+					native-mode = <&timing0>;
+					timing0: timing0 {
+						clock-frequency = <4965000>;
+						hactive = <240>;
+						vactive = <320>;
+						hback-porch = <1>;
+						hfront-porch = <33>;
+						vback-porch = <1>;
+						vfront-porch = <0>;
+						hsync-len = <5>;
+						vsync-len = <1>;
+						hsync-active = <1>;
+						vsync-active = <1>;
+					};
+				};
+			};
+		};
+
+		nand0: nand at 40000000 {
+			nand-bus-width = <8>;
+			nand-ecc-mode = "soft";
+			nand-on-flash-bbt;
+			status = "okay";
+
+			at91bootstrap at 0 {
+				label = "at91bootstrap";
+				reg = <0x0 0x40000>;
+			};
+
+			bootloader at 40000 {
+				label = "bootloader";
+				reg = <0x40000 0x80000>;
+			};
+
+			bootloaderenv at c0000 {
+				label = "bootloader env";
+				reg = <0xc0000 0xc0000>;
+			};
+
+			dtb at 180000 {
+				label = "device tree";
+				reg = <0x180000 0x80000>;
+			};
+
+			kernel at 200000 {
+				label = "kernel";
+				reg = <0x200000 0x600000>;
+			};
+
+			rootfs at 800000 {
+				label = "rootfs";
+				reg = <0x800000 0x0f800000>;
+			};
+		};
+
+		apb {
+			usb1: gadget at fffa4000 {
+				atmel,vbus-gpio = <&pioB 29 GPIO_ACTIVE_HIGH>;
+				status = "okay";
+			};
+
+			spi0: spi at fffc8000 {
+				cs-gpios = <&pioA 3 0>, <0>, <&pioA 28 0>, <0>;
+				status = "okay";
+
+				mtd_dataflash at 0 {
+					compatible = "atmel,at45", "atmel,dataflash";
+					reg = <0>;
+					spi-max-frequency = <15000000>;
+				};
+
+				tsc2046 at 0 {
+					reg = <2>;
+					compatible = "ti,ads7843";
+					interrupts-extended = <&pioC 2 IRQ_TYPE_EDGE_BOTH>;
+					spi-max-frequency = <3000000>;
+					pendown-gpio = <&pioC 2 GPIO_ACTIVE_HIGH>;
+
+					ti,x-min = /bits/ 16 <150>;
+					ti,x-max = /bits/ 16 <3830>;
+					ti,y-min = /bits/ 16 <190>;
+					ti,y-max = /bits/ 16 <3830>;
+					ti,vref-delay-usecs = /bits/ 16 <450>;
+					ti,x-plate-ohms = /bits/ 16 <450>;
+					ti,y-plate-ohms = /bits/ 16 <250>;
+					ti,pressure-max = /bits/ 16 <15000>;
+					ti,debounce-rep = /bits/ 16 <0>;
+					ti,debounce-tol = /bits/ 16 <65535>;
+					ti,debounce-max = /bits/ 16 <1>;
+
+					wakeup-source;
+				};
+			};
+
+			dbgu: serial at fffff200 {
+				status = "okay";
+			};
+
+			watchdog at fffffd40 {
+				status = "okay";
+			};
+
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		ds8 {
+			label = "ds8";
+			gpios = <&pioA 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "none";
+		};
+
+		ds7 {
+			label = "ds7";
+			gpios = <&pioA 14 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "nand-disk";
+		};
+
+		ds1 {
+			label = "ds1";
+			gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+
+		button_0 {
+			label = "button_0";
+			gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
+			linux,code = <256>;
+			wakeup-source;
+		};
+
+		button_1 {
+			label = "button_1";
+			gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
+			linux,code = <257>;
+			wakeup-source;
+		};
+
+		button_2 {
+			label = "button_2";
+			gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
+			linux,code = <258>;
+			wakeup-source;
+		};
+
+		button_3 {
+			label = "button_3";
+			gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
+			linux,code = <259>;
+			wakeup-source;
+		};
+	};
+};
-- 
2.11.0



More information about the U-Boot mailing list