Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts
29271 views
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 *  at91-sama7d65_curiosity.dts - Device Tree file for SAMA7D65 Curiosity board
 *
 *  Copyright (c) 2024 Microchip Technology Inc. and its subsidiaries
 *
 *  Author: Romain Sioen <[email protected]>
 *
 */
/dts-v1/;
#include "sama7d65-pinfunc.h"
#include "sama7d65.dtsi"
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/at91.h>

/ {
	model = "Microchip SAMA7D65 Curiosity";
	compatible = "microchip,sama7d65-curiosity", "microchip,sama7d65",
		     "microchip,sama7d6", "microchip,sama7";

	aliases {
		serial0 = &uart6;
	};

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

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

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

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

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_led_gpio_default>;

		led0: led-red {
			color = <LED_COLOR_ID_RED>;
			gpios = <&pioa PIN_PB17 GPIO_ACTIVE_HIGH>; /* Conflict with pwm. */
		};

		led1: led-green {
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&pioa PIN_PB15 GPIO_ACTIVE_HIGH>; /* Conflict with pwm. */
		};

		led2: led-blue {
			color = <LED_COLOR_ID_BLUE>;
			function = LED_FUNCTION_HEARTBEAT;
			gpios = <&pioa PIN_PA21 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
		};
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	reg_5v: regulator-5v {
		compatible = "regulator-fixed";
		regulator-name = "5V_MAIN";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};
};

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

&can2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_can2_default>;
	status = "okay";
};

&can3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_can3_default>;
	status = "okay";
};

&dma0 {
	status = "okay";
};

&dma1 {
	status = "okay";
};

&dma2 {
	status = "okay";
};

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

&uart6 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart6_default>;
	status = "okay";
};

&flx10 {
	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
	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";
	nvmem-cells = <&eeprom0_eui48>;
	nvmem-cell-names = "mac-address";
	status = "okay";

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

&i2c10 {
	dmas = <0>, <0>;
	i2c-analog-filter;
	i2c-digital-filter;
	i2c-digital-filter-width-ns = <35>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c10_default>;
	status = "okay";

	power-monitor@10 {
		compatible = "microchip,pac1934";
		reg = <0x10>;
		#address-cells = <1>;
		#size-cells = <0>;

		channel@1 {
			reg = <0x1>;
			shunt-resistor-micro-ohms = <47000>;
			label = "VDD3V3";
		};

		channel@2 {
			reg = <0x2>;
			shunt-resistor-micro-ohms = <47000>;
			label = "VDDIODDR";
		};

		channel@3 {
			reg = <0x3>;
			shunt-resistor-micro-ohms = <47000>;
			label = "VDDCORE";
		};

		channel@4 {
			reg = <0x4>;
			shunt-resistor-micro-ohms = <47000>;
			label = "VDDCPU";
		};
	};

	pmic@5b {
		compatible = "microchip,mcp16502";
		reg = <0x5b>;
		lvin-supply = <&reg_5v>;
		pvin1-supply = <&reg_5v>;
		pvin2-supply = <&reg_5v>;
		pvin3-supply = <&reg_5v>;
		pvin4-supply = <&reg_5v>;
		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 = <1050000>;
				regulator-max-microvolt = <1050000>;
				regulator-initial-mode = <2>;
				regulator-allowed-modes = <2>, <4>;
				regulator-always-on;

				regulator-state-standby {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1050000>;
					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-microvolt = <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-microvolt = <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-on-in-suspend;
				};

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

	eeprom0: eeprom@51 {
		compatible = "microchip,24aa025e48";
		reg = <0x51>;
		size = <256>;
		pagesize = <16>;
		vcc-supply = <&vdd_3v3>;

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

			eeprom0_eui48: eui48@fa {
				reg = <0xfa 0x6>;
			};
		};
	};
};

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

&pioa {
	pinctrl_can1_default: can1-default {
		pinmux = <PIN_PD10__CANTX1>,
			 <PIN_PD11__CANRX1>;
		bias-disable;
	};

	pinctrl_can2_default: can2-default {
		pinmux = <PIN_PD12__CANTX2>,
			 <PIN_PD13__CANRX2>;
		bias-disable;
	};

	pinctrl_can3_default: can3-default {
		pinmux = <PIN_PD14__CANTX3>,
			 <PIN_PD15__CANRX3>;
		bias-disable;
	};

	pinctrl_gmac0_default: gmac0-default {
		pinmux = <PIN_PA26__G0_TX0>,
			 <PIN_PA27__G0_TX1>,
			 <PIN_PB4__G0_TX2>,
			 <PIN_PB5__G0_TX3>,
			 <PIN_PA29__G0_RX0>,
			 <PIN_PA30__G0_RX1>,
			 <PIN_PB2__G0_RX2>,
			 <PIN_PB6__G0_RX3>,
			 <PIN_PA25__G0_TXCTL>,
			 <PIN_PB3__G0_RXCK>,
			 <PIN_PA28__G0_RXCTL>;
		slew-rate = <0>;
		bias-disable;
	};

	pinctrl_gmac0_mdio_default: gmac0-mdio-default {
		pinmux = <PIN_PA31__G0_MDC>,
			 <PIN_PB0__G0_MDIO>;
		bias-disable;
	};

	pinctrl_gmac0_phy_irq: gmac0-phy-irq {
		pinmux = <PIN_PC1__GPIO>;
		bias-disable;
	};

	pinctrl_gmac0_txck_default: gmac0-txck-default {
		pinmux = <PIN_PB1__G0_REFCK>;
		slew-rate = <0>;
		bias-pull-up;
	};

	pinctrl_i2c10_default: i2c10-default {
		pinmux = <PIN_PB19__FLEXCOM10_IO1>,
			 <PIN_PB20__FLEXCOM10_IO0>;
		bias-pull-up;
	};

	pinctrl_key_gpio_default: key-gpio-default {
		pinmux = <PIN_PC10__GPIO>;
		bias-pull-up;
	};

	pinctrl_led_gpio_default: led-gpio-default {
		pinmux = <PIN_PB15__GPIO>,
			 <PIN_PB17__GPIO>,
			 <PIN_PA21__GPIO>;
		bias-pull-up;
	};

	pinctrl_sdmmc1_default: sdmmc1-default {
		cmd-data {
			pinmux = <PIN_PB22__SDMMC1_CMD>,
				 <PIN_PB24__SDMMC1_DAT0>,
				 <PIN_PB25__SDMMC1_DAT1>,
				 <PIN_PB26__SDMMC1_DAT2>,
				 <PIN_PB27__SDMMC1_DAT3>;
			slew-rate = <0>;
			bias-disable;
		};

		ck-cd-rstn-vddsel {
			pinmux = <PIN_PB23__SDMMC1_CK>,
				 <PIN_PB21__SDMMC1_RSTN>,
				 <PIN_PB30__SDMMC1_1V8SEL>,
				 <PIN_PB29__SDMMC1_CD>,
				 <PIN_PB28__SDMMC1_WP>;
			slew-rate = <0>;
			bias-disable;
		};
	};

	pinctrl_uart6_default: uart6-default {
		pinmux = <PIN_PD18__FLEXCOM6_IO0>,
			 <PIN_PD19__FLEXCOM6_IO1>;
		bias-disable;
	};
};

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

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

&shdwc {
	debounce-delay-us = <976>;
	status = "okay";

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

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