#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15xxaa-pinctrl.dtsi"
#include "stm32mp157-m4-srm.dtsi"
/dts-v1/;

/* USER CODE BEGIN includes */
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/st,stpmic1.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/stm32-hdp.h>
/* USER CODE END includes */

/{
	model = "STMicroelectronics STM32MP157A-EV1 STM32CubeMX board";
	compatible = "st,stm32mp157a-board_157a-ev1-mx", "st,stm32mp157";

	/* USER CODE BEGIN root */

	led{
		compatible = "gpio-leds";

		blue{
			label = "heartbeat";
			gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			default-state = "off";
		};
	};

	sd_switch:regulator-sd_switch{
		compatible = "regulator-gpio";
		regulator-name = "sd_switch";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2900000>;
		regulator-type = "voltage";
		regulator-always-on;
		gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>;
		gpios-states = <0>;
		states = <1800000 0x1 2900000 0x0>;
	};

	vin:vin{
		compatible = "regulator-fixed";
		regulator-name = "vin";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	chosen{
		stdout-path = "serial0:115200n8";
	};

	aliases{
		serial0 = &uart4;
		serial1 = &usart3;
		ethernet0 = &ethernet0;
	};

	joystick{
		compatible = "gpio-keys";
		#size-cells = <0>;
		pinctrl-0 = <&joystick_pins>;
		pinctrl-names = "default";

		button-0{
			label = "JoySel";
			linux,code = <KEY_ENTER>;
			interrupt-parent = <&stmfx_pinctrl>;
			interrupts = <0 IRQ_TYPE_EDGE_RISING>;
		};

		button-1{
			label = "JoyDown";
			linux,code = <KEY_DOWN>;
			interrupt-parent = <&stmfx_pinctrl>;
			interrupts = <1 IRQ_TYPE_EDGE_RISING>;
		};

		button-2{
			label = "JoyLeft";
			linux,code = <KEY_LEFT>;
			interrupt-parent = <&stmfx_pinctrl>;
			interrupts = <2 IRQ_TYPE_EDGE_RISING>;
		};

		button-3{
			label = "JoyRight";
			linux,code = <KEY_RIGHT>;
			interrupt-parent = <&stmfx_pinctrl>;
			interrupts = <3 IRQ_TYPE_EDGE_RISING>;
		};

		button-4{
			label = "JoyUp";
			linux,code = <KEY_UP>;
			interrupt-parent = <&stmfx_pinctrl>;
			interrupts = <4 IRQ_TYPE_EDGE_RISING>;
		};
	};

	panel_backlight:panel-backlight{
		compatible = "gpio-backlight";
		gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
		default-on;
		status = "okay";
	};

	spdif_out:spdif-out{
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dit";
		status = "okay";

		spdif_out_port:port{

			spdif_out_endpoint:endpoint{
				remote-endpoint = <&sai4a_endpoint>;
			};
		};
	};

	spdif_in:spdif-in{
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dir";
		status = "okay";

		spdif_in_port:port{

			spdif_in_endpoint:endpoint{
				remote-endpoint = <&spdifrx_endpoint>;
			};
		};
	};

	sound{
		compatible = "audio-graph-card";
		label = "STM32MP1-EV";
		routing = "AIF1CLK", "MCLK1", "AIF2CLK", "MCLK1", "IN1LN", "MICBIAS2", "DMIC2DAT", "MICBIAS1", "DMIC1DAT", "MICBIAS1";
		dais = <&sai2a_port &sai2b_port &sai4a_port &spdifrx_port
			&dfsdm0_port &dfsdm1_port &dfsdm2_port &dfsdm3_port>;
		status = "okay";
	};

	dmic0:dmic-0{
		compatible = "dmic-codec";
		#sound-dai-cells = <1>;
		sound-name-prefix = "dmic0";
		status = "okay";

		port{

			dmic0_endpoint:endpoint{
				remote-endpoint = <&dfsdm_endpoint0>;
			};
		};
	};

	dmic1:dmic-1{
		compatible = "dmic-codec";
		#sound-dai-cells = <1>;
		sound-name-prefix = "dmic1";
		status = "okay";

		port{

			dmic1_endpoint:endpoint{
				remote-endpoint = <&dfsdm_endpoint1>;
			};
		};
	};

	dmic2:dmic-2{
		compatible = "dmic-codec";
		#sound-dai-cells = <1>;
		sound-name-prefix = "dmic2";
		status = "okay";

		port{

			dmic2_endpoint:endpoint{
				remote-endpoint = <&dfsdm_endpoint2>;
			};
		};
	};

	dmic3:dmic-3{
		compatible = "dmic-codec";
		#sound-dai-cells = <1>;
		sound-name-prefix = "dmic3";
		status = "okay";

		port{

			dmic3_endpoint:endpoint{
				remote-endpoint = <&dfsdm_endpoint3>;
			};
		};
	};

	usb_phy_tuning:usb-phy-tuning{
		st,hs-dc-level = <2>;
		st,fs-rftime-tuning;
		st,hs-rftime-reduction;
		st,hs-current-trim = <15>;
		st,hs-impedance-trim = <1>;
		st,squelch-level = <3>;
		st,hs-rx-offset = <2>;
		st,no-lsfs-sc;
	};
	/* USER CODE END root */

	memory@c0000000{
		device_type = "memory";
		reg = <0xc0000000 0x40000000>;
	};

	reserved-memory{
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		/* USER CODE BEGIN reserved-memory */

		mcuram2:mcuram2@10000000{
			compatible = "shared-dma-pool";
			reg = <0x10000000 0x40000>;
			no-map;
		};

		vdev0vring0:vdev0vring0@10040000{
			compatible = "shared-dma-pool";
			reg = <0x10040000 0x1000>;
			no-map;
		};

		vdev0vring1:vdev0vring1@10041000{
			compatible = "shared-dma-pool";
			reg = <0x10041000 0x1000>;
			no-map;
		};

		vdev0buffer:vdev0buffer@10042000{
			compatible = "shared-dma-pool";
			reg = <0x10042000 0x4000>;
			no-map;
		};

		mcuram:mcuram@30000000{
			compatible = "shared-dma-pool";
			reg = <0x30000000 0x40000>;
			no-map;
		};

		retram:retram@38000000{
			compatible = "shared-dma-pool";
			reg = <0x38000000 0x10000>;
			no-map;
		};

		gpu_reserved:gpu@f6000000{
			reg = <0xf6000000 0x8000000>;
			no-map;
		};
		/* USER CODE END reserved-memory */
	};

	clocks{

		/* USER CODE BEGIN clocks */

		clk_ext_camera:clk-ext-camera{
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <24000000>;
		};
		/* USER CODE END clocks */

#ifndef CONFIG_STM32MP1_TRUSTED

		clk_lsi:clk-lsi{
			clock-frequency = <32000>;
		};

		clk_hsi:clk-hsi{
			clock-frequency = <64000000>;
		};

		clk_csi:clk-csi{
			clock-frequency = <4000000>;
		};

		clk_lse:clk-lse{
			clock-frequency = <32768>;
		};

		clk_hse:clk-hse{
			clock-frequency = <24000000>;
		};
#endif
	};
};

&pinctrl{
	u-boot,dm-pre-reloc;

	dcmi_pins_mx:dcmi_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 6, AF13)>, <STM32_PINMUX('B', 7, AF13)>, <STM32_PINMUX('B', 8, AF13)>, <STM32_PINMUX('E', 6, AF13)>, <STM32_PINMUX('H', 8, AF13)>, <STM32_PINMUX('H', 9, AF13)>, <STM32_PINMUX('H', 10, AF13)>, <STM32_PINMUX('H', 11, AF13)>, <STM32_PINMUX('H', 12, AF13)>, <STM32_PINMUX('H', 14, AF13)>, <STM32_PINMUX('I', 4, AF13)>;
			bias-disable;
		};
	};

	dcmi_sleep_pins_mx:dcmi_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 6, ANALOG)>, <STM32_PINMUX('B', 7, ANALOG)>, <STM32_PINMUX('B', 8, ANALOG)>, <STM32_PINMUX('E', 6, ANALOG)>, <STM32_PINMUX('H', 8, ANALOG)>, <STM32_PINMUX('H', 9, ANALOG)>, <STM32_PINMUX('H', 10, ANALOG)>, <STM32_PINMUX('H', 11, ANALOG)>, <STM32_PINMUX('H', 12, ANALOG)>, <STM32_PINMUX('H', 14, ANALOG)>, <STM32_PINMUX('I', 4, ANALOG)>;
		};
	};

	dfsdm_pins_mx:dfsdm_mx-0{

		pins1{
			pinmux = <STM32_PINMUX('B', 13, AF3)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};

		pins2{
			pinmux = <STM32_PINMUX('C', 3, AF3)>, <STM32_PINMUX('F', 13, AF6)>;
			bias-disable;
		};
	};

	dfsdm_sleep_pins_mx:dfsdm_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('B', 13, ANALOG)>, <STM32_PINMUX('C', 3, ANALOG)>, <STM32_PINMUX('F', 13, ANALOG)>;
		};
	};

	eth1_pins_mx:eth1_mx-0{

		pins1{
			pinmux = <STM32_PINMUX('A', 1, AF11)>, <STM32_PINMUX('A', 7, AF11)>, <STM32_PINMUX('B', 0, AF11)>, <STM32_PINMUX('B', 1, AF11)>, <STM32_PINMUX('C', 4, AF11)>, <STM32_PINMUX('C', 5, AF11)>;
			bias-disable;
		};

		pins2{
			pinmux = <STM32_PINMUX('A', 2, AF11)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};

		pins3{
			pinmux = <STM32_PINMUX('B', 11, AF11)>, <STM32_PINMUX('C', 1, AF11)>, <STM32_PINMUX('C', 2, AF11)>, <STM32_PINMUX('E', 2, AF11)>, <STM32_PINMUX('G', 4, AF11)>, <STM32_PINMUX('G', 5, AF11)>, <STM32_PINMUX('G', 13, AF11)>, <STM32_PINMUX('G', 14, AF11)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <2>;
		};
	};

	eth1_sleep_pins_mx:eth1_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 1, ANALOG)>, <STM32_PINMUX('A', 2, ANALOG)>, <STM32_PINMUX('A', 7, ANALOG)>, <STM32_PINMUX('B', 0, ANALOG)>, <STM32_PINMUX('B', 1, ANALOG)>, <STM32_PINMUX('B', 11, ANALOG)>, <STM32_PINMUX('C', 1, ANALOG)>, <STM32_PINMUX('C', 2, ANALOG)>, <STM32_PINMUX('C', 4, ANALOG)>, <STM32_PINMUX('C', 5, ANALOG)>, <STM32_PINMUX('E', 2, ANALOG)>, <STM32_PINMUX('G', 4, ANALOG)>, <STM32_PINMUX('G', 5, ANALOG)>, <STM32_PINMUX('G', 13, ANALOG)>, <STM32_PINMUX('G', 14, ANALOG)>;
		};
	};

	fdcan1_pins_mx:fdcan1_mx-0{

		pins1{
			pinmux = <STM32_PINMUX('H', 13, AF9)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			pinmux = <STM32_PINMUX('I', 9, AF9)>;
			bias-disable;
		};
	};

	fdcan1_sleep_pins_mx:fdcan1_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('H', 13, ANALOG)>, <STM32_PINMUX('I', 9, ANALOG)>;
		};
	};

	fmc_pins_mx:fmc_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('D', 0, AF12)>, <STM32_PINMUX('D', 1, AF12)>, <STM32_PINMUX('D', 4, AF12)>, <STM32_PINMUX('D', 5, AF12)>, <STM32_PINMUX('D', 11, AF12)>, <STM32_PINMUX('D', 12, AF12)>, <STM32_PINMUX('D', 14, AF12)>, <STM32_PINMUX('D', 15, AF12)>, <STM32_PINMUX('E', 7, AF12)>, <STM32_PINMUX('E', 8, AF12)>, <STM32_PINMUX('E', 9, AF12)>, <STM32_PINMUX('E', 10, AF12)>, <STM32_PINMUX('G', 9, AF12)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('D', 6, AF12)>;
			bias-pull-up;
		};
	};

	fmc_sleep_pins_mx:fmc_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('D', 0, ANALOG)>, <STM32_PINMUX('D', 1, ANALOG)>, <STM32_PINMUX('D', 4, ANALOG)>, <STM32_PINMUX('D', 5, ANALOG)>, <STM32_PINMUX('D', 6, ANALOG)>, <STM32_PINMUX('D', 11, ANALOG)>, <STM32_PINMUX('D', 12, ANALOG)>, <STM32_PINMUX('D', 14, ANALOG)>, <STM32_PINMUX('D', 15, ANALOG)>, <STM32_PINMUX('E', 7, ANALOG)>, <STM32_PINMUX('E', 8, ANALOG)>, <STM32_PINMUX('E', 9, ANALOG)>, <STM32_PINMUX('E', 10, ANALOG)>, <STM32_PINMUX('G', 9, ANALOG)>;
		};
	};

	hdmi_cec_pins_mx:hdmi_cec_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 15, AF4)>;
			bias-disable;
			drive-open-drain;
			slew-rate = <0>;
		};
	};

	hdmi_cec_sleep_pins_mx:hdmi_cec_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 15, ANALOG)>;
		};
	};

	i2c2_pins_mx:i2c2_mx-0{

		pins{
			pinmux = <STM32_PINMUX('H', 4, AF4)>, <STM32_PINMUX('H', 5, AF4)>;
			bias-disable;
			drive-open-drain;
			slew-rate = <0>;
		};
	};

	i2c2_sleep_pins_mx:i2c2_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('H', 4, ANALOG)>, <STM32_PINMUX('H', 5, ANALOG)>;
		};
	};

	i2c5_pins_mx:i2c5_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 11, AF4)>, <STM32_PINMUX('A', 12, AF4)>;
			bias-disable;
			drive-open-drain;
			slew-rate = <0>;
		};
	};

	i2c5_sleep_pins_mx:i2c5_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('A', 11, ANALOG)>, <STM32_PINMUX('A', 12, ANALOG)>;
		};
	};

	quadspi_pins_mx:quadspi_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 6, AF10)>, <STM32_PINMUX('C', 0, AF10)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('F', 10, AF9)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <3>;
		};

		pins3{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('F', 6, AF9)>, <STM32_PINMUX('F', 7, AF9)>, <STM32_PINMUX('F', 8, AF10)>, <STM32_PINMUX('F', 9, AF10)>, <STM32_PINMUX('G', 7, AF11)>, <STM32_PINMUX('G', 10, AF11)>, <STM32_PINMUX('H', 2, AF9)>, <STM32_PINMUX('H', 3, AF9)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};
	};

	quadspi_sleep_pins_mx:quadspi_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 6, ANALOG)>, <STM32_PINMUX('C', 0, ANALOG)>, <STM32_PINMUX('F', 6, ANALOG)>, <STM32_PINMUX('F', 7, ANALOG)>, <STM32_PINMUX('F', 8, ANALOG)>, <STM32_PINMUX('F', 9, ANALOG)>, <STM32_PINMUX('F', 10, ANALOG)>, <STM32_PINMUX('G', 7, ANALOG)>, <STM32_PINMUX('G', 10, ANALOG)>, <STM32_PINMUX('H', 2, ANALOG)>, <STM32_PINMUX('H', 3, ANALOG)>;
		};
	};

	sai2a_pins_mx:sai2a_mx-0{

		pins{
			pinmux = <STM32_PINMUX('E', 0, AF10)>, <STM32_PINMUX('I', 5, AF10)>, <STM32_PINMUX('I', 6, AF10)>, <STM32_PINMUX('I', 7, AF10)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};

	sai2a_sleep_pins_mx:sai2a_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('E', 0, ANALOG)>, <STM32_PINMUX('I', 5, ANALOG)>, <STM32_PINMUX('I', 6, ANALOG)>, <STM32_PINMUX('I', 7, ANALOG)>;
		};
	};

	sai2b_pins_mx:sai2b_mx-0{

		pins{
			pinmux = <STM32_PINMUX('E', 12, AF10)>, <STM32_PINMUX('E', 13, AF10)>, <STM32_PINMUX('E', 14, AF10)>, <STM32_PINMUX('F', 11, AF10)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};

	sai2b_sleep_pins_mx:sai2b_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('E', 12, ANALOG)>, <STM32_PINMUX('E', 13, ANALOG)>, <STM32_PINMUX('E', 14, ANALOG)>, <STM32_PINMUX('F', 11, ANALOG)>;
		};
	};

	sai4a_pins_mx:sai4a_mx-0{

		pins{
			pinmux = <STM32_PINMUX('B', 5, AF10)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};

	sai4a_sleep_pins_mx:sai4a_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('B', 5, ANALOG)>;
		};
	};

	sdmmc1_pins_mx:sdmmc1_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 9, AF11)>, <STM32_PINMUX('C', 7, AF8)>, <STM32_PINMUX('F', 2, AF11)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('C', 8, AF12)>, <STM32_PINMUX('C', 9, AF12)>, <STM32_PINMUX('C', 10, AF12)>, <STM32_PINMUX('C', 11, AF12)>, <STM32_PINMUX('D', 2, AF12)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins3{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('C', 12, AF12)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <2>;
		};

		pins4{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('E', 4, AF8)>;
			bias-pull-up;
		};
	};

	sdmmc1_opendrain_pins_mx:sdmmc1_opendrain_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 9, AF11)>, <STM32_PINMUX('C', 7, AF8)>, <STM32_PINMUX('F', 2, AF11)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('C', 8, AF12)>, <STM32_PINMUX('C', 9, AF12)>, <STM32_PINMUX('C', 10, AF12)>, <STM32_PINMUX('C', 11, AF12)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins3{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('C', 12, AF12)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <2>;
		};

		pins4{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('D', 2, AF12)>;
			bias-disable;
			drive-open-drain;
			slew-rate = <1>;
		};

		pins5{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('E', 4, AF8)>;
			bias-pull-up;
		};
	};

	sdmmc1_sleep_pins_mx:sdmmc1_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 9, ANALOG)>, <STM32_PINMUX('C', 7, ANALOG)>, <STM32_PINMUX('C', 8, ANALOG)>, <STM32_PINMUX('C', 9, ANALOG)>, <STM32_PINMUX('C', 10, ANALOG)>, <STM32_PINMUX('C', 11, ANALOG)>, <STM32_PINMUX('C', 12, ANALOG)>, <STM32_PINMUX('D', 2, ANALOG)>, <STM32_PINMUX('E', 4, ANALOG)>, <STM32_PINMUX('F', 2, ANALOG)>;
		};
	};

	sdmmc2_pins_mx:sdmmc2_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('A', 8, AF9)>, <STM32_PINMUX('A', 9, AF10)>, <STM32_PINMUX('B', 3, AF9)>, <STM32_PINMUX('B', 4, AF9)>, <STM32_PINMUX('B', 14, AF9)>, <STM32_PINMUX('B', 15, AF9)>, <STM32_PINMUX('D', 3, AF9)>, <STM32_PINMUX('E', 5, AF9)>, <STM32_PINMUX('G', 6, AF10)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('E', 3, AF9)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <2>;
		};
	};

	sdmmc2_opendrain_pins_mx:sdmmc2_opendrain_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('A', 8, AF9)>, <STM32_PINMUX('A', 9, AF10)>, <STM32_PINMUX('B', 3, AF9)>, <STM32_PINMUX('B', 4, AF9)>, <STM32_PINMUX('B', 14, AF9)>, <STM32_PINMUX('B', 15, AF9)>, <STM32_PINMUX('D', 3, AF9)>, <STM32_PINMUX('E', 5, AF9)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <1>;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('E', 3, AF9)>;
			bias-pull-up;
			drive-push-pull;
			slew-rate = <2>;
		};

		pins3{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('G', 6, AF10)>;
			bias-pull-up;
			drive-open-drain;
			slew-rate = <1>;
		};
	};

	sdmmc2_sleep_pins_mx:sdmmc2_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('A', 8, ANALOG)>, <STM32_PINMUX('A', 9, ANALOG)>, <STM32_PINMUX('B', 3, ANALOG)>, <STM32_PINMUX('B', 4, ANALOG)>, <STM32_PINMUX('B', 14, ANALOG)>, <STM32_PINMUX('B', 15, ANALOG)>, <STM32_PINMUX('D', 3, ANALOG)>, <STM32_PINMUX('E', 3, ANALOG)>, <STM32_PINMUX('E', 5, ANALOG)>, <STM32_PINMUX('G', 6, ANALOG)>;
		};
	};

	spdifrx_pins_mx:spdifrx_mx-0{

		pins{
			pinmux = <STM32_PINMUX('G', 12, AF8)>;
			bias-disable;
		};
	};

	spdifrx_sleep_pins_mx:spdifrx_sleep_mx-0{

		pins{
			pinmux = <STM32_PINMUX('G', 12, ANALOG)>;
		};
	};

	uart4_pins_mx:uart4_mx-0{
		u-boot,dm-pre-reloc;

		pins1{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 2, AF8)>;
			bias-disable;
		};

		pins2{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('G', 11, AF6)>;
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};

	uart4_sleep_pins_mx:uart4_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('B', 2, ANALOG)>, <STM32_PINMUX('G', 11, ANALOG)>;
		};
	};

	usb_otg_hs_pins_mx:usb_otg_hs_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('A', 10, ANALOG)>;
		};
	};

	usb_otg_hs_sleep_pins_mx:usb_otg_hs_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('A', 10, ANALOG)>;
		};
	};
};

