Skip to contentSkip to conversation

ARM: at91/dt: sama5d4: Add support for DENX MA5D4 SoM and EVK

PATCH Superseded Marek Vasut 2 participants 3 messages Nov 3, 2015 – Nov 4, 2015

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

PATCH v2 1/1 ARM: at91/dt: sama5d4: Add support for DENX MA5D4 SoM and EVK

Add support for the DENX MA5D4 SoM and MA5D4EVK board. The system consists of a SoM with eMMC, SPI NOR for booting, 2x SPI CAN chip and an EVK with microSD slot, 2x UART, 2x CAN port, 3x USB port, LEDs and expansion headers.

Cc Alexandre Belloni <[email protected]>
Cc Josh Wu <[email protected]>
Cc Nicolas Ferre <[email protected]>
---
 arch/arm/boot/dts/Makefile                  |   1 +
 arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi   | 136 ++++++++++++++++++++++
 arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts | 169 ++++++++++++++++++++++++++++
 3 files changed, 306 insertions(+)
 create mode 100644 arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi
 create mode 100644 arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts

V2: Zap bogus bootargs, zap clock at 0 and clk20m .
Zap bogus address-cells / size-cells / ranges in the clocks node.

arch/arm/boot/dts/Makefile +1 -0
index bb8fa02..67130bb 100644
@@ -48,6 +48,7 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
 	sama5d34ek.dtb \
 	sama5d35ek.dtb \
 	sama5d36ek.dtb \
+	at91-sama5d4_ma5d4evk.dtb \
 	at91-sama5d4_xplained.dtb \
 	at91-sama5d4ek.dtb
 dtb-$(CONFIG_ARCH_ATLAS6) += \
arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi new file +136 -0

136 lines not on this page · raw message

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +169 -0

169 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/1 ARM: at91/dt: sama5d4: Add support for DENX MA5D4 SoM and EVK

Le 03/11/2015 22:18, Marek Vasut a ?crit :

Quoted 6 lines

Add support for the DENX MA5D4 SoM and MA5D4EVK board. The system consists of a SoM with eMMC, SPI NOR for booting, 2x SPI CAN chip and an EVK with microSD slot, 2x UART, 2x CAN port, 3x USB port, LEDs and expansion headers.

Hi Marek,

I'm delighted to see this board submitted: thanks!

Quoted 103 lines
Cc Alexandre Belloni <[email protected]>
Cc Josh Wu <[email protected]>
Cc Nicolas Ferre <[email protected]>
---
 arch/arm/boot/dts/Makefile                  |   1 +
 arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi   | 136 ++++++++++++++++++++++
 arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts | 169 ++++++++++++++++++++++++++++
 3 files changed, 306 insertions(+)
 create mode 100644 arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi
 create mode 100644 arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts

V2: Zap bogus bootargs, zap clock at 0 and clk20m .
Zap bogus address-cells / size-cells / ranges in the clocks node.

arch/arm/boot/dts/Makefile +1 -0
index bb8fa02..67130bb 100644
@@ -48,6 +48,7 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
 	sama5d34ek.dtb \
 	sama5d35ek.dtb \
 	sama5d36ek.dtb \
+	at91-sama5d4_ma5d4evk.dtb \
 	at91-sama5d4_xplained.dtb \
 	at91-sama5d4ek.dtb
 dtb-$(CONFIG_ARCH_ATLAS6) += \
arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi new file +71 -0
new file mode 100644
index 0000000..0430aa9
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2015 Marek Vasut <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "sama5d4.dtsi"
+
+/ {
+	model = "DENX MA5D4";
+	compatible = "denx,ma5d4", "atmel,sama5d4", "atmel,sama5";
+
+	memory {
+		reg = <0x20000000 0x10000000>;
+	};
+
+	clocks {
+		main_clock: main_clock {
+			compatible = "atmel,osc", "fixed-clock";
+			clock-frequency = <12000000>;
+		};
+
+		slow_xtal {
+			clock-frequency = <32768>;
+		};
+
+		main_xtal {
+			clock-frequency = <12000000>;
+		};
+
+		clk20m: clk20m {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <20000000>;
+			clock-output-names = "clk20m";
+		};
+	};
+
+	ahb {
+		apb {
+			spi0: spi at f8010000 {
+				cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
+				status = "okay";
+
+				m25p80 at 0 {
+					compatible = "atmel,at25df321a";
+					spi-max-frequency = <50000000>;
+					reg = <0>;
+				};
+			};
+
+			spi1: spi at fc018000 {
+				cs-gpios = <&pioB 22 0>, <&pioB 23 0>, <0>, <0>;
+				status = "okay";
+
+				can0: can at 0 {
+					compatible = "microchip,mcp2515";
+					reg = <0>;
+					clocks = <&clk20m>;
+					interrupt-parent = <&pioE>;
+					interrupts = <6 GPIO_ACTIVE_LOW>;
+					spi-max-frequency = <10000000>;
+				};
+
+				can1: can at 1 {
+					compatible = "microchip,mcp2515";

arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi line 81

Quoted 10 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi new file +10 -0
+					reg = <1>;
+					clocks = <&clk20m>;
+					interrupt-parent = <&pioE>;
+					interrupts = <7 GPIO_ACTIVE_LOW>;
+					spi-max-frequency = <10000000>;
+				};
+			};
+
+
+			i2c0: i2c at f8014000 {

We tend to sort node by ascending addresses, but for sure, it's absolutely up to you to sort them in whichever order you choose (and I admit it sometimes led us to strange numbering schemes: so we might reconsider this (soft) constrain in the future for our own boards)...

Quoted 166 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi new file +55 -0
+				status = "okay";
+			};
+
+			mmc0: mmc at f8000000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7>;
+				vmmc-supply = <&vcc_mmc0_reg>;
+				vqmmc-supply = <&vcc_3v3_reg>;
+				status = "okay";
+				slot at 0 {
+					reg = <0>;
+					bus-width = <8>;
+					broken-cd;
+				};
+			};
+
+			adc0: adc at fc034000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <
+					/* external trigger conflicts with USBA_VBUS */
+					&pinctrl_adc0_ad0
+					&pinctrl_adc0_ad1
+					&pinctrl_adc0_ad2
+					&pinctrl_adc0_ad3
+					&pinctrl_adc0_ad4
+					>;
+				atmel,adc-vref = <3300>;
+				status = "okay";
+			};
+
+			watchdog at fc068640 {
+				status = "okay";
+			};
+		};
+	};
+
+	vcc_3v3_reg: fixedregulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC 3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	vcc_mmc0_reg: fixedregulator at 1 {
+		compatible = "regulator-fixed";
+		gpio = <&pioE 15 GPIO_ACTIVE_HIGH>;
+		regulator-name = "RST_n MCI0";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_reg>;
+		regulator-boot-on;
+	};
+};
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +105 -0
new file mode 100644
index 0000000..5754f14
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2015 Marek Vasut <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "at91-sama5d4_ma5d4.dtsi"
+
+/ {
+	model = "DENX MA5D4EVK";
+	compatible = "denx,ma5d4evk", "atmel,sama5d4", "atmel,sama5";
+
+	chosen {
+		stdout-path = "serial3:115200n8";
+	};
+
+	ahb {
+		apb {
+			adc0: adc at fc034000 {
+				atmel,adc-ts-wires = <4>;
+				atmel,adc-ts-pressure-threshold = <10000>;
+			};
+
+			hlcdc: hlcdc at f0000000 {
+				status = "okay";
+
+				hlcdc-display-controller {
+					pinctrl-names = "default";
+					pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>;
+
+					port at 0 {
+						hlcdc_panel_output: endpoint at 0 {
+							reg = <0>;
+							remote-endpoint = <&panel_input>;
+						};
+					};
+				};
+
+			};
+
+			macb0: ethernet at f8020000 {
+				phy-mode = "rmii";
+				status = "okay";
+
+				phy0: ethernet-phy at 0 {
+					reg = <0>;
+				};
+			};
+
+			mmc1: mmc at fc000000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
+				vmmc-supply = <&vcc_mmc1_reg>;
+				vqmmc-supply = <&vcc_3v3_reg>;
+				status = "okay";
+				slot at 0 {
+					reg = <0>;
+					bus-width = <4>;
+					cd-gpios = <&pioE 5 0>;
+				};
+			};
+
+			usart0: serial at f802c000 {
+				status = "okay";
+			};
+
+			usart1: serial at f8030000 {
+				status = "okay";
+			};
+
+			pinctrl at fc06a000 {
+				board {
+					pinctrl_mmc1_cd: mmc1_cd {
+						atmel,pins = <AT91_PIOE 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
+					};
+					pinctrl_usba_vbus: usba_vbus {
+						atmel,pins =
+							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
+					};
+				};
+			};
+		};
+
+		usb0: gadget at 00400000 {
+			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usba_vbus>;
+			status = "okay";
+		};
+
+		usb1: ohci at 00500000 {
+			num-ports = <3>;
+			atmel,vbus-gpio = <0
+					   &pioE 11 GPIO_ACTIVE_LOW
+					   &pioE 14 GPIO_ACTIVE_LOW
+					  >;
+			status = "okay";
+		};
+

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 115

Quoted 10 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +10 -0
+		usb2: ehci at 00600000 {
+			status = "okay";
+		};
+	};
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&hlcdc_pwm 0 50000 0>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;

