code:
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright (c) 2021 Oleksij Rempel <kernel@pengutronix.de>, Pengutronix
 */
/dts-v1/;
#include "sama5d36.dtsi"

/ {
	model = "EVB-KSZ9477";
	compatible = "microchip,sama5d3-ksz9477-evb", "atmel,sama5d36",
		     "atmel,sama5d3", "atmel,sama5";

	chosen {
		stdout-path = &dbgu;
	};

	reg_3v3: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "3v3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_vcc_mmc0: regulator-mmc0 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mcc0_vcc>;
		regulator-name = "mmc0-vcc";
		regulator-max-microvolt = <3300000>;
		regulator-min-microvolt = <3300000>;
		gpio = <&pioE 2 GPIO_ACTIVE_LOW>;
	};
};

&dbgu {
	status = "okay";
};

&ebi {
	pinctrl-0 = <&pinctrl_ebi_nand_addr>;
	pinctrl-names = "default";
	status = "okay";
};

&i2c0 {
	pinctrl-0 = <&pinctrl_i2c0_pu>;
	status = "okay";
};

&macb0 {
	phy-mode = "rgmii";
	status = "okay";

	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};

&main_xtal {
	clock-frequency = <12000000>;
};

&mmc0 {
	pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3
		     &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>;
	status = "okay";

	slot@0 {
		reg = <0>;
		bus-width = <8>;
		cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>;
		disable-wp;
		vmmc-supply = <&reg_vcc_mmc0>;
		vqmmc-supply = <&reg_3v3>;
	};
};

&nand_controller {
	status = "okay";

	nand@3 {
		reg = <0x3 0x0 0x2>;
		atmel,rb = <0>;
		nand-bus-width = <8>;
		nand-ecc-mode = "hw";
		nand-ecc-strength = <4>;
		nand-ecc-step-size = <512>;
		nand-on-flash-bbt;
		label = "atmel_nand";
	};
};

&slow_xtal {
	clock-frequency = <32768>;
};

&spi0 {
	cs-gpios = <&pioD 13 GPIO_ACTIVE_LOW>, <0>, <0>,
		   <&pioD 16 GPIO_ACTIVE_LOW>;
	status = "okay";
};

&spi1 {
	pinctrl-0 = <&pinctrl_spi_ksz>;
	cs-gpios = <&pioC 25 GPIO_ACTIVE_LOW>;
	status = "okay";

	switch@0 {
		compatible = "microchip,ksz9477";
		reg = <0>;
		spi-max-frequency = <1000000>;
		spi-cpha;
		spi-cpol;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				label = "lan1";
				phy-mode = "internal";
			};

			port@1 {
				reg = <1>;
				label = "lan2";
				phy-mode = "internal";
			};

			port@2 {
				reg = <2>;
				label = "lan3";
				phy-mode = "internal";
			};

			port@3 {
				reg = <3>;
				label = "lan4";
				phy-mode = "internal";
			};

			port@4 {
				reg = <4>;
				label = "lan5";
				phy-mode = "internal";
			};

			port@5 {
				reg = <5>;
				label = "cpu";
				ethernet = <&macb0>;
				phy-mode = "rgmii-txid";

				fixed-link {
					speed = <1000>;
					full-duplex;
				};
			};
		};
	};
};

&usb0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usba_vbus>;
	atmel,vbus-gpio = <&pioE 9 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

&pinctrl {
	board {
		pinctrl_i2c0_pu: i2c0-pu {
			atmel,pins =
				<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
				<AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
		};

		pinctrl_mmc0_cd: mmc0-cd {
			atmel,pins = <AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};

		pinctrl_mcc0_vcc: mmc0-vcc {
			atmel,pins = <AT91_PIOE 2 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};

		pinctrl_spi_ksz: spi-ksz {
			atmel,pins =
				<
				/* SPI1_MISO */
				AT91_PIOC 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
				/* SPI1_MOSI */
				AT91_PIOC 23 AT91_PERIPH_A AT91_PINCTRL_NONE
				/* SPI1_SPCK */
				AT91_PIOC 24 AT91_PERIPH_A AT91_PINCTRL_NONE

				/* SPI CS */
				AT91_PIOC 25 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
				/* switch IRQ */
				AT91_PIOB 28 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH
				/* switch PME_N, SoC IN */
				AT91_PIOC 30 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP
				/* switch RST */
				AT91_PIOC 31 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH
				>;
		};

		pinctrl_usba_vbus: usba-vbus {
			atmel,pins =
				<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * at91-sama5d3_xplained.dts - Device Tree file for the SAMA5D3 Xplained board
 *
 *  Copyright (C) 2014 Atmel,
 *		  2014 Nicolas Ferre <nicolas.ferre@atmel.com>
 */
/dts-v1/;
#include "sama5d36.dtsi"
#include <dt-bindings/input/input.h>

/ {
	model = "SAMA5D3 Xplained";
	compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5";

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x10000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <12000000>;
		};
	};

	ahb {
		apb {
			mmc0: mmc@f0000000 {
				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>;
				vmmc-supply = <&vcc_mmc0_reg>;
				vqmmc-supply = <&vcc_3v3_reg>;
				status = "okay";
				slot@0 {
					reg = <0>;
					bus-width = <8>;
					cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>;
				};
			};

			mmc1: mmc@f8000000 {
				vmmc-supply = <&vcc_3v3_reg>;
				vqmmc-supply = <&vcc_3v3_reg>;
				status = "disabled";
				slot@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 1 GPIO_ACTIVE_LOW>;
				};
			};

			spi0: spi@f0004000 {
				pinctrl-names = "default", "cs";
				pinctrl-1 = <&pinctrl_spi0_cs>;
				cs-gpios = <&pioD 13 0>, <0>, <0>, <&pioD 16 0>;
				status = "okay";
			};

			can0: can@f000c000 {
				status = "okay";
			};

			tcb0: timer@f0010000 {
				timer0: timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>;
				};

				timer1: timer@1 {
					compatible = "atmel,tcb-timer";
					reg = <1>;
				};
			};

			i2c0: i2c@f0014000 {
				pinctrl-0 = <&pinctrl_i2c0_pu>;
				status = "okay";
			};

			i2c1: i2c@f0018000 {
				status = "okay";

				pmic: act8865@5b {
					compatible = "active-semi,act8865";
					reg = <0x5b>;
					status = "disabled";

					regulators {
						vcc_1v8_reg: DCDC_REG1 {
							regulator-name = "VCC_1V8";
							regulator-min-microvolt = <1800000>;
							regulator-max-microvolt = <1800000>;
							regulator-always-on;
						};

						vcc_1v2_reg: DCDC_REG2 {
							regulator-name = "VCC_1V2";
							regulator-min-microvolt = <1200000>;
							regulator-max-microvolt = <1200000>;
							regulator-always-on;
						};

						vcc_3v3_reg: DCDC_REG3 {
							regulator-name = "VCC_3V3";
							regulator-min-microvolt = <3300000>;
							regulator-max-microvolt = <3300000>;
							regulator-always-on;
						};

						vddfuse_reg: LDO_REG1 {
							regulator-name = "FUSE_2V5";
							regulator-min-microvolt = <2500000>;
							regulator-max-microvolt = <2500000>;
						};

						vddana_reg: LDO_REG2 {
							regulator-name = "VDDANA";
							regulator-min-microvolt = <3300000>;
							regulator-max-microvolt = <3300000>;
							regulator-always-on;
						};
					};
				};
			};

			macb0: ethernet@f0028000 {
				phy-mode = "rgmii-rxid";
				#address-cells = <1>;
				#size-cells = <0>;
				status = "okay";

				ethernet-phy@7 {
					reg = <0x7>;
				};
			};

			pwm0: pwm@f002c000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_pwm0_pwmh0_0 &pinctrl_pwm0_pwmh1_0>;
				status = "okay";
			};

			usart0: serial@f001c000 {
				status = "okay";
			};

			usart1: serial@f0020000 {
				pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
				status = "okay";
			};

			uart0: serial@f0024000 {
				status = "okay";
			};

			mmc1: mmc@f8000000 {
				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
				status = "okay";
				slot@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 1 GPIO_ACTIVE_HIGH>;
				};
			};

			spi1: spi@f8008000 {
				pinctrl-names = "default", "cs";
				pinctrl-1 = <&pinctrl_spi1_cs>;
				cs-gpios = <&pioC 25 0>;
				status = "okay";
			};

			adc0: adc@f8018000 {
				atmel,adc-vref = <3300>;
				atmel,adc-channels-used = <0xfe>;
				pinctrl-0 = <
					&pinctrl_adc0_adtrg
					&pinctrl_adc0_ad1
					&pinctrl_adc0_ad2
					&pinctrl_adc0_ad3
					&pinctrl_adc0_ad4
					&pinctrl_adc0_ad5
					&pinctrl_adc0_ad6
					&pinctrl_adc0_ad7
					>;
				status = "okay";
			};

			i2c2: i2c@f801c000 {
				dmas = <0>, <0>;	/* Do not use DMA for i2c2 */
				pinctrl-0 = <&pinctrl_i2c2_pu>;
				status = "okay";
			};

			macb1: ethernet@f802c000 {
				phy-mode = "rmii";
				#address-cells = <1>;
				#size-cells = <0>;
				status = "okay";

				ethernet-phy@1 {
					reg = <0x1>;
				};
			};

			dbgu: serial@ffffee00 {
				status = "okay";
			};

			pinctrl@fffff200 {
				board {
					pinctrl_i2c0_pu: i2c0_pu {
						atmel,pins =
							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
							<AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
					};

					pinctrl_i2c2_pu: i2c2_pu {
						atmel,pins =
							<AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
							<AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
					};

					pinctrl_key_gpio: key_gpio_0 {
						atmel,pins =
							<AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};

					pinctrl_mmc0_cd: mmc0_cd {
						atmel,pins =
							<AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};

					pinctrl_mmc1_cd: mmc1_cd {
						atmel,pins =
							<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};

					pinctrl_usba_vbus: usba_vbus {
						atmel,pins =
							<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;	/* PE9, conflicts with A9 */
					};
					pinctrl_usb_default: usb_default {
						atmel,pins =
							<AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
							 AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};

					pinctrl_gpio_leds: gpio_leds_default {
						atmel,pins =
							<AT91_PIOE 23 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
							 AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};

					pinctrl_spi0_cs: spi0_cs_default {
						atmel,pins =
							<AT91_PIOD 13 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
							 AT91_PIOD 16 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};

					pinctrl_spi1_cs: spi1_cs_default {
						atmel,pins = <AT91_PIOC 25 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};

					pinctrl_vcc_mmc0_reg_gpio: vcc_mmc0_reg_gpio_default {
						atmel,pins = <AT91_PIOE 2 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
				};
			};
		};

		usb0: gadget@500000 {
			atmel,vbus-gpio = <&pioE 9 GPIO_ACTIVE_HIGH>;	/* PE9, conflicts with A9 */
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usba_vbus>;
			status = "okay";
		};

		usb1: ohci@600000 {
			num-ports = <3>;
			atmel,vbus-gpio = <0
					   &pioE 3 GPIO_ACTIVE_LOW
					   &pioE 4 GPIO_ACTIVE_LOW
					  >;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usb_default>;
			status = "okay";
		};

		usb2: ehci@700000 {
			status = "okay";
		};

		ebi: ebi@10000000 {
			pinctrl-0 = <&pinctrl_ebi_nand_addr>;
			pinctrl-names = "default";
			status = "okay";

			nand_controller: nand-controller {
				status = "okay";

				nand@3 {
					reg = <0x3 0x0 0x2>;
					atmel,rb = <0>;
					nand-bus-width = <8>;
					nand-ecc-mode = "hw";
					nand-ecc-strength = <4>;
					nand-ecc-step-size = <512>;
					nand-on-flash-bbt;
					label = "atmel_nand";

					partitions {
						compatible = "fixed-partitions";
						#address-cells = <1>;
						#size-cells = <1>;

						at91bootstrap@0 {
							label = "at91bootstrap";
							reg = <0x0 0x40000>;
						};

						bootloader@40000 {
							label = "bootloader";
							reg = <0x40000 0xc0000>;
						};

						bootloaderenvred@100000 {
							label = "bootloader env redundant";
							reg = <0x100000 0x40000>;
						};

						bootloaderenv@140000 {
							label = "bootloader env";
							reg = <0x140000 0x40000>;
						};

						dtb@180000 {
							label = "device tree";
							reg = <0x180000 0x80000>;
						};

						kernel@200000 {
							label = "kernel";
							reg = <0x200000 0x600000>;
						};

						rootfs@800000 {
							label = "rootfs";
							reg = <0x800000 0x0f800000>;
						};
					};
				};
			};
		};
	};

	vcc_mmc0_reg: fixedregulator_mmc0 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_vcc_mmc0_reg_gpio>;
		gpio = <&pioE 2 GPIO_ACTIVE_LOW>;
		regulator-name = "mmc0-card-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_key_gpio>;

		button {
			label = "PB_USER";
			gpios = <&pioE 29 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_PROG1>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_leds>;
		status = "okay";

		d2 {
			label = "d2";
			gpios = <&pioE 23 GPIO_ACTIVE_LOW>;	/* PE23, conflicts with A23, CTS2 */
			linux,default-trigger = "heartbeat";
		};

		d3 {
			label = "d3"; /* Conflict with EBI CS0, USART2 CTS. */
			gpios = <&pioE 24 GPIO_ACTIVE_HIGH>;
		};
	};
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
 */