&pinctrl_z{
	u-boot,dm-pre-reloc;

	i2c4_pins_z_mx:i2c4_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('Z', 4, AF6)>, <STM32_PINMUX('Z', 5, AF6)>;
			bias-disable;
			drive-open-drain;
			slew-rate = <0>;
		};
	};

	i2c4_sleep_pins_z_mx:i2c4_sleep_mx-0{
		u-boot,dm-pre-reloc;

		pins{
			u-boot,dm-pre-reloc;
			pinmux = <STM32_PINMUX('Z', 4, ANALOG)>, <STM32_PINMUX('Z', 5, ANALOG)>;
		};
	};
};

&m4_rproc{
	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
	mbox-names = "vq0", "vq1", "shutdown";
	status = "okay";

	/* USER CODE BEGIN m4_rproc */
	memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>;
	interrupt-parent = <&exti>;
	interrupts = <68 1>;
	wakeup-source;
	/* USER CODE END m4_rproc */
};

&bsec{
	status = "okay";
};

&cec{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&hdmi_cec_pins_mx>;
	pinctrl-1 = <&hdmi_cec_sleep_pins_mx>;
	status = "okay";
};

&crc1{
	status = "okay";
};

&dcmi{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&dcmi_pins_mx>;
	pinctrl-1 = <&dcmi_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN dcmi */

	port{

		dcmi_0:endpoint{
			remote-endpoint = <&ov5640_0>;
			bus-width = <8>;
			hsync-active = <0>;
			vsync-active = <0>;
			pclk-sample = <1>;
			pclk-max-frequency = <77000000>;
		};
	};
	/* USER CODE END dcmi */
};

