// SPDX-License-Identifier: (GPL-2.0 OR MIT)

/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target-path = "/soc/spi@11009800";
		__overlay__ {
			pinctrl-names = "default";
			pinctrl-0 = <&spi2_flash_pins>;
			status = "okay";

			flash@0 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "jedec,spi-nor";
				spi-cal-enable;
				spi-cal-mode = "read-data";
				spi-cal-datalen = <7>;
				spi-cal-data = /bits/ 8 <
					0x53 0x46 0x5F 0x42 0x4F 0x4F 0x54>;
				spi-cal-addrlen = <1>;
				spi-cal-addr = /bits/ 32 <0x0>;
				reg = <0>;
				spi-max-frequency = <52000000>;
				spi-tx-bus-width = <4>;
				spi-rx-bus-width = <4>;

				partition@00000 {
					label = "BL2";
					reg = <0x00000 0x0040000>;
				};
				partition@40000 {
					label = "u-boot-env";
					reg = <0x40000 0x0010000>;
				};
				partition@50000 {
					label = "Factory";
					reg = <0x50000 0x0200000>;
				};
				partition@250000 {
					label = "FIP";
					reg = <0x250000 0x0080000>;
				};
				nor_rootdisk: partition@2D0000 {
					label = "firmware";
					reg = <0x2D0000 0x1D30000>;
				};
			};
		};
	};

	fragment@1 {
		target-path = "/chosen";
		__overlay__ {
			rootdisk-nor = <&nor_rootdisk>;
		};
	};
};
