code:
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2018-2019 Purism SPC
 */

/dts-v1/;

#include "dt-bindings/input/input.h"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
#include "dt-bindings/pwm/pwm.h"
#include "dt-bindings/usb/pd.h"
#include "imx8mq.dtsi"

/ {
	model = "Purism Librem 5 devkit";
	compatible = "purism,librem5-devkit", "fsl,imx8mq";

	backlight_dsi: backlight-dsi {
		compatible = "pwm-backlight";
		/* 200 Hz for the PAM2841 */
		pwms = <&pwm1 0 5000000 0>;
		brightness-levels = <0 100>;
		num-interpolated-steps = <100>;
		/* Default brightness level (index into the array defined by */
		/* the "brightness-levels" property) */
		default-brightness-level = <0>;
		power-supply = <&reg_22v4_p>;
	};

	chosen {
		stdout-path = &uart1;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_keys>;

		button-1 {
			label = "VOL_UP";
			gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
			wakeup-source;
			linux,code = <KEY_VOLUMEUP>;
		};

		button-2 {
			label = "VOL_DOWN";
			gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
			wakeup-source;
			linux,code = <KEY_VOLUMEDOWN>;
		};

		button-3 {
			label = "WWAN_WAKE";
			gpios = <&gpio3 8 GPIO_ACTIVE_LOW>;
			interrupt-parent = <&gpio3>;
			interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
			wakeup-source;
			linux,code = <KEY_PHONE>;
		};
	};

	leds {
		compatible = "pwm-leds";

		led1 {
			function = LED_FUNCTION_STATUS;
			color = <LED_COLOR_ID_RED>;
			max-brightness = <248>;
			pwms = <&pwm2 0 50000 0>;
		};
	};

	pmic_osc: clock-pmic {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		clock-output-names = "pmic_osc";
	};

	reg_1v8_p: regulator-1v8-p {
		compatible = "regulator-fixed";
		regulator-name = "1v8_p";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_pwr_en>;
	};

	reg_2v8_p: regulator-2v8-p {
		compatible = "regulator-fixed";
		regulator-name = "2v8_p";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		vin-supply = <&reg_pwr_en>;
	};

	reg_3v3_p: regulator-3v3-p {
		compatible = "regulator-fixed";
		regulator-name = "3v3_p";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&reg_pwr_en>;

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

	reg_5v_p: regulator-5v-p {
		compatible = "regulator-fixed";
		regulator-name = "5v_p";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&reg_pwr_en>;

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

	reg_22v4_p: regulator-22v4-p  {
		compatible = "regulator-fixed";
		regulator-name = "22v4_P";
		regulator-min-microvolt = <22400000>;
		regulator-max-microvolt = <22400000>;
		vin-supply = <&reg_pwr_en>;
	};

	reg_pwr_en: regulator-pwr-en {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pwr_en>;
		regulator-name = "PWR_EN";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-always-on;
	};

	reg_usdhc2_vmmc: regulator-usdhc2-vmmc {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usdhc2_pwr>;
		regulator-name = "VSD_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-always-on;
	};

	wwan_codec: sound-wwan-codec {
		compatible = "option,gtm601";
		#sound-dai-cells = <0>;
	};

	mic_mux: mic-mux {
		compatible = "simple-audio-mux";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_micsel>;
		mux-gpios = <&gpio5 5 GPIO_ACTIVE_LOW>;
		sound-name-prefix = "Mic Mux";
	};

	sound {
		compatible = "simple-audio-card";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hpdet>;
		simple-audio-card,aux-devs = <&speaker_amp>, <&mic_mux>;
		simple-audio-card,name = "Librem 5 Devkit";
		simple-audio-card,format = "i2s";
		simple-audio-card,widgets =
			"Microphone", "Builtin Microphone",
			"Microphone", "Headset Microphone",
			"Headphone", "Headphones",
			"Speaker", "Builtin Speaker";
		simple-audio-card,routing =
			"MIC_IN", "Mic Mux OUT",
			"Mic Mux IN1", "Headset Microphone",
			"Mic Mux IN2", "Builtin Microphone",
			"Mic Mux OUT", "Mic Bias",
			"Headphones", "HP_OUT",
			"Builtin Speaker", "Speaker Amp OUTR",
			"Speaker Amp INR", "LINE_OUT";
		simple-audio-card,hp-det-gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>;

		simple-audio-card,cpu {
			sound-dai = <&sai2>;
		};

		simple-audio-card,codec {
			sound-dai = <&sgtl5000>;
			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
			frame-master;
			bitclock-master;
		};
	};

	sound-wwan {
		compatible = "simple-audio-card";
		simple-audio-card,name = "SIMCom SIM7100";
		simple-audio-card,format = "dsp_a";

		simple-audio-card,cpu {
			sound-dai = <&sai6>;
		};

		telephony_link_master: simple-audio-card,codec {
			sound-dai = <&wwan_codec>;
			frame-master;
			bitclock-master;
		};
	};

	speaker_amp: speaker-amp {
		compatible = "simple-audio-amplifier";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_spkamp>;
		VCC-supply = <&reg_3v3_p>;
		sound-name-prefix = "Speaker Amp";
		enable-gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>;
	};

	vibrator {
		compatible = "gpio-vibrator";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_haptic>;
	        enable-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
		vcc-supply = <&reg_3v3_p>;
	};

	wifi_pwr_en: regulator-wifi-en {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_wifi_pwr_en>;
		regulator-name = "WIFI_EN";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-always-on;
	};
};

&A53_0 {
	cpu-supply = <&buck2_reg>;
};

&A53_1 {
	cpu-supply = <&buck2_reg>;
};

&A53_2 {
	cpu-supply = <&buck2_reg>;
};

&A53_3 {
	cpu-supply = <&buck2_reg>;
};

&dphy {
	status = "okay";
};

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	phy-supply = <&reg_3v3_p>;
	status = "okay";

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

		ethphy0: ethernet-phy@1 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <1>;
		};
	};
};

