// SPDX-License-Identifier: (GPL-2.0-or-later OR X11)
/*
 * Copyright 2013-2014 Freescale Semiconductor, Inc.
 * Copyright 2018-2023 TQ-Systems GmbH <linux@ew.tq-group.com>,
 * D-82229 Seefeld, Germany.
 * Author: Alexander Stein
 */

#include "ls1021a.dtsi"

/ {
	model = "TQMLS102xA SOM";
	compatible = "tq,ls1021a-tqmls1021a", "fsl,ls1021a";

	reg_3p3v_som: regulator-3p3v-som {
		compatible = "regulator-fixed";
		regulator-name = "3P3V_SOM";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};
};

&esdhc {
	/* e-MMC over 8 data lines */
	bus-width = <8>;
	status = "okay";
};

&i2c0 {
	status = "okay";

	/* MC34VR500 DC/DC regulator at 0x8, managed by PMIC */
	/* On-board PMC at 0x11 */

	sa56004: temperature-sensor@4c {
		compatible = "nxp,sa56004";
		reg = <0x4c>;
		vcc-supply = <&reg_3p3v_som>;
	};

	rtc0: rtc@51 {
		compatible = "nxp,pcf85063a";
		reg = <0x51>;
		quartz-load-femtofarads = <12500>;
	};

	m24c64_54: eeprom@54 {
		compatible = "atmel,24c64";
		reg = <0x54>;
		pagesize = <32>;
		read-only;
		vcc-supply = <&reg_3p3v_som>;
	};
};

&mdio0 {
	tbi1: tbi-phy@8 {
		reg = <0x8>;
		device_type = "tbi-phy";
	};
};

&qspi {
	status = "okay";

	qflash0: flash@0 {
		compatible = "jedec,spi-nor";
		#address-cells = <1>;
		#size-cells = <1>;
		spi-max-frequency = <20000000>;
		spi-rx-bus-width = <4>;
		spi-tx-bus-width = <4>;
		reg = <0>;

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

			uboot@0 {
				label = "U-Boot-PBL";
				reg = <0x0 0xe0000>;
			};

			env@e0000 {
				label = "U-Boot Environment";
				reg = <0xe0000 0x10000>;
			};

			dtb@f0000 {
				label = "DTB";
				reg = <0xf0000 0x10000>;
			};

			linux@100000 {
				label = "Linux";
				reg = <0x100000 0x700000>;
			};

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