lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240521-board-ids-v3-8-e6c71d05f4d2@quicinc.com>
Date: Tue, 21 May 2024 11:38:05 -0700
From: Elliot Berman <quic_eberman@...cinc.com>
To: Rob Herring <robh+dt@...nel.org>, Frank Rowand <frowand.list@...il.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley
	<conor+dt@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio
	<konrad.dybcio@...aro.org>
CC: Amrit Anand <quic_amrianan@...cinc.com>,
        Peter Griffin
	<peter.griffin@...aro.org>,
        Caleb Connolly <caleb.connolly@...aro.org>,
        "Andy
 Gross" <agross@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        "Doug
 Anderson" <dianders@...omium.org>,
        Simon Glass <sjg@...omium.org>, "Chen-Yu
 Tsai" <wenst@...omium.org>,
        Julius Werner <jwerner@...omium.org>,
        "Humphreys,
 Jonathan" <j-humphreys@...com>,
        Sumit Garg <sumit.garg@...aro.org>,
        "Jon
 Hunter" <jonathanh@...dia.org>,
        Michal Simek <michal.simek@....com>,
        <boot-architecture@...ts.linaro.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-arm-msm@...r.kernel.org>,
        Elliot Berman <quic_eberman@...cinc.com>
Subject: [PATCH RFC v3 8/9] arm64: boot: dts: qcom: sm8550: Split into
 overlays

Generic sm8550 devicetree is split into a dtsi. Move it into its own DTB
and preserve the boards as overlays.

When not using overlays, 264 KB needed to store the sm8550-mtp.dtb and
sm8550-qrd.dtb. When using overlays, 188 KB is needed to store
sm8550.dtb, sm8550-mtp.dtbo, and sm8550-qrd.dtbo; where the overlays are
~36 KB.

Also add the board-ids for these DTBs.

This change is not intended to be merged, it breaks aliases and I doubt
it boots correct. The intent here is to show how board-id could be used
with a DTB and DTBO.

Signed-off-by: Elliot Berman <quic_eberman@...cinc.com>
---
 arch/arm64/boot/dts/qcom/Makefile                  |  4 ++++
 .../dts/qcom/{sm8550-mtp.dts => sm8550-mtp.dtso}   | 24 ++++++++++++++++++++--
 .../dts/qcom/{sm8550-qrd.dts => sm8550-qrd.dtso}   | 22 +++++++++++++++++---
 .../boot/dts/qcom/{sm8550.dtsi => sm8550.dts}      |  8 ++++++++
 4 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 39889d5f8e12..7f137f274d8c 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -233,6 +233,10 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx223.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx224.dtb
+
+sm8550-mtp-dtbs		:= sm8550.dtb sm8550-mtp.dtbo
+sm8550-qrd-dtbs		:= sm8550.dtb sm8550-qrd.dtbo
+
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8550-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8550-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-mtp.dtb
diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dtso
similarity index 98%
rename from arch/arm64/boot/dts/qcom/sm8550-mtp.dts
rename to arch/arm64/boot/dts/qcom/sm8550-mtp.dtso
index c1135ad5fa69..0ee4614719ca 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dtso
@@ -4,9 +4,12 @@
  */
 
 /dts-v1/;
+/plugin/;
 
+#include <dt-bindings/arm/qcom,ids.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-#include "sm8550.dtsi"
+#include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h>
 #include "pm8010.dtsi"
 #include "pm8550.dtsi"
 #include "pm8550b.dtsi"
@@ -17,13 +20,30 @@
 #include "pmr735d_a.dtsi"
 #include "pmr735d_b.dtsi"
 
+#define BOARD_ID	qcom,soc = <QCOM_ID_SM8550>; \
+			qcom,platform-type = <QCOM_BOARD_ID_MTP 0>
+
 / {
+	board-id {
+		BOARD_ID;
+	};
+};
+
+&{/} {
 	model = "Qualcomm Technologies, Inc. SM8550 MTP";
 	compatible = "qcom,sm8550-mtp", "qcom,sm8550";
 	chassis-type = "handset";
 
+	/**
+	 * Redefine the overlay in the DTBO so the sm8550-mtp.dtb that Kbuild
+	 * generates has accurate board-id.
+	 */
+	board-id {
+		BOARD_ID;
+	};
+
 	aliases {
-		serial0 = &uart7;
+		// serial0 = &uart7;
 	};
 
 	wcd938x: audio-codec {
diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dtso
similarity index 98%
rename from arch/arm64/boot/dts/qcom/sm8550-qrd.dts
rename to arch/arm64/boot/dts/qcom/sm8550-qrd.dtso
index d401d63e5c4d..f756c50a80b9 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dtso
@@ -4,10 +4,14 @@
  */
 
 /dts-v1/;
+/plugin/;
 
+#include <dt-bindings/arm/qcom,ids.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-qcom-qmp.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-#include "sm8550.dtsi"
+#include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h>
 #include "pm8010.dtsi"
 #include "pm8550.dtsi"
 #include "pm8550b.dtsi"
@@ -19,13 +23,25 @@
 #include "pmr735d_b.dtsi"
 
 / {
+	board-id {
+		qcom,soc = <QCOM_ID_SM8550>;
+		qcom,platform = <QCOM_BOARD_ID_QRD>;
+	};
+};
+
+&{/} {
 	model = "Qualcomm Technologies, Inc. SM8550 QRD";
 	compatible = "qcom,sm8550-qrd", "qcom,sm8550";
 	chassis-type = "handset";
 
+	board-id {
+		qcom,soc = <QCOM_ID_SM8550>;
+		qcom,platform = <QCOM_BOARD_ID_QRD>;
+	};
+
 	aliases {
-		serial0 = &uart7;
-		serial1 = &uart14;
+		// serial0 = &uart7;
+		// serial1 = &uart14;
 	};
 
 	wcd938x: audio-codec {
diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dts
similarity index 99%
rename from arch/arm64/boot/dts/qcom/sm8550.dtsi
rename to arch/arm64/boot/dts/qcom/sm8550.dts
index c68e08747b6f..3546ea4b96f1 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dts
@@ -3,6 +3,9 @@
  * Copyright (c) 2022, Linaro Limited
  */
 
+/dts-v1/;
+
+#include <dt-bindings/arm/qcom,ids.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,sm8450-videocc.h>
 #include <dt-bindings/clock/qcom,sm8550-camcc.h>
@@ -32,6 +35,11 @@ / {
 
 	chosen { };
 
+	board_id: board-id {
+		qcom,soc-version = <QCOM_ID_SM8550 QCOM_SOC_REVISION(1)>,
+				   <QCOM_ID_SM8550 QCOM_SOC_REVISION(2)>;
+	};
+
 	clocks {
 		xo_board: xo-board {
 			compatible = "fixed-clock";

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