&i2c1 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	pmic: pmic@4b {
		compatible = "rohm,bd71837";
		reg = <0x4b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pmic>;
		clocks = <&pmic_osc>;
		clock-names = "osc";
		#clock-cells = <0>;
		clock-output-names = "pmic_clk";
		interrupt-parent = <&gpio1>;
		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
		rohm,reset-snvs-powered;

		regulators {
			buck1_reg: BUCK1 {
				regulator-name = "buck1";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <900000>;
				rohm,dvs-idle-voltage = <850000>;
				rohm,dvs-suspend-voltage = <800000>;
			};

			buck2_reg: BUCK2 {
				regulator-name = "buck2";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <1000000>;
				rohm,dvs-idle-voltage = <900000>;
			};

			buck3_reg: BUCK3 {
				regulator-name = "buck3";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				rohm,dvs-run-voltage = <900000>;
			};

			buck4_reg: BUCK4 {
				regulator-name = "buck4";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				rohm,dvs-run-voltage = <1000000>;
			};

			buck5_reg: BUCK5 {
				regulator-name = "buck5";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1350000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck6_reg: BUCK6 {
				regulator-name = "buck6";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck7_reg: BUCK7 {
				regulator-name = "buck7";
				regulator-min-microvolt = <1605000>;
				regulator-max-microvolt = <1995000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck8_reg: BUCK8 {
				regulator-name = "buck8";
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1400000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo1_reg: LDO1 {
				regulator-name = "ldo1";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo2_reg: LDO2 {
				regulator-name = "ldo2";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-boot-on;
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo3_reg: LDO3 {
				regulator-name = "ldo3";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo4_reg: LDO4 {
				regulator-name = "ldo4";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo5_reg: LDO5 {
				regulator-name = "ldo5";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			ldo6_reg: LDO6 {
				regulator-name = "ldo6";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo7_reg: LDO7 {
				regulator-name = "ldo7";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};

	typec_ptn5100: usb-typec@52 {
		compatible = "nxp,ptn5110";
		reg = <0x52>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_typec>;
		interrupt-parent = <&gpio3>;
		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;

		connector {
			compatible = "usb-c-connector";
			label = "USB-C";
			data-role = "dual";
			power-role = "dual";
			try-power-role = "sink";
			source-pdos = <PDO_FIXED(5000, 2000,
				PDO_FIXED_USB_COMM |
				PDO_FIXED_DUAL_ROLE |
				PDO_FIXED_DATA_SWAP )>;
			sink-pdos = <PDO_FIXED(5000, 3500, PDO_FIXED_USB_COMM |
				PDO_FIXED_DUAL_ROLE |
				PDO_FIXED_DATA_SWAP )
			     PDO_VAR(5000, 5000, 3500)>;
			op-sink-microwatt = <10000000>;

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

				port@0 {
					reg = <0>;

					usb_con_hs: endpoint {
						remote-endpoint = <&typec_hs>;
					};
				};

				port@1 {
					reg = <1>;

					usb_con_ss: endpoint {
						remote-endpoint = <&typec_ss>;
					};
				};
			};
		};
	};

	rtc@68 {
		compatible = "microcrystal,rv4162";
		reg = <0x68>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_rtc>;
		interrupt-parent = <&gpio4>;
		interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
	};

	charger@6b { /* bq25896 */
		compatible = "ti,bq25890";
		reg = <0x6b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_charger>;
		interrupt-parent = <&gpio3>;
		interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
		ti,battery-regulation-voltage = <4192000>; /* 4.192V */
		ti,charge-current = <1600000>; /* 1.6A */
		ti,termination-current = <66000>;  /* 66mA */
		ti,precharge-current = <130000>; /* 130mA */
		ti,minimum-sys-voltage = <3000000>; /* 3V */
		ti,boost-voltage = <5000000>; /* 5V */
		ti,boost-max-current = <50000>; /* 50mA */
	};
};

&i2c3 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";

	magnetometer@1e	{
		compatible = "st,lsm9ds1-magn";
		reg = <0x1e>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_imu>;
		interrupt-parent = <&gpio3>;
		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
		vdd-supply = <&reg_3v3_p>;
		vddio-supply = <&reg_3v3_p>;
	};

	sgtl5000: audio-codec@a {
		compatible = "fsl,sgtl5000";
		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
		assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
		assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
		assigned-clock-rates = <24576000>;
		#sound-dai-cells = <0>;
		reg = <0x0a>;
		VDDD-supply = <&reg_1v8_p>;
		VDDIO-supply = <&reg_3v3_p>;
		VDDA-supply = <&reg_3v3_p>;
	};

	touchscreen@5d {
		compatible = "goodix,gt5688";
		reg = <0x5d>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_ts>;
		interrupt-parent = <&gpio3>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
		reset-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
		irq-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
		touchscreen-size-x = <720>;
		touchscreen-size-y = <1440>;
		AVDD28-supply = <&reg_2v8_p>;
		VDDIO-supply = <&reg_1v8_p>;
	};

	proximity-sensor@60 {
		compatible = "vishay,vcnl4040";
		reg = <0x60>;
		pinctrl-0 = <&pinctrl_prox>;
	};

	accel-gyro@6a {
		compatible = "st,lsm9ds1-imu";
		reg = <0x6a>;
		vdd-supply = <&reg_3v3_p>;
		vddio-supply = <&reg_3v3_p>;
		mount-matrix =  "1",  "0",  "0",
				"0",  "1",  "0",
				"0",  "0", "-1";
	};
};

&iomuxc {
	pinctrl_bl: blgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO01_PWM1_OUT	0x6 /* DSI_BL_PWM */
		>;
	};

	pinctrl_bt: btgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11	0x16 /* nBT_DISABLE */
			MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7	0x10 /* BT_HOST_WAKE */
		>;
	};

	pinctrl_charger: chargergrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25	0x80 /* CHRG_nINT */
		>;
	};

	pinctrl_fec1: fec1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC			0x3
			MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO		0x3
			MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
			MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
			MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
			MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
			MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
			MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
			MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
			MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
			MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
			MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
			MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
			MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9		0x19
			MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2      0x1f
		>;
	};

	pinctrl_ts: tsgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_ALE_GPIO3_IO0		0x16  /* TOUCH INT */
			MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x19  /* TOUCH RST */
		>;
	};

	pinctrl_pwm_led: pwmledgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT	0x16
		>;
	};

	pinctrl_gpio_keys: gpiokeygrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI2_RXFS_GPIO4_IO21	0x16
			MX8MQ_IOMUXC_SAI2_RXC_GPIO4_IO22	0x16
			MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8	0x80   /* nWoWWAN */
		>;
	};

	pinctrl_haptic: hapticgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SPDIF_RX_GPIO5_IO4		0xc6   /* nHAPTIC */
		>;
	};

	pinctrl_hpdet: hpdetgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20	0xC0   /* HP_DET */
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL		0x4000001f
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA		0x4000001f
		>;
	};

	pinctrl_i2c3: i2c3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL		0x4000001f
			MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA		0x4000001f
		>;
	};

	pinctrl_imu: imugrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_RXFS_GPIO3_IO19	0x8  /* IMU_INT */
		>;
	};

	pinctrl_micsel: micselgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SPDIF_EXT_CLK_GPIO5_IO5	0xc6  /* MIC_SEL */
		>;
	};

	pinctrl_spkamp: spkamp {
		fsl,pins = <
			MX8MQ_IOMUXC_SPDIF_TX_GPIO5_IO3		0x81  /* MUTE */
		>;
	};

	pinctrl_pmic: pmicgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3	0x80  /* PMIC intr */
		>;
	};

	pinctrl_prox: proxgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x80  /* prox intr */
		>;
	};

	pinctrl_pwr_en: pwrengrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8	0x06
		>;
	};

	pinctrl_rtc: rtcgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29	0x80  /* RTC intr */
		>;
	};

	pinctrl_sai2: sai2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK	0xd6
			MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK	0xd6
		>;
	};

	pinctrl_sai6: sai6grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI1_RXD5_SAI6_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI1_RXD6_SAI6_RX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI1_TXD4_SAI6_RX_BCLK     0xd6
			MX8MQ_IOMUXC_SAI1_TXD5_SAI6_TX_DATA0	0xd6
		>;
	};

	pinctrl_typec: typecgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12		0x16
			MX8MQ_IOMUXC_NAND_CE0_B_GPIO3_IO1		0x80
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX		0x49
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX		0x49
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX		0x49
			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX		0x49
			MX8MQ_IOMUXC_UART4_RXD_UART2_DCE_CTS_B		0x49
			MX8MQ_IOMUXC_UART4_TXD_UART2_DCE_RTS_B		0x49
		>;
	};

	pinctrl_uart3: uart3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART3_RXD_UART3_DCE_RX		0x49
			MX8MQ_IOMUXC_UART3_TXD_UART3_DCE_TX		0x49
		>;
	};

	pinctrl_uart4: uart4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ECSPI2_SCLK_UART4_DCE_RX		0x49
			MX8MQ_IOMUXC_ECSPI2_MOSI_UART4_DCE_TX		0x49
			MX8MQ_IOMUXC_ECSPI2_MISO_UART4_DCE_CTS_B	0x49
			MX8MQ_IOMUXC_ECSPI2_SS0_UART4_DCE_RTS_B		0x49
			MX8MQ_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K	0x49
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x83
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x8d
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x9f
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc2_pwr: usdhc2pwrgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_RESET_B_GPIO2_IO19	0x41
		>;
	};

	pinctrl_usdhc2_gpio: usdhc2gpiogrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20		0x80 /* WIFI_WAKE */
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xc3
		>;
	};

	pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x8d
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcd
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcd
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcd
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcd
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcd
		>;
	};

	pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x9f
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcf
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcf
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcf
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcf
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcf
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0xc6
		>;
	};

	pinctrl_wifi_pwr_en: wifipwrengrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5         0x06
		>;
	};

	pinctrl_wwan: wwangrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4	0x09 /* nWWAN_DISABLE */
			MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8	0x80 /* nWoWWAN */
			MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9	0x19 /* WWAN_RESET */
		>;
	};
};

&lcdif {
	status = "okay";
};

&mipi_dsi {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	panel@0 {
		compatible = "rocktech,jh057n00900";
		reg = <0>;
		backlight = <&backlight_dsi>;
		reset-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
		iovcc-supply = <&reg_1v8_p>;
		vcc-supply = <&reg_2v8_p>;
		port {
			panel_in: endpoint {
				remote-endpoint = <&mipi_dsi_out>;
			};
		};
	};

	ports {
		port@1 {
			reg = <1>;
			mipi_dsi_out: endpoint {
				remote-endpoint = <&panel_in>;
			};
		};
	};
};

&pgc_gpu {
	power-supply = <&buck3_reg>;
};

&pgc_vpu {
	power-supply = <&buck4_reg>;
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_bl>;
	status = "okay";
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm_led>;
	status = "okay";
};

&snvs_pwrkey {
	status = "okay";
};

&snvs_rtc {
	status = "disabled";
};

&sai2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai2>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	status = "okay";
};

&sai6 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai6>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI6>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	fsl,sai-synchronous-rx;
	status = "okay";
};

&uart1 { /* console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&uart3 { /* GNSS */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart3>;
	status = "okay";
};

&uart4 { /* BT */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart4>, <&pinctrl_bt>;
	uart-has-rtscts;
	status = "okay";
};

&usb3_phy0 {
	vbus-supply = <&reg_5v_p>;
	status = "okay";
};

&usb3_phy1 {
	vbus-supply = <&reg_5v_p>;
	status = "okay";
};

&usb_dwc3_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	dr_mode = "otg";
	status = "okay";

	port@0 {
		reg = <0>;

		typec_hs: endpoint {
			remote-endpoint = <&usb_con_hs>;
		};
	};

	port@1 {
		reg = <1>;

		typec_ss: endpoint {
			remote-endpoint = <&usb_con_ss>;
		};
	};
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
};

&usdhc1 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
	assigned-clock-rates = <400000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	bus-width = <8>;
	non-removable;
	status = "okay";
};

&usdhc2 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC2>;
	assigned-clock-rates = <200000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
	bus-width = <4>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	power-supply = <&wifi_pwr_en>;
	broken-cd;
	disable-wp;
	cap-sdio-irq;
	keep-power-in-suspend;
	wakeup-source;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (C) 2020 Purism SPC <kernel@puri.sm>
//
// Librem 5 Chestnut

/dts-v1/;

#include "imx8mq-librem5.dtsi"

