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

#include "mt7628an_teltonika_rut9xx.dtsi"

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

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

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x20000>;
				read-only;
			};

			partition@20000 {
				label = "config";
				reg = <0x020000 0x010000>;
				read-only;

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

					macaddr_config_0: macaddr@0 {
						reg = <0x0 0x6>;
						compatible = "mac-base";
						#nvmem-cell-cells = <1>;
					};
				};
			};

			partition@30000 {
				label = "factory";
				reg = <0x030000 0x030000>;
				read-only;

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

					eeprom_factory_0: eeprom@0 {
						reg = <0x20000 0x400>;
					};
				};
			};

			partition@60000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x060000 0xf10000>;
			};

			partition@f70000 {
				label = "event-log";
				reg = <0xf70000 0x90000>;
			};
		};
	};
};
