// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "ipq8071-edgecore.dtsi"

/ {
	model = "Edgecore EAP102";
	compatible = "edgecore,eap102", "qcom,ipq8074";

	leds {
		compatible = "gpio-leds";

		led_poe: led-poe {
			label = "poe:status";
			gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;
		};

		led_pw: led-pw {
			label = "pw:status";
			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
		};
	};
};

&blsp1_spi1 {
	status = "okay";

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

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

			partition@0 {
				label = "0:sbl1";
				reg = <0x0 0x50000>;
				read-only;
			};

			partition@50000 {
				label = "0:mibib";
				reg = <0x50000 0x10000>;
				read-only;
			};

			partition@60000 {
				label = "0:bootconfig";
				reg = <0x60000 0x20000>;
				read-only;
			};

			partition@80000 {
				label = "0:bootconfig1";
				reg = <0x80000 0x20000>;
				read-only;
			};

			partition@a0000 {
				label = "0:qsee";
				reg = <0xa0000 0x180000>;
				read-only;
			};

			partition@220000 {
				label = "0:qsee_1";
				reg = <0x220000 0x180000>;
				read-only;
			};

			partition@3a0000 {
				label = "0:devcfg";
				reg = <0x3a0000 0x10000>;
				read-only;
			};

			partition@3b0000 {
				label = "0:devcfg_1";
				reg = <0x3b0000 0x10000>;
				read-only;
			};

			partition@3c0000 {
				label = "0:apdp";
				reg = <0x3c0000 0x10000>;
				read-only;
			};

			partition@3d0000 {
				label = "0:apdp_1";
				reg = <0x3d0000 0x10000>;
				read-only;
			};

			partition@3e0000 {
				label = "0:rpm";
				reg = <0x3e0000 0x40000>;
				read-only;
			};

			partition@420000 {
				label = "0:rpm_1";
				reg = <0x420000 0x40000>;
				read-only;
			};

			partition@460000 {
				label = "0:cdt";
				reg = <0x460000 0x10000>;
				read-only;
			};

			partition@470000 {
				label = "0:cdt_1";
				reg = <0x470000 0x10000>;
				read-only;
			};

			partition@480000 {
				label = "0:appsblenv";
				reg = <0x480000 0x10000>;
			};

			partition@490000 {
				label = "0:appsbl";
				reg = <0x490000 0xc0000>;
				read-only;
			};

			partition@550000 {
				label = "0:appsbl_1";
				reg = <0x530000 0xc0000>;
				read-only;
			};

			partition@610000 {
				label = "0:art";
				reg = <0x610000 0x40000>;
				read-only;
			};

			partition@650000 {
				label = "0:ethphyfw";
				reg = <0x650000 0x80000>;
				read-only;
			};

			partition@6d0000 {
				label = "0:product_info";
				reg = <0x6d0000 0x80000>;
				read-only;
			};

			partition@750000 {
				label = "priv_data1";
				reg = <0x750000 0x10000>;
				read-only;
			};

			partition@760000 {
				label = "priv_data2";
				reg = <0x760000 0x10000>;
				read-only;
			};
		};
	};
};

&qpic_nand {
	status = "okay";

	nand@0 {
		reg = <0>;
		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;

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

			partition@0 {
				label = "rootfs1";
				reg = <0x0000000 0x3400000>;
			};

			partition@3400000 {
				label = "0:wififw";
				reg = <0x3400000 0x800000>;
				read-only;
			};

			partition@3c00000 {
				label = "rootfs2";
				reg = <0x3c00000 0x3400000>;
			};

			partition@7000000 {
				label = "0:wififw_1";
				reg = <0x7000000 0x800000>;
				read-only;
			};
		};
	};
};

&dp5 {
	status = "okay";
	phy-handle = <&qca8081_24>;
	label = "lan";
};

&dp6 {
	status = "okay";
	phy-handle = <&qca8081_28>;
	label = "wan";
};

&wifi {
	status = "okay";
	qcom,ath11k-fw-memory-mode = <1>;
	qcom,ath11k-calibration-variant = "Edgecore-EAP102";
};