/ {
	model = "Purism Librem 5r2";
	compatible = "purism,librem5r2", "purism,librem5", "fsl,imx8mq";
};

&bq25895 {
	ti,battery-regulation-voltage = <4192000>; /* uV */
	ti,charge-current = <1600000>; /* uA */
	ti,termination-current = <66000>;  /* uA */
};

&accel_gyro {
	mount-matrix =  "1",  "0",  "0",
			"0", "-1",  "0",
			"0",  "0",  "1";
};

&proximity {
	proximity-near-level = <120>;
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (C) 2021 Purism SPC <kernel@puri.sm>

/dts-v1/;

#include "imx8mq-librem5-r3.dtsi"

&a53_opp_table {
	opp-1000000000 {
		opp-microvolt = <1000000>;
	};
};

&buck3_reg {
	regulator-always-on;
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (C) 2021 Purism SPC <kernel@puri.sm>

/dts-v1/;

/*
 * This file describes hardware that is shared among r3 ("Dogwood") and
 * later revisions of the Librem 5 so it has to be included in dts there.
 */

#include "imx8mq-librem5.dtsi"

/ {
	model = "Purism Librem 5r3";
	compatible = "purism,librem5r3", "purism,librem5", "fsl,imx8mq";
};

&accel_gyro {
	mount-matrix =  "1",  "0",  "0",
			"0",  "1",  "0",
			"0",  "0", "-1";
};

&bq25895 {
	ti,battery-regulation-voltage = <4200000>; /* uV */
	ti,charge-current = <1500000>; /* uA */
	ti,termination-current = <144000>;  /* uA */
};

&camera_front {
	pinctrl-0 = <&pinctrl_csi1>, <&pinctrl_r3_camera_pwr>;
	shutdown-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
};

&iomuxc {
	pinctrl_r3_camera_pwr: r3camerapwrgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SPDIF_RX_GPIO5_IO4		0x83
		>;
	};
};

&proximity {
	proximity-near-level = <25>;
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (C) 2021 Purism SPC <kernel@puri.sm>

/dts-v1/;

#include "imx8mq-librem5-r3.dtsi"

/ {
	model = "Purism Librem 5r4";
	compatible = "purism,librem5r4", "purism,librem5", "fsl,imx8mq";
};

&bat {
	maxim,rsns-microohm = <1667>;
};

&led_backlight {
	led-max-microamp = <25000>;
};

&lcd_panel {
	compatible = "ys,ys57pss36bh5gq";
};

&proximity {
	proximity-near-level = <10>;
};


code:
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2018-2020 Purism SPC
 */

/dts-v1/;

#include "dt-bindings/input/input.h"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
#include "dt-bindings/pwm/pwm.h"
#include "dt-bindings/usb/pd.h"
#include "imx8mq.dtsi"

/ {
	model = "Purism Librem 5";
	compatible = "purism,librem5", "fsl,imx8mq";
	chassis-type = "handset";

	backlight_dsi: backlight-dsi {
		compatible = "led-backlight";
		leds = <&led_backlight>;
	};

	pmic_osc: clock-pmic {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		clock-output-names = "pmic_osc";
	};

	chosen {
		stdout-path = &uart1;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_keys>;

		key-vol-down {
			label = "VOL_DOWN";
			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
			debounce-interval = <50>;
			wakeup-source;
		};

		key-vol-up {
			label = "VOL_UP";
			gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
			debounce-interval = <50>;
			wakeup-source;
		};
	};

	led-controller {
		compatible = "pwm-leds";

		led-0 {
			function = LED_FUNCTION_STATUS;
			color = <LED_COLOR_ID_BLUE>;
			max-brightness = <248>;
			pwms = <&pwm2 0 50000 0>;
		};

		led-1 {
			function = LED_FUNCTION_STATUS;
			color = <LED_COLOR_ID_GREEN>;
			max-brightness = <248>;
			pwms = <&pwm4 0 50000 0>;
		};

		led-2 {
			function = LED_FUNCTION_STATUS;
			color = <LED_COLOR_ID_RED>;
			max-brightness = <248>;
			pwms = <&pwm3 0 50000 0>;
		};
	};

	reg_aud_1v8: regulator-audio-1v8 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_audiopwr>;
		regulator-name = "AUDIO_PWR_EN";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	/*
	 * the pinctrl for reg_csi_1v8 and reg_vcam_1v8 is added to the PMIC
	 * since we can't have it twice in the 2 different regulator nodes.
	 */
	reg_csi_1v8: regulator-csi-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "CAMERA_VDDIO_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_vdd_3v3>;
		gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	/* controlled by the CAMERA_POWER_KEY HKS */
	reg_vcam_1v2: regulator-vcam-1v2 {
		compatible = "regulator-fixed";
		regulator-name = "CAMERA_VDDD_1V2";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		vin-supply = <&reg_vdd_1v8>;
		enable-active-high;
	};

	reg_vcam_2v8: regulator-vcam-2v8 {
		compatible = "regulator-fixed";
		regulator-name = "CAMERA_VDDA_2V8";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		vin-supply = <&reg_vdd_3v3>;
		gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_gnss: regulator-gnss {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gnsspwr>;
		regulator-name = "GNSS";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 12 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_hub: regulator-hub {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hub_pwr>;
		regulator-name = "HUB";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_lcd_1v8: regulator-lcd-1v8 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsien>;
		regulator-name = "LCD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_vdd_1v8>;
		gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		/* Otherwise i2c3 is not functional */
		regulator-always-on;
	};

	reg_lcd_3v4: regulator-lcd-3v4 {
		compatible = "regulator-fixed";
		regulator-name = "LCD_3V4";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsibiasen>;
		vin-supply = <&reg_vsys_3v4>;
		gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_vdd_sen: regulator-vdd-sen {
		compatible = "regulator-fixed";
		regulator-name = "VDD_SEN";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_vdd_1v8: regulator-vdd-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VDD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&buck7_reg>;
	};

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

	reg_vsys_3v4: regulator-vsys-3v4 {
		compatible = "regulator-fixed";
		regulator-name = "VSYS_3V4";
		regulator-min-microvolt = <3400000>;
		regulator-max-microvolt = <3400000>;
		regulator-always-on;
	};

	reg_wifi_3v3: regulator-wifi-3v3 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_wifi_pwr>;
		regulator-name = "3V3_WIFI";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 10 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		vin-supply = <&reg_vdd_3v3>;
	};

	sound {
		compatible = "simple-audio-card";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hp>;
		simple-audio-card,name = "Librem 5";
		simple-audio-card,format = "i2s";
		simple-audio-card,widgets =
			"Headphone", "Headphones",
			"Microphone", "Headset Mic",
			"Microphone", "Digital Mic",
			"Speaker", "Speaker";
		simple-audio-card,routing =
			"Headphones", "HPOUTL",
			"Headphones", "HPOUTR",
			"Speaker", "SPKOUTL",
			"Speaker", "SPKOUTR",
			"Headset Mic", "MICBIAS",
			"IN3R", "Headset Mic",
			"DMICDAT", "Digital Mic";
		simple-audio-card,hp-det-gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;

		simple-audio-card,cpu {
			sound-dai = <&sai2>;
		};

		simple-audio-card,codec {
			sound-dai = <&codec>;
			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
			frame-master;
			bitclock-master;
		};
	};

	sound-wwan {
		compatible = "simple-audio-card";
		simple-audio-card,name = "Modem";
		simple-audio-card,format = "i2s";

		simple-audio-card,cpu {
			sound-dai = <&sai6>;
			frame-inversion;
		};

		simple-audio-card,codec {
			sound-dai = <&bm818_codec>;
			frame-master;
			bitclock-master;
		};
	};

	usdhc2_pwrseq: pwrseq {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_bt>, <&pinctrl_wifi_disable>;
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio3 25 GPIO_ACTIVE_HIGH>,
			      <&gpio4 29 GPIO_ACTIVE_HIGH>;
	};

	bm818_codec: sound-wwan-codec {
		compatible = "broadmobi,bm818", "option,gtm601";
		#sound-dai-cells = <0>;
	};

	vibrator {
		compatible = "pwm-vibrator";
		pwms = <&pwm1 0 1000000000 0>;
		pwm-names = "enable";
		vcc-supply = <&reg_vdd_3v3>;
	};
};

&A53_0 {
	cpu-supply = <&buck2_reg>;
};

&A53_1 {
	cpu-supply = <&buck2_reg>;
};

&A53_2 {
	cpu-supply = <&buck2_reg>;
};

&A53_3 {
	cpu-supply = <&buck2_reg>;
};

&csi1 {
	status = "okay";
};

&ddrc {
	operating-points-v2 = <&ddrc_opp_table>;
	status = "okay";

	ddrc_opp_table: opp-table {
		compatible = "operating-points-v2";

		opp-25000000 {
			opp-hz = /bits/ 64 <25000000>;
		};

		opp-100000000 {
			opp-hz = /bits/ 64 <100000000>;
		};

		opp-800000000 {
			opp-hz = /bits/ 64 <800000000>;
		};
	};
};

&dphy {
	status = "okay";
};

&ecspi1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1>;
	cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	nor_flash: flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <1000000>;
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "protected0";
			reg = <0x0 0x30000>;
			read-only;
		};

		partition@30000 {
			label = "firmware";
			reg = <0x30000 0x1d0000>;
			read-only;
		};
	};
};

&gpio1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pmic_5v>;

	pmic-5v-hog {
		gpio-hog;
		gpios = <1 GPIO_ACTIVE_HIGH>;
		input;
		lane-mapping = "pmic-5v";
	};
};