#include "sama5d4.dtsi"

/ {
	model = "Aries/DENX MA5D4";
	compatible = "aries,ma5d4", "denx,ma5d4", "atmel,sama5d4", "atmel,sama5";

	memory@20000000 {
		reg = <0x20000000 0x10000000>;
	};

	clocks {
		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 {
			mmc0: mmc@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@0 {
					reg = <0>;
					bus-width = <8>;
					broken-cd;
				};
			};

			spi0: spi@f8010000 {
				cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
				status = "okay";

				flash@0 {
					compatible = "atmel,at25df321a";
					spi-max-frequency = <50000000>;
					reg = <0>;
				};
			};

			i2c0: i2c@f8014000 {
				status = "okay";
			};

			spi1: spi@fc018000 {
				cs-gpios = <&pioB 22 0>, <&pioB 23 0>, <0>, <0>;
				status = "okay";

				can0: can@0 {
					compatible = "microchip,mcp2515";
					reg = <0>;
					clocks = <&clk20m>;
					interrupt-parent = <&pioE>;
					interrupts = <6 IRQ_TYPE_EDGE_RISING>;
					spi-max-frequency = <10000000>;
				};

				can1: can@1 {
					compatible = "microchip,mcp2515";
					reg = <1>;
					clocks = <&clk20m>;
					interrupt-parent = <&pioE>;
					interrupts = <7 IRQ_TYPE_EDGE_RISING>;
					spi-max-frequency = <10000000>;
				};
			};

			tcb2: timer@fc024000 {
				timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>;
				};

				timer@1 {
					compatible = "atmel,tcb-timer";
					reg = <1>;
				};
			};

			adc0: adc@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@fc068640 {
				status = "okay";
			};
		};
	};

	vcc_3v3_reg: fixedregulator_3v3 {
		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_mmc0 {
		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;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
 */

/dts-v1/;
#include "at91-sama5d4_ma5d4.dtsi"

/ {
	model = "Aries/DENX MA5D4EVK";
	compatible = "aries,ma5d4evk", "denx,ma5d4evk", "atmel,sama5d4", "atmel,sama5";

	chosen {
		stdout-path = "serial3:115200n8";
	};

	ahb {
		usb0: gadget@400000 {
			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usba_vbus>;
			status = "okay";
		};

		usb1: ohci@500000 {
			num-ports = <3>;
			atmel,vbus-gpio = <0
					   &pioE 11 GPIO_ACTIVE_LOW
					   &pioE 14 GPIO_ACTIVE_LOW
					  >;
			status = "okay";
		};

		usb2: ehci@600000 {
			status = "okay";
		};

		apb {
			hlcdc: hlcdc@f0000000 {
				status = "okay";

				hlcdc-display-controller {
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>;

					port@0 {
						hlcdc_panel_output: endpoint@0 {
							reg = <0>;
							remote-endpoint = <&panel_input>;
						};
					};
				};

			};

			macb0: ethernet@f8020000 {
				phy-mode = "rmii";
				status = "okay";

				phy0: ethernet-phy@0 {
					reg = <0>;
				};
			};

			usart0: serial@f802c000 {
				status = "okay";
			};

			usart1: serial@f8030000 {
				status = "okay";
			};

			mmc1: mmc@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@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 5 0>;
				};
			};

			adc0: adc@fc034000 {
				atmel,adc-ts-wires = <4>;
				atmel,adc-ts-pressure-threshold = <10000>;
			};

			pinctrl@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>;
					};
				};
			};
		};
	};

	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>;
		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";
		};

		user3 {
			label = "user3";
			gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
		};
	};

	panel: panel {
		/* Actually Ampire 800480R2 */
		compatible = "foxlink,fl500wvr00-a0t";
		backlight = <&backlight>;
		#address-cells = <1>;
		#size-cells = <0>;
		status = "okay";

		port@0 {
			#address-cells = <1>;
			#size-cells = <0>;

			panel_input: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&hlcdc_panel_output>;
			};
		};
	};

	vcc_mmc1_reg: fixedregulator_mmc1 {
		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>;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * at91-sama5d4_xplained.dts - Device Tree file for SAMA5D4 Xplained board
 *
 *  Copyright (C) 2015 Atmel,
 *                2015 Josh Wu <josh.wu@atmel.com>
 */
/dts-v1/;
#include "sama5d4.dtsi"
#include <dt-bindings/input/input.h>

/ {
	model = "Atmel SAMA5D4 Xplained";
	compatible = "atmel,sama5d4-xplained", "atmel,sama5d4", "atmel,sama5";

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x20000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <12000000>;
		};
	};

	ahb {
		apb {
			uart0: serial@f8004000 {
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				status = "okay";
			};

			i2c0: i2c@f8014000 {
				i2c-digital-filter;
				status = "okay";
			};

			macb0: ethernet@f8020000 {
				phy-mode = "rmii";
				status = "okay";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;

				phy0: ethernet-phy@1 {
					interrupt-parent = <&pioE>;
					interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
					reg = <1>;
				};
			};

			mmc1: mmc@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@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 3 0>;
				};
			};

			usart3: serial@fc00c000 {
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				status = "okay";
			};

			usart4: serial@fc010000 {
				status = "okay";
			};

			spi1: spi@fc018000 {
				pinctrl-names = "default", "cs";
				pinctrl-1 = <&pinctrl_spi1_cs>;
				cs-gpios = <&pioB 21 0>;
				status = "okay";
			};

			tcb2: timer@fc024000 {
				timer0: timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>;
				};

				timer1: timer@1 {
					compatible = "atmel,tcb-timer";
					reg = <1>;
				};
			};

			adc0: adc@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@fc068640 {
				status = "okay";
			};

			pinctrl@fc06a000 {
				board {
					pinctrl_mmc1_cd: mmc1_cd {
						atmel,pins =
							<AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_usba_vbus: usba_vbus {
						atmel,pins =
							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
					};
					pinctrl_usb_default: usb_default {
						atmel,pins =
							<AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
							 AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
					pinctrl_key_gpio: key_gpio_0 {
						atmel,pins =
							<AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_macb0_phy_irq: macb0_phy_irq_0 {
						atmel,pins =
							<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_spi1_cs: spi1_cs_default {
						atmel,pins =
							<AT91_PIOB 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
					pinctrl_gpio_leds: gpio_leds_default {
						atmel,pins =
							<AT91_PIOD 30 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
							 AT91_PIOE 15 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
					pinctrl_vcc_mmc1_reg: vcc_mmc1_reg {
						atmel,pins =
							<AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
				};
			};
		};

		usb0: gadget@400000 {
			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usba_vbus>;
			status = "okay";
		};

		usb1: ohci@500000 {
			num-ports = <3>;
			atmel,vbus-gpio = <0
					   &pioE 11 GPIO_ACTIVE_HIGH
					   &pioE 14 GPIO_ACTIVE_HIGH
					  >;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usb_default>;
			status = "okay";
		};

		usb2: ehci@600000 {
			status = "okay";
		};

		ebi: ebi@10000000 {
			pinctrl-0 = <&pinctrl_ebi_cs3 &pinctrl_ebi_nrd_nandoe
				     &pinctrl_ebi_nwe_nandwe &pinctrl_ebi_nandrdy
				     &pinctrl_ebi_data_0_7 &pinctrl_ebi_nand_addr>;
			pinctrl-names = "default";
			status = "okay";

			nand_controller: nand-controller {
				status = "okay";

				nand@3 {
					reg = <0x3 0x0 0x2>;
					atmel,rb = <0>;
					nand-bus-width = <8>;
					nand-ecc-mode = "hw";
					nand-on-flash-bbt;
					label = "atmel_nand";

					partitions {
						compatible = "fixed-partitions";
						#address-cells = <1>;
						#size-cells = <1>;

						at91bootstrap@0 {
							label = "at91bootstrap";
							reg = <0x0 0x40000>;
						};

						bootloader@40000 {
							label = "bootloader";
							reg = <0x40000 0xc0000>;
						};

						bootloaderenvred@100000 {
							label = "bootloader env redundant";
							reg = <0x100000 0x40000>;
						};

						bootloaderenv@140000 {
							label = "bootloader env";
							reg = <0x140000 0x40000>;
						};

						dtb@180000 {
							label = "device tree";
							reg = <0x180000 0x80000>;
						};

						kernel@200000 {
							label = "kernel";
							reg = <0x200000 0x600000>;
						};

						rootfs@800000 {
							label = "rootfs";
							reg = <0x800000 0x1f800000>;
						};
					};
				};
			};
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_key_gpio>;

		button {
			label = "pb_user1";
			gpios = <&pioE 8 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_PROG1>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_leds>;
		status = "okay";

		d8 {
			label = "d8";
			gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		d10 {
			label = "d10";
			gpios = <&pioE 15 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "heartbeat";
		};
	};

	vcc_3v3_reg: fixedregulator_3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VCC 3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		regulator-always-on;
	};

	vcc_mmc1_reg: fixedregulator_mmc1 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_vcc_mmc1_reg>;
		gpio = <&pioE 4 GPIO_ACTIVE_LOW>;
		regulator-name = "VDD MCI1";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_3v3_reg>;
		regulator-always-on;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * at91-sama5d4ek.dts - Device Tree file for SAMA5D4 Evaluation Kit
 *
 *  Copyright (C) 2014 Atmel,
 *                2014 Nicolas Ferre <nicolas.ferre@atmel.com>
 */
/dts-v1/;
#include "sama5d4.dtsi"

/ {
	model = "Atmel SAMA5D4-EK";
	compatible = "atmel,sama5d4ek", "atmel,sama5d4", "atmel,sama5";

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x20000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <12000000>;
		};
	};

	ahb {
		apb {
			adc0: adc@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
					>;
				/* The vref depends on JP22 of EK. If connect 1-2 then use 3.3V. connect 2-3 use 3.0V */
				atmel,adc-vref = <3300>;
				/*atmel,adc-ts-wires = <4>;*/	/* Set up ADC touch screen */
				status = "okay";		/* Enable ADC IIO support */
			};

			mmc0: mmc@f8000000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
				slot@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 5 0>;
				};
			};

			ssc0: ssc@f8008000 {
				status = "okay";
			};

			spi0: spi@f8010000 {
				cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
				status = "okay";
				flash@0 {
					compatible = "atmel,at25df321a";
					spi-max-frequency = <50000000>;
					reg = <0>;
				};
			};

			i2c0: i2c@f8014000 {
				status = "okay";

				wm8904: codec@1a {
					compatible = "wlf,wm8904";
					reg = <0x1a>;
					clocks = <&pmc PMC_TYPE_SYSTEM 10>;
					clock-names = "mclk";
				};

				qt1070:keyboard@1b {
					compatible = "qt1070";
					reg = <0x1b>;
					interrupt-parent = <&pioE>;
					interrupts = <25 0x0>;
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_qt1070_irq>;
					wakeup-source;
				};

				touchscreen@4c {
					compatible = "atmel,maxtouch";
					reg = <0x4c>;
					interrupt-parent = <&pioE>;
					interrupts = <24 0x0>;
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_mxt_ts>;
				};
			};

			macb0: ethernet@f8020000 {
				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;
				phy-mode = "rmii";
				status = "okay";

				ethernet-phy@1 {
					reg = <0x1>;
					interrupt-parent = <&pioE>;
					interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
				};
			};

			mmc1: mmc@fc000000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
				status = "okay";
				slot@0 {
					reg = <0>;
					bus-width = <4>;
					cd-gpios = <&pioE 6 0>;
				};
			};

			usart2: serial@fc008000 {
				status = "okay";
			};

			usart3: serial@fc00c000 {
				status = "okay";
			};

			usart4: serial@fc010000 {
				status = "okay";
			};

			tcb2: timer@fc024000 {
				timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>;
				};

				timer@1 {
					compatible = "atmel,tcb-timer";
					reg = <1>;
				};
			};

			watchdog@fc068640 {
				status = "okay";
			};

			pinctrl@fc06a000 {
				board {
					pinctrl_macb0_phy_irq: macb0_phy_irq {
						atmel,pins =
							<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
					};
					pinctrl_mmc0_cd: mmc0_cd {
						atmel,pins =
							<AT91_PIOE 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_mmc1_cd: mmc1_cd {
						atmel,pins =
							<AT91_PIOE 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_pck2_as_audio_mck: pck2_as_audio_mck {
						atmel,pins =
							<AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};
					pinctrl_usba_vbus: usba_vbus {
						atmel,pins =
							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
					};
					pinctrl_key_gpio: key_gpio_0 {
						atmel,pins =
							<AT91_PIOE 13 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PE13 gpio */
					};
					pinctrl_qt1070_irq: qt1070_irq {
						atmel,pins =
							<AT91_PIOE 25 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
					pinctrl_mxt_ts: mxt_irq {
						atmel,pins =
							<AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
					};
				};
			};
		};

		usb0: gadget@400000 {
			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usba_vbus>;
			status = "okay";
		};

		usb1: ohci@500000 {
			num-ports = <3>;
			atmel,vbus-gpio = <0 /* &pioE 10 GPIO_ACTIVE_LOW */
					   &pioE 11 GPIO_ACTIVE_LOW
					   &pioE 12 GPIO_ACTIVE_LOW
					  >;
			status = "okay";
		};

		usb2: ehci@600000 {
			status = "okay";
		};

		ebi: ebi@10000000 {
			pinctrl-0 = <&pinctrl_ebi_cs3 &pinctrl_ebi_nrd_nandoe
				     &pinctrl_ebi_nwe_nandwe &pinctrl_ebi_nandrdy
				     &pinctrl_ebi_data_0_7 &pinctrl_ebi_nand_addr>;
			pinctrl-names = "default";
			status = "okay";

			nand_controller: nand-controller {
				status = "okay";

				nand@3 {
					reg = <0x3 0x0 0x2>;
					atmel,rb = <0>;
					nand-bus-width = <8>;
					nand-ecc-mode = "hw";
					nand-on-flash-bbt;
					label = "atmel_nand";

					partitions {
						compatible = "fixed-partitions";
						#address-cells = <1>;
						#size-cells = <1>;

						at91bootstrap@0 {
							label = "at91bootstrap";
							reg = <0x0 0x40000>;
						};

						bootloader@40000 {
							label = "bootloader";
							reg = <0x40000 0x80000>;
						};

						bootloaderenv@c0000 {
							label = "bootloader env";
							reg = <0xc0000 0xc0000>;
						};

						dtb@180000 {
							label = "device tree";
							reg = <0x180000 0x80000>;
						};

						kernel@200000 {
							label = "kernel";
							reg = <0x200000 0x600000>;
						};

						rootfs@800000 {
							label = "rootfs";
							reg = <0x800000 0x0f800000>;
						};
					};
				};
			};
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_key_gpio>;

		button {
			label = "pb_user1";
			gpios = <&pioE 13 GPIO_ACTIVE_HIGH>;
			linux,code = <0x100>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";
		status = "okay";

		d8 {
			label = "d8";
			/* PE28, conflicts with usart4 rts pin */
			gpios = <&pioE 28 GPIO_ACTIVE_LOW>;
		};

		d9 {
			label = "d9";
			gpios = <&pioE 9 GPIO_ACTIVE_HIGH>;
		};

		d10 {
			label = "d10";
			gpios = <&pioE 8 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "heartbeat";
		};
	};

	sound {
		compatible = "atmel,asoc-wm8904";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pck2_as_audio_mck>;

		atmel,model = "wm8904 @ SAMA5D4EK";
		atmel,audio-routing =
			"Headphone Jack", "HPOUTL",
			"Headphone Jack", "HPOUTR",
			"IN1L", "Line In Jack",
			"IN1R", "Line In Jack";

		atmel,ssc-controller = <&ssc0>;
		atmel,audio-codec = <&wm8904>;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 *  at91-sama7g5ek.dts - Device Tree file for SAMA7G5-EK board
 *
 *  Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries
 *
 *  Author: Eugen Hristev <eugen.hristev@microchip.com>
 *  Author: Claudiu Beznea <claudiu.beznea@microchip.com>
 *
 */
/dts-v1/;
#include "sama7g5-pinfunc.h"
#include "sama7g5.dtsi"
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/at91.h>
#include <dt-bindings/sound/microchip,pdmc.h>

/ {
	model = "Microchip SAMA7G5-EK";
	compatible = "microchip,sama7g5ek", "microchip,sama7g5", "microchip,sama7";

	chosen {
		bootargs = "rw root=/dev/mmcblk1p2 rootfstype=ext4 rootwait";
		stdout-path = "serial0:115200n8";
	};

	aliases {
		serial0 = &uart3;
		serial1 = &uart4;
		serial2 = &uart7;
		serial3 = &uart0;
		i2c0 = &i2c1;
		i2c1 = &i2c8;
		i2c2 = &i2c9;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <24000000>;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_key_gpio_default>;

		button {
			label = "PB_USER";
			gpios = <&pioA PIN_PA12 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_PROG1>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_led_gpio_default>;
		status = "okay"; /* Conflict with pwm. */

		red_led {
			label = "red";
			gpios = <&pioA PIN_PB8 GPIO_ACTIVE_HIGH>;
		};

		green_led {
			label = "green";
			gpios = <&pioA PIN_PA13 GPIO_ACTIVE_HIGH>;
		};

		blue_led {
			label = "blue";
			gpios = <&pioA PIN_PD20 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
		};
	};

	/* 512 M */
	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x20000000>;
	};

	sound: sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "sama7g5ek audio";
		#address-cells = <1>;
		#size-cells = <0>;
		simple-audio-card,dai-link@0 {
			reg = <0>;
			cpu {
				sound-dai = <&spdiftx>;
			};
			codec {
				sound-dai = <&spdif_out>;
			};
		};
		simple-audio-card,dai-link@1 {
			reg = <1>;
			cpu {
				sound-dai = <&spdifrx>;
			};
			codec {
				sound-dai = <&spdif_in>;
			};
		};
	};

	spdif_in: spdif-in {
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dir";
	};

	spdif_out: spdif-out {
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dit";
	};
};

&adc {
	vddana-supply = <&vddout25>;
	vref-supply = <&vddout25>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_mikrobus1_an_default &pinctrl_mikrobus2_an_default>;
	status = "okay";
};

&can0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_can0_default>;
	status = "okay";
};

&can1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_can1_default>;
	status = "okay";
};

&cpu0 {
	cpu-supply = <&vddcpu>;
};

&qspi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_qspi>;
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <133000000>;
		spi-tx-bus-width = <8>;
		spi-rx-bus-width = <8>;
		m25p,fast-read;

		at91bootstrap@0 {
			label = "ospi: at91bootstrap";
			reg = <0x0 0x40000>;
		};

		bootloader@40000 {
			label = "ospi: bootloader";
			reg = <0x40000 0xc0000>;
		};

		bootloaderenvred@100000 {
			label = "ospi: bootloader env redundant";
			reg = <0x100000 0x40000>;
		};

		bootloaderenv@140000 {
			label = "ospi: bootloader env";
			reg = <0x140000 0x40000>;
		};

		dtb@180000 {
			label = "ospi: device tree";
			reg = <0x180000 0x80000>;
		};

		kernel@200000 {
			label = "ospi: kernel";
			reg = <0x200000 0x600000>;
		};

		rootfs@800000 {
			label = "ospi: rootfs";
			reg = <0x800000 0x7800000>;
		};

	};
};

&dma0 {
	status = "okay";
};

&dma1 {
	status = "okay";
};

&dma2 {
	status = "okay";
};

&flx0 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
	status = "disabled";

	uart0: serial@200 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_flx0_default>;
		status = "disabled";
	};
};

