Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12d92292 authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: core: put mhi channel, events, and device into a child node



Fix devicetree warning "duplicate unit-address" between MHI channel
nodes, MHI event nodes, and MHI device node by moving each group into
child nodes.

CRs-Fixed: 2313588
Change-Id: I9824025f37f65c34103365ef96e7c23367f5a16e
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent e0615925
Loading
Loading
Loading
Loading
+794 −782
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
		#address-cells = <1>;
		#size-cells = <0>;

		mhi_channels {
			mhi_chan@0 {
				reg = <0>;
				label = "LOOPBACK";
@@ -357,7 +358,9 @@
				mhi,offload-chan;
				mhi,lpm-notify;
			};
		};

		mhi_events {
				mhi_event@0 {
				mhi,num-elements = <32>;
				mhi,intmod = <1>;
@@ -411,7 +414,9 @@
				mhi,hw-ev;
				mhi,client-manage;
			};
		};

		mhi_devices {
			mhi_netdev_0: mhi_rmnet@0 {
				reg = <0x0>;
				mhi,chan = "IP_HW0";
@@ -427,6 +432,7 @@
			};
		};
	};
};

&pcie_rc0 {
	reg = <0 0 0 0 0>;
@@ -450,6 +456,7 @@
		#address-cells = <1>;
		#size-cells = <0>;

		mhi_channels {
			mhi_chan@0 {
				reg = <0>;
				label = "LOOPBACK";
@@ -774,7 +781,9 @@
				mhi,offload-chan;
				mhi,lpm-notify;
			};
		};

		mhi_events {
				mhi_event@0 {
				mhi,num-elements = <32>;
				mhi,intmod = <1>;
@@ -828,7 +837,9 @@
				mhi,hw-ev;
				mhi,client-manage;
			};
		};

		mhi_devices {
			mhi_netdev_2: mhi_rmnet@0 {
				reg = <0x0>;
				mhi,chan = "IP_HW0";
@@ -844,3 +855,4 @@
			};
		};
	};
};
+81 −61
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
	mhi,buffer-len = <0x8000>;
	qcom,addr-win = <0x0 0xa0000000 0x0 0xa4bfffff>;

	mhi_channels {
		mhi_chan@1 {
			mhi,num-elements = <32>;
		};
@@ -47,7 +48,9 @@
		mhi_chan@101 {
			status = "disabled";
		};
	};

	mhi_events {
		mhi_event@4 {
			mhi,num-elements = <0>;
			mhi,intmod = <0>;
@@ -72,8 +75,22 @@
			mhi,offload;
		};
	};
};

&mhi_1 {
	mhi_channels {
		mhi_chan@1 {
			mhi,num-elements = <32>;
		};

		mhi_chan@11 {
			mhi,num-elements = <32>;
		};

		mhi_chan@21 {
			mhi,num-elements = <32>;
		};

		mhi_chan@100 {
			status = "disabled";
		};
@@ -81,7 +98,9 @@
		mhi_chan@101 {
			status = "disabled";
		};
	};

	mhi_events {
		mhi_event@4 {
			mhi,num-elements = <0>;
			mhi,intmod = <0>;
@@ -106,6 +125,7 @@
			mhi,offload;
		};
	};
};

&tlmm {
	pcie1 {
+8 −0
Original line number Diff line number Diff line
@@ -781,6 +781,10 @@ static int of_parse_ev_cfg(struct mhi_controller *mhi_cntrl,
	struct mhi_event *mhi_event;
	struct device_node *child;

	of_node = of_find_node_by_name(of_node, "mhi_events");
	if (!of_node)
		return -EINVAL;

	for_each_available_child_of_node(of_node, child) {
		if (!strcmp(child->name, "mhi_event"))
			num++;
@@ -896,6 +900,10 @@ static int of_parse_ch_cfg(struct mhi_controller *mhi_cntrl,
	if (ret)
		return ret;

	of_node = of_find_node_by_name(of_node, "mhi_channels");
	if (!of_node)
		return -EINVAL;

	mhi_cntrl->mhi_chan = kcalloc(mhi_cntrl->max_chan,
				      sizeof(*mhi_cntrl->mhi_chan), GFP_KERNEL);
	if (!mhi_cntrl->mhi_chan)
+4 −1
Original line number Diff line number Diff line
@@ -592,7 +592,10 @@ static void mhi_assign_of_node(struct mhi_controller *mhi_cntrl,
	const char *dt_name;
	int ret;

	controller = mhi_cntrl->of_node;
	controller = of_find_node_by_name(mhi_cntrl->of_node, "mhi_devices");
	if (!controller)
		return;

	for_each_available_child_of_node(controller, node) {
		ret = of_property_read_string(node, "mhi,chan", &dt_name);
		if (ret)