&iomuxc {
	pinctrl_audiopwr: audiopwrgrp {
		fsl,pins = <
			/* AUDIO_POWER_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4	0x83
		>;
	};

	pinctrl_bl: blgrp {
		fsl,pins = <
			/* BACKLINGE_EN */
			MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14	0x83
		>;
	};

	pinctrl_bt: btgrp {
		fsl,pins = <
			/* BT_REG_ON */
			MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25	0x83
		>;
	};

	pinctrl_camera_pwr: camerapwrgrp {
		fsl,pins = <
			/* CAMERA_PWR_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0	0x83
		>;
	};

	pinctrl_csi1: csi1grp {
		fsl,pins = <
			/* CSI1_NRST */
			MX8MQ_IOMUXC_ENET_RXC_GPIO1_IO25	0x83
		>;
	};

	pinctrl_charger_in: chargeringrp {
		fsl,pins = <
			/* CHRG_INT */
			MX8MQ_IOMUXC_NAND_CE2_B_GPIO3_IO3	0x80
		>;
	};

	pinctrl_dsibiasen: dsibiasengrp {
		fsl,pins = <
			/* DSI_BIAS_EN */
			MX8MQ_IOMUXC_ENET_TD1_GPIO1_IO20	0x83
		>;
	};

	pinctrl_dsien: dsiengrp {
		fsl,pins = <
			/* DSI_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x83
		>;
	};

	pinctrl_dsirst: dsirstgrp {
		fsl,pins = <
			/* DSI_RST */
			MX8MQ_IOMUXC_ENET_RD3_GPIO1_IO29	0x83
			/* DSI_TE */
			MX8MQ_IOMUXC_ENET_RD2_GPIO1_IO28	0x83
			/* TP_RST */
			MX8MQ_IOMUXC_ENET_RX_CTL_GPIO1_IO24	0x83
		>;
	};

	pinctrl_ecspi1: ecspigrp {
		fsl,pins = <
			MX8MQ_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI	0x83
			MX8MQ_IOMUXC_ECSPI1_MISO_ECSPI1_MISO	0x83
			MX8MQ_IOMUXC_ECSPI1_SS0_GPIO5_IO9	0x19
			MX8MQ_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK	0x83
		>;
	};

	pinctrl_gauge: gaugegrp {
		fsl,pins = <
			/* BAT_LOW */
			MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20	0x80
		>;
	};

	pinctrl_gnsspwr: gnsspwrgrp {
		fsl,pins = <
			/* GPS3V3_EN */
			MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12	0x83
		>;
	};

	pinctrl_haptic: hapticgrp {
		fsl,pins = <
			/* MOTO */
			MX8MQ_IOMUXC_SPDIF_EXT_CLK_PWM1_OUT	0x83
		>;
	};

	pinctrl_hp: hpgrp {
		fsl,pins = <
			/* HEADPHONE_DET_1V8 */
			MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9	0x180
		>;
	};

	pinctrl_hub_pwr: hubpwrgrp {
		fsl,pins = <
			/* HUB_PWR_3V3_EN */
			MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14	0x83
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL		0x40000026
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA		0x40000026
		>;
	};

	pinctrl_i2c2: i2c2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C2_SCL_I2C2_SCL		0x40000026
			MX8MQ_IOMUXC_I2C2_SDA_I2C2_SDA		0x40000026
		>;
	};

	pinctrl_i2c3: i2c3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL		0x40000026
			MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA		0x40000026
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL		0x40000026
			MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA		0x40000026
		>;
	};

	pinctrl_keys: keysgrp {
		fsl,pins = <
			/* VOL- */
			MX8MQ_IOMUXC_ENET_MDIO_GPIO1_IO17	0x01C0
			/* VOL+ */
			MX8MQ_IOMUXC_ENET_MDC_GPIO1_IO16	0x01C0
		>;
	};

	pinctrl_led_b: ledbgrp {
		fsl,pins = <
			/* LED_B */
			MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT	0x06
		>;
	};

	pinctrl_led_g: ledggrp {
		fsl,pins = <
			/* LED_G */
			MX8MQ_IOMUXC_SAI3_MCLK_PWM4_OUT		0x06
		>;
	};

	pinctrl_led_r: ledrgrp {
		fsl,pins = <
			/* LED_R */
			MX8MQ_IOMUXC_SPDIF_TX_PWM3_OUT		0x06
		>;
	};

	pinctrl_mag: maggrp {
		fsl,pins = <
			/* INT_MAG */
			MX8MQ_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x80
		>;
	};

	pinctrl_pmic: pmicgrp {
		fsl,pins = <
			/* PMIC_NINT */
			MX8MQ_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x80
		>;
	};

	pinctrl_pmic_5v: pmic5vgrp {
		fsl,pins = <
			/* PMIC_5V */
			MX8MQ_IOMUXC_GPIO1_IO01_GPIO1_IO1	0x80
		>;
	};

	pinctrl_prox: proxgrp {
		fsl,pins = <
			/* INT_LIGHT */
			MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7	0x80
		>;
	};

	pinctrl_rtc: rtcgrp {
		fsl,pins = <
			/* RTC_INT */
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9	0x80
		>;
	};

	pinctrl_sai2: sai2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK	0xd6
			MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK	0xd6
		>;
	};

	pinctrl_sai6: sai6grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI1_RXD5_SAI6_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI1_RXD6_SAI6_RX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI1_TXD4_SAI6_RX_BCLK	0xd6
			MX8MQ_IOMUXC_SAI1_TXD5_SAI6_TX_DATA0	0xd6
		>;
	};

	pinctrl_tcpc: tcpcgrp {
		fsl,pins = <
			/* TCPC_INT */
			MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10	0x01C0
		>;
	};

	pinctrl_touch: touchgrp {
		fsl,pins = <
			/* TP_INT */
			MX8MQ_IOMUXC_ENET_RD1_GPIO1_IO27	0x80
		>;
	};

	pinctrl_typec: typecgrp {
		fsl,pins = <
			/* TYPEC_MUX_EN */
			MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11	0x83
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX	0x49
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX	0x49
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX	0x49
			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX	0x49
		>;
	};

	pinctrl_uart3: uart3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART3_RXD_UART3_DCE_RX	0x49
			MX8MQ_IOMUXC_UART3_TXD_UART3_DCE_TX	0x49
		>;
	};

	pinctrl_uart4: uart4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ECSPI2_SCLK_UART4_DCE_RX		0x49
			MX8MQ_IOMUXC_ECSPI2_MOSI_UART4_DCE_TX		0x49
			MX8MQ_IOMUXC_ECSPI2_MISO_UART4_DCE_CTS_B	0x49
			MX8MQ_IOMUXC_ECSPI2_SS0_UART4_DCE_RTS_B		0x49
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x83
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x8d
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x9f
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xc3
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

	pinctrl_usdhc2_100mhz: usdhc2grp100mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x8d
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcd
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcd
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcd
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcd
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcd
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

	pinctrl_usdhc2_200mhz: usdhc2grp200mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x9f
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcf
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcf
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcf
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcf
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcf
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

	pinctrl_wifi_disable: wifidisablegrp {
		fsl,pins = <
			/* WIFI_REG_ON */
			MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29	0x83
		>;
	};

	pinctrl_wifi_pwr: wifipwrgrp {
		fsl,pins = <
			/* WIFI3V3_EN */
			MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10	0x83
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			/* nWDOG */
			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x1f
		>;
	};
};