&dfsdm{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&dfsdm_pins_mx>;
	pinctrl-1 = <&dfsdm_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN dfsdm */
	spi-max-frequency = <2048000>;
	clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
	clock-names = "dfsdm", "audio";

	dfsdm0:filter@0{
		compatible = "st,stm32-dfsdm-dmic";
		st,adc-channels = <3>;
		st,adc-channel-names = "dmic_u1";
		st,adc-channel-types = "SPI_R";
		st,adc-channel-clk-src = "CLKOUT";
		st,filter-order = <3>;
		status = "okay";

		asoc_pdm0:dfsdm-dai{
			compatible = "st,stm32h7-dfsdm-dai";
			#sound-dai-cells = <0>;
			io-channels = <&dfsdm0 0>;
			status = "okay";

			dfsdm0_port:port{

				dfsdm_endpoint0:endpoint{
					remote-endpoint = <&dmic0_endpoint>;
				};
			};
		};
	};

	dfsdm1:filter@1{
		compatible = "st,stm32-dfsdm-dmic";
		st,adc-channels = <0>;
		st,adc-channel-names = "dmic_u2";
		st,adc-channel-types = "SPI_F";
		st,adc-channel-clk-src = "CLKOUT";
		st,filter-order = <3>;
		st,adc-alt-channel = <1>;
		status = "okay";

		asoc_pdm1:dfsdm-dai{
			compatible = "st,stm32h7-dfsdm-dai";
			#sound-dai-cells = <0>;
			io-channels = <&dfsdm1 0>;
			status = "okay";

			dfsdm1_port:port{

				dfsdm_endpoint1:endpoint{
					remote-endpoint = <&dmic1_endpoint>;
				};
			};
		};
	};

	dfsdm2:filter@2{
		compatible = "st,stm32-dfsdm-dmic";
		st,adc-channels = <2>;
		st,adc-channel-names = "dmic_u3";
		st,adc-channel-types = "SPI_F";
		st,adc-channel-clk-src = "CLKOUT";
		st,adc-alt-channel = <1>;
		st,filter-order = <3>;
		status = "okay";

		asoc_pdm2:dfsdm-dai{
			compatible = "st,stm32h7-dfsdm-dai";
			#sound-dai-cells = <0>;
			io-channels = <&dfsdm2 0>;
			status = "okay";

			dfsdm2_port:port{

				dfsdm_endpoint2:endpoint{
					remote-endpoint = <&dmic2_endpoint>;
				};
			};
		};
	};

	dfsdm3:filter@3{
		compatible = "st,stm32-dfsdm-dmic";
		st,adc-channels = <1>;
		st,adc-channel-names = "dmic_u4";
		st,adc-channel-types = "SPI_R";
		st,adc-channel-clk-src = "CLKOUT";
		st,filter-order = <3>;
		status = "okay";

		asoc_pdm3:dfsdm-dai{
			compatible = "st,stm32h7-dfsdm-dai";
			#sound-dai-cells = <0>;
			io-channels = <&dfsdm3 0>;
			status = "okay";

			dfsdm3_port:port{

				dfsdm_endpoint3:endpoint{
					remote-endpoint = <&dmic3_endpoint>;
				};
			};
		};
	};
	/* USER CODE END dfsdm */
};