&flx1 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
	status = "okay";

	i2c1: i2c@600 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_i2c1_default>;
		i2c-analog-filter;
		i2c-digital-filter;
		i2c-digital-filter-width-ns = <35>;
		status = "okay";

		mcp16502@5b {
			compatible = "microchip,mcp16502";
			reg = <0x5b>;
			status = "okay";

			regulators {
				vdd_3v3: VDD_IO {
					regulator-name = "VDD_IO";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-initial-mode = <2>;
					regulator-allowed-modes = <2>, <4>;
					regulator-always-on;

					regulator-state-standby {
						regulator-on-in-suspend;
						regulator-suspend-microvolt = <3300000>;
						regulator-mode = <4>;
					};

					regulator-state-mem {
						regulator-off-in-suspend;
						regulator-mode = <4>;
					};
				};

				vddioddr: VDD_DDR {
					regulator-name = "VDD_DDR";
					regulator-min-microvolt = <1350000>;
					regulator-max-microvolt = <1350000>;
					regulator-initial-mode = <2>;
					regulator-allowed-modes = <2>, <4>;
					regulator-always-on;

					regulator-state-standby {
						regulator-on-in-suspend;
						regulator-suspend-microvolt = <1350000>;
						regulator-mode = <4>;
					};

					regulator-state-mem {
						regulator-on-in-suspend;
						regulator-suspend-microvolt = <1350000>;
						regulator-mode = <4>;
					};
				};

				vddcore: VDD_CORE {
					regulator-name = "VDD_CORE";
					regulator-min-microvolt = <1150000>;
					regulator-max-microvolt = <1150000>;
					regulator-initial-mode = <2>;
					regulator-allowed-modes = <2>, <4>;
					regulator-always-on;

					regulator-state-standby {
						regulator-on-in-suspend;
						regulator-suspend-voltage = <1150000>;
						regulator-mode = <4>;
					};

					regulator-state-mem {
						regulator-off-in-suspend;
						regulator-mode = <4>;
					};
				};

				vddcpu: VDD_OTHER {
					regulator-name = "VDD_OTHER";
					regulator-min-microvolt = <1050000>;
					regulator-max-microvolt = <1250000>;
					regulator-initial-mode = <2>;
					regulator-allowed-modes = <2>, <4>;
					regulator-ramp-delay = <3125>;
					regulator-always-on;

					regulator-state-standby {
						regulator-on-in-suspend;
						regulator-suspend-voltage = <1050000>;
						regulator-mode = <4>;
					};

					regulator-state-mem {
						regulator-off-in-suspend;
						regulator-mode = <4>;
					};
				};

				vldo1: LDO1 {
					regulator-name = "LDO1";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;

					regulator-state-standby {
						regulator-suspend-voltage = <1800000>;
						regulator-on-in-suspend;
					};

					regulator-state-mem {
						regulator-off-in-suspend;
					};
				};

				vldo2: LDO2 {
					regulator-name = "LDO2";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <3700000>;

					regulator-state-standby {
						regulator-suspend-voltage = <1800000>;
						regulator-on-in-suspend;
					};

					regulator-state-mem {
						regulator-off-in-suspend;
					};
				};
			};
		};
	};
};

&flx3 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
	status = "okay";

	uart3: serial@200 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_flx3_default>;
		status = "okay";
	};
};

&flx4 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
	status = "okay";

	uart4: serial@200 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_flx4_default>;
		status = "okay";
	};
};

&flx7 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
	status = "okay";

	uart7: serial@200 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_flx7_default>;
		status = "okay";
	};
};

&flx8 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
	status = "okay";

	i2c8: i2c@600 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_i2c8_default>;
		i2c-analog-filter;
		i2c-digital-filter;
		i2c-digital-filter-width-ns = <35>;
		status = "okay";
	};
};

&flx9 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
	status = "okay";

	i2c9: i2c@600 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_i2c9_default>;
		i2c-analog-filter;
		i2c-digital-filter;
		i2c-digital-filter-width-ns = <35>;
		status = "okay";
	};
};

&flx11 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
	status = "okay";

	spi11: spi@400 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mikrobus1_spi &pinctrl_mikrobus1_spi_cs>;
		status = "okay";
	};
};

&gmac0 {
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gmac0_default
		     &pinctrl_gmac0_mdio_default
		     &pinctrl_gmac0_txck_default
		     &pinctrl_gmac0_phy_irq>;
	phy-mode = "rgmii-id";
	status = "okay";

	ethernet-phy@7 {
		reg = <0x7>;
		interrupt-parent = <&pioA>;
		interrupts = <PIN_PA31 IRQ_TYPE_LEVEL_LOW>;
	};
};