&i2c1 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	typec_pd: usb-pd@3f {
		compatible = "ti,tps6598x";
		reg = <0x3f>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_typec>, <&pinctrl_tcpc>;
		interrupt-parent = <&gpio1>;
		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
		interrupt-names = "irq";

		connector {
			compatible = "usb-c-connector";
			label = "USB-C";
			data-role = "dual";

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

				port@0 {
					reg = <0>;

					usb_con_hs: endpoint {
						remote-endpoint = <&typec_hs>;
					};
				};

				port@1 {
					reg = <1>;

					usb_con_ss: endpoint {
						remote-endpoint = <&typec_ss>;
					};
				};
			};
		};
	};

	pmic: pmic@4b {
		compatible = "rohm,bd71837";
		reg = <0x4b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pmic>, <&pinctrl_camera_pwr>;
		clocks = <&pmic_osc>;
		clock-names = "osc";
		clock-output-names = "pmic_clk";
		interrupt-parent = <&gpio1>;
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
		rohm,reset-snvs-powered;

		regulators {
			buck1_reg: BUCK1 {
				regulator-name = "buck1";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <900000>;
				rohm,dvs-idle-voltage = <850000>;
				rohm,dvs-suspend-voltage = <800000>;
				regulator-always-on;
			};

			buck2_reg: BUCK2 {
				regulator-name = "buck2";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <1000000>;
				rohm,dvs-idle-voltage = <900000>;
				regulator-always-on;
			};

			buck3_reg: BUCK3 {
				regulator-name = "buck3";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				rohm,dvs-run-voltage = <900000>;
			};

			buck4_reg: BUCK4 {
				regulator-name = "buck4";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				rohm,dvs-run-voltage = <1000000>;
			};

			buck5_reg: BUCK5 {
				regulator-name = "buck5";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1350000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck6_reg: BUCK6 {
				regulator-name = "buck6";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck7_reg: BUCK7 {
				regulator-name = "buck7";
				regulator-min-microvolt = <1605000>;
				regulator-max-microvolt = <1995000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck8_reg: BUCK8 {
				regulator-name = "buck8";
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1400000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo1_reg: LDO1 {
				regulator-name = "ldo1";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo2_reg: LDO2 {
				regulator-name = "ldo2";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-boot-on;
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo3_reg: LDO3 {
				regulator-name = "ldo3";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo4_reg: LDO4 {
				regulator-name = "ldo4";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo5_reg: LDO5 {
				/* VDD_PHY_0V9 - MIPI and HDMI domains */
				regulator-name = "ldo5";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			ldo6_reg: LDO6 {
				/* VDD_PHY_0V9 - MIPI, HDMI and USB domains */
				regulator-name = "ldo6";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo7_reg: LDO7 {
				/* VDD_PHY_3V3 - USB domain */
				regulator-name = "ldo7";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};

	rtc@68 {
		compatible = "microcrystal,rv4162";
		reg = <0x68>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_rtc>;
		interrupt-parent = <&gpio1>;
		interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
	};
};

&i2c2 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";

	magnetometer@1e	{
		compatible = "st,lsm9ds1-magn";
		reg = <0x1e>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mag>;
		interrupt-parent = <&gpio3>;
		interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
		vdd-supply = <&reg_vdd_sen>;
		vddio-supply = <&reg_vdd_1v8>;
	};

	regulator@3e {
		compatible = "tps65132";
		reg = <0x3e>;

		reg_lcd_avdd: outp {
			regulator-name = "LCD_AVDD";
			vin-supply = <&reg_lcd_3v4>;
		};

		reg_lcd_avee: outn {
			regulator-name = "LCD_AVEE";
			vin-supply = <&reg_lcd_3v4>;
		};
	};

	proximity: prox@60 {
		compatible = "vishay,vcnl4040";
		reg = <0x60>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_prox>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
	};

	accel_gyro: accel-gyro@6a	{
		compatible = "st,lsm9ds1-imu";
		reg = <0x6a>;
		vdd-supply = <&reg_vdd_sen>;
		vddio-supply = <&reg_vdd_1v8>;
	};
};

&i2c3 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";

	codec: audio-codec@1a {
		compatible = "wlf,wm8962";
		reg = <0x1a>;
		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
		assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
		assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
		assigned-clock-rates = <24576000>;
		#sound-dai-cells = <0>;
		mic-cfg = <0x200>;
		DCVDD-supply = <&reg_aud_1v8>;
		DBVDD-supply = <&reg_aud_1v8>;
		AVDD-supply = <&reg_aud_1v8>;
		CPVDD-supply = <&reg_aud_1v8>;
		MICVDD-supply = <&reg_aud_1v8>;
		PLLVDD-supply = <&reg_aud_1v8>;
		SPKVDD1-supply = <&reg_vsys_3v4>;
		SPKVDD2-supply = <&reg_vsys_3v4>;
		gpio-cfg = <
			0x0000 /* n/c */
			0x0001 /* gpio2, 1: default */
			0x0013 /* gpio3, 2: dmicclk */
			0x0000 /* n/c, 3: default */
			0x8014 /* gpio5, 4: dmic_dat */
			0x0000 /* gpio6, 5: default */
		>;
	};

	camera_front: camera@20 {
		compatible = "hynix,hi846";
		reg = <0x20>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi1>;
		clocks = <&clk IMX8MQ_CLK_CLKO2>;
		assigned-clocks = <&clk IMX8MQ_CLK_CLKO2>;
		assigned-clock-rates = <25000000>;
		reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
		vdda-supply = <&reg_vcam_2v8>;
		vddd-supply = <&reg_vcam_1v2>;
		vddio-supply = <&reg_csi_1v8>;
		rotation = <90>;
		orientation = <0>;

		port {
			camera1_ep: endpoint {
				data-lanes = <1 2>;
				link-frequencies = /bits/ 64
					<80000000 200000000 300000000>;
				remote-endpoint = <&mipi1_sensor_ep>;
			};
		};
	};

	backlight@36 {
		compatible = "ti,lm36922";
		reg = <0x36>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_bl>;
		#address-cells = <1>;
		#size-cells = <0>;
		enable-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
		vled-supply = <&reg_vsys_3v4>;
		ti,ovp-microvolt = <25000000>;

		led_backlight: led@0 {
			reg = <0>;
			label = ":backlight";
			linux,default-trigger = "backlight";
			led-max-microamp = <20000>;
		};
	};

	touchscreen@38 {
		compatible = "edt,edt-ft5506";
		reg = <0x38>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_touch>;
		interrupt-parent = <&gpio1>;
		interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
		touchscreen-size-x = <720>;
		touchscreen-size-y = <1440>;
		vcc-supply = <&reg_lcd_1v8>;
	};
};

&i2c4 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

	vcm@c {
		compatible = "dongwoon,dw9714";
		reg = <0x0c>;
		vcc-supply = <&reg_csi_1v8>;
	};

	bat: fuel-gauge@36 {
		compatible = "maxim,max17055";
		reg = <0x36>;
		interrupt-parent = <&gpio3>;
		interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gauge>;
		power-supplies = <&bq25895>;
		maxim,over-heat-temp = <700>;
		maxim,over-volt = <4500>;
		maxim,rsns-microohm = <5000>;
	};

	bq25895: charger@6a {
		compatible = "ti,bq25895", "ti,bq25890";
		reg = <0x6a>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_charger_in>;
		interrupt-parent = <&gpio3>;
		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
		phys = <&usb3_phy0>;
		ti,precharge-current = <130000>; /* uA */
		ti,minimum-sys-voltage = <3700000>; /* uV */
		ti,boost-voltage = <5000000>; /* uV */
		ti,boost-max-current = <1500000>; /* uA */
		ti,use-vinmin-threshold = <1>; /* enable VINDPM */
		ti,vinmin-threshold = <3900000>; /* uV */
		monitored-battery = <&bat>;
		power-supplies = <&typec_pd>;
	};
};

&lcdif {
	status = "okay";
};

&mipi_csi1 {
	status = "okay";

	ports {
		port@0 {
			reg = <0>;

			mipi1_sensor_ep: endpoint {
				remote-endpoint = <&camera1_ep>;
				data-lanes = <1 2>;
			};
		};
	};
};

&mipi_dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	lcd_panel: panel@0 {
		compatible = "mantix,mlaf057we51-x";
		reg = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsirst>;
		avdd-supply = <&reg_lcd_avdd>;
		avee-supply = <&reg_lcd_avee>;
		vddi-supply = <&reg_lcd_1v8>;
		backlight = <&backlight_dsi>;
		reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
		mantix,tp-rstn-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;

		port {
			panel_in: endpoint {
				remote-endpoint = <&mipi_dsi_out>;
			};
		};
	};

	ports {
		port@1 {
			reg = <1>;

			mipi_dsi_out: endpoint {
				remote-endpoint = <&panel_in>;
			};
		};
	};
};

&pgc_gpu {
	power-supply = <&buck3_reg>;
};

&pgc_mipi {
	power-supply = <&ldo5_reg>;
};

&pgc_vpu {
	power-supply = <&buck4_reg>;
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_haptic>;
	status = "okay";
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_b>;
	status = "okay";
};

&pwm3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_r>;
	status = "okay";
};

&pwm4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_g>;
	status = "okay";
};

&sai2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai2>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	status = "okay";
};

&sai6 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai6>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI6>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	fsl,sai-synchronous-rx;
	status = "okay";
};

&snvs_pwrkey {
	status = "okay";
};

&snvs_rtc {
	status = "disabled";
};

&uart1 { /* console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&uart2 { /* TPS - GPS - DEBUG */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	status = "okay";

	gnss {
		compatible = "globaltop,pa6h";
		vcc-supply = <&reg_gnss>;
		current-speed = <9600>;
	};
};

&uart3 { /* SMC */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart3>;
	status = "okay";
};

&uart4 { /* BT */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart4>;
	uart-has-rtscts;
	status = "okay";
};

&usb3_phy0 {
	status = "okay";
};

&usb3_phy1 {
	vbus-supply = <&reg_hub>;
	status = "okay";
};

&usb_dwc3_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	dr_mode = "otg";
	snps,dis_u3_susphy_quirk;
	usb-role-switch;
	status = "okay";

	port@0 {
		reg = <0>;

		typec_hs: endpoint {
			remote-endpoint = <&usb_con_hs>;
		};
	};

	port@1 {
		reg = <1>;

		typec_ss: endpoint {
			remote-endpoint = <&usb_con_ss>;
		};
	};
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	/* Microchip USB2642 */
	hub@1 {
		compatible = "usb424,2640";
		reg = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		mass-storage@1 {
			compatible = "usb424,4041";
			reg = <1>;
		};
	};
};

&usdhc1 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
	assigned-clock-rates = <400000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	bus-width = <8>;
	vmmc-supply = <&reg_vdd_3v3>;
	power-supply = <&reg_vdd_1v8>;
	non-removable;
	status = "okay";
};

&usdhc2 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC2>;
	assigned-clock-rates = <200000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
	bus-width = <4>;
	vmmc-supply = <&reg_wifi_3v3>;
	mmc-pwrseq = <&usdhc2_pwrseq>;
	post-power-on-delay-ms = <1000>;
	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
	max-frequency = <50000000>;
	disable-wp;
	cap-sdio-irq;
	keep-power-in-suspend;
	wakeup-source;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

/*
 * Copyright 2019-2021 MNT Research GmbH
 * Copyright 2021 Lucas Stach <dev@lynxeye.de>
 */

/dts-v1/;

#include "imx8mq-nitrogen-som.dtsi"

/ {
	model = "MNT Reform 2";
	compatible = "mntre,reform2", "boundary,imx8mq-nitrogen8m-som", "fsl,imx8mq";
	chassis-type = "laptop";

	backlight: backlight {
		compatible = "pwm-backlight";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_backlight>;
		pwms = <&pwm2 0 10000 0>;
		power-supply = <&reg_main_usb>;
		enable-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
		brightness-levels = <0 32 64 128 160 200 255>;
		default-brightness-level = <6>;
	};

	panel {
		compatible = "innolux,n125hce-gn1", "simple-panel";
		power-supply = <&reg_main_3v3>;
		backlight = <&backlight>;
		no-hpd;

		port {
			panel_in: endpoint {
				remote-endpoint = <&edp_bridge_out>;
			};
		};
	};

	pcie1_refclk: clock-pcie1-refclk {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <100000000>;
	};

	reg_main_5v: regulator-main-5v {
		compatible = "regulator-fixed";
		regulator-name = "5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

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

	reg_main_usb: regulator-main-usb {
		compatible = "regulator-fixed";
		regulator-name = "USB_PWR";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&reg_main_5v>;
	};

	reg_main_1v8: regulator-main-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_main_3v3>;
	};

	reg_main_1v2: regulator-main-1v2 {
		compatible = "regulator-fixed";
		regulator-name = "1V2";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		vin-supply = <&reg_main_5v>;
	};

	sound {
		compatible = "fsl,imx-audio-wm8960";
		audio-cpu = <&sai2>;
		audio-codec = <&wm8960>;
		audio-routing =
			"Headphone Jack", "HP_L",
			"Headphone Jack", "HP_R",
			"Ext Spk", "SPK_LP",
			"Ext Spk", "SPK_LN",
			"Ext Spk", "SPK_RP",
			"Ext Spk", "SPK_RN",
			"LINPUT1", "Mic Jack",
			"Mic Jack", "MICB",
			"LINPUT2", "Line In Jack",
			"RINPUT2", "Line In Jack";
		model = "wm8960-audio";
	};
};

&dphy {
	assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
	assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_800M>;
	assigned-clock-rates = <25000000>;
	status = "okay";
};

&fec1 {
	status = "okay";
};

&i2c3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";

	wm8960: codec@1a {
		compatible = "wlf,wm8960";
		reg = <0x1a>;
		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
		clock-names = "mclk";
		#sound-dai-cells = <0>;
	};

	rtc@68 {
		compatible = "nxp,pcf8523";
		reg = <0x68>;
	};
};