&dma1{
	status = "okay";

	/* USER CODE BEGIN dma1 */
	sram = <&dma_pool>;
	/* USER CODE END dma1 */
};

&dma2{
	status = "okay";

	/* USER CODE BEGIN dma2 */
	sram = <&dma_pool>;
	/* USER CODE END dma2 */
};

&dmamux1{
	dma-masters = <&dma1 &dma2>;
	dma-channels = <16>;
	status = "okay";
};

&dsi{
	status = "okay";

	/* USER CODE BEGIN dsi */
	#address-cells = <1>;
	#size-cells = <0>;

	ports{
		#address-cells = <1>;
		#size-cells = <0>;

		port@0{
			reg = <0>;

			dsi_in:endpoint{
				remote-endpoint = <&ltdc_ep0_out>;
			};
		};

		port@1{
			reg = <1>;

			dsi_out:endpoint{
				remote-endpoint = <&dsi_panel_in>;
			};
		};
	};

	panel_dsi:panel-dsi@0{
		compatible = "raydium,rm68200";
		reg = <0>;
		reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
		backlight = <&panel_backlight>;
		power-supply = <&v3v3>;
		status = "okay";

		port{

			dsi_panel_in:endpoint{
				remote-endpoint = <&dsi_out>;
			};
		};
	};
	/* USER CODE END dsi */
};

