// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Device Tree Source for IFM PDM360NG.
 *
 * Copyright 2009 - 2010 DENX Software Engineering.
 * Anatolij Gustschin <agust@denx.de>
 *
 * Based on MPC5121E ADS dts.
 * Copyright 2008 Freescale Semiconductor Inc.
 */

#include "mpc5121.dtsi"

/ {
	model = "pdm360ng";
	compatible = "ifm,pdm360ng", "fsl,mpc5121";
	#address-cells = <1>;
	#size-cells = <1>;
	interrupt-parent = <&ipic>;

	memory {
		device_type = "memory";
		reg = <0x00000000 0x20000000>;	// 512MB at 0
	};

	nfc@40000000 {
		bank-width = <0x1>;
		chips = <0x1>;

		partition@0 {
			label = "nand0";
			reg = <0x0 0x40000000>;
		};
	};

	localbus@80000020 {
		ranges = <0x0 0x0 0xf0000000 0x10000000   /* Flash */
			  0x2 0x0 0x50040000 0x00020000>; /* CS2: MRAM */

		flash@0,0 {
			compatible = "amd,s29gl01gp", "cfi-flash";
			reg = <0 0x00000000 0x08000000
			       0 0x08000000 0x08000000>;
			#address-cells = <1>;
			#size-cells = <1>;
			bank-width = <4>;
			device-width = <2>;

			partition@0 {
				label = "u-boot";
				reg = <0x00000000 0x00080000>;
				read-only;
			};
			partition@80000 {
				label = "environment";
				reg = <0x00080000 0x00080000>;
				read-only;
			};
			partition@100000 {
				label = "splash-image";
				reg = <0x00100000 0x00080000>;
				read-only;
			};
			partition@180000 {
				label = "device-tree";
				reg = <0x00180000 0x00040000>;
			};
			partition@1c0000 {
				label = "kernel";
				reg = <0x001c0000 0x00500000>;
			};
			partition@6c0000 {
				label = "filesystem";
				reg = <0x006c0000 0x07940000>;
			};
		};

		mram0@2,0 {
			compatible = "mtd-ram";
			reg = <2 0x00000 0x10000>;
			bank-width = <2>;
		};

		mram1@2,10000 {
			compatible = "mtd-ram";
			reg = <2 0x010000 0x10000>;
			bank-width = <2>;
		};
	};

	soc@80000000 {

		i2c@1700 {
			fsl,preserve-clocking;

			eeprom@50 {
				compatible = "atmel,24c01";
				reg = <0x50>;
			};

			rtc@68 {
				compatible = "st,m41t00";
				reg = <0x68>;
			};
		};

		i2c@1720 {
			status = "disabled";
		};

		i2c@1740 {
			fsl,preserve-clocking;
		};

		ethernet@2800 {
			phy-handle = <&phy0>;
		};

		mdio@2800 {
			phy0: ethernet-phy@1f {
				compatible = "smsc,lan8700";
				reg = <0x1f>;
			};
		};

		/* USB1 using external ULPI PHY */
		usb@3000 {
			dr_mode = "host";
		};

		/* USB0 using internal UTMI PHY */
		usb@4000 {
			fsl,invert-pwr-fault;
		};

		psc@11000 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11100 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11200 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11300 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11400 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11500 {
			status = "disabled";
		};

		psc@11600 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11700 {
			status = "disabled";
		};

		psc@11800 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};

		psc@11900 {
			compatible = "fsl,mpc5121-psc-spi", "fsl,mpc5121-psc";
			#address-cells = <1>;
			#size-cells = <0>;

			/* ADS7845 touch screen controller */
			ts@0 {
				compatible = "ti,ads7846";
				reg = <0x0>;
				spi-max-frequency = <3000000>;
				/* pen irq is GPIO25 */
				interrupts = <78 0x8>;
			};
		};

		psc@11a00 {
			status = "disabled";
		};

		psc@11b00 {
			compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
		};
	};
};