&i2c4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	clock-frequency = <400000>;
	status = "okay";

	edp_bridge: bridge@2c {
		compatible = "ti,sn65dsi86";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_edp_bridge>;
		reg = <0x2c>;
		enable-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
		vccio-supply = <&reg_main_1v8>;
		vpll-supply = <&reg_main_1v8>;
		vcca-supply = <&reg_main_1v2>;
		vcc-supply = <&reg_main_1v2>;

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

			port@0 {
				reg = <0>;

				edp_bridge_in: endpoint {
					remote-endpoint = <&mipi_dsi_out>;
				};
			};

			port@1 {
				reg = <1>;

				edp_bridge_out: endpoint {
					remote-endpoint = <&panel_in>;
				};
			};
		};
	};
};

&lcdif {
	assigned-clocks = <&clk IMX8MQ_CLK_LCDIF_PIXEL>;
	assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_800M>;
	/delete-property/assigned-clock-rates;
	status = "okay";
};

&mipi_dsi {
	status = "okay";

	ports {
		port@1 {
			reg = <1>;

			mipi_dsi_out: endpoint {
				remote-endpoint = <&edp_bridge_in>;
			};
		};
	};
};

&pcie1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pcie1>;
	reset-gpio = <&gpio3 23 GPIO_ACTIVE_LOW>;
	clocks = <&clk IMX8MQ_CLK_PCIE2_ROOT>,
		 <&clk IMX8MQ_CLK_PCIE2_AUX>,
		 <&clk IMX8MQ_CLK_PCIE2_PHY>,
		 <&pcie1_refclk>;
	clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
	status = "okay";
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm2>;
	status = "okay";
};

&reg_1p8v {
	vin-supply = <&reg_main_5v>;
};

&reg_snvs {
	vin-supply = <&reg_main_5v>;
};

&reg_arm_dram {
	vin-supply = <&reg_main_5v>;
};

&reg_dram_1p1v {
	vin-supply = <&reg_main_5v>;
};

&reg_soc_gpu_vpu {
	vin-supply = <&reg_main_5v>;
};

&sai2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai2>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
	assigned-clock-parents = <&clk IMX8MQ_CLK_25M>;
	assigned-clock-rates = <25000000>;
	fsl,sai-mclk-direction-output;
	fsl,sai-asynchronous;
	status = "okay";
};

&snvs_rtc {
	status = "disabled";
};

&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	status = "okay";
};

&usb3_phy0 {
	vbus-supply = <&reg_main_usb>;
	status = "okay";
};

&usb3_phy1 {
	vbus-supply = <&reg_main_usb>;
	status = "okay";
};

&usb_dwc3_0 {
	dr_mode = "host";
	status = "okay";
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
};

&usdhc2 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC2>;
	assigned-clock-rates = <200000000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc2>;
	vqmmc-supply = <&reg_main_3v3>;
	vmmc-supply = <&reg_main_3v3>;
	bus-width = <4>;
	status = "okay";
};

&iomuxc {
	pinctrl_backlight: backlightgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10		0x3
		>;
	};

	pinctrl_edp_bridge: edpbridgegrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20		0x1
		>;
	};

	pinctrl_i2c3: i2c3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL			0x40000022
			MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA			0x40000022
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL			0x40000022
			MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA			0x40000022
		>;
	};

	pinctrl_pcie1: pcie1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_RXD2_GPIO3_IO23		0x16
		>;
	};

	pinctrl_pwm2: pwm2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SPDIF_RX_PWM2_OUT			0x3
		>;
	};

	pinctrl_sai2: sai2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0		0xd6
			MX8MQ_IOMUXC_SAI2_RXFS_SAI2_RX_SYNC		0xd6
			MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK		0xd6
			MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC		0xd6
			MX8MQ_IOMUXC_SAI2_RXC_SAI2_RX_BCLK		0xd6
			MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK		0xd6
			MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0		0xd6
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX		0x45
			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX		0x45
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_USDHC2_CD_B		0x0
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK			0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD			0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0		0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1		0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2		0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3		0xc3
		>;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright 2018 Boundary Devices
 * Copyright 2021 Lucas Stach <dev@lynxeye.de>
 */

#include "imx8mq.dtsi"

/ {
	model = "Boundary Devices i.MX8MQ Nitrogen8M";
	compatible = "boundary,imx8mq-nitrogen8m-som", "fsl,imx8mq";

	chosen {
		stdout-path = &uart1;
	};

	reg_1p8v: regulator-fixed-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "1P8V";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
	};

	reg_snvs: regulator-fixed-snvs {
		compatible = "regulator-fixed";
		regulator-name = "VDD_SNVS";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};
};

&{/opp-table/opp-800000000} {
	opp-microvolt = <1000000>;
};

&{/opp-table/opp-1000000000} {
	opp-microvolt = <1000000>;
};

&A53_0 {
	cpu-supply = <&reg_arm_dram>;
};

&A53_1 {
	cpu-supply = <&reg_arm_dram>;
};

&A53_2 {
	cpu-supply = <&reg_arm_dram>;
};

&A53_3 {
	cpu-supply = <&reg_arm_dram>;
};

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;

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

		ethphy0: ethernet-phy@4 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <4>;
			interrupt-parent = <&gpio1>;
			interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
			reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
			reset-assert-us = <10000>;
			reset-deassert-us = <300>;
		};
	};
};

&i2c1 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	i2c-mux@70 {
		compatible = "nxp,pca9546";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_i2c1_pca9546>;
		reg = <0x70>;
		reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
		#address-cells = <1>;
		#size-cells = <0>;

		i2c1a: i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_arm_dram: regulator@60 {
				compatible = "fcs,fan53555";
				reg = <0x60>;
				regulator-name = "VDD_ARM_DRAM_1V";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
			};
		};

		i2c1b: i2c@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_dram_1p1v: regulator@60 {
				compatible = "fcs,fan53555";
				reg = <0x60>;
				regulator-name = "NVCC_DRAM_1P1V";
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-always-on;
			};
		};

		i2c1c: i2c@2 {
			reg = <2>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_soc_gpu_vpu: regulator@60 {
				compatible = "fcs,fan53555";
				reg = <0x60>;
				regulator-name = "VDD_SOC_GPU_VPU";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-always-on;
			};
		};

		i2c1d: i2c@3 {
			reg = <3>;
			#address-cells = <1>;
			#size-cells = <0>;
		};
	};
};