&dts{
	status = "okay";
};

&ethernet0{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&eth1_pins_mx>;
	pinctrl-1 = <&eth1_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN ethernet0 */
	phy-mode = "rgmii-id";
	max-speed = <1000>;
	phy-handle = <&phy0>;
	nvmem-cells = <&ethernet_mac_address>;
	nvmem-cell-names = "mac-address";

	mdio0{
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "snps,dwmac-mdio";

		phy0:ethernet-phy@0{
			reg = <0>;
		};
	};
	/* USER CODE END ethernet0 */
};

&fmc{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&fmc_pins_mx>;
	pinctrl-1 = <&fmc_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN fmc */

	nand-controller@4,0{
		status = "okay";

		nand@0{
			reg = <0>;
			nand-on-flash-bbt;
			#address-cells = <1>;
			#size-cells = <1>;
		};
	};
	/* USER CODE END fmc */
};

&gpu{
	status = "okay";

	/* USER CODE BEGIN gpu */
	contiguous-area = <&gpu_reserved>;
	/* USER CODE END gpu */
};

&hash1{
	u-boot,dm-pre-reloc;
	status = "okay";
};

&hsem{
	status = "okay";
};

&i2c2{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c2_pins_mx>;
	pinctrl-1 = <&i2c2_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN i2c2 */
	i2c-scl-rising-time-ns = <185>;
	i2c-scl-falling-time-ns = <20>;
	/delete-property/ dmas;
	/delete-property/ dma-names;

	wm8994:wm8994@1b{
		compatible = "wlf,wm8994";
		#sound-dai-cells = <0>;
		reg = <0x1b>;
		status = "okay";
		gpio-controller;
		#gpio-cells = <2>;
		DBVDD-supply = <&vdd>;
		SPKVDD1-supply = <&vdd>;
		SPKVDD2-supply = <&vdd>;
		AVDD2-supply = <&v1v8>;
		CPVDD-supply = <&v1v8>;
		wlf,ldoena-always-driven;
		clocks = <&sai2a>;
		clock-names = "MCLK1";
		wlf,gpio-cfg = <0x8101 0xa100 0xa100 0xa100 0xa101 0xa101 0xa100 0xa101 0xa101 0xa101 0xa101>;

		ports{
			#address-cells = <1>;
			#size-cells = <0>;

			wm8994_tx_port:port@0{
				reg = <0>;

				wm8994_tx_endpoint:endpoint{
					remote-endpoint = <&sai2a_endpoint>;
				};
			};

			wm8994_rx_port:port@1{
				reg = <1>;

				wm8994_rx_endpoint:endpoint{
					remote-endpoint = <&sai2b_endpoint>;
				};
			};
		};
	};

	ov5640:camera@3c{
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		clock-names = "xclk";
		DOVDD-supply = <&v2v8>;
		powerdown-gpios = <&stmfx_pinctrl 18 (GPIO_ACTIVE_HIGH | GPIO_PUSH_PULL)>;
		reset-gpios = <&stmfx_pinctrl 19 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		rotation = <180>;
		status = "okay";

		port{

			ov5640_0:endpoint{
				remote-endpoint = <&dcmi_0>;
				bus-width = <8>;
				data-shift = <2>;
				hsync-active = <0>;
				vsync-active = <0>;
				pclk-sample = <1>;
				pclk-max-frequency = <77000000>;
			};
		};
	};

	stmfx:stmfx@42{
		compatible = "st,stmfx-0300";
		reg = <0x42>;
		interrupts = <8 IRQ_TYPE_EDGE_RISING>;
		interrupt-parent = <&gpioi>;
		vdd-supply = <&v3v3>;

		stmfx_pinctrl:stmfx-pin-controller{
			compatible = "st,stmfx-0300-pinctrl";
			gpio-controller;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
			gpio-ranges = <&stmfx_pinctrl 0 0 24>;

			goodix_pins:goodix{
				pins = "gpio14";
				bias-pull-down;
			};

			joystick_pins:joystick{
				pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
				bias-pull-down;
			};
		};
	};

	gt9147:goodix_ts@5d{
		compatible = "goodix,gt9147";
		reg = <0x5d>;
		panel = <&panel_dsi>;
		pinctrl-0 = <&goodix_pins>;
		pinctrl-names = "default";
		status = "okay";
		interrupts = <14 IRQ_TYPE_EDGE_RISING>;
		interrupt-parent = <&stmfx_pinctrl>;
	};
	/* USER CODE END i2c2 */
};