&gmac1 {
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gmac1_default
		     &pinctrl_gmac1_mdio_default
		     &pinctrl_gmac1_phy_irq>;
	phy-mode = "rmii";
	status = "okay"; /* Conflict with pdmc0. */

	ethernet-phy@0 {
		reg = <0x0>;
		interrupt-parent = <&pioA>;
		interrupts = <PIN_PA21 IRQ_TYPE_LEVEL_LOW>;
	};
};

&i2s0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2s0_default>;
};

&pdmc0 {
	#sound-dai-cells = <0>;
	microchip,mic-pos = <MCHP_PDMC_DS0 MCHP_PDMC_CLK_NEGATIVE>, /* MIC 1 */
			    <MCHP_PDMC_DS1 MCHP_PDMC_CLK_NEGATIVE>, /* MIC 2 */
			    <MCHP_PDMC_DS0 MCHP_PDMC_CLK_POSITIVE>, /* MIC 3 */
			    <MCHP_PDMC_DS1 MCHP_PDMC_CLK_POSITIVE>; /* MIC 4 */
	status = "disabled"; /* Conflict with gmac1. */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pdmc0_default>;
};

&pioA {

	pinctrl_can0_default: can0_default {
		pinmux = <PIN_PD12__CANTX0>,
			 <PIN_PD13__CANRX0 >;
		bias-disable;
	};

	pinctrl_can1_default: can1_default {
		pinmux = <PIN_PD14__CANTX1>,
			 <PIN_PD15__CANRX1 >;
		bias-disable;
	};

	pinctrl_flx0_default: flx0_default {
		pinmux = <PIN_PE3__FLEXCOM0_IO0>,
			 <PIN_PE4__FLEXCOM0_IO1>,
			 <PIN_PE6__FLEXCOM0_IO3>,
			 <PIN_PE7__FLEXCOM0_IO4>;
		bias-disable;
	};

	pinctrl_flx3_default: flx3_default {
		pinmux = <PIN_PD16__FLEXCOM3_IO0>,
			 <PIN_PD17__FLEXCOM3_IO1>;
		bias-pull-up;
	};

	pinctrl_flx4_default: flx4_default {
		pinmux = <PIN_PD18__FLEXCOM4_IO0>,
			 <PIN_PD19__FLEXCOM4_IO1>;
		bias-disable;
	};

	pinctrl_flx7_default: flx7_default {
		pinmux = <PIN_PC23__FLEXCOM7_IO0>,
			 <PIN_PC24__FLEXCOM7_IO1>;
		bias-disable;
	};

	pinctrl_gmac0_default: gmac0_default {
		pinmux = <PIN_PA16__G0_TX0>,
			 <PIN_PA17__G0_TX1>,
			 <PIN_PA26__G0_TX2>,
			 <PIN_PA27__G0_TX3>,
			 <PIN_PA19__G0_RX0>,
			 <PIN_PA20__G0_RX1>,
			 <PIN_PA28__G0_RX2>,
			 <PIN_PA29__G0_RX3>,
			 <PIN_PA15__G0_TXEN>,
			 <PIN_PA30__G0_RXCK>,
			 <PIN_PA18__G0_RXDV>,
			 <PIN_PA25__G0_125CK>;
		slew-rate = <0>;
		bias-disable;
	};

	pinctrl_gmac0_mdio_default: gmac0_mdio_default {
		pinmux = <PIN_PA22__G0_MDC>,
			 <PIN_PA23__G0_MDIO>;
		bias-disable;
	};

	pinctrl_gmac0_txck_default: gmac0_txck_default {
		pinmux = <PIN_PA24__G0_TXCK>;
		slew-rate = <0>;
		bias-pull-up;
	};

	pinctrl_gmac0_phy_irq: gmac0_phy_irq {
		pinmux = <PIN_PA31__GPIO>;
		bias-disable;
	};

	pinctrl_gmac1_default: gmac1_default {
		pinmux = <PIN_PD30__G1_TXCK>,
			 <PIN_PD22__G1_TX0>,
			 <PIN_PD23__G1_TX1>,
			 <PIN_PD21__G1_TXEN>,
			 <PIN_PD25__G1_RX0>,
			 <PIN_PD26__G1_RX1>,
			 <PIN_PD27__G1_RXER>,
			 <PIN_PD24__G1_RXDV>;
		slew-rate = <0>;
		bias-disable;
	};

	pinctrl_gmac1_mdio_default: gmac1_mdio_default {
		pinmux = <PIN_PD28__G1_MDC>,
			 <PIN_PD29__G1_MDIO>;
		bias-disable;
	};

	pinctrl_gmac1_phy_irq: gmac1_phy_irq {
		pinmux = <PIN_PA21__GPIO>;
		bias-disable;
	};

	pinctrl_i2c1_default: i2c1_default {
		pinmux = <PIN_PC9__FLEXCOM1_IO0>,
			 <PIN_PC10__FLEXCOM1_IO1>;
		bias-disable;
	};

	pinctrl_i2c8_default: i2c8_default {
		pinmux = <PIN_PC14__FLEXCOM8_IO0>,
			 <PIN_PC13__FLEXCOM8_IO1>;
		bias-disable;
	};

	pinctrl_i2c9_default: i2c9_default {
		pinmux = <PIN_PC18__FLEXCOM9_IO0>,
			 <PIN_PC19__FLEXCOM9_IO1>;
		bias-disable;
	};

	pinctrl_i2s0_default: i2s0_default {
		pinmux = <PIN_PB23__I2SMCC0_CK>,
			 <PIN_PB24__I2SMCC0_WS>,
			 <PIN_PB25__I2SMCC0_DOUT1>,
			 <PIN_PB26__I2SMCC0_DOUT0>,
			 <PIN_PB27__I2SMCC0_MCK>;
		bias-disable;
	};

	pinctrl_key_gpio_default: key_gpio_default {
		pinmux = <PIN_PA12__GPIO>;
		bias-pull-up;
	};

	pinctrl_led_gpio_default: led_gpio_default {
		pinmux = <PIN_PA13__GPIO>,
			 <PIN_PB8__GPIO>,
			 <PIN_PD20__GPIO>;
		bias-pull-up;
	};

	pinctrl_mikrobus1_an_default: mikrobus1_an_default {
		pinmux = <PIN_PD0__GPIO>;
		bias-disable;
	};

	pinctrl_mikrobus2_an_default: mikrobus2_an_default {
		pinmux = <PIN_PD1__GPIO>;
		bias-disable;
	};

	pinctrl_mikrobus1_pwm2_default: mikrobus1_pwm2_default {
		pinmux = <PIN_PA13__PWMH2>;
		bias-disable;
	};

	pinctrl_mikrobus2_pwm3_default: mikrobus2_pwm3_default {
		pinmux = <PIN_PD20__PWMH3>;
		bias-disable;
	};

	pinctrl_mikrobus1_spi_cs: mikrobus1_spi_cs {
		pinmux = <PIN_PB6__FLEXCOM11_IO3>;
		bias-disable;
	};

	pinctrl_mikrobus1_spi: mikrobus1_spi {
		pinmux = <PIN_PB3__FLEXCOM11_IO0>,
			 <PIN_PB4__FLEXCOM11_IO1>,
			 <PIN_PB5__FLEXCOM11_IO2>;
		bias-disable;
	};

	pinctrl_pdmc0_default: pdmc0_default {
		pinmux = <PIN_PD23__PDMC0_DS0>,
			 <PIN_PD24__PDMC0_DS1>,
			 <PIN_PD22__PDMC0_CLK>;
		bias_disable;
	};

	pinctrl_qspi: qspi {
		pinmux = <PIN_PB12__QSPI0_IO0>,
			 <PIN_PB11__QSPI0_IO1>,
			 <PIN_PB10__QSPI0_IO2>,
			 <PIN_PB9__QSPI0_IO3>,
			 <PIN_PB16__QSPI0_IO4>,
			 <PIN_PB17__QSPI0_IO5>,
			 <PIN_PB18__QSPI0_IO6>,
			 <PIN_PB19__QSPI0_IO7>,
			 <PIN_PB13__QSPI0_CS>,
			 <PIN_PB14__QSPI0_SCK>,
			 <PIN_PB15__QSPI0_SCKN>,
			 <PIN_PB20__QSPI0_DQS>,
			 <PIN_PB21__QSPI0_INT>;
		bias-disable;
		slew-rate = <0>;
		atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>;
	};

	pinctrl_sdmmc0_default: sdmmc0_default {
		cmd_data {
			pinmux = <PIN_PA1__SDMMC0_CMD>,
				 <PIN_PA3__SDMMC0_DAT0>,
				 <PIN_PA4__SDMMC0_DAT1>,
				 <PIN_PA5__SDMMC0_DAT2>,
				 <PIN_PA6__SDMMC0_DAT3>,
				 <PIN_PA7__SDMMC0_DAT4>,
				 <PIN_PA8__SDMMC0_DAT5>,
				 <PIN_PA9__SDMMC0_DAT6>,
				 <PIN_PA10__SDMMC0_DAT7>;
			slew-rate = <0>;
			bias-pull-up;
		};

		ck_cd_rstn_vddsel {
			pinmux = <PIN_PA0__SDMMC0_CK>,
				 <PIN_PA2__SDMMC0_RSTN>,
				 <PIN_PA11__SDMMC0_DS>;
			slew-rate = <0>;
			bias-pull-up;
		};
	};

	pinctrl_sdmmc1_default: sdmmc1_default {
		cmd_data {
			pinmux = <PIN_PB29__SDMMC1_CMD>,
				 <PIN_PB31__SDMMC1_DAT0>,
				 <PIN_PC0__SDMMC1_DAT1>,
				 <PIN_PC1__SDMMC1_DAT2>,
				 <PIN_PC2__SDMMC1_DAT3>;
			slew-rate = <0>;
			bias-pull-up;
		};

		ck_cd_rstn_vddsel {
			pinmux = <PIN_PB30__SDMMC1_CK>,
				 <PIN_PB28__SDMMC1_RSTN>,
				 <PIN_PC5__SDMMC1_1V8SEL>,
				 <PIN_PC4__SDMMC1_CD>;
			slew-rate = <0>;
			bias-pull-up;
		};
	};

	pinctrl_sdmmc2_default: sdmmc2_default {
		cmd_data {
			pinmux = <PIN_PD3__SDMMC2_CMD>,
				 <PIN_PD5__SDMMC2_DAT0>,
				 <PIN_PD6__SDMMC2_DAT1>,
				 <PIN_PD7__SDMMC2_DAT2>,
				 <PIN_PD8__SDMMC2_DAT3>;
			slew-rate = <0>;
			bias-pull-up;
		};

		ck {
			pinmux = <PIN_PD4__SDMMC2_CK>;
			slew-rate = <0>;
			bias-pull-up;
		};
	};

	pinctrl_spdifrx_default: spdifrx_default {
		pinmux = <PIN_PB0__SPDIF_RX>;
		bias-disable;
	};

	pinctrl_spdiftx_default: spdiftx_default {
		pinmux = <PIN_PB1__SPDIF_TX>;
		bias-disable;
	};
};

&pwm {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_mikrobus1_pwm2_default &pinctrl_mikrobus2_pwm3_default>;
	status = "disabled"; /* Conflict with leds. */
};

&rtt {
	atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
};

&sdmmc0 {
	bus-width = <8>;
	non-removable;
	sdhci-caps-mask = <0x0 0x00200000>;
	vmmc-supply = <&vdd_3v3>;
	vqmmc-supply = <&vldo1>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdmmc0_default>;
	status = "okay";
};

&sdmmc1 {
	bus-width = <4>;
	no-1-8-v;
	sdhci-caps-mask = <0x0 0x00200000>;
	vmmc-supply = <&vdd_3v3>;
	vqmmc-supply = <&vdd_3v3>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdmmc1_default>;
	status = "okay";
};

&sdmmc2 {
	bus-width = <4>;
	no-1-8-v;
	sdhci-caps-mask = <0x0 0x00200000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdmmc2_default>;
};

&shdwc {
	atmel,shdwc-debouncer = <976>;
	status = "okay";

	input@0 {
		reg = <0>;
	};
};

&spdifrx {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spdifrx_default>;
	status = "okay";
};

&spdiftx {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spdiftx_default>;
	status = "okay";
};

&tcb0 {
	timer0: timer@0 {
		compatible = "atmel,tcb-timer";
		reg = <0>;
	};

	timer1: timer@1 {
		compatible = "atmel,tcb-timer";
		reg = <1>;
	};
};

&trng {
	status = "okay";
};

