devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elliot Berman <quic_eberman@quicinc.com>
To: Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Amrit Anand <quic_amrianan@quicinc.com>,
	Peter Griffin <peter.griffin@linaro.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	"Andy Gross" <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	"Doug Anderson" <dianders@chromium.org>,
	Simon Glass <sjg@chromium.org>,
	"Chen-Yu Tsai" <wenst@chromium.org>,
	Julius Werner <jwerner@chromium.org>,
	"Humphreys, Jonathan" <j-humphreys@ti.com>,
	Sumit Garg <sumit.garg@linaro.org>,
	"Jon Hunter" <jonathanh@nvidia.org>,
	Michal Simek <michal.simek@amd.com>,
	<boot-architecture@lists.linaro.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-arm-msm@vger.kernel.org>,
	Elliot Berman <quic_eberman@quicinc.com>
Subject: [PATCH RFC v3 4/9] dt-bindings: arm: qcom: Update Devicetree identifiers
Date: Tue, 21 May 2024 11:38:01 -0700	[thread overview]
Message-ID: <20240521-board-ids-v3-4-e6c71d05f4d2@quicinc.com> (raw)
In-Reply-To: <20240521-board-ids-v3-0-e6c71d05f4d2@quicinc.com>

From: Amrit Anand <quic_amrianan@quicinc.com>

Update existing documentation for qcom,msm-id (interchangeably:
qcom,soc-id) and qcom,board-id. Add support for qcom,pmic-id, qcom,oem-id
to support multi-DTB selection on Qualcomm's boards.

"qcom,soc-id", "qcom,board-id" and "qcom,pmic-id" are tuples of two 32-bit
values. The "qcom,oem-id" is a tuple of one 32-bit value.
Introduce macros to help generate SOC, board, PMIC and OEM identifiers.
QCOM_SOC_ID and QCOM_SOC_REVISION can be used to generate qcom,msm-id.
QCOM_BOARD_ID and QCOM_BOARD_SUBTYPE can be used to generate qcom,board-id.
QCOM_PMIC_SID and QCOM_PMIC_MODEL can be used to generate qcom,pmic-id.
QCOM_OEM_ID can be used to generate qcom,oem-id.

Add entries for different types of SoC, boards, DDR type, Boot device
type which are currently used by Qualcomm based bootloader.

Signed-off-by: Amrit Anand <quic_amrianan@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
---
 include/dt-bindings/arm/qcom,ids.h | 86 ++++++++++++++++++++++++++++++++++----
 1 file changed, 77 insertions(+), 9 deletions(-)

diff --git a/include/dt-bindings/arm/qcom,ids.h b/include/dt-bindings/arm/qcom,ids.h
index 51e0f6059410..0cb521f0c0e7 100644
--- a/include/dt-bindings/arm/qcom,ids.h
+++ b/include/dt-bindings/arm/qcom,ids.h
@@ -8,9 +8,14 @@
 #define _DT_BINDINGS_ARM_QCOM_IDS_H
 
 /*
- * The MSM chipset and hardware revision used by Qualcomm bootloaders, DTS for
- * older chipsets (qcom,msm-id) and in socinfo driver:
+ * The MSM chipset ID (soc-id) used by Qualcomm bootloaders,
+ * and in socinfo driver:
+ * where, "a" indicates Qualcomm supported chipsets, example MSM8260, MSM8660 etc
  */
+
+#define QCOM_SOC_ID(a)  ((QCOM_ID_##a) && 0xffff)
+
+
 #define QCOM_ID_MSM8260			70
 #define QCOM_ID_MSM8660			71
 #define QCOM_ID_APQ8060			86
@@ -267,16 +272,79 @@
 #define QCOM_ID_IPQ5302			595
 #define QCOM_ID_IPQ5300			624
 