&pgc_gpu {
	power-supply = <&reg_soc_gpu_vpu>;
};

&pgc_vpu {
	power-supply = <&reg_soc_gpu_vpu>;
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&usdhc1 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
	assigned-clock-rates = <400000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	vqmmc-supply = <&reg_1p8v>;
	vmmc-supply = <&reg_snvs>;
	bus-width = <8>;
	non-removable;
	no-mmc-hs400;
	no-sdio;
	no-sd;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};

&iomuxc {
	pinctrl_fec1: fec1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC			0x3
			MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO		0x23
			MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
			MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
			MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
			MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
			MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
			MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
			MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
			MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0xd1
			MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
			MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
			MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
			MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0xd1
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9		0x1
			MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11		0x41
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL			0x40000022
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA			0x40000022
		>;
	};

	pinctrl_i2c1_pca9546: i2c1-pca9546grp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8		0x49
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX		0x45
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX		0x45
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B		0xc6
		>;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright 2018 Boundary Devices
 */

/dts-v1/;

#include <dt-bindings/input/input.h>
#include "imx8mq.dtsi"

/ {
	model = "Boundary Devices i.MX8MQ Nitrogen8M";
	compatible = "boundary,imx8mq-nitrogen8m", "fsl,imx8mq";

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

	memory@40000000 {
		device_type = "memory";
		reg = <0x00000000 0x40000000 0 0x80000000>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_keys>;

		button-power {
			label = "Power Button";
			gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			wakeup-source;
		};
	};

	hdmi-connector {
		compatible = "hdmi-connector";
		ddc-i2c-bus = <&ddc_i2c_bus>;
		label = "hdmi";
		type = "a";

		port {
			hdmi_connector_in: endpoint {
				remote-endpoint = <&lt8912_out>;
			};
		};
	};

	reg_usb_otg_vbus: regulator-usb-otg-vbus {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_reg_usbotg_vbus>;
		regulator-name = "usb_otg_vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_vref_0v9: regulator-vref-0v9 {
		compatible = "regulator-fixed";
		regulator-name = "vref-0v9";
		regulator-min-microvolt = <900000>;
		regulator-max-microvolt = <900000>;
	};

	reg_vref_1v8: regulator-vref-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "vref-1v8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
	};

	reg_vref_2v5: regulator-vref-2v5 {
		compatible = "regulator-fixed";
		regulator-name = "vref-2v5";
		regulator-min-microvolt = <2500000>;
		regulator-max-microvolt = <2500000>;
	};

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

	reg_vref_5v: regulator-vref-5v {
		compatible = "regulator-fixed";
		regulator-name = "vref-5v";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};
};

&dphy {
	status = "okay";
};

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	status = "okay";

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

		ethphy0: ethernet-phy@4 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <4>;
			interrupts-extended = <&gpio1 11 IRQ_TYPE_LEVEL_LOW>;
		};
	};
};

/* Release reset of the USB Host HUB */
&gpio1 {
	usb-host-reset-hog {
		gpio-hog;
		gpios = <14 GPIO_ACTIVE_HIGH>;
		output-high;
	};
};

&i2c1 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	i2cmux@70 {
		compatible = "nxp,pca9546";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_i2c1_pca9546>;
		reg = <0x70>;
		reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
		#address-cells = <1>;
		#size-cells = <0>;

		i2c1a: i2c1@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_arm_dram: regulator@60 {
				compatible = "fcs,fan53555";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_reg_arm_dram>;
				reg = <0x60>;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
				vsel-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
			};
		};

		i2c1b: i2c1@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_dram_1p1v: regulator@60 {
				compatible = "fcs,fan53555";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_reg_dram_1p1v>;
				reg = <0x60>;
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-always-on;
				vsel-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
			};
		};

		i2c1c: i2c1@2 {
			reg = <2>;
			#address-cells = <1>;
			#size-cells = <0>;

			reg_soc_gpu_vpu: regulator@60 {
				compatible = "fcs,fan53555";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_reg_soc_gpu_vpu>;
				reg = <0x60>;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
				vsel-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
			};
		};

		i2c1d: i2c1@3 {
			reg = <3>;
			#address-cells = <1>;
			#size-cells = <0>;

			rtc@68 {
				compatible = "microcrystal,rv4162";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_i2c1d_rv4162>;
				reg = <0x68>;
				interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_LOW>;
				wakeup-source;
			};
		};
	};
};

&i2c4 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

	pca9546: i2cmux@70 {
		compatible = "nxp,pca9546";
		reg = <0x70>;
		#address-cells = <1>;
		#size-cells = <0>;

		i2c4@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
			clock-frequency = <100000>;

			hdmi-bridge@48 {
				compatible = "lontium,lt8912b";
				reg = <0x48> ;
				reset-gpios = <&max7323 0 GPIO_ACTIVE_LOW>;

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

					port@0 {
						reg = <0>;

						hdmi_out_in: endpoint {
							data-lanes = <1 2 3 4>;
							remote-endpoint = <&mipi_dsi_out>;
						};
					};

					port@1 {
						reg = <1>;

						lt8912_out: endpoint {
							remote-endpoint = <&hdmi_connector_in>;
						};
					};
				};
			};
		};

		ddc_i2c_bus: i2c4@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			clock-frequency = <100000>;
		};

		i2c4@3 {
			reg = <3>;
			#address-cells = <1>;
			#size-cells = <0>;
			clock-frequency = <100000>;

			max7323: gpio-expander@68 {
				compatible = "maxim,max7323";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_max7323>;
				gpio-controller;
				reg = <0x68>;
				#gpio-cells = <2>;
			};
		};
	};
};

&lcdif {
	status = "okay";
};

&mipi_dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	ports {
		port@1 {
			reg = <1>;

			mipi_dsi_out: endpoint {
				remote-endpoint = <&hdmi_out_in>;
			};
		};
	};
};

