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

/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target-path = "/";
		__overlay__ {
			reg_3p3v: regulator-3p3v {
				compatible = "regulator-fixed";
				regulator-name = "fixed-3.3V";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};

	fragment@1 {
		target-path = "/soc/spi@11007800";
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@2 {
		target-path = "/soc/mmc@11230000";
		__overlay__ {
			pinctrl-names = "default", "state_uhs";
			pinctrl-0 = <&mmc_pins_default>;
			pinctrl-1 = <&mmc_pins_uhs>;
			bus-width = <8>;
			max-frequency = <48000000>;
			cap-mmc-highspeed;
			vmmc-supply = <&reg_3p3v>;
			non-removable;
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;

			card@0 {
				compatible = "mmc-card";
				reg = <0>;

				block {
					compatible = "block-device";
					partitions {
						block-partition-env {
							partname = "ubootenv";
							nvmem-layout {
								compatible = "u-boot,env";
							};
						};

						block-partition-factory {
							partname = "factory";

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

								eeprom_factory_0: eeprom@0 {
									reg = <0x0 0x1e00>;
								};
							};
						};

						emmc_rootfs: block-partition-production {
							partname = "production";
						};
					};
				};
			};
		};
	};

	fragment@3 {
		target-path = "/chosen";
		__overlay__ {
			rootdisk-emmc = <&emmc_rootfs>;
		};
	};

	fragment@4 {
		target = <&pcie0>;
		__overlay__ {
			slot0: pcie@0,0 {
				reg = <0x0000 0 0 0 0>;
				mt7996@0,0 {
					reg = <0x0000 0 0 0 0>;
					nvmem-cells = <&eeprom_factory_0>;
					nvmem-cell-names = "eeprom";
				};
			};
		};
	};
};