+ /* The SOC revision used by Qualcomm bootloaders (soc-revision) */
+
+#define QCOM_SOC_REVISION(a)		(a & 0xff)
+
 /*
- * The board type and revision information, used by Qualcomm bootloaders and
- * DTS for older chipsets (qcom,board-id):
+ * The board type and revision information (board-id), used by Qualcomm bootloaders
+ * where, "a" indicates board type which can be either MTP, QRD etc
  */
+
 #define QCOM_BOARD_ID(a, major, minor) \
-	(((major & 0xff) << 16) | ((minor & 0xff) << 8) | QCOM_BOARD_ID_##a)
+	(((major & 0xff) << 16) | ((minor & 0xff) << 8) | ((QCOM_BOARD_ID_##a) & 0xff))
+
+#define QCOM_BOARD_ID_MTP		0x8
+#define QCOM_BOARD_ID_LIQUID		0x9
+#define QCOM_BOARD_ID_DRAGONBOARD	0xA
+#define QCOM_BOARD_ID_QRD		0x11
+#define QCOM_BOARD_ID_ADP		0x19
+#define QCOM_BOARD_ID_HDK		0x1F
+#define QCOM_BOARD_ID_ATP		0x21
+#define QCOM_BOARD_ID_IDP		0x22
+#define QCOM_BOARD_ID_SBC		0x24
+#define QCOM_BOARD_ID_QXR		0x26
+#define QCOM_BOARD_ID_X100		0x26
+#define QCOM_BOARD_ID_CRD		0x28
+
+/*
+ * The platform subtype is used by Qualcomm bootloaders and
+ * DTS (board-subtype)
+ * where, "a" indicates boot device type, it can be EMMC,
+ * UFS, NAND or OTHER (which can be used for default).
+ * "b" indicates DDR type which can be 128MB, 256MB,
+ * 512MB, 1024MB, 2048MB, 3072MB, 4096MB or ANY 
+ * (which can be used for default).
+ */
+#define QCOM_BOARD_SUBTYPE(a, b, SUBTYPE) \
+	(((QCOM_BOARD_BOOT_##a & 0xf) << 16) | ((QCOM_BOARD_DDRTYPE_##b & 0x7) << 8) | \
+	(SUBTYPE & 0xff))
+
+/* Board DDR Type where each value indicates higher limit */
+#define QCOM_BOARD_DDRTYPE_ANY		0x0
+#define QCOM_BOARD_DDRTYPE_128M		0x1
+#define QCOM_BOARD_DDRTYPE_256M		0x2
+#define QCOM_BOARD_DDRTYPE_512M		0x3
+#define QCOM_BOARD_DDRTYPE_1024M	0x4
+#define QCOM_BOARD_DDRTYPE_2048M	0x5
+#define QCOM_BOARD_DDRTYPE_3072M	0x6
+#define QCOM_BOARD_DDRTYPE_4096M	0x7
 
-#define QCOM_BOARD_ID_MTP			8
-#define QCOM_BOARD_ID_DRAGONBOARD		10
-#define QCOM_BOARD_ID_QRD			11
-#define QCOM_BOARD_ID_SBC			24
+/* Board Boot Device Type */
+#define QCOM_BOARD_BOOT_EMMC		0x0
+#define QCOM_BOARD_BOOT_UFS		0x1
+#define QCOM_BOARD_BOOT_NAND		0x2
+#define QCOM_BOARD_BOOT_OTHER		0x3
+
+/*
+ * The PMIC slave id is used by Qualcomm bootloaders to
+ * indicates which PMIC is attached (pmic-sid)
+ */
+
+#define QCOM_PMIC_SID(a)		(a & 0xff)
+
+/*
+ * The PMIC ID is used by Qualcomm bootloaders to describe the ID
+ * of PMIC attached to bus described by SID (pmic-model)
+ */
+
+#define QCOM_PMIC_MODEL(ID, major, minor) \
+	(((major & 0xff) << 16) | ((minor & 0xff) << 8) | (ID & 0xff))
+
+/*
+ * The OEM ID consists of 32 bit value to support OEM boards where they
+ * have slight differences on top of Qualcomm's standard boards
+ */
+#define QCOM_OEM_ID(a)		(a & 0xffffffff)
 
 #endif /* _DT_BINDINGS_ARM_QCOM_IDS_H */

-- 
2.34.1


  parent reply	other threads:[~2024-05-21 18:40 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 18:37 [PATCH RFC v3 0/9] dt-bindings: hwinfo: Introduce board-id Elliot Berman
2024-05-21 18:37 ` [PATCH RFC v3 1/9] libfdt: board-id: Implement board-id scoring Elliot Berman
2024-05-21 19:28   ` Conor Dooley
2024-05-22 23:57     ` Elliot Berman
2024-05-21 18:37 ` [PATCH RFC v3 2/9] dt-bindings: board: Introduce board-id Elliot Berman
2024-05-21 19:19   ` Rob Herring (Arm)
2024-05-21 19:21   ` Conor Dooley
2024-05-21 19:25     ` Conor Dooley
2024-05-21 21:32       ` Rob Herring
2024-05-21 21:47         ` Conor Dooley
2024-05-22 23:47     ` Elliot Berman
2024-05-22 23:54       ` Elliot Berman
2024-05-23  1:23         ` Rob Herring (Arm)
2024-05-25 16:54         ` Conor Dooley
2024-05-29 15:43           ` Elliot Berman
2024-05-21 18:38 ` [PATCH RFC v3 3/9] fdt-select-board: Add test tool for selecting dtbs based on board-id Elliot Berman
2024-05-21 18:38 ` Elliot Berman [this message]
2024-05-25 17:21   ` [PATCH RFC v3 4/9] dt-bindings: arm: qcom: Update Devicetree identifiers Conor Dooley
2024-05-29 15:34     ` Elliot Berman
2024-05-21 18:38 ` [PATCH RFC v3 5/9] dt-bindings: board: Document board-ids for Qualcomm devices Elliot Berman
2024-05-21 19:19   ` Rob Herring (Arm)
2024-05-25 17:08   ` Conor Dooley
2024-05-29 15:09     ` Elliot Berman
2024-05-21 18:38 ` [PATCH RFC v3 6/9] arm64: boot: dts: sm8650: Add board-id Elliot Berman
2024-06-05  8:18   ` Krzysztof Kozlowski
2024-05-21 18:38 ` [PATCH RFC v3 7/9] arm64: boot: dts: qcom: Use phandles for thermal_zones Elliot Berman
2024-05-21 18:38 ` [PATCH RFC v3 8/9] arm64: boot: dts: qcom: sm8550: Split into overlays Elliot Berman
2024-06-05  8:20   ` Krzysztof Kozlowski
2024-05-21 18:38 ` [PATCH RFC v3 9/9] tools: board-id: Add test suite Elliot Berman
2024-05-21 19:00 ` [PATCH RFC v3 0/9] dt-bindings: hwinfo: Introduce board-id Dmitry Baryshkov
2024-05-24 15:51   ` Konrad Dybcio
2024-05-27  7:19     ` Michal Simek
2024-05-29 15:32       ` Elliot Berman
2024-05-30 14:12         ` Michal Simek
2024-06-05 13:17 ` Simon Glass
2024-06-05 17:17   ` Elliot Berman
2024-06-06 16:00     ` Simon Glass
2024-06-21 22:40       ` Elliot Berman
2024-06-22  7:18         ` Dmitry Baryshkov
2024-06-28  7:33         ` Simon Glass
2024-06-28  8:04           ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240521-board-ids-v3-4-e6c71d05f4d2@quicinc.com \
    --to=quic_eberman@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=boot-architecture@lists.linaro.org \
    --cc=caleb.connolly@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=frowand.list@gmail.com \
    --cc=j-humphreys@ti.com \
    --cc=jonathanh@nvidia.org \
    --cc=jwerner@chromium.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=peter.griffin@linaro.org \
    --cc=quic_amrianan@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).