&i2c4{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c4_pins_z_mx>;
	pinctrl-1 = <&i2c4_sleep_pins_z_mx>;
	status = "okay";

	/* USER CODE BEGIN i2c4 */
	i2c-scl-rising-time-ns = <185>;
	i2c-scl-falling-time-ns = <20>;
	clock-frequency = <400000>;
	/delete-property/ dmas;
	/delete-property/ dma-names;

	pmic:stpmic@33{
		compatible = "st,stpmic1";
		reg = <0x33>;
		interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
		interrupt-controller;
		#interrupt-cells = <2>;
		status = "okay";

		regulators{
			compatible = "st,stpmic1-regulators";
			buck1-supply = <&vin>;
			buck2-supply = <&vin>;
			buck3-supply = <&vin>;
			buck4-supply = <&vin>;
			ldo1-supply = <&v3v3>;
			ldo2-supply = <&v3v3>;
			ldo3-supply = <&vdd_ddr>;
			ldo4-supply = <&vin>;
			ldo5-supply = <&v3v3>;
			ldo6-supply = <&v3v3>;
			vref_ddr-supply = <&vin>;
			boost-supply = <&vin>;
			pwr_sw1-supply = <&bst_out>;
			pwr_sw2-supply = <&bst_out>;

			vddcore:buck1{
				regulator-name = "vddcore";
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-initial-mode = <0>;
				regulator-over-current-protection;
			};

			vdd_ddr:buck2{
				regulator-name = "vdd_ddr";
				regulator-min-microvolt = <1350000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-initial-mode = <0>;
				regulator-over-current-protection;
			};

			vdd:buck3{
				regulator-name = "vdd";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
				st,mask-reset;
				regulator-initial-mode = <0>;
				regulator-over-current-protection;
			};

			v3v3:buck4{
				regulator-name = "v3v3";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
				regulator-over-current-protection;
				regulator-initial-mode = <0>;
			};

			vdda:ldo1{
				regulator-name = "vdda";
				regulator-min-microvolt = <2900000>;
				regulator-max-microvolt = <2900000>;
				interrupts = <IT_CURLIM_LDO1 0>;
			};

			v2v8:ldo2{
				regulator-name = "v2v8";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
				interrupts = <IT_CURLIM_LDO2 0>;
			};

			vtt_ddr:ldo3{
				regulator-name = "vtt_ddr";
				regulator-min-microvolt = <500000>;
				regulator-max-microvolt = <750000>;
				regulator-always-on;
				regulator-over-current-protection;
			};

			vdd_usb:ldo4{
				regulator-name = "vdd_usb";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				interrupts = <IT_CURLIM_LDO4 0>;
				regulator-always-on;
			};

			vdd_sd:ldo5{
				regulator-name = "vdd_sd";
				regulator-min-microvolt = <2900000>;
				regulator-max-microvolt = <2900000>;
				interrupts = <IT_CURLIM_LDO5 0>;
				regulator-boot-on;
			};

			v1v8:ldo6{
				regulator-name = "v1v8";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				interrupts = <IT_CURLIM_LDO6 0>;
				regulator-enable-ramp-delay = <300000>;
			};

			vref_ddr:vref_ddr{
				regulator-name = "vref_ddr";
				regulator-always-on;
				regulator-over-current-protection;
			};

			bst_out:boost{
				regulator-name = "bst_out";
				interrupts = <IT_OCP_BOOST 0>;
			};

			vbus_otg:pwr_sw1{
				regulator-name = "vbus_otg";
				interrupts = <IT_OCP_OTG 0>;
			};

			vbus_sw:pwr_sw2{
				regulator-name = "vbus_sw";
				interrupts = <IT_OCP_SWOUT 0>;
				regulator-active-discharge = <1>;
			};
		};

		onkey{
			compatible = "st,stpmic1-onkey";
			interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
			interrupt-names = "onkey-falling", "onkey-rising";
			power-off-time-sec = <10>;
			status = "okay";
		};

		watchdog{
			compatible = "st,stpmic1-wdt";
			status = "disabled";
		};
	};
	/* USER CODE END i2c4 */
};