&vddout25 {
	vin-supply = <&vdd_3v3>;
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2017-2018 Overkiz SAS
 *   Author: Mickael Gardet <m.gardet@overkiz.com>
 *           Kévin Raymond <k.raymond@overkiz.com>
 *           Dorian Rocipon <d.rocipon@overkiz.com>
 */
/dts-v1/;
#include "at91-kizboxmini-common.dtsi"

/ {
	model = "Overkiz SmartKiz";
	compatible = "overkiz,smartkiz", "atmel,at91sam9g25",
		     "atmel,at91sam9x5", "atmel,at91sam9";

	clocks {
		adc_op_clk {
			status = "okay";
		};
	};

	aliases {
		serial5 = &uart0;
	};

	pio_keys {
		hk_reset {
			label = "HK_RESET";
			gpios = <&pioC 13 GPIO_ACTIVE_HIGH>;
		};

		power_rf {
			label = "POWER_RF";
			gpios = <&pioA 20 GPIO_ACTIVE_HIGH>;
		};

		power_wifi {
			label = "POWER_WIFI";
			gpios = <&pioA 21 GPIO_ACTIVE_HIGH>;
		};
	};
};

&pinctrl {
	i2c1 {
		pinctrl_i2c1: i2c1-0 {
			atmel,pins =
				<AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_PULL_UP
				AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>;
		};
	};

	adc0 {
		pinctrl_adc0_ad0: adc0_ad0-0 {
			/* pull-up disable */
			atmel,pins = <AT91_PIOB 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};
		pinctrl_adc0_ad5: adc0_ad5-0 {
			/* pull-up disable */
			atmel,pins = <AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};
		pinctrl_adc0_ad6: adc0_ad6-0 {
			/* pull-up disable */
			atmel,pins = <AT91_PIOB 17 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};
		pinctrl_adc0_ad11: adc0_ad11-0 {
			/* pull-up disable */
			atmel,pins = <AT91_PIOB 10 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};
	};
};

&i2c1 {
	dmas = <0>, <0>;
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "disabled";
};

&macb0 {
	status = "disabled";
};

&rtc {
	status = "okay";
};

&led_blue {
	status = "okay";
};

&adc0 {
	atmel,adc-vref = <2500>;
	pinctrl-names = "default";
	pinctrl-0 = <
		&pinctrl_adc0_ad0
		&pinctrl_adc0_ad5
		&pinctrl_adc0_ad6
		&pinctrl_adc0_ad11
	>;
	atmel,adc-channels-used = <0x0861>;
	status = "okay";
};

&uart0 {
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * at91-som60.dtsi - Device Tree file for the SOM60 module
 *
 *  Copyright (C) 2018 Laird,
 *		  2018 Ben Whitten <ben.whitten@lairdtech.com>
 *
 */
#include "sama5d36.dtsi"

/ {
	model = "Laird SOM60";
	compatible = "laird,som60", "atmel,sama5d36", "atmel,sama5d3", "atmel,sama5";

	chosen {
		stdout-path = &dbgu;
	};

	memory@20000000 {
		reg = <0x20000000 0x8000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <12000000>;
		};
	};
};

&pinctrl {
	board {
		pinctrl_mmc0_cd: mmc0_cd {
			atmel,pins =
				<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
		};

		pinctrl_mmc0_en: mmc0_en {
			atmel,pins =
				<AT91_PIOE 30 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
		};

		pinctrl_nand0_wp: nand0_wp {
			atmel,pins =
				<AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
		};

		pinctrl_usb_vbus: usb_vbus {
			atmel,pins =
				<AT91_PIOE 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
				/* Conflicts with USART2_SCK */
		};

		pinctrl_usart2_sck: usart2_sck {
			atmel,pins =
				<AT91_PIOE 20 AT91_PERIPH_B AT91_PINCTRL_NONE>;
				/* Conflicts with USB_VBUS */
		};

		pinctrl_usb_oc: usb_oc {
			atmel,pins =
				<AT91_PIOE 15 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
				/* Conflicts with USART3_SCK */
		};

		pinctrl_usart3_sck: usart3_sck {
			atmel,pins =
				<AT91_PIOE 15 AT91_PERIPH_B AT91_PINCTRL_NONE>;
				/* Conflicts with USB_OC */
		};

		pinctrl_usba_vbus: usba_vbus {
		   atmel,pins =
				<AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
		};

		pinctrl_geth_int: geth_int {
			atmel,pins =
				<AT91_PIOB 25 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
				/* Conflicts with USART1_SCK */
		};

		pinctrl_usart1_sck: usart1_sck {
			atmel,pins =
				<AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_NONE>;
				/* Conflicts with GETH_INT */
		};

		pinctrl_eth_int: eth_int {
			atmel,pins =
				<AT91_PIOC 10 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
		};

		pinctrl_pck2_as_audio_mck: pck2_as_audio_mck {
			atmel,pins =
				<AT91_PIOC 15 AT91_PERIPH_B AT91_PINCTRL_NONE>;
		};
	};
};

&mmc0 {
	slot@0 {
		reg = <0>;
		bus-width = <8>;
	};
};

&mmc1 {
	status = "okay";
	slot@0 {
		reg = <0>;
		bus-width = <4>;
	};
};

&spi0 {
	cs-gpios = <&pioD 13 0>, <0>, <0>, <0>;
};

&usart0 {
	atmel,use-dma-rx;
	atmel,use-dma-tx;
	status = "okay";
	pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>;
};

&usart1 {
	pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
};

&usart2 {
	pinctrl-0 = <&pinctrl_usart2 &pinctrl_usart2_rts_cts>;
};

&usart3 {
	pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>;
};

&adc0 {
	pinctrl-0 = <
		&pinctrl_adc0_adtrg
		&pinctrl_adc0_ad0
		&pinctrl_adc0_ad1
		&pinctrl_adc0_ad2
		&pinctrl_adc0_ad3
		&pinctrl_adc0_ad4
		&pinctrl_adc0_ad5
		>;
};

&macb0 {
	phy-mode = "rgmii";
};

&macb1 {
	phy-mode = "rmii";
};

&ebi {
	pinctrl-0 = <&pinctrl_ebi_nand_addr>;
	pinctrl-names = "default";
	status = "okay";
};

&nand_controller {
	status = "okay";

	nand: nand@3 {
		reg = <0x3 0x0 0x2>;
		atmel,rb = <0>;
		nand-bus-width = <8>;
		nand-ecc-mode = "hw";
		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-on-flash-bbt;
		label = "atmel_nand";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			ubootspl@0 {
				label = "u-boot-spl";
				reg = <0x0 0x20000>;
			};

			uboot@20000 {
				label = "u-boot";
				reg = <0x20000 0x80000>;
			};

			ubootenv@a0000 {
				label = "u-boot-env";
				reg = <0xa0000 0x20000>;
			};

			ubootenv@c0000 {
				label = "u-boot-env";
				reg = <0xc0000 0x20000>;
			};

			ubi@e0000 {
				label = "ubi";
				reg = <0xe0000 0xfe00000>;
			};
		};
	};
};

&usb0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usba_vbus>;
	atmel,vbus-gpio = <&pioC 14 GPIO_ACTIVE_HIGH>;
};

&usb1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb_vbus &pinctrl_usb_oc>;
	num-ports = <3>;
	atmel,vbus-gpio = <0
		&pioE 20 GPIO_ACTIVE_HIGH
		0>;
	atmel,oc-gpio = <0
		&pioE 15 GPIO_ACTIVE_LOW
		0>;
};


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * at91-tse850-3.dts - Device Tree file for the Axentia TSE-850 3.0 board
 *
 * Copyright (C) 2017 Axentia Technologies AB
 *
 * Author: Peter Rosin <peda@axentia.se>
 */
/dts-v1/;
#include <dt-bindings/pwm/pwm.h>
#include "at91-linea.dtsi"

/ {
	model = "Axentia TSE-850 3.0";
	compatible = "axentia,tse850v3", "axentia,linea",
		     "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";

	sck: oscillator {
		compatible = "fixed-clock";

		#clock-cells = <0>;
		clock-frequency = <16000000>;
		clock-output-names = "sck";
	};

	reg_3v3: regulator {
		compatible = "regulator-fixed";

		regulator-name = "3v3-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	ana: reg-ana {
		compatible = "pwm-regulator";

		regulator-name = "ANA";

		pwms = <&pwm0 2 1000 PWM_POLARITY_INVERTED>;
		pwm-dutycycle-unit = <1000>;
		pwm-dutycycle-range = <100 1000>;

		regulator-min-microvolt = <2000000>;
		regulator-max-microvolt = <20000000>;
		regulator-ramp-delay = <1000>;
	};

	sound {
		compatible = "axentia,tse850-pcm5142";

		axentia,cpu-dai = <&ssc0>;
		axentia,audio-codec = <&pcm5142>;

		axentia,add-gpios = <&pioA 8 GPIO_ACTIVE_LOW>;
		axentia,loop1-gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
		axentia,loop2-gpios = <&pioA 11 GPIO_ACTIVE_LOW>;

		axentia,ana-supply = <&ana>;
	};

	dac: dpot-dac {
		compatible = "dpot-dac";
		vref-supply = <&reg_3v3>;
		io-channels = <&dpot 0>;
		io-channel-names = "dpot";
		#io-channel-cells = <1>;
	};

	env_det: envelope-detector {
		compatible = "axentia,tse850-envelope-detector";
		io-channels = <&dac 0>;
		io-channel-names = "dac";
		#io-channel-cells = <1>;

		interrupt-parent = <&pioA>;
		interrupts = <3 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "comp";
	};

	mux: mux-controller {
		compatible = "gpio-mux";
		#mux-control-cells = <0>;

		mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
			    <&pioA 1 GPIO_ACTIVE_HIGH>,
			    <&pioA 2 GPIO_ACTIVE_HIGH>;
		idle-state = <0>;
	};

	envelope-detector-mux {
		compatible = "io-channel-mux";
		io-channels = <&env_det 0>;
		io-channel-names = "parent";

		mux-controls = <&mux>;

		channels = "", "",
			 "sync-1",
			 "in",
			 "out",
			 "sync-2",
			 "sys-reg",
			 "ana-reg";
	};

	leds {
		compatible = "gpio-leds";

		ch1-red {
			label = "ch-1:red";
			gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
		};
		ch1-green {
			label = "ch-1:green";
			gpios = <&pioA 22 GPIO_ACTIVE_LOW>;
		};
		ch2-red {
			label = "ch-2:red";
			gpios = <&pioA 21 GPIO_ACTIVE_LOW>;
		};
		ch2-green {
			label = "ch-2:green";
			gpios = <&pioA 20 GPIO_ACTIVE_LOW>;
		};
		data-red {
			label = "data:red";
			gpios = <&pioA 19 GPIO_ACTIVE_LOW>;
		};
		data-green {
			label = "data:green";
			gpios = <&pioA 18 GPIO_ACTIVE_LOW>;
		};
		alarm-red {
			label = "alarm:red";
			gpios = <&pioA 17 GPIO_ACTIVE_LOW>;
		};
		alarm-green {
			label = "alarm:green";
			gpios = <&pioA 16 GPIO_ACTIVE_LOW>;
		};
	};
};

&nand {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		at91bootstrap@0 {
			label = "at91bootstrap";
			reg = <0x0 0x40000>;
		};

		barebox@40000 {
			label = "bootloader";
			reg = <0x40000 0x60000>;
		};

		bareboxenv@c0000 {
			label = "bareboxenv";
			reg = <0xc0000 0x40000>;
		};

		bareboxenv2@100000 {
			label = "bareboxenv2";
			reg = <0x100000 0x40000>;
		};

		oftree@180000 {
			label = "oftree";
			reg = <0x180000 0x20000>;
		};

		kernel@200000 {
			label = "kernel";
			reg = <0x200000 0x500000>;
		};

		rootfs@800000 {
			label = "rootfs";
			reg = <0x800000 0x0f800000>;
		};

		ovlfs@10000000 {
			label = "ovlfs";
			reg = <0x10000000 0x10000000>;
		};
	};
};

&ssc0 {
	#sound-dai-cells = <0>;

	status = "okay";
};

&i2c0 {
	status = "okay";

	jc42@18 {
		compatible = "nxp,se97b", "jedec,jc-42.4-temp";
		reg = <0x18>;
		smbus-timeout-disable;
	};

	dpot: mcp4651-104@28 {
		compatible = "microchip,mcp4651-104";
		reg = <0x28>;
		#io-channel-cells = <1>;
	};

	pcm5142: pcm5142@4c {
		compatible = "ti,pcm5142";

		reg = <0x4c>;
		#sound-dai-cells = <0>;

		AVDD-supply = <&reg_3v3>;
		DVDD-supply = <&reg_3v3>;
		CPVDD-supply = <&reg_3v3>;

		clocks = <&sck>;

		pll-in = <3>;
		pll-out = <6>;
	};

	eeprom@50 {
		compatible = "nxp,se97b", "atmel,24c02";
		reg = <0x50>;
		pagesize = <16>;
	};
};

