#include <dt-bindings/interconnect/qcom,waipio.h>

&wlan {
	status = "disabled";
};

&bluetooth {
	status = "disabled";
};

&cnss_pins {
	cnss_host_sol_default: cnss_host_sol_default {
		mux {
			pins = "gpio48";
			function = "gpio";
		};

		config {
			pins = "gpio48";
			drive-strength = <4>;
			bias-pull-down;
		};
	};

	cnss_dev_sol_default: cnss_dev_sol_default {
		mux {
			pins = "gpio50";
			function = "gpio";
		};

		config {
			pins = "gpio50";
			drive-strength = <4>;
			bias-pull-down;
		};
	};
};

&soc {
	wlan_kiwi: qcom,cnss-kiwi@b0000000 {
		compatible = "qcom,cnss-kiwi";
		reg = <0xb0000000 0x10000>;
		reg-names = "smmu_iova_ipa";
		wlan-en-gpio = <&tlmm 80 0>;
		wlan-host-sol-gpio = <&tlmm 48 0>;
		wlan-dev-sol-gpio = <&tlmm 50 0>;
		pinctrl-names = "wlan_en_active", "wlan_en_sleep",
				"sol_default";
		pinctrl-0 = <&cnss_wlan_en_active>;
		pinctrl-1 = <&cnss_wlan_en_sleep>;
		pinctrl-2 = <&cnss_host_sol_default &cnss_dev_sol_default>;
		qcom,wlan;
		qcom,wlan-rc-num = <1>;
		qcom,wlan-ramdump-dynamic = <0x780000>;
		qcom,wlan-cbc-enabled;
		use-pm-domain;
		qcom,same-dt-multi-dev;
		mboxes = <&qmp_aop 0>;

		vdd-wlan-io-supply = <&S10B>;
		qcom,vdd-wlan-io-config = <1800000 1800000 0 0 1>;
		vdd-wlan-supply = <&S3E>;
		qcom,vdd-wlan-config = <1000000 1000000 0 0 0>;
		vdd-wlan-aon-supply = <&S2E>;
		qcom,vdd-wlan-aon-config = <980000 980000 0 0 1>;
		vdd-wlan-dig-supply = <&S11B>;
		qcom,vdd-wlan-dig-config = <950000 950000 0 0 1>;
		vdd-wlan-rfa1-supply = <&S1C>;
		qcom,vdd-wlan-rfa1-config = <1900000 1900000 0 0 1>;
		vdd-wlan-rfa2-supply = <&S12B>;
		qcom,vdd-wlan-rfa2-config = <1350000 1350000 0 0 1>;

		qcom,pmu_vreg_map =
			"VDD095_MX_PMU", "s2e",
			"VDD095_PMU", "s3e",
			"VDD_PMU_AON_I", "s11b",
			"VDD095_PMU_BT", "s11b",
			"VDD09_PMU_RFA_I", "s11b",
			"VDD13_PMU_PCIE_I", "s12b",
			"VDD13_PMU_RFA_I", "s12b",
			"VDD19_PMU_PCIE_I", "s1c",
			"VDD19_PMU_RFA_I", "s1c";

		qcom,vreg_pdc_map =
			"s11b", "rf", "s10b", "rf", "s12b", "rf", "s1c", "rf",
			"l7e", "rf", "s3e", "bb", "s2e", "bb";

		qcom,pdc_init_table =
			" {class: wlan_pdc, ss: rf, res: s11b.v, upval: 916}",
			" {class: wlan_pdc, ss: rf, res: s11b.v, dwnval: 612}",
			" {class: wlan_pdc, ss: rf, res: s12b.v, upval: 1316}",
			" {class: wlan_pdc, ss: rf, res: s12b.v, dwnval: 944}",
			" {class: wlan_pdc, ss: rf, res: s1c.v, upval: 1864}",
			" {class: wlan_pdc, ss: rf, res: s1c.v, dwnval: 1820}",
			" {class: wlan_pdc, ss: rf, res: s2e.m, enable: 0}",
			" {class: wlan_pdc, ss: rf, res: s2e.v, enable: 0}",
			" {class: wlan_pdc, ss: rf, res: s3e.m, enable: 0}",
			" {class: wlan_pdc, ss: rf, res: s3e.v, enable: 0}",
			" {class: wlan_pdc, ss: bb, res: s2e.v, upval: 976}",
			" {class: wlan_pdc, ss: bb, res: s2e.v, dwnval: 512}",
			" {class: wlan_pdc, ss: bb, res: s3e.v, upval: 940}",
			" {class: wlan_pdc, ss: bb, res: s3e.v, dwnval: 420}",
			" {class: wlan_pdc, ss: bb, res: pdc, enable: 1}";

		interconnects =
		<&pcie_noc MASTER_PCIE_1 &pcie_noc SLAVE_ANOC_PCIE_GEM_NOC>,
		<&gem_noc MASTER_ANOC_PCIE_GEM_NOC &mc_virt SLAVE_EBI1>;
		interconnect-names = "pcie_to_memnoc", "memnoc_to_ddr";

		qcom,icc-path-count = <2>;
		qcom,bus-bw-cfg-count = <9>;
		qcom,bus-bw-cfg =
		/** ICC Path 1 **/
		<0 0>, /* no vote */
		/* idle: 0-18 Mbps snoc/anoc: 100 Mhz ddr: 451.2 MHz */
		<2250 1600000>,
		/* low: 18-60 Mbps snoc/anoc: 100 Mhz ddr: 451.2 MHz */
		<7500 1600000>,
		/* medium: 60-240 Mbps snoc/anoc: 100 Mhz ddr: 451.2 MHz */
		<30000 1600000>,
		/* high: 240-1200 Mbps snoc/anoc: 100 Mhz ddr: 451.2 MHz */
		<100000 1600000>,
		/* very high: > 1200 Mbps snoc/anoc: 403 Mhz ddr: 1555 MHz */
		<175000 6448000>,
		/* ultra high: DBS mode snoc/anoc: 403 Mhz ddr: 2092 MHz */
		<175000 6448000>,
		/* super high: DBS mode snoc/anoc: 533 Mhz ddr: 3.2GHz */
		<175000 8528000>,
		/* low (latency critical): 18-60 Mbps snoc/anoc: 200 Mhz
		 * ddr: 547.2 MHz
		 */
		<7500 3200000>,

		/** ICC Path 2 **/
		<0 0>,
		/* ddr: 451.2 MHz */
		<2250 1804800>,
		/* ddr: 451.2 MHz */
		<7500 1804800>,
		/* ddr: 451.2 MHz */
		<30000 1804800>,
		/* ddr: 451.2 MHz */
		<100000 1804800>,
		/* ddr: 1555 MHz */
		<175000 6220800>,
		/* ddr: 2092 MHz */
		<175000 8368000>,
		/* ddr: 3.2 GHz */
		<175000 12800000>,
		/* ddr: 547.2 MHz */
		<7500 2188800>;

	};

	bt_hmt: bt_kiwi {
		compatible = "qcom,kiwi";
		pinctrl-names = "default";
		pinctrl-0 = <&bt_en_sleep>;
		qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */
		qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */
		qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */

		qcom,bt-vdd-aon-supply = <&S11B>;
		qcom,bt-vdd-dig-supply = <&S11B>;
		qcom,bt-vdd-rfa1-supply = <&S1C>;
		qcom,bt-vdd-rfa2-supply = <&S12B>;

		qcom,bt-vdd-aon-config = <950000 950000 0 1>;
		qcom,bt-vdd-dig-config = <950000 950000 0 1>;
		qcom,bt-vdd-rfa1-config = <1900000 1900000 0 1>;
		qcom,bt-vdd-rfa2-config = <1350000 1350000 0 1>;
	};
};

&pcie1_rp {
	#address-cells = <5>;
	#size-cells = <0>;

	cnss_pci1: cnss_pci1 {
		reg = <0 0 0 0 0>;
		qcom,iommu-group = <&cnss_pci_iommu_group1>;
		memory-region = <&cnss_wlan_mem>;

		#address-cells = <1>;
		#size-cells = <1>;

		cnss_pci_iommu_group1: cnss_pci_iommu_group1 {
			qcom,iommu-msi-size = <0x1000>;
			qcom,iommu-dma-addr-pool = <0xa0000000 0x10000000>;
			qcom,iommu-dma = "fastmap";
			qcom,iommu-pagetable = "coherent";
			qcom,iommu-faults = "stall-disable", "HUPCF", "no-CFRE",
					    "non-fatal";
		};
	};
};