&i2c5{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c5_pins_mx>;
	pinctrl-1 = <&i2c5_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN i2c5 */
	i2c-scl-rising-time-ns = <185>;
	i2c-scl-falling-time-ns = <20>;
	/delete-property/ dmas;
	/delete-property/ dma-names;
	/* USER CODE END i2c5 */
};

&ipcc{
	status = "okay";
};

&iwdg2{
	status = "okay";

	/* USER CODE BEGIN iwdg2 */
	timeout-sec = <32>;
	/* USER CODE END iwdg2 */
};

&ltdc{
	status = "okay";

	/* USER CODE BEGIN ltdc */

	port{
		#address-cells = <1>;
		#size-cells = <0>;

		ltdc_ep0_out:endpoint@0{
			reg = <0>;
			remote-endpoint = <&dsi_in>;
		};
	};
	/* USER CODE END ltdc */
};

&m_can1{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&fdcan1_pins_mx>;
	pinctrl-1 = <&fdcan1_sleep_pins_mx>;
	status = "okay";
};

&mdma1{
	status = "okay";
};

&pwr_regulators{
	status = "okay";

	/* USER CODE BEGIN pwr_regulators */
	vdd-supply = <&vdd>;
	vdd_3v3_usbfs-supply = <&vdd_usb>;
	/* USER CODE END pwr_regulators */
};

&qspi{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&quadspi_pins_mx>;
	pinctrl-1 = <&quadspi_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN qspi */
	reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
	#address-cells = <1>;
	#size-cells = <0>;

	flash0:mx66l51235l@0{
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-rx-bus-width = <4>;
		spi-max-frequency = <108000000>;
		#address-cells = <1>;
		#size-cells = <1>;
	};

	flash1:mx66l51235l@1{
		compatible = "jedec,spi-nor";
		reg = <1>;
		spi-rx-bus-width = <4>;
		spi-max-frequency = <108000000>;
		#address-cells = <1>;
		#size-cells = <1>;
	};
	/* USER CODE END qspi */
};

&rcc{
	u-boot,dm-pre-reloc;
	status = "okay";
};

&rng1{
	status = "okay";
};

&rtc{
	status = "okay";
};