&uart1 { /* console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	assigned-clocks = <&clk IMX8MQ_CLK_UART1>;
	assigned-clock-parents = <&clk IMX8MQ_CLK_25M>;
	status = "okay";
};

&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	assigned-clocks = <&clk IMX8MQ_CLK_UART2>;
	assigned-clock-parents = <&clk IMX8MQ_CLK_25M>;
	status = "okay";
};

&usb_dwc3_0 {
	dr_mode = "otg";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb3_0>;
	status = "okay";
};

&usb3_phy0 {
	vbus-supply = <&reg_usb_otg_vbus>;
	status = "okay";
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
};

&usb3_phy1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb3_1>;
	status = "okay";
};

&usdhc1 {
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
	assigned-clock-rates = <400000000>;
	bus-width = <8>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc1>;
	non-removable;
	vmmc-supply = <&reg_vref_1v8>;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};

&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_hog>;

	pinctrl_hog: hoggrp {
		fsl,pins = <
			/* J17 connector, odd */
			MX8MQ_IOMUXC_SAI1_RXFS_GPIO4_IO0		0x19	/* Pin 19 */
			MX8MQ_IOMUXC_SAI1_RXC_GPIO4_IO1			0x19	/* Pin 21 */
			MX8MQ_IOMUXC_SAI1_RXD1_GPIO4_IO3		0x19	/* Pin 23 */
			MX8MQ_IOMUXC_SAI1_RXD2_GPIO4_IO4		0x19	/* Pin 25 */
			MX8MQ_IOMUXC_SAI1_RXD3_GPIO4_IO5		0x19	/* Pin 27 */
			MX8MQ_IOMUXC_SAI1_RXD4_GPIO4_IO6		0x19	/* Pin 29 */
			MX8MQ_IOMUXC_SAI1_RXD5_GPIO4_IO7		0x19	/* Pin 31 */
			MX8MQ_IOMUXC_SAI1_RXD6_GPIO4_IO8		0x19	/* Pin 33 */
			MX8MQ_IOMUXC_SAI1_RXD7_GPIO4_IO9		0x19	/* Pin 35 */
			MX8MQ_IOMUXC_SAI1_TXD1_GPIO4_IO13		0x19	/* Pin 39 */
			MX8MQ_IOMUXC_SAI1_TXD2_GPIO4_IO14		0x19	/* Pin 41 */
			MX8MQ_IOMUXC_SAI1_TXD3_GPIO4_IO15		0x19	/* Pin 43 */
			MX8MQ_IOMUXC_SAI1_TXD4_GPIO4_IO16		0x19	/* Pin 45 */
			MX8MQ_IOMUXC_SAI1_TXD5_GPIO4_IO17		0x19	/* Pin 47 */
			MX8MQ_IOMUXC_SAI1_TXD6_GPIO4_IO18		0x19	/* Pin 49 */
			MX8MQ_IOMUXC_SAI1_TXD7_GPIO4_IO19		0x19	/* Pin 51 */

			/* J17 connector, even */
			MX8MQ_IOMUXC_SAI3_RXFS_GPIO4_IO28		0x19	/* Pin 44 */
			MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29		0x19	/* Pin 48 */
			MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10		0x19	/* Pin 50 */
			MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3		0x19	/* Pin 54 */
			MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5		0x19	/* Pin 56 */

			/* J18 connector, odd */
			MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4		0x19	/* Pin 41 */
			MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5			0x19	/* Pin 43 */
			MX8MQ_IOMUXC_NAND_READY_B_GPIO3_IO16		0x19	/* Pin 45 */
			MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11		0x19	/* Pin 47 */
			MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18		0x19	/* Pin 49 */
			MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14		0x19	/* Pin 53 */

			/* J18 connector, even */
			MX8MQ_IOMUXC_NAND_ALE_GPIO3_IO0			0x19	/* Pin 32 */
			MX8MQ_IOMUXC_NAND_CE0_B_GPIO3_IO1		0x19	/* Pin 36 */
			MX8MQ_IOMUXC_NAND_DATA00_GPIO3_IO6		0x19	/* Pin 38 */
			MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7		0x19	/* Pin 40 */
			MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8		0x19	/* Pin 42 */
			MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9		0x19	/* Pin 44 */
			MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10		0x19	/* Pin 46 */

			/* J13 Pin 2, WL_WAKE */
			MX8MQ_IOMUXC_SAI5_RXD2_GPIO3_IO23		0xd6
			/* J13 Pin 4, WL_IRQ, not needed for Silex */
			MX8MQ_IOMUXC_SAI5_RXD0_GPIO3_IO21		0xd6
			/* J13 pin 9, unused */
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12		0x19
			/* J13 Pin 41, BT_CLK_REQ */
			MX8MQ_IOMUXC_SAI5_RXD1_GPIO3_IO22		0xd6
			/* J13 Pin 42, BT_HOST_WAKE */
			MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25		0xd6

			/* Clock for both CSI1 and CSI2 */
			MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2	0x07
			/* test points */
			MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4		0xc1	/* TP87 */
		>;
	};

	pinctrl_fec1: fec1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC			0x3
			MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO		0x23
			MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
			MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
			MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
			MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
			MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
			MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
			MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
			MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
			MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
			MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
			MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
			MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9		0x19
			MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11		0x59
		>;
	};

	pinctrl_gpio_keys: gpio-keysgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO07_GPIO1_IO7		0x19
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL			0x4000007f
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA			0x4000007f
		>;
	};

	pinctrl_i2c1_pca9546: i2c1-pca9546grp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8		0x49
		>;
	};

	pinctrl_i2c1d_rv4162: i2c1d-rv4162grp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6		0x49
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL			0x4000007f
			MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA			0x4000007f
		>;
	};

	pinctrl_max7323: max7323grp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_RE_B_GPIO3_IO15 0x19
		>;
	};

	pinctrl_reg_arm_dram: reg-arm-dramgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24	0x16
		>;
	};

	pinctrl_reg_dram_1p1v: reg-dram-1p1vgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_STROBE_GPIO2_IO11	0x16
		>;
	};

	pinctrl_reg_soc_gpu_vpu: reg-soc-gpu-vpugrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20		0x16
		>;
	};

	pinctrl_reg_usbotg_vbus: reg-usbotg-vbusgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x16
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX		0x45
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX		0x45
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX		0x45
			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX		0x45
		>;
	};

	pinctrl_usb3_0: usb3-0grp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO13_USB1_OTG_OC		0x16
		>;
	};

	pinctrl_usb3_1: usb3-1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14		0x16
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_RESET_B_GPIO2_IO10		0x41
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
		MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0xc6
		>;
	};
};


code:
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright 2017-2019 NXP
 */

/dts-v1/;

#include "imx8mq.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Google i.MX8MQ Phanbell";
	compatible = "google,imx8mq-phanbell", "fsl,imx8mq";

	chosen {
		stdout-path = &uart1;
	};

	memory@40000000 {
		device_type = "memory";
		reg = <0x00000000 0x40000000 0 0x40000000>;
	};

	pmic_osc: clock-pmic {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		clock-output-names = "pmic_osc";
	};

	reg_usdhc2_vmmc: regulator-usdhc2-vmmc {
		compatible = "regulator-fixed";
		regulator-name = "VSD_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	fan: gpio-fan {
		compatible = "gpio-fan";
		gpio-fan,speed-map = <0 0 8600 1>;
		gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>;
		#cooling-cells = <2>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_fan>;
		status = "okay";
	};
};

&A53_0 {
	cpu-supply = <&buck2>;
};

&A53_1 {
	cpu-supply = <&buck2>;
};

&A53_2 {
	cpu-supply = <&buck2>;
};

&A53_3 {
	cpu-supply = <&buck2>;
};

&cpu_thermal {
	trips {
		cpu_alert0: trip0 {
			temperature = <75000>;
			hysteresis = <2000>;
			type = "passive";
		};

		cpu_alert1: trip1 {
			temperature = <80000>;
			hysteresis = <2000>;
			type = "passive";
		};

		cpu_crit0: trip3 {
			temperature = <90000>;
			hysteresis = <2000>;
			type = "critical";
		};

		fan_toggle0: trip4 {
			temperature = <65000>;
			hysteresis = <10000>;
			type = "active";
		};
	};

	cooling-maps {
		map0 {
			trip = <&cpu_alert0>;
			cooling-device =
			<&A53_0 0 1>; /* Exclude highest OPP */
		};

		map1 {
			trip = <&cpu_alert1>;
			cooling-device =
			<&A53_0 0 2>; /* Exclude two highest OPPs */
		};

		map4 {
			trip = <&fan_toggle0>;
			cooling-device = <&fan 0 1>;
		};
	};
};

&i2c1 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	pmic: pmic@4b {
		compatible = "rohm,bd71837";
		reg = <0x4b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pmic>;
		#clock-cells = <0>;
		clocks = <&pmic_osc>;
		clock-output-names = "pmic_clk";
		interrupt-parent = <&gpio1>;
		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

		regulators {
			buck1: BUCK1 {
				regulator-name = "buck1";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <900000>;
				rohm,dvs-idle-voltage = <900000>;
				rohm,dvs-suspend-voltage = <800000>;
			};

			buck2: BUCK2 {
				regulator-name = "buck2";
				regulator-min-microvolt = <850000>;
				regulator-max-microvolt = <1000000>;
				regulator-boot-on;
				regulator-always-on;
				rohm,dvs-run-voltage = <1000000>;
				rohm,dvs-idle-voltage = <900000>;
			};

			buck3: BUCK3 {
				regulator-name = "buck3";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				rohm,dvs-run-voltage = <900000>;
			};

			buck4: BUCK4 {
				regulator-name = "buck4";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-always-on;
				rohm,dvs-run-voltage = <900000>;
			};

			buck5: BUCK5 {
				regulator-name = "buck5";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1350000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck6: BUCK6 {
				regulator-name = "buck6";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck7: BUCK7 {
				regulator-name = "buck7";
				regulator-min-microvolt = <1605000>;
				regulator-max-microvolt = <1995000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck8: BUCK8 {
				regulator-name = "buck8";
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1400000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo1: LDO1 {
				regulator-name = "ldo1";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo2: LDO2 {
				regulator-name = "ldo2";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo3: LDO3 {
				regulator-name = "ldo3";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo4: LDO4 {
				regulator-name = "ldo4";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo5: LDO5 {
				regulator-name = "ldo5";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo6: LDO6 {
				regulator-name = "ldo6";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo7: LDO7 {
				regulator-name = "ldo7";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};
};

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;
		ethphy0: ethernet-phy@0 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <0>;
			reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
			reset-assert-us = <10000>;
			reset-deassert-us = <50000>;
		};
	};
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&usdhc1 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	bus-width = <8>;
	non-removable;
	status = "okay";
};

&usdhc2 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
	bus-width = <4>;
	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	status = "okay";
};

&usb3_phy0 {
	status = "okay";
};

&usb_dwc3_0 {
	dr_mode = "otg";
	status = "okay";
};

&usb3_phy1 {
	status = "okay";
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};

&iomuxc {
	pinctrl_fec1: fec1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC			0x3
			MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO		0x23
			MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
			MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
			MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
			MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
			MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
			MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
			MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
			MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
			MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
			MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
			MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
			MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9		0x19
		>;
	};

	pinctrl_gpio_fan: gpiofangrp {
		fsl,pins = <
			MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5			0x16
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL			0x4000007f
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA			0x4000007f
		>;
	};

	pinctrl_pmic: pmicirqgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3	0x41
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX		0x49
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX		0x49
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x83
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x85
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc5
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc5
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc5
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc5
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc5
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc5
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc5
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc5
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc5
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x85
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x87
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc7
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc7
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc7
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc7
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc7
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc7
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc7
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc7
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc7
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x87
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc2_gpio: usdhc2gpiogrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x41
			MX8MQ_IOMUXC_SD2_RESET_B_GPIO2_IO19	0x41
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK			0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD			0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0		0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1		0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2		0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3		0xc3
			MX8MQ_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0xc1
		>;
	};

	pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK			0x85
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD			0xc5
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0		0xc5
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1		0xc5
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2		0xc5
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3		0xc5
			MX8MQ_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0xc1
		>;
	};

	pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK			0x87
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD			0xc7
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0		0xc7
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1		0xc7
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2		0xc7
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3		0xc7
			MX8MQ_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0xc1
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B 0xc6
		>;
	};
};