[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230510-dt-resv-bottom-up-v1-4-3bf68873dbed@gerhold.net>
Date: Mon, 15 May 2023 12:12:19 +0200
From: Stephan Gerhold <stephan@...hold.net>
To: Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
devicetree@...r.kernel.org, devicetree-spec@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
Stephan Gerhold <stephan@...hold.net>
Subject: [PATCH RFC 4/5] arm64: dts: qcom: msm8916: Enable modem on two
phones
DO NOT APPLY - this is just an example to show the motivation for the
patch series. For clarity only some of the device trees are updated.
On MSM8916 there are different independent firmware regions, e.g. for
the modem (mpss), WiFi/Bluetooth (wcnss) or video acceleration (venus).
They need a specific size but the address is relocatable within a
certain memory region as long as the necessary alignment is respected.
The modem firmware size varies from device to device depending on the
available functionality. Right now msm8916.dtsi specifies the firmware
sizes for the DragonBoard 410c SBC, which has smaller firmware because
the modem firmware only implements GPS but not LTE etc.
The modem firmware is much larger on actual smartphones. Unfortunately,
changing the modem/mpss reserved memory size requires shifting all
following reserved memory regions to new addresses as well, even though
the size for the wcnss/venus firmware is the same for all devices.
This introduces quite a lot of churn with many magic addresses and room
for errors. Only two devices are shown in the example below, but similar
diffs would need to be applied to 30+ more similar MSM8916 device trees.
Note that msm8916-longcheer-l8150 is a single exception where the wcnss
firmware is not relocatable and must be loaded at a specific address.
It is included here to show that the dynamic reserved memory allocation
in the next patch handles this automatically.
Signed-off-by: Stephan Gerhold <stephan@...hold.net>
---
.../boot/dts/qcom/msm8916-longcheer-l8150.dts | 29 +++++++++++++++++++++-
.../boot/dts/qcom/msm8916-samsung-serranove.dts | 28 +++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
index f1dd625e1822..4a5eab06c18b 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
@@ -21,14 +21,37 @@ chosen {
stdout-path = "serial0";
};
+ /*
+ * For some reason, the wcnss firmware is not relocatable, so it must be
+ * loaded at 0x8b600000. Unfortunately this overlaps with the memory
+ * region usually used for the modem firmware (0x86800000-0x8b800000).
+ * However, the modem firmware is relocatable, so wcnss is placed at the
+ * fixed address and all other firmware regions are moved to a fitting place.
+ */
reserved-memory {
- /* wcnss.mdt is not relocatable, so it must be loaded at 0x8b600000 */
+ /delete-node/ mpss@...00000;
/delete-node/ wcnss@...00000;
+ /delete-node/ venus@...00000;
wcnss_mem: wcnss@...00000 {
reg = <0x0 0x8b600000 0x0 0x600000>;
no-map;
};
+
+ venus_mem: venus@...00000 {
+ reg = <0x0 0x8bc00000 0x0 0x500000>;
+ no-map;
+ };
+
+ mpss_mem: mpss@...00000 {
+ reg = <0x0 0x8ec00000 0x0 0x5000000>;
+ no-map;
+ };
+
+ gps_mem: gps@...00000 {
+ reg = <0x0 0x93c00000 0x0 0x200000>;
+ no-map;
+ };
};
gpio-keys {
@@ -218,6 +241,10 @@ &blsp1_uart2 {
status = "okay";
};
+&mpss {
+ status = "okay";
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
index 1a41a4db874d..25ad098b1503 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
@@ -36,11 +36,35 @@ chosen {
};
reserved-memory {
+ /delete-node/ mpss@...00000;
+ /delete-node/ wcnss@...00000;
+ /delete-node/ venus@...00000;
+
/* Additional memory used by Samsung firmware modifications */
tz-apps@...00000 {
reg = <0x0 0x85500000 0x0 0xb00000>;
no-map;
};
+
+ mpss_mem: mpss@...00000 {
+ reg = <0x0 0x86800000 0x0 0x5a00000>;
+ no-map;
+ };
+
+ gps_mem: gps@...00000 {
+ reg = <0x0 0x8c200000 0x0 0x200000>;
+ no-map;
+ };
+
+ wcnss_mem: wcnss@...00000 {
+ reg = <0x0 0x8c400000 0x0 0x600000>;
+ no-map;
+ };
+
+ venus_mem: venus@...00000 {
+ reg = <0x0 0x8ca00000 0x0 0x500000>;
+ no-map;
+ };
};
gpio-keys {
@@ -263,6 +287,10 @@ &blsp1_uart2 {
status = "okay";
};
+&mpss {
+ status = "okay";
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
--
2.40.1
Powered by blists - more mailing lists