// SPDX-License-Identifier: GPL-2.0-or-later
/*

 * Copyright (C) 2012 Marek Vasut <marex@denx.de>
 */

/dts-v1/;
#include "imx28-m28.dtsi"

/ {
	model = "Aries/DENX M28EVK";
	compatible = "aries,m28evk", "denx,m28evk", "fsl,imx28";

	backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm 4 5000000>;
		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <6>;
	};

	reg_vddio_sd0: regulator-1 {
		compatible = "regulator-fixed";
		regulator-name = "vddio-sd0";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 28 0>;
	};

	reg_usb0_vbus: regulator-2 {
		compatible = "regulator-fixed";
		regulator-name = "usb0_vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio3 12 0>;
	};

	reg_usb1_vbus: regulator-3 {
		compatible = "regulator-fixed";
		regulator-name = "usb1_vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio3 13 0>;
	};

	sound {
		compatible = "denx,m28evk-sgtl5000",
			     "fsl,mxs-audio-sgtl5000";
		model = "m28evk-sgtl5000";
		saif-controllers = <&saif0 &saif1>;
		audio-codec = <&sgtl5000>;
	};
};

&auart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&auart0_pins_a>;
	status = "okay";
};

&auart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&auart1_pins_a>;
	status = "okay";
};

&auart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&auart2_2pins_b>;
	status = "okay";
};

&duart {
	pinctrl-names = "default";
	pinctrl-0 = <&duart_pins_a>;
	status = "okay";
};

&i2c0 {
	sgtl5000: codec@a {
		compatible = "fsl,sgtl5000";
		reg = <0x0a>;
		#sound-dai-cells = <0>;
		VDDA-supply = <&reg_3p3v>;
		VDDIO-supply = <&reg_3p3v>;
		clocks = <&saif0>;
	};

	eeprom: eeprom@51 {
		compatible = "atmel,24c128";
		reg = <0x51>;
		pagesize = <32>;
	};
};

&lcdif {
	pinctrl-names = "default";
	pinctrl-0 = <&lcdif_24bit_pins_a
		     &lcdif_pins_m28>;
	display = <&display0>;
	status = "okay";

	display0: display0 {
		bits-per-pixel = <16>;
		bus-width = <18>;

		display-timings {
			native-mode = <&timing0>;
			timing0: timing0 {
				clock-frequency = <33260000>;
				hactive = <800>;
				vactive = <480>;
				hback-porch = <0>;
				hfront-porch = <256>;
				vback-porch = <0>;
				vfront-porch = <45>;
				hsync-len = <1>;
				vsync-len = <1>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <1>;
				pixelclk-active = <1>;
			};
		};
	};
};

&lradc {
	status = "okay";
	fsl,lradc-touchscreen-wires = <4>;
};

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

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

&mac0 {
	phy-mode = "rmii";
	pinctrl-names = "default";
	pinctrl-0 = <&mac0_pins_a>;
	clocks = <&clks 57>, <&clks 57>;
	clock-names = "ipg", "ahb";
	status = "okay";
};

&mac1 {
	phy-mode = "rmii";
	pinctrl-names = "default";
	pinctrl-0 = <&mac1_pins_a>;
	status = "okay";
};

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

	hog_pins_a: hog@0 {
		reg = <0>;
		fsl,pinmux-ids = <
			MX28_PAD_PWM3__GPIO_3_28
			MX28_PAD_AUART2_CTS__GPIO_3_10
			MX28_PAD_AUART2_RTS__GPIO_3_11
			MX28_PAD_AUART3_RX__GPIO_3_12
			MX28_PAD_AUART3_TX__GPIO_3_13
		>;
		fsl,drive-strength = <MXS_DRIVE_4mA>;
		fsl,voltage = <MXS_VOLTAGE_HIGH>;
		fsl,pull-up = <MXS_PULL_DISABLE>;
	};

	lcdif_pins_m28: lcdif-m28@0 {
		reg = <0>;
		fsl,pinmux-ids = <
			MX28_PAD_LCD_DOTCLK__LCD_DOTCLK
			MX28_PAD_LCD_ENABLE__LCD_ENABLE
		>;
		fsl,drive-strength = <MXS_DRIVE_4mA>;
		fsl,voltage = <MXS_VOLTAGE_HIGH>;
		fsl,pull-up = <MXS_PULL_DISABLE>;
	};
};

&pwm {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm4_pins_a>;
	status = "okay";
};

&saif0 {
	pinctrl-names = "default";
	pinctrl-0 = <&saif0_pins_a>;
	status = "okay";
};

&saif1 {
	pinctrl-names = "default";
	pinctrl-0 = <&saif1_pins_a>;
	fsl,saif-master = <&saif0>;
	status = "okay";
};

&ssp0 {
	compatible = "fsl,imx28-mmc";
	pinctrl-names = "default";
	pinctrl-0 = <&mmc0_8bit_pins_a
		     &mmc0_cd_cfg
		     &mmc0_sck_cfg>;
	bus-width = <8>;
	wp-gpios = <&gpio3 10 0>;
	vmmc-supply = <&reg_vddio_sd0>;
	status = "okay";
};

&ssp2 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "fsl,imx28-spi";
	pinctrl-names = "default";
	pinctrl-0 = <&spi2_pins_a>;
	status = "okay";

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

&usb0 {
	vbus-supply = <&reg_usb0_vbus>;
	pinctrl-names = "default";
	pinctrl-0 = <&usb0_pins_a>;
	status = "okay";
};

&usb1 {
	vbus-supply = <&reg_usb1_vbus>;
	pinctrl-names = "default";
	pinctrl-0 = <&usb1_pins_a>;
	status = "okay";
};

&usbphy0 {
	status = "okay";
};

&usbphy1 {
	status = "okay";
};