&pinctrl {
	tse850 {
		pinctrl_usba_vbus: usba-vbus {
			atmel,pins = <AT91_PIOC 31 AT91_PERIPH_GPIO
				      AT91_PINCTRL_DEGLITCH>;
		};
	};
};

&watchdog {
	status = "okay";
};

&usart0 {
	status = "okay";

	atmel,use-dma-rx;
};

&pwm0 {
	status = "okay";

	pinctrl-0 = <&pinctrl_pwm0_pwml2_1>;
	pinctrl-names = "default";
};

&macb1 {
	status = "okay";

	phy-mode = "rmii";

	#address-cells = <1>;
	#size-cells = <0>;

	phy0: ethernet-phy@3 {
		reg = <3>;

		interrupt-parent = <&pioE>;
		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
	};
};

&usb0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usba_vbus>;
	atmel,vbus-gpio = <&pioC 31 GPIO_ACTIVE_HIGH>;
};

&usb1 {
	status = "okay";

	num-ports = <1>;
	atmel,vbus-gpio = <&pioD 29 GPIO_ACTIVE_HIGH>;
	atmel,oc-gpio = <&pioC 15 GPIO_ACTIVE_LOW>;
};

&usb2 {
	status = "okay";
};

&dbgu {
	status = "okay";

	dmas = <0>, <0>;	/*  Do not use DMA for dbgu */
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Device Tree file for VInCo platform
 *
 *  Copyright (C) 2014 Atmel,
 *                2014 Nicolas Ferre <nicolas.ferre@atmel.com>
 *   2015 Gregory CLEMENT <gregory.clement@free-electrons.com>
 */
/dts-v1/;
#include "sama5d4.dtsi"

/ {
	model = "L+G VInCo platform";
	compatible = "l+g,vinco", "atmel,sama5d4", "atmel,sama5";

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x4000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <12000000>;
		};
	};

	ahb {
		apb {

			adc0: adc@fc034000 {
				status = "okay"; /* Enable ADC IIO support */
			};

			mmc0: mmc@f8000000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0
					     &pinctrl_mmc0_dat1_3
					     &pinctrl_mmc0_dat4_7>;
				vqmmc-supply = <&vcc_3v3_reg>;
				vmmc-supply = <&vcc_3v3_reg>;
				no-1-8-v;
				status = "okay";
				slot@0 {
					reg = <0>;
					bus-width = <8>;
					non-removable;
					broken-cd;
					status = "okay";
				};
			};

			spi0: spi@f8010000 {
				cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
				status = "okay";
				flash@0 {
					compatible = "n25q32b", "jedec,spi-nor";
					spi-max-frequency = <50000000>;
					reg = <0>;
				};
			};

			i2c0: i2c@f8014000 {
				status = "okay";
			};

			i2c1: i2c@f8018000 {
				status = "okay";
				/* kerkey security module */
			};

			macb0: ethernet@f8020000 {
				phy-mode = "rmii";
				status = "okay";

				ethernet-phy@1 {
					reg = <0x1>;
					reset-gpios = <&pioE 8 GPIO_ACTIVE_LOW>;
					interrupt-parent = <&pioB>;
					interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
				};

			};

			i2c2: i2c@f8024000 {
				status = "okay";

				rtc1: rtc@32 {
					compatible = "epson,rx8900";
					reg = <0x32>;
				};
			};

			usart2: serial@fc008000 {
				/* MBUS */
				status = "okay";
			};

			usart3: serial@fc00c000 {
				/* debug */
				status = "okay";
			};

			usart4: serial@fc010000 {
				/* LMN */
				pinctrl-0 = <&pinctrl_usart4 &pinctrl_usart4_rts>;
				linux,rs485-enabled-at-boot-time;
				status = "okay";
			};

			tcb2: timer@fc024000 {
				timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>;
				};

				timer@1 {
					compatible = "atmel,tcb-timer";
					reg = <1>;
				};
			};

			macb1: ethernet@fc028000 {
				phy-mode = "rmii";
				status = "okay";
				#address-cells = <1>;
				#size-cells = <0>;
				status = "okay";

				ethernet-phy@1 {
					reg = <0x1>;
					interrupt-parent = <&pioB>;
					interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
					reset-gpios = <&pioE 6 GPIO_ACTIVE_LOW>;
				};
			};

			watchdog@fc068640 {
				status = "okay";
			};

			pinctrl@fc06a000 {
				board {
					pinctrl_usba_vbus: usba_vbus {
						atmel,pins =
						<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
					};
				};
			};
		};

		usb0: gadget@400000 {
			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usba_vbus>;
			status = "disable";
		};

		usb1: ohci@500000 {
			num-ports = <3>;
			atmel,vbus-gpio = <0
					   &pioE 11 GPIO_ACTIVE_LOW
					   &pioE 12 GPIO_ACTIVE_LOW
					  >;
			status = "disable";
		};

		usb2: ehci@600000 {
			/* 4G Modem */
			status = "okay";
		};

	};

	leds {
		compatible = "gpio-leds";
		status = "okay";

		led_err {
			label = "err";
			gpios = <&pioA 7 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led_rssi {
			label = "rssi";
			gpios = <&pioA 9 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led_tls {
			label = "tls";
			gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led_lmc {
			label = "lmc";
			gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led_wmt {
			label = "wmt";
			gpios = <&pioA 29 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led_pwr {
			label = "pwr";
			gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
			default-state = "on";
		};

	};

	vcc_3v3_reg: fixedregulator_3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VCC 3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		regulator-always-on;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * at91-wb45n.dts - Device Tree file for WB45NBT board
 *
 *  Copyright (C) 2018 Laird
 *
 */
/dts-v1/;
#include "at91-wb45n.dtsi"

/ {
	model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)";
	compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9";

	gpio-keys {
		compatible = "gpio-keys";

		button {
			label = "IRQBTN";
			linux,code = <99>;
			gpios = <&pioB 18 GPIO_ACTIVE_LOW>;
			wakeup-source;
		};
	};
};

&watchdog {
	status = "okay";
};

&usb0 {
	status = "okay";
};

&mmc0 {
	status = "okay";
};

&spi0 {
	status = "okay";
};

&macb0 {
	status = "okay";
};

&dbgu {
	status = "okay";
};

&usart0 {
	status = "okay";
};

&usart3 {
	status = "okay";
};

&i2c1 {
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * at91-wb45n.dtsi - Device Tree file for WB45NBT board
 *
 *  Copyright (C) 2018 Laird
 *
 */

#include "at91sam9g25.dtsi"

/ {
	model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)";
	compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9";

	chosen {
		bootargs = "ubi.mtd=6 root=ubi0:rootfs rootfstype=ubifs rw";
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x4000000>;
	};

	atheros {
		compatible = "atheros,ath6kl";
		atheros,board-id = "SD32";
	};
};

&reset_controller {
	compatible = "atmel,sama5d3-rstc";
};

&shutdown_controller {
	atmel,wakeup-mode = "low";
};

&slow_xtal {
	clock-frequency = <32768>;
};

&main_xtal {
	clock-frequency = <12000000>;
};

&ebi {
	status = "okay";
	nand_controller: nand-controller {
		pinctrl-0 = <&pinctrl_nand_cs &pinctrl_nand_rb &pinctrl_nand_oe_we>;
		pinctrl-names = "default";
		status = "okay";

		nand@3 {
			reg = <0x3 0x0 0x800000>;
			rb-gpios = <&pioD 5 GPIO_ACTIVE_HIGH>;
			cs-gpios = <&pioD 4 GPIO_ACTIVE_HIGH>;
			nand-bus-width = <8>;
			nand-ecc-mode = "hw";
			nand-ecc-strength = <4>;
			nand-ecc-step-size = <512>;
			nand-on-flash-bbt;
			label = "atmel_nand";

			partitions {
				compatible = "fixed-partitions";
				#address-cells = <1>;
				#size-cells = <1>;

				at91bootstrap@0 {
					label = "at91bs";
					reg = <0x0 0x20000>;
				};

				uboot@20000 {
					label = "u-boot";
					reg = <0x20000 0x80000>;
				};

				ubootenv@a0000 {
					label = "u-boot-env";
					reg = <0xa0000 0x20000>;
				};

				ubootenv@c0000 {
					label = "redund-env";
					reg = <0xc0000 0x20000>;
				};

				kernel-a@e0000 {
					label = "kernel-a";
					reg = <0xe0000 0x280000>;
				};

				kernel-b@360000 {
					label = "kernel-b";
					reg = <0x360000 0x280000>;
				};

				rootfs-a@5e0000 {
					label = "rootfs-a";
					reg = <0x5e0000 0x2600000>;
				};

				rootfs-b@2be0000 {
					label = "rootfs-b";
					reg = <0x2be0000 0x2600000>;
				};

				user@51e0000 {
					label = "user";
					reg = <0x51e0000 0x2dc0000>;
				};

				logs@7fa0000 {
					label = "logs";
					reg = <0x7fa0000 0x60000>;
				};

			};
		};
	};
};

&usb0 {
	num-ports = <2>;
	atmel,vbus-gpio = <
		&pioB 12 GPIO_ACTIVE_HIGH
		&pioA 31 GPIO_ACTIVE_HIGH
		>;
	atmel,oc-gpio = <&pioB 13 GPIO_ACTIVE_LOW>;
};

&macb0 {
	phy-mode = "rmii";
};

&spi0 {
	cs-gpios = <&pioA 14 0>, <&pioA 7 0>, <0>, <0>;
};

&usb2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_board_usb2>;
	atmel,vbus-gpio = <&pioB 11 GPIO_ACTIVE_HIGH>;
};

&mmc0 {
	pinctrl-names = "default";
	pinctrl-0 = <
		&pinctrl_mmc0_slot0_clk_cmd_dat0
		&pinctrl_mmc0_slot0_dat1_3>;
	slot@0 {
		reg = <0>;
		bus-width = <4>;
	};
};

&pinctrl {
	usb2 {
		pinctrl_board_usb2: usb2-board {
			atmel,pins =
				<AT91_PIOB 11 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB11 gpio vbus sense, deglitch */
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * at91-wb50n.dts - Device Tree file for wb50n evaluation board
 *
 *  Copyright (C) 2018 Laird
 *
 */

/dts-v1/;
#include "at91-wb50n.dtsi"

/ {
	model = "Laird Workgroup Bridge 50N - Atmel SAMA5D";
	compatible = "laird,wb50n", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";

	gpio-keys {
		compatible = "gpio-keys";

		button-0 {
			label = "BTNESC";
			linux,code = <1>; /* ESC button */
			gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
			wakeup-source;
		};

		button-1 {
			label = "IRQBTN";
			linux,code = <99>; /* SysReq button */
			gpios = <&pioE 31 GPIO_ACTIVE_LOW>;
			wakeup-source;
		};
	};

	leds {
		compatible = "gpio-leds";

		led0 {
			label = "wb50n:blue:led0";
			gpios = <&pioA 12 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led1 {
			label = "wb50n:green:led1";
			gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		led2 {
			label = "wb50n:red:led2";
			gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};
	};
};

&watchdog {
	status = "okay";
};

&mmc0 {
	status = "okay";
};

&macb1 {
	status = "okay";
};

&dbgu {
	status = "okay";
};

/* On BB40 this port is labeled UART1 */
&usart0 {
	status = "okay";
};

/* On BB40 this port is labeled UART0 */
&usart1 {
	status = "okay";
};

&i2c0 {
	status = "okay";
};

&spi1 {
	status = "okay";
};

&usb0 {
	status = "okay";
};

&usb1 {
	status = "okay";
};

&usb2 {
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
/*
 * at91-wb50n.dtsi - Device Tree include file for wb50n cpu module
 *
 *  Copyright (C) 2018 Laird
 *
 */

#include "sama5d31.dtsi"

/ {
	model = "Laird Workgroup Bridge 50N - Atmel SAMA5D";
	compatible = "laird,wb50n", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";

	chosen {
		bootargs = "ubi.mtd=6 root=ubi0:rootfs rootfstype=ubifs rw";
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x4000000>;
	};
};

&pinctrl {
	board {
		pinctrl_mmc0_cd: mmc0_cd {
			atmel,pins = <AT91_PIOC 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PC26 GPIO with pullup deglitch */
		};

		pinctrl_usba_vbus: usba_vbus {
			atmel,pins = <AT91_PIOB 13 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PB13 GPIO with deglitch */
		};
	};
};

&slow_xtal {
	clock-frequency = <32768>;
};

&main_xtal {
	clock-frequency = <12000000>;
};

&clk32k {
	atmel,osc-bypass;
};

&mmc0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
	cd-gpios = <&pioC 26 GPIO_ACTIVE_LOW>;
	slot@0 {
		reg = <0>;
		bus-width = <4>;
	};
};

&mmc1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
	status = "okay";
	atheros@0 {
		compatible = "atheros,ath6kl";
		atheros,board-id = "SD32";
		reg = <0>;
		bus-width = <4>;
	};
};

&macb1 {
	phy-mode = "rmii";
};

&dbgu {
	dmas = <0>, <0>;	/*  Do not use DMA for dbgu */
};

/* On BB40 this port is labeled UART1 */
&usart0 {
	atmel,use-dma-rx;
	atmel,use-dma-tx;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>;
};

/* On BB40 this port is labeled UART0 */
&usart1 {
	atmel,use-dma-rx;
	atmel,use-dma-tx;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
	dtr-gpios = <&pioD 13 GPIO_ACTIVE_LOW>;
	dsr-gpios = <&pioD 11 GPIO_ACTIVE_LOW>;
	dcd-gpios = <&pioD 7 GPIO_ACTIVE_LOW>;
	rng-gpios = <&pioD 8 GPIO_ACTIVE_LOW>;
};

/* USART3 is direct-connect to the Bluetooth UART on the radio SIP */
&usart3 {
	atmel,use-dma-rx;
	atmel,use-dma-tx;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>;
	status = "okay";
};

&spi1 {
	cs-gpios = <&pioC 25 0>, <0>, <0>, <0>;
};

&ebi {
	pinctrl-0 = <&pinctrl_ebi_nand_addr>;
	pinctrl-names = "default";
	status = "okay";
};

&nand_controller {
	status = "okay";

	nand: nand@3 {
		reg = <0x3 0x0 0x2>;
		atmel,rb = <0>;
		nand-bus-width = <8>;
		nand-ecc-mode = "hw";
		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-on-flash-bbt;
		label = "atmel_nand";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			at91bootstrap@0 {
				label = "at91bs";
				reg = <0x0 0x20000>;
			};

			uboot@20000 {
				label = "u-boot";
				reg = <0x20000 0x80000>;
			};

			ubootenv@a0000 {
				label = "u-boot-env";
				reg = <0xa0000 0x20000>;
			};

			ubootenv@c0000 {
				label = "u-boot-env";
				reg = <0xc0000 0x20000>;
			};

			kernel-a@e0000 {
				label = "kernel-a";
				reg = <0xe0000 0x500000>;
			};

			kernel-b@5e0000 {
				label = "kernel-b";
				reg = <0x5e0000 0x500000>;
			};

			rootfs-a@ae0000 {
				label = "rootfs-a";
				reg = <0xae0000 0x3000000>;
			};

			rootfs-b@3ae0000 {
				label = "rootfs-b";
				reg = <0x3ae0000 0x3000000>;
			};

			user@6ae0000 {
				label = "user";
				reg = <0x6ae0000 0x14e0000>;
			};
		};
	};
};

&usb0 {
	atmel,vbus-gpio = <&pioB 13 GPIO_ACTIVE_LOW>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usba_vbus>;
};

&usb1 {
	num-ports = <3>;
	atmel,vbus-gpio = <&pioA 2 GPIO_ACTIVE_LOW>;
	atmel,oc-gpio = <&pioA 4 GPIO_ACTIVE_LOW>;
};


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * at91rm9200.dtsi - Device Tree Include file for AT91RM9200 family SoC
 *
 *  Copyright (C) 2011 Atmel,
 *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>,
 *                2012 Joachim Eastwood <manabian@gmail.com>
 *
 * Based on at91sam9260.dtsi
 */

#include <dt-bindings/pinctrl/at91.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
#include <dt-bindings/mfd/at91-usart.h>

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	model = "Atmel AT91RM9200 family SoC";
	compatible = "atmel,at91rm9200";
	interrupt-parent = <&aic>;

	aliases {
		serial0 = &dbgu;
		serial1 = &usart0;
		serial2 = &usart1;
		serial3 = &usart2;
		serial4 = &usart3;
		gpio0 = &pioA;
		gpio1 = &pioB;
		gpio2 = &pioC;
		gpio3 = &pioD;
		tcb0 = &tcb0;
		tcb1 = &tcb1;
		i2c0 = &i2c0;
		ssc0 = &ssc0;
		ssc1 = &ssc1;
		ssc2 = &ssc2;
	};
	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu@0 {
			compatible = "arm,arm920t";
			device_type = "cpu";
			reg = <0>;
		};
	};

	memory@20000000 {
		device_type = "memory";
		reg = <0x20000000 0x04000000>;
	};

	clocks {
		slow_xtal: slow_xtal {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <0>;
		};

		main_xtal: main_xtal {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <0>;
		};
	};

	sram: sram@200000 {
		compatible = "mmio-sram";
		reg = <0x00200000 0x4000>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0 0x00200000 0x4000>;
	};

	ahb {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		apb {
			compatible = "simple-bus";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			aic: interrupt-controller@fffff000 {
				#interrupt-cells = <3>;
				compatible = "atmel,at91rm9200-aic";
				interrupt-controller;
				reg = <0xfffff000 0x200>;
				atmel,external-irqs = <25 26 27 28 29 30 31>;
			};

			ramc0: ramc@ffffff00 {
				compatible = "atmel,at91rm9200-sdramc", "syscon";
				reg = <0xffffff00 0x100>;
			};

			pmc: pmc@fffffc00 {
				compatible = "atmel,at91rm9200-pmc", "syscon";
				reg = <0xfffffc00 0x100>;
				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
				#clock-cells = <2>;
				clocks = <&slow_xtal>, <&main_xtal>;
				clock-names = "slow_xtal", "main_xtal";
			};

			st: timer@fffffd00 {
				compatible = "atmel,at91rm9200-st", "syscon", "simple-mfd";
				reg = <0xfffffd00 0x100>;
				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
				clocks = <&slow_xtal>;

				watchdog {
					compatible = "atmel,at91rm9200-wdt";
				};
			};

			rtc: rtc@fffffe00 {
				compatible = "atmel,at91rm9200-rtc";
				reg = <0xfffffe00 0x40>;
				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
				clocks = <&slow_xtal>;
				status = "disabled";
			};

			tcb0: timer@fffa0000 {
				compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0xfffa0000 0x100>;
				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0
					      18 IRQ_TYPE_LEVEL_HIGH 0
					      19 IRQ_TYPE_LEVEL_HIGH 0>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_PERIPHERAL 18>, <&pmc PMC_TYPE_PERIPHERAL 19>, <&slow_xtal>;
				clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk";
			};

			tcb1: timer@fffa4000 {
				compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0xfffa4000 0x100>;
				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0
					      21 IRQ_TYPE_LEVEL_HIGH 0
					      22 IRQ_TYPE_LEVEL_HIGH 0>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 20>, <&pmc PMC_TYPE_PERIPHERAL 21>, <&pmc PMC_TYPE_PERIPHERAL 22>, <&slow_xtal>;
				clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk";
			};

			i2c0: i2c@fffb8000 {
				compatible = "atmel,at91rm9200-i2c";
				reg = <0xfffb8000 0x4000>;
				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_twi>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 12>;
				#address-cells = <1>;
				#size-cells = <0>;
				status = "disabled";
			};

			mmc0: mmc@fffb4000 {
				compatible = "atmel,hsmci";
				reg = <0xfffb4000 0x4000>;
				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
				clock-names = "mci_clk";
				#address-cells = <1>;
				#size-cells = <0>;
				status = "disabled";
			};

			ssc0: ssc@fffd0000 {
				compatible = "atmel,at91rm9200-ssc";
				reg = <0xfffd0000 0x4000>;
				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
				clock-names = "pclk";
				status = "disabled";
			};

			ssc1: ssc@fffd4000 {
				compatible = "atmel,at91rm9200-ssc";
				reg = <0xfffd4000 0x4000>;
				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
				clock-names = "pclk";
				status = "disabled";
			};

			ssc2: ssc@fffd8000 {
				compatible = "atmel,at91rm9200-ssc";
				reg = <0xfffd8000 0x4000>;
				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
				clock-names = "pclk";
				status = "disabled";
			};

			macb0: ethernet@fffbc000 {
				compatible = "cdns,at91rm9200-emac", "cdns,emac";
				reg = <0xfffbc000 0x4000>;
				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
				phy-mode = "rmii";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_macb_rmii>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 24>;
				clock-names = "ether_clk";
				status = "disabled";
			};

			pinctrl@fffff400 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
				ranges = <0xfffff400 0xfffff400 0x800>;

				atmel,mux-mask = <
					/*    A         B     */
					 0xffffffff 0xffffffff  /* pioA */
					 0xffffffff 0x083fffff  /* pioB */
					 0xffff3fff 0x00000000  /* pioC */
					 0x03ff87ff 0x0fffff80  /* pioD */
					>;

				/* shared pinctrl settings */
				dbgu {
					pinctrl_dbgu: dbgu-0 {
						atmel,pins =
							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
							 AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;
					};
				};

				uart0 {
					pinctrl_uart0: uart0-0 {
						atmel,pins =
							<AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE
							 AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
					};

					pinctrl_uart0_cts: uart0_cts-0 {
						atmel,pins =
							<AT91_PIOA 20 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA20 periph A */
					};

					pinctrl_uart0_rts: uart0_rts-0 {
						atmel,pins =
							<AT91_PIOA 21 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA21 periph A */
					};
				};

				uart1 {
					pinctrl_uart1: uart1-0 {
						atmel,pins =
							<AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE
							 AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
					};

					pinctrl_uart1_rts: uart1_rts-0 {
						atmel,pins =
							<AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB24 periph A */
					};

					pinctrl_uart1_cts: uart1_cts-0 {
						atmel,pins =
							<AT91_PIOB 26 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB26 periph A */
					};

					pinctrl_uart1_dtr_dsr: uart1_dtr_dsr-0 {
						atmel,pins =
							<AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB19 periph A */
							 AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB25 periph A */
					};

					pinctrl_uart1_dcd: uart1_dcd-0 {
						atmel,pins =
							<AT91_PIOB 23 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB23 periph A */
					};

					pinctrl_uart1_ri: uart1_ri-0 {
						atmel,pins =
							<AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB18 periph A */
					};
				};

				uart2 {
					pinctrl_uart2: uart2-0 {
						atmel,pins =
							<AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
							 AT91_PIOA 23 AT91_PERIPH_A AT91_PINCTRL_NONE>;
					};

					pinctrl_uart2_rts: uart2_rts-0 {
						atmel,pins =
							<AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PA30 periph B */
					};

					pinctrl_uart2_cts: uart2_cts-0 {
						atmel,pins =
							<AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PA31 periph B */
					};
				};

				uart3 {
					pinctrl_uart3: uart3-0 {
						atmel,pins =
							<AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_NONE
							 AT91_PIOA 6 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
					};

					pinctrl_uart3_rts: uart3_rts-0 {
						atmel,pins =
							<AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PB0 periph B */
					};

					pinctrl_uart3_cts: uart3_cts-0 {
						atmel,pins =
							<AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PB1 periph B */
					};
				};

				nand {
					pinctrl_nand: nand-0 {
						atmel,pins =
							<AT91_PIOC 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP	/* PC2 gpio RDY pin pull_up */
							 AT91_PIOB 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;	/* PB1 gpio CD pin pull_up */
					};
				};

				macb {
					pinctrl_macb_rmii: macb_rmii-0 {
						atmel,pins =
							<AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA7 periph A */
							 AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA8 periph A */
							 AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA9 periph A */
							 AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA10 periph A */
							 AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA11 periph A */
							 AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA12 periph A */
							 AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA13 periph A */
							 AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA14 periph A */
							 AT91_PIOA 15 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA15 periph A */
							 AT91_PIOA 16 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA16 periph A */
					};

					pinctrl_macb_rmii_mii: macb_rmii_mii-0 {
						atmel,pins =
							<AT91_PIOB 12 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB12 periph B */
							 AT91_PIOB 13 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB13 periph B */
							 AT91_PIOB 14 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB14 periph B */
							 AT91_PIOB 15 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB15 periph B */
							 AT91_PIOB 16 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB16 periph B */
							 AT91_PIOB 17 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB17 periph B */
							 AT91_PIOB 18 AT91_PERIPH_B AT91_PINCTRL_NONE	/* PB18 periph B */
							 AT91_PIOB 19 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PB19 periph B */
					};
				};

				mmc0 {
					pinctrl_mmc0_clk: mmc0_clk-0 {
						atmel,pins =
							<AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA27 periph A */
					};

					pinctrl_mmc0_slot0_cmd_dat0: mmc0_slot0_cmd_dat0-0 {
						atmel,pins =
							<AT91_PIOA 28 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PA28 periph A with pullup */
							 AT91_PIOA 29 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PA29 periph A with pullup */
					};

					pinctrl_mmc0_slot0_dat1_3: mmc0_slot0_dat1_3-0 {
						atmel,pins =
							<AT91_PIOB 3 AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PB3 periph B with pullup */
							 AT91_PIOB 4 AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PB4 periph B with pullup */
							 AT91_PIOB 5 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;	/* PB5 periph B with pullup */
					};

					pinctrl_mmc0_slot1_cmd_dat0: mmc0_slot1_cmd_dat0-0 {
						atmel,pins =
							<AT91_PIOA 8 AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PA8 periph B with pullup */
							 AT91_PIOA 9 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;	/* PA9 periph B with pullup */
					};

					pinctrl_mmc0_slot1_dat1_3: mmc0_slot1_dat1_3-0 {
						atmel,pins =
							<AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PA10 periph B with pullup */
							 AT91_PIOA 11 AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PA11 periph B with pullup */
							 AT91_PIOA 12 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;	/* PA12 periph B with pullup */
					};
				};

				ssc0 {
					pinctrl_ssc0_tx: ssc0_tx-0 {
						atmel,pins =
							<AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB0 periph A */
							 AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB1 periph A */
							 AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB2 periph A */
					};

					pinctrl_ssc0_rx: ssc0_rx-0 {
						atmel,pins =
							<AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB3 periph A */
							 AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB4 periph A */
							 AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB5 periph A */
					};
				};

				ssc1 {
					pinctrl_ssc1_tx: ssc1_tx-0 {
						atmel,pins =
							<AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB6 periph A */
							 AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB7 periph A */
							 AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB8 periph A */
					};

					pinctrl_ssc1_rx: ssc1_rx-0 {
						atmel,pins =
							<AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB9 periph A */
							 AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB10 periph A */
							 AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB11 periph A */
					};
				};

				ssc2 {
					pinctrl_ssc2_tx: ssc2_tx-0 {
						atmel,pins =
							<AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB12 periph A */
							 AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB13 periph A */
							 AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB14 periph A */
					};

					pinctrl_ssc2_rx: ssc2_rx-0 {
						atmel,pins =
							<AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB15 periph A */
							 AT91_PIOB 16 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB16 periph A */
							 AT91_PIOB 17 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB17 periph A */
					};
				};

				twi {
					pinctrl_twi: twi-0 {
						atmel,pins =
							<AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_MULTI_DRIVE	/* PA25 periph A with multi drive */
							 AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_MULTI_DRIVE>;	/* PA26 periph A with multi drive */
					};

					pinctrl_twi_gpio: twi_gpio-0 {
						atmel,pins =
							<AT91_PIOA 25 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE	/* PA25 GPIO with multi drive */
							 AT91_PIOA 26 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE>;	/* PA26 GPIO with multi drive */
					};
				};

				tcb0 {
					pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
						atmel,pins = <AT91_PIOA 13 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tclk1: tcb0_tclk1-0 {
						atmel,pins = <AT91_PIOA 14 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tclk2: tcb0_tclk2-0 {
						atmel,pins = <AT91_PIOA 15 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tioa0: tcb0_tioa0-0 {
						atmel,pins = <AT91_PIOA 17 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tioa1: tcb0_tioa1-0 {
						atmel,pins = <AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tioa2: tcb0_tioa2-0 {
						atmel,pins = <AT91_PIOA 21 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tiob0: tcb0_tiob0-0 {
						atmel,pins = <AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tiob1: tcb0_tiob1-0 {
						atmel,pins = <AT91_PIOA 20 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb0_tiob2: tcb0_tiob2-0 {
						atmel,pins = <AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};
				};

				tcb1 {
					pinctrl_tcb1_tclk0: tcb1_tclk0-0 {
						atmel,pins = <AT91_PIOA 27 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tclk1: tcb1_tclk1-0 {
						atmel,pins = <AT91_PIOA 28 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tclk2: tcb1_tclk2-0 {
						atmel,pins = <AT91_PIOA 29 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tioa0: tcb1_tioa0-0 {
						atmel,pins = <AT91_PIOB 6 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tioa1: tcb1_tioa1-0 {
						atmel,pins = <AT91_PIOB 8 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tioa2: tcb1_tioa2-0 {
						atmel,pins = <AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tiob0: tcb1_tiob0-0 {
						atmel,pins = <AT91_PIOB 7 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tiob1: tcb1_tiob1-0 {
						atmel,pins = <AT91_PIOB 9 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};

					pinctrl_tcb1_tiob2: tcb1_tiob2-0 {
						atmel,pins = <AT91_PIOB 11 AT91_PERIPH_B AT91_PINCTRL_NONE>;
					};
				};

				spi0 {
					pinctrl_spi0: spi0-0 {
						atmel,pins =
							<AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA0 periph A SPI0_MISO pin */
							 AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA1 periph A SPI0_MOSI pin */
							 AT91_PIOA 2 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA2 periph A SPI0_SPCK pin */
					};
				};

				pioA: gpio@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 = <&pmc PMC_TYPE_PERIPHERAL 2>;
				};

				pioB: gpio@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 = <&pmc PMC_TYPE_PERIPHERAL 3>;
				};

				pioC: gpio@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 = <&pmc PMC_TYPE_PERIPHERAL 4>;
				};

				pioD: gpio@fffffa00 {
					compatible = "atmel,at91rm9200-gpio";
					reg = <0xfffffa00 0x200>;
					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
					#gpio-cells = <2>;
					gpio-controller;
					interrupt-controller;
					#interrupt-cells = <2>;
					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
				};
			};

			dbgu: serial@fffff200 {
				compatible = "atmel,at91rm9200-dbgu", "atmel,at91rm9200-usart";
				reg = <0xfffff200 0x200>;
				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_dbgu>;
				clocks = <&pmc PMC_TYPE_CORE PMC_MCK>;
				clock-names = "usart";
				status = "disabled";
			};

			usart0: serial@fffc0000 {
				compatible = "atmel,at91rm9200-usart";
				reg = <0xfffc0000 0x200>;
				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart0>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
				clock-names = "usart";
				status = "disabled";
			};

			usart1: serial@fffc4000 {
				compatible = "atmel,at91rm9200-usart";
				reg = <0xfffc4000 0x200>;
				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart1>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
				clock-names = "usart";
				status = "disabled";
			};

			usart2: serial@fffc8000 {
				compatible = "atmel,at91rm9200-usart";
				reg = <0xfffc8000 0x200>;
				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart2>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
				clock-names = "usart";
				status = "disabled";
			};

			usart3: serial@fffcc000 {
				compatible = "atmel,at91rm9200-usart";
				reg = <0xfffcc000 0x200>;
				atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 5>;
				atmel,use-dma-rx;
				atmel,use-dma-tx;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart3>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
				clock-names = "usart";
				status = "disabled";
			};

			usb1: gadget@fffb0000 {
				compatible = "atmel,at91rm9200-udc";
				reg = <0xfffb0000 0x4000>;
				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 1>;
				clock-names = "pclk", "hclk";
				status = "disabled";
			};

			spi0: spi@fffe0000 {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "atmel,at91rm9200-spi";
				reg = <0xfffe0000 0x200>;
				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_spi0>;
				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
				clock-names = "spi_clk";
				status = "disabled";
			};
		};

		nand0: nand@40000000 {
			compatible = "atmel,at91rm9200-nand";
			#address-cells = <1>;
			#size-cells = <1>;
			reg = <0x40000000 0x10000000>;
			atmel,nand-addr-offset = <21>;
			atmel,nand-cmd-offset = <22>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_nand>;
			nand-ecc-mode = "soft";
			gpios = <&pioC 2 GPIO_ACTIVE_HIGH
				 0
				 &pioB 1 GPIO_ACTIVE_HIGH
				>;
			status = "disabled";
		};

		usb0: ohci@300000 {
			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
			reg = <0x00300000 0x100000>;
			interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>;
			clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_SYSTEM 4>;
			clock-names = "ohci_clk", "hclk", "uhpck";
			status = "disabled";
		};
	};

	i2c-gpio-0 {
		compatible = "i2c-gpio";
		gpios = <&pioA 25 GPIO_ACTIVE_HIGH /* sda */
			 &pioA 26 GPIO_ACTIVE_HIGH /* scl */
			>;
		i2c-gpio,sda-open-drain;
		i2c-gpio,scl-open-drain;
		i2c-gpio,delay-us = <2>;	/* ~100 kHz */
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_twi_gpio>;
		#address-cells = <1>;
		#size-cells = <0>;
		status = "disabled";
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * at91rm9200_pqfp.dtsi - Device Tree Include file for AT91RM9200 PQFP family SoC
 *
 * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 */

#include "at91rm9200.dtsi"

/ {
	compatible = "atmel,at91rm9200-pqfp", "atmel,at91rm9200";
};

&pioD {
	status = "disabled";
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * at91rm9200ek.dts - Device Tree file for Atmel AT91RM9200 evaluation kit
 *
 *  Copyright (C) 2012 Joachim Eastwood <manabian@gmail.com>
 */
/dts-v1/;
#include "at91rm9200.dtsi"

/ {
	model = "Atmel AT91RM9200 evaluation kit";
	compatible = "atmel,at91rm9200ek", "atmel,at91rm9200";

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@20000000 {
		reg = <0x20000000 0x4000000>;
	};

	clocks {
		slow_xtal {
			clock-frequency = <32768>;
		};

		main_xtal {
			clock-frequency = <18432000>;
		};
	};

	ahb {
		apb {
			tcb0: timer@fffa0000 {
				timer@0 {
					compatible = "atmel,tcb-timer";
					reg = <0>, <1>;
				};

				timer@2 {
					compatible = "atmel,tcb-timer";
					reg = <2>;
				};
			};

			usb1: gadget@fffb0000 {
				atmel,vbus-gpio = <&pioD 4 GPIO_ACTIVE_HIGH>;
				atmel,pullup-gpio = <&pioD 5 GPIO_ACTIVE_HIGH>;
				status = "okay";
			};

			macb0: ethernet@fffbc000 {
				phy-mode = "rmii";
				status = "okay";

				phy0: ethernet-phy {
					interrupt-parent = <&pioC>;
					interrupts = <4 IRQ_TYPE_EDGE_BOTH>;
				};
			};

			usart1: serial@fffc4000 {
				pinctrl-0 =
						<&pinctrl_uart1
						 &pinctrl_uart1_rts
						 &pinctrl_uart1_cts
						 &pinctrl_uart1_dtr_dsr
						 &pinctrl_uart1_dcd
						 &pinctrl_uart1_ri>;
				status = "okay";
			};

			spi0: spi@fffe0000 {
				status = "okay";
				cs-gpios = <&pioA 3 0>, <0>, <0>, <0>;
				flash@0 {
					compatible = "atmel,at45", "atmel,dataflash";
					spi-max-frequency = <15000000>;
					reg = <0>;
				};
			};

			dbgu: serial@fffff200 {
				status = "okay";
			};

			rtc: rtc@fffffe00 {
				status = "okay";
			};
		};

		usb0: ohci@300000 {
			num-ports = <2>;
			status = "okay";
		};

		flash@10000000 {
			compatible = "cfi-flash";
			reg = <0x10000000 0x800000>;
			linux,mtd-name = "physmap-flash.0";
			bank-width = <2>;
			#address-cells = <1>;
			#size-cells = <1>;

			barebox@0 {
				label = "barebox";
				reg = <0x00000 0x40000>;
			};

			bareboxenv@40000 {
				label = "bareboxenv";
				reg = <0x40000 0x10000>;
			};

			kernel@50000 {
				label = "kernel";
				reg = <0x50000 0x300000>;
			};

			root@350000  {
				label = "root";
				reg = <0x350000 0x4B0000>;
			};
		};
	};

	leds {
		compatible = "gpio-leds";

		ds2 {
			label = "green";
			gpios = <&pioB 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "mmc0";
		};

		ds4 {
			label = "yellow";
			gpios = <&pioB 1 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "heartbeat";
		};

		ds6 {
			label = "red";
			gpios = <&pioB 2 GPIO_ACTIVE_LOW>;
		};
	};
};