&sai2{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sai2a_pins_mx>, <&sai2b_pins_mx>;
	pinctrl-1 = <&sai2a_sleep_pins_mx>, <&sai2b_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sai2 */
	clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
	clock-names = "pclk", "x8k", "x11k";
	/* USER CODE END sai2 */

	sai2a:audio-controller@4400b004{
		status = "okay";

		/* USER CODE BEGIN sai2a */
		#clock-cells = <0>;
		dma-names = "tx";
		clocks = <&rcc SAI2_K>;
		clock-names = "sai_ck";

		sai2a_port:port{

			sai2a_endpoint:endpoint{
				remote-endpoint = <&wm8994_tx_endpoint>;
				format = "i2s";
				mclk-fs = <256>;
			};
		};
		/* USER CODE END sai2a */
	};

	sai2b:audio-controller@4400b024{
		status = "okay";

		/* USER CODE BEGIN sai2b */
		dma-names = "rx";
		clocks = <&rcc SAI2_K>, <&sai2a>;
		clock-names = "sai_ck", "MCLK";

		sai2b_port:port{

			sai2b_endpoint:endpoint{
				remote-endpoint = <&wm8994_rx_endpoint>;
				format = "i2s";
				mclk-fs = <256>;
			};
		};
		/* USER CODE END sai2b */
	};
};

&sai4{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sai4a_pins_mx>;
	pinctrl-1 = <&sai4a_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sai4 */
	clocks = <&rcc SAI4>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
	clock-names = "pclk", "x8k", "x11k";
	/* USER CODE END sai4 */

	sai4a:audio-controller@50027004{
		status = "okay";

		/* USER CODE BEGIN sai4a */
		dma-names = "tx";
		clocks = <&rcc SAI4_K>;
		clock-names = "sai_ck";
		st,iec60958;

		sai4a_port:port{

			sai4a_endpoint:endpoint{
				remote-endpoint = <&spdif_out_endpoint>;
			};
		};
		/* USER CODE END sai4a */
	};
};

&sdmmc1{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc1_pins_mx>;
	pinctrl-1 = <&sdmmc1_opendrain_pins_mx>;
	pinctrl-2 = <&sdmmc1_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sdmmc1 */
	cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
	disable-wp;
	st,sig-dir;
	st,neg-edge;
	st,use-ckin;
	bus-width = <4>;
	vmmc-supply = <&vdd_sd>;
	vqmmc-supply = <&sd_switch>;
	sd-uhs-sdr12;
	sd-uhs-sdr25;
	sd-uhs-sdr50;
	sd-uhs-ddr50;
	sd-uhs-sdr104;
	/* USER CODE END sdmmc1 */
};

&sdmmc2{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc2_pins_mx>;
	pinctrl-1 = <&sdmmc2_opendrain_pins_mx>;
	pinctrl-2 = <&sdmmc2_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sdmmc2 */
	non-removable;
	no-sd;
	no-sdio;
	st,neg-edge;
	bus-width = <8>;
	vmmc-supply = <&v3v3>;
	vqmmc-supply = <&vdd>;
	mmc-ddr-3_3v;
	/* USER CODE END sdmmc2 */
};

&spdifrx{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&spdifrx_pins_mx>;
	pinctrl-1 = <&spdifrx_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN spdifrx */

	spdifrx_port:port{

		spdifrx_endpoint:endpoint{
			remote-endpoint = <&spdif_in_endpoint>;
		};
	};
	/* USER CODE END spdifrx */
};

&tamp{
	status = "okay";
};

&timers6{
	status = "okay";

	/* USER CODE BEGIN timers6 */
	/delete-property/ dmas;
	/delete-property/ dma-names;

	timer@5{
		status = "okay";
	};
	/* USER CODE END timers6 */
};

&uart4{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&uart4_pins_mx>;
	pinctrl-1 = <&uart4_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN uart4 */
	/delete-property/ dmas;
	/delete-property/ dma-names;
	/* USER CODE END uart4 */
};

&usbh_ehci{
	status = "okay";

	/* USER CODE BEGIN usbh_ehci */
	phys = <&usbphyc_port0>;
	/* USER CODE END usbh_ehci */
};

&usbh_ohci{
	status = "okay";
};

&usbotg_hs{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&usb_otg_hs_pins_mx>;
	pinctrl-1 = <&usb_otg_hs_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN usbotg_hs */
	vbus-supply = <&vbus_otg>;
	phys = <&usbphyc_port1 0>;
	phy-names = "usb2-phy";
	/* USER CODE END usbotg_hs */
};

&usbphyc{
	u-boot,dm-pre-reloc;
	status = "okay";
};

&usbphyc_port0{
	u-boot,dm-pre-reloc;
	status = "okay";

	/* USER CODE BEGIN usbphyc_port0 */
	phy-supply = <&vdd_usb>;
	st,phy-tuning = <&usb_phy_tuning>;
	vbus-supply = <&vbus_sw>;
	/* USER CODE END usbphyc_port0 */
};

&usbphyc_port1{
	u-boot,dm-pre-reloc;
	status = "okay";

	/* USER CODE BEGIN usbphyc_port1 */
	phy-supply = <&vdd_usb>;
	st,phy-tuning = <&usb_phy_tuning>;
	/* USER CODE END usbphyc_port1 */
};

/* USER CODE BEGIN addons */

&cpu0{
	cpu-supply = <&vddcore>;
};

&sram{

	dma_pool:dma_pool@0{
		reg = <0x50000 0x10000>;
		pool;
	};
};

&cpu1{
	cpu-supply = <&vddcore>;
};
/* USER CODE END addons */
