// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright (C) 2021 MediaTek Inc.
 * Author: Frank Wunderlich <frank-w@public-files.de>
 */

/dts-v1/;
/plugin/;

/ {
	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";

	fragment@0 {
		target-path = "/soc/mmc@11230000";
		__overlay__ {
			pinctrl-names = "default", "state_uhs";
			pinctrl-0 = <&mmc0_pins_emmc_51>;
			pinctrl-1 = <&mmc0_pins_emmc_51>;
			bus-width = <8>;
			max-frequency = <200000000>;
			cap-mmc-highspeed;
			mmc-hs200-1_8v;
			mmc-hs400-1_8v;
			hs400-ds-delay = <0x12814>;
			vqmmc-supply = <&reg_1p8v>;
			vmmc-supply = <&reg_3p3v>;
			non-removable;
			no-sd;
			no-sdio;
			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-layout";
							};
						};
						emmc_rootfs: block-partition-production {
							partname = "production";
						};
					};
				};
			};
		};
	};

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