// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
/*
 * Copyright (c) 2021, Iskren Chernev <iskren.chernev@gmail.com>
 */

/dts-v1/;

#include "sm4250.dtsi"

/ {
	model = "OnePlus Nord N100";
	compatible = "oneplus,billie2", "qcom,sm4250";

	/* required for bootloader to select correct board */
	qcom,msm-id = <0x1a1 0x10000 0x1bc 0x10000>;
	qcom,board-id = <0x1000b 0x00>;

	aliases {
	};

	chosen {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		stdout-path = "framebuffer0";

		framebuffer0: framebuffer@9d400000 {
			compatible = "simple-framebuffer";
			reg = <0 0x5c000000 0 (1600 * 720 * 4)>;
			width = <720>;
			height = <1600>;
			stride = <(720 * 4)>;
			format = "a8r8g8b8";
		};
	};
};

&reserved_memory {
	bootloader_log_mem: memory@5fff7000 {
		reg = <0x0 0x5fff7000 0x0 0x8000>;
		no-map;
	};

	ramoops@cbe00000 {
		compatible = "ramoops";
		reg = <0x0 0xcbe00000 0x0 0x400000>;
		record-size = <0x40000>;
		pmsg-size = <0x200000>;
		console-size = <0x40000>;
		ftrace-size = <0x40000>;
	};

	param_mem: memory@cc200000 {
		reg = <0x0 0xcc200000 0x0 0x100000>;
		no-map;
	};

	mtp_mem: memory@cc300000 {
		reg = <0x00 0xcc300000 0x00 0xb00000>;
		no-map;
	};
};

&rpm_requests {
	regulators-0 {
		compatible = "qcom,rpm-pm6125-regulators";

		vreg_s6a: s6 {
			regulator-min-microvolt = <320000>;
			regulator-max-microvolt = <1456000>;
		};

		vreg_s7a: s7 {
			regulator-min-microvolt = <1280000>;
			regulator-max-microvolt = <2040000>;
		};

		vreg_s8a: s8 {
			regulator-min-microvolt = <1064000>;
			regulator-max-microvolt = <1304000>;
		};

		vreg_l1a: l1 {
			regulator-min-microvolt = <952000>;
			regulator-max-microvolt = <1152000>;
		};

		vreg_l4a: l4 {
			regulator-min-microvolt = <488000>;
			regulator-max-microvolt = <1000000>;
		};

		vreg_l5a: l5 {
			regulator-min-microvolt = <1648000>;
			regulator-max-microvolt = <3056000>;
		};

		vreg_l6a: l6 {
			regulator-min-microvolt = <576000>;
			regulator-max-microvolt = <656000>;
		};

		vreg_l7a: l7 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1304000>;
		};

		vreg_l8a: l8 {
			regulator-min-microvolt = <400000>;
			regulator-max-microvolt = <728000>;
		};

		vreg_l9a: l9 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2000000>;
		};

		vreg_l10a: l10 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
		};

		vreg_l11a: l11 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1952000>;
		};

		vreg_l12a: l12 {
			regulator-min-microvolt = <1624000>;
			regulator-max-microvolt = <1984000>;
		};

		vreg_l13a: l13 {
			regulator-min-microvolt = <1504000>;
			regulator-max-microvolt = <1952000>;
		};

		vreg_l14a: l14 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
		};

		vreg_l15a: l15 {
			regulator-min-microvolt = <2920000>;
			regulator-max-microvolt = <3232000>;
		};

		vreg_l16a: l16 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
		};

		vreg_l17a: l17 {
			regulator-min-microvolt = <1152000>;
			regulator-max-microvolt = <1304000>;
		};

		vreg_l18a: l18 {
			regulator-min-microvolt = <1104000>;
			regulator-max-microvolt = <1304000>;
		};

		vreg_l19a: l19 {
			regulator-min-microvolt = <1624000>;
			regulator-max-microvolt = <3304000>;
		};

		vreg_l20a: l20 {
			regulator-min-microvolt = <1624000>;
			regulator-max-microvolt = <3304000>;
		};

		vreg_l21a: l21 {
			regulator-min-microvolt = <2400000>;
			regulator-max-microvolt = <3544000>;
		};

		vreg_l22a: l22 {
			regulator-min-microvolt = <2952000>;
			regulator-max-microvolt = <3304000>;
		};

		vreg_l23a: l23 {
			regulator-min-microvolt = <3296000>;
			regulator-max-microvolt = <3304000>;
		};

		vreg_l24a: l24 {
			regulator-min-microvolt = <2704000>;
			regulator-max-microvolt = <3544000>;
		};
	};
};

&sleep_clk {
	clock-frequency = <32764>;
};

&sdhc_2 {
	vmmc-supply = <&vreg_l22a>;
	vqmmc-supply = <&vreg_l5a>;

	cd-gpios = <&tlmm 88 GPIO_ACTIVE_HIGH>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_state_on &sdc2_card_det_n>;
	pinctrl-1 = <&sdc2_state_off &sdc2_card_det_n>;

	status = "okay";
};

&tlmm {
	gpio-reserved-ranges = <14 4>;

	sdc2_card_det_n: sd-card-det-n-state {
		pins = "gpio88";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-up;
	};
};

&ufs_mem_hc {
	vcc-supply = <&vreg_l24a>;
	vcc-max-microamp = <600000>;
	vccq2-supply = <&vreg_l11a>;
	vccq2-max-microamp = <600000>;
	vdd-hba-supply = <&vreg_l18a>;
	status = "okay";
};

&ufs_mem_phy {
	vdda-phy-supply = <&vreg_l4a>;
	vdda-pll-supply = <&vreg_l12a>;
	status = "okay";
};

&usb {
	status = "okay";
};

&usb_dwc3 {
	maximum-speed = "high-speed";
	dr_mode = "peripheral";

	phys = <&usb_hsphy>;
	phy-names = "usb2-phy";
};

&usb_hsphy {
	vdd-supply = <&vreg_l4a>;
	vdda-pll-supply = <&vreg_l12a>;
	vdda-phy-dpdm-supply = <&vreg_l15a>;
	status = "okay";
};

&xo_board {
	clock-frequency = <19200000>;
};