Nit: I don't see "6" in the levels just above...

Quoted 13 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +13 -0
+		status = "okay";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		status = "okay";
+
+		user1 {
+			label = "user1";
+			gpios = <&pioD 28 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 138

Quoted 10 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +10 -0
+		user2 {
+			label = "user2";
+			gpios = <&pioD 29 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+
+		user3 {
+			label = "user3";
+			gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";

So all the 3 leds are blinking at "heartbeat" ? Disco party time!

Quoted 21 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +21 -0
+		};
+	};
+
+	panel: panel {
+		/* Actually Ampire 800480R2 */
+		compatible = "foxlink,fl500wvr00-a0t", "simple-panel";
+		backlight = <&backlight>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "okay";
+
+		port at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			panel_input: endpoint at 0 {
+				reg = <0>;
+				remote-endpoint = <&hlcdc_panel_output>;
+			};
+		};
+	};

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 169

Quoted 10 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +10 -0
+
+	vcc_mmc1_reg: fixedregulator at 2 {
+		compatible = "regulator-fixed";
+		gpio = <&pioE 17 GPIO_ACTIVE_LOW>;
+		regulator-name = "VDD MCI1";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_reg>;
+	};
+};

Apart form the little remarks, I'm absolutely fine with the patch:

Thanks Marek, it will probably go into kernel 4.5 ; we have to build the at91-4.5-dt branch once the merge window is closed. It will then show up in at91-next which is pulled by Stephen.

Bye,

Signature · 1 line
Nicolas Ferre
#2 lore raw

PATCH v2 1/1 ARM: at91/dt: sama5d4: Add support for DENX MA5D4 SoM and EVK

Quoted 11 lines · Nicolas Ferre

Le 03/11/2015 22:18, Marek Vasut a ?crit :

Quoted 6 lines

Add support for the DENX MA5D4 SoM and MA5D4EVK board. The system consists of a SoM with eMMC, SPI NOR for booting, 2x SPI CAN chip and an EVK with microSD slot, 2x UART, 2x CAN port, 3x USB port, LEDs and expansion headers.

Hi Marek,

I'm delighted to see this board submitted: thanks!

Hi Nicolas,

thanks for the review :)

[...]

Quoted 6 lines

arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi line 81

Quoted 1 line
arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi new file +1 -0
+			i2c0: i2c at f8014000 {

We tend to sort node by ascending addresses, but for sure, it's absolutely up to you to sort them in whichever order you choose (and I admit it sometimes led us to strange numbering schemes: so we might reconsider this (soft) constrain in the future for our own boards)...

Oh, this is a good point. I used to sort them by the reference, but here I missed the ADC anyway, so I can as well sort them by the address.

Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+				status = "okay";
+			};

[...]

Quoted 7 lines

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 115

Quoted 5 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +5 -0
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&hlcdc_pwm 0 50000 0>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;

Nit: I don't see "6" in the levels just above...

That's to be expected, see

Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt

quote:

11 - default-brightness-level: the default brightness level (index into the
12 array defined by the "brightness-levels" property)

So the default brighness is set to 128, which is is 50% brightness.

Quoted 17 lines
Quoted 17 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +17 -0
+		status = "okay";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		status = "okay";
+
+		user1 {
+			label = "user1";
+			gpios = <&pioD 28 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+
+		user2 {
+			label = "user2";
+			gpios = <&pioD 29 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
Quoted 8 lines

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 138

Quoted 6 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +6 -0
+		};
+
+		user3 {
+			label = "user3";
+			gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";

So all the 3 leds are blinking at "heartbeat" ? Disco party time!

Hehe :-) It's probably the best way to check if they work and demonstrate that they do something.

Quoted 33 lines
Quoted 21 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +21 -0
+		};
+	};
+
+	panel: panel {
+		/* Actually Ampire 800480R2 */
+		compatible = "foxlink,fl500wvr00-a0t", "simple-panel";
+		backlight = <&backlight>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "okay";
+
+		port at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			panel_input: endpoint at 0 {
+				reg = <0>;
+				remote-endpoint = <&hlcdc_panel_output>;
+			};
+		};
+	};

arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts line 169

Quoted 10 lines
arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dts new file +10 -0
+
+	vcc_mmc1_reg: fixedregulator at 2 {
+		compatible = "regulator-fixed";
+		gpio = <&pioE 17 GPIO_ACTIVE_LOW>;
+		regulator-name = "VDD MCI1";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_reg>;
+	};
+};

Apart form the little remarks, I'm absolutely fine with the patch:

Quoted 5 lines

Thanks Marek, it will probably go into kernel 4.5 ; we have to build the at91-4.5-dt branch once the merge window is closed. It will then show up in at91-next which is pulled by Stephen.

Cool, thanks!