Skip to contentSkip to conversation

Remove the need for qcom,{msm-id,board-id,pmic-id}

PATCH In review Stephen Boyd 3 participants 10 messages Nov 20, 2015 – Jan 7, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Remove the need for qcom,{msm-id,board-id,pmic-id}

This patchset documents a compatible string format that encodes all the information that was being encoded in qcom specific DT properties in downstream msm kernels. The goal being to come up with a format that will allow us to express the information we want to express without requiring the use of vendor specific properties. An updated dtbTool will be released after these new bindings are accepted so that users can work with non-updateable bootloaders.

This is an attempt to resolve a discussion around March of this year[1] where the arm-soc maintainers suggested we express this information through the board's compatible string.

Changes from v1:
* Remove unused elements (mb, panel, boot device)
* Remove PMICs from board compatible
* Add patches to allow us to parse PMIC compatibles with aliases

[1] http://lkml.kernel.org/g/1425503602-24916-1-git-send-email-galak at codeaurora.org

Stephen Boyd (5):
devicetree: bindings: Document qcom board compatible format
arm64: dts: qcom: Make msm8916-mtp compatible string compliant
arm: dts: qcom: Update ifc6540 compat for qcom boot format
arm64: dts: qcom: Alias pm8916 on msm8916 devices
arm: dts: qcom: Add aliases for PMICs

 Documentation/devicetree/bindings/arm/qcom.txt | 51 ++++++++++++++++++++++++++
 arch/arm/boot/dts/qcom-apq8074-dragonboard.dts |  2 +
 arch/arm/boot/dts/qcom-apq8084-ifc6540.dts     |  3 +-
 arch/arm/boot/dts/qcom-apq8084-mtp.dts         |  1 +
 arch/arm/boot/dts/qcom-pm8841.dtsi             |  8 ++--
 arch/arm/boot/dts/qcom-pm8941.dtsi             |  8 ++--
 arch/arm/boot/dts/qcom-pma8084.dtsi            |  8 ++--
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi      |  1 +
 arch/arm64/boot/dts/qcom/msm8916-mtp.dts       |  2 +-
 arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi      |  1 +
 arch/arm64/boot/dts/qcom/pm8916.dtsi           |  6 +--
 11 files changed, 74 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom.txt
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

PATCH v2 1/5 devicetree: bindings: Document qcom board compatible format

Some qcom based bootloaders identify the dtb blob based on a set of device properties like SoC, platform, PMIC, and revisions of those components. In downstream kernels, these values are added to the different component dtsi files (i.e. pmic dtsi file, SoC dtsi file, board dtsi file, etc.) via qcom specific DT properties. The dtb files are parsed by a program called dtbTool that picks out these properties and creates a table of contents binary blob with the property information and some offsets into the concatenation of all the dtbs (termed a QCDT image).

The suggestion is to do this via the board compatible string instead, because these qcom specific properties are never used by the kernel. Add a document describing the format of the compatible string that encodes all this information that's currently encoded in the qcom,{msm-id,board-id,pmic-id} properties in downstream devicetrees. Future bootloaders may be updated to look at the compatible field instead of looking for the table of contents image. For non-updateable bootloaders, a new dtbTool program will parse the compatible string and generate a QCDT image from it.

---
 Documentation/devicetree/bindings/arm/qcom.txt | 51 ++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom.txt
Documentation/devicetree/bindings/arm/qcom.txt new file +51 -0
new file mode 100644
index 000000000000..3e24518c6678
@@ -0,0 +1,51 @@
+QCOM device tree bindings
+-------------------------
+
+Some qcom based bootloaders identify the dtb blob based on a set of
+device properties like SoC and platform and revisions of those components.
+To support this scheme, we encode this information into the board compatible
+string.
+
+Each board must specify a top-level board compatible string with the following
+format:
+
+	compatible = "qcom,<SoC>[-<soc_version>][-<foundry_id>]-<board>[/<subtype>][-<board_version>]"
+
+The 'SoC' and 'board' elements are required. All other elements are optional.
+
+The 'SoC' element must be one of the following strings:
+
+	apq8016
+	apq8074
+	apq8084
+	apq8096
+	msm8916
+	msm8974
+	msm8996
+
+The 'board' element must be one of the following strings:
+
+	cdp
+	liquid
+	dragonboard
+	mtp
+	sbc
+
+The 'soc_version' and 'board_version' elements take the form of v<Major>.<Minor>
+where the minor number may be omitted when it's zero, i.e.  v1.0 is the same
+as v1. If all versions of the 'board_version' elements match, then a
+wildcard '*' should be used, e.g. 'v*'.
+
+The 'foundry_id' and 'subtype' elements are one or more digits from 0 to 9.
+
+Examples:
+
+	"qcom,msm8916-v1-cdp-pm8916-v2.1"
+
+A CDP board with an msm8916 SoC, version 1 paired with a pm8916 PMIC of version
+2.1.
+
+	"qcom,apq8074-v2.0-2-dragonboard/1-v0.1"
+
+A dragonboard board v0.1 of subtype 1 with an apq8074 SoC version 2, made in
+foundry 2.
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer Acked-by on v2 1/5
#2 lore raw

Re: [PATCH v2 1/5] devicetree: bindings: Document qcom board compatible format

Quoted 21 lines · Stephen Boyd

Some qcom based bootloaders identify the dtb blob based on a set of device properties like SoC, platform, PMIC, and revisions of those components. In downstream kernels, these values are added to the different component dtsi files (i.e. pmic dtsi file, SoC dtsi file, board dtsi file, etc.) via qcom specific DT properties. The dtb files are parsed by a program called dtbTool that picks out these properties and creates a table of contents binary blob with the property information and some offsets into the concatenation of all the dtbs (termed a QCDT image).

The suggestion is to do this via the board compatible string instead, because these qcom specific properties are never used by the kernel. Add a document describing the format of the compatible string that encodes all this information that's currently encoded in the qcom,{msm-id,board-id,pmic-id} properties in downstream devicetrees. Future bootloaders may be updated to look at the compatible field instead of looking for the table of contents image. For non-updateable bootloaders, a new dtbTool program will parse the compatible string and generate a QCDT image from it.

Quoted 1 line

Much more reasonable now. I do find the '/' in it a bit strange though.

Quoted 70 lines
---
 Documentation/devicetree/bindings/arm/qcom.txt | 51 ++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom.txt
Documentation/devicetree/bindings/arm/qcom.txt new file +51 -0
new file mode 100644
index 000000000000..3e24518c6678
@@ -0,0 +1,51 @@
+QCOM device tree bindings
+-------------------------
+
+Some qcom based bootloaders identify the dtb blob based on a set of
+device properties like SoC and platform and revisions of those components.
+To support this scheme, we encode this information into the board compatible
+string.
+
+Each board must specify a top-level board compatible string with the following
+format:
+
+	compatible = "qcom,<SoC>[-<soc_version>][-<foundry_id>]-<board>[/<subtype>][-<board_version>]"
+
+The 'SoC' and 'board' elements are required. All other elements are optional.
+
+The 'SoC' element must be one of the following strings:
+
+	apq8016
+	apq8074
+	apq8084
+	apq8096
+	msm8916
+	msm8974
+	msm8996
+
+The 'board' element must be one of the following strings:
+
+	cdp
+	liquid
+	dragonboard
+	mtp
+	sbc
+
+The 'soc_version' and 'board_version' elements take the form of v<Major>.<Minor>
+where the minor number may be omitted when it's zero, i.e.  v1.0 is the same
+as v1. If all versions of the 'board_version' elements match, then a
+wildcard '*' should be used, e.g. 'v*'.
+
+The 'foundry_id' and 'subtype' elements are one or more digits from 0 to 9.
+
+Examples:
+
+	"qcom,msm8916-v1-cdp-pm8916-v2.1"
+
+A CDP board with an msm8916 SoC, version 1 paired with a pm8916 PMIC of version
+2.1.
+
+	"qcom,apq8074-v2.0-2-dragonboard/1-v0.1"
+
+A dragonboard board v0.1 of subtype 1 with an apq8074 SoC version 2, made in
+foundry 2.
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Re: [PATCH v2 1/5] devicetree: bindings: Document qcom board compatible format

Quoted 22 lines · Rob Herring
Quoted 21 lines · Stephen Boyd

Some qcom based bootloaders identify the dtb blob based on a set of device properties like SoC, platform, PMIC, and revisions of those components. In downstream kernels, these values are added to the different component dtsi files (i.e. pmic dtsi file, SoC dtsi file, board dtsi file, etc.) via qcom specific DT properties. The dtb files are parsed by a program called dtbTool that picks out these properties and creates a table of contents binary blob with the property information and some offsets into the concatenation of all the dtbs (termed a QCDT image).

The suggestion is to do this via the board compatible string instead, because these qcom specific properties are never used by the kernel. Add a document describing the format of the compatible string that encodes all this information that's currently encoded in the qcom,{msm-id,board-id,pmic-id} properties in downstream devicetrees. Future bootloaders may be updated to look at the compatible field instead of looking for the table of contents image. For non-updateable bootloaders, a new dtbTool program will parse the compatible string and generate a QCDT image from it.

Quoted 3 lines
Quoted 1 line

Much more reasonable now. I do find the '/' in it a bit strange though.

I can remove the backslash if you like. Is a dash more preferred?

Quoted 3 lines

and if so can I keep the ack? I'll resend with that change and add the ack.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#4 lore raw

Re: [PATCH v2 1/5] devicetree: bindings: Document qcom board compatible format

Quoted 10 lines · Stephen Boyd
Quoted 2 lines · Rob Herring

Much more reasonable now. I do find the '/' in it a bit strange though.

I can remove the backslash if you like. Is a dash more preferred?

Quoted 2 lines

and if so can I keep the ack? I'll resend with that change and add the ack.

I'll take no answer as "let's not change anything", so can someone pickup this patch as is? Perhaps Andy can do that?

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#5 lore raw

PATCH v2 2/5 arm64: dts: qcom: Make msm8916-mtp compatible string compliant

In reply to Stephen Boyd

This compatible string isn't compliant with the format for subtypes. Replace it with a compliant compatible type.

---
 arch/arm64/boot/dts/qcom/msm8916-mtp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916-mtp.dts +1 -1
index fced77f0fd3a..b0a064d3806b 100644
@@ -17,6 +17,6 @@
 
 / {
 	model = "Qualcomm Technologies, Inc. MSM 8916 MTP";
-	compatible = "qcom,msm8916-mtp", "qcom,msm8916-mtp-smb1360",
+	compatible = "qcom,msm8916-mtp", "qcom,msm8916-mtp/1",
 			"qcom,msm8916", "qcom,mtp";
 };
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#6 lore raw

PATCH v2 3/5 arm: dts: qcom: Update ifc6540 compat for qcom boot format

In reply to Stephen Boyd

The ifc6540 is an sbc (single board computer) board, so update the compatible field accordingly.

---
 arch/arm/boot/dts/qcom-apq8084-ifc6540.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8084-ifc6540.dts +1 -1
index c9c2b769554f..32aaa9d45228 100644
@@ -3,7 +3,7 @@
 
 / {
 	model = "Qualcomm APQ8084/IFC6540";
-	compatible = "qcom,apq8084-ifc6540", "qcom,apq8084";
+	compatible = "qcom,apq8084-sbc", "qcom,apq8084";
 
 	aliases {
 		serial0 = &blsp2_uart2;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#7 lore raw

PATCH v2 4/5 arm64: dts: qcom: Alias pm8916 on msm8916 devices

In reply to Stephen Boyd

Add an alias for pm8916 on msm8916 based SoCs so that the newly updated dtbTool can find the pmic compatible string and add the pmic-id element to the QCDT header.

---
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 1 +
 arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi | 1 +
 arch/arm64/boot/dts/qcom/pm8916.dtsi      | 6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +1 -0
index 6b8abbe68746..46bfcb9b2e84 100644
@@ -20,6 +20,7 @@
 	aliases {
 		serial0 = &blsp1_uart2;
 		serial1 = &blsp1_uart1;
+		usid0 = &pm8916_0;
 	};
 
 	chosen {
arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi +1 -0
index a1aa0b201e92..ceeb8a6feed6 100644
@@ -17,6 +17,7 @@
 / {
 	aliases {
 		serial0 = &blsp1_uart2;
+		usid0 = &pm8916_0;
 	};
 
 	chosen {
arch/arm64/boot/dts/qcom/pm8916.dtsi +3 -3
index b222ece7e3d2..37432451ee4c 100644
@@ -4,8 +4,8 @@
 
 &spmi_bus {
 
-	usid0: pm8916 at 0 {
-		compatible = "qcom,spmi-pmic";
+	pm8916_0: pm8916 at 0 {
+		compatible = "qcom,pm8916", "qcom,spmi-pmic";
 		reg = <0x0 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -90,7 +90,7 @@
 		};
 	};
 
-	usid1: pm8916 at 1 {
+	pm8916_1: pm8916 at 1 {
 		compatible = "qcom,spmi-pmic";
 		reg = <0x1 SPMI_USID>;
 		#address-cells = <1>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#8 lore raw

Re: [PATCH v2 4/5] arm64: dts: qcom: Alias pm8916 on msm8916 devices

Quoted 52 lines · Stephen Boyd

Add an alias for pm8916 on msm8916 based SoCs so that the newly updated dtbTool can find the pmic compatible string and add the pmic-id element to the QCDT header.

---
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 1 +
 arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi | 1 +
 arch/arm64/boot/dts/qcom/pm8916.dtsi      | 6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +1 -0
index 6b8abbe68746..46bfcb9b2e84 100644
@@ -20,6 +20,7 @@
 	aliases {
 		serial0 = &blsp1_uart2;
 		serial1 = &blsp1_uart1;
+		usid0 = &pm8916_0;
 	};
 
 	chosen {
arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi +1 -0
index a1aa0b201e92..ceeb8a6feed6 100644
@@ -17,6 +17,7 @@
 / {
 	aliases {
 		serial0 = &blsp1_uart2;
+		usid0 = &pm8916_0;
 	};
 
 	chosen {
arch/arm64/boot/dts/qcom/pm8916.dtsi +2 -2
index b222ece7e3d2..37432451ee4c 100644
@@ -4,8 +4,8 @@
 
 &spmi_bus {
 
-	usid0: pm8916 at 0 {
-		compatible = "qcom,spmi-pmic";
+	pm8916_0: pm8916 at 0 {
+		compatible = "qcom,pm8916", "qcom,spmi-pmic";
 		reg = <0x0 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;

arch/arm64/boot/dts/qcom/pm8916.dtsi line 96

Quoted 8 lines
arch/arm64/boot/dts/qcom/pm8916.dtsi +1 -1
@@ -90,7 +90,7 @@
 		};
 	};
 
-	usid1: pm8916 at 1 {
+	pm8916_1: pm8916 at 1 {
 		compatible = "qcom,spmi-pmic";
 		reg = <0x1 SPMI_USID>;
 		#address-cells = <1>;

Where are usid0 and usid1 documented? I understand why they exist given the context of v1 and v2 of this patchset, but it will not be obvious to anyone who is just looking at the .dtsi files in the future.

#9 lore raw

PATCH v2 5/5 arm: dts: qcom: Add aliases for PMICs

In reply to Stephen Boyd

Add an alias for the PMICs found on qcom based SoCs so that the newly updated dtbTool can find the PMIC compatible string and add the pmic-id element to the QCDT header.

---
 arch/arm/boot/dts/qcom-apq8074-dragonboard.dts | 2 ++
 arch/arm/boot/dts/qcom-apq8084-ifc6540.dts     | 1 +
 arch/arm/boot/dts/qcom-apq8084-mtp.dts         | 1 +
 arch/arm/boot/dts/qcom-pm8841.dtsi             | 8 ++++----
 arch/arm/boot/dts/qcom-pm8941.dtsi             | 8 ++++----
 arch/arm/boot/dts/qcom-pma8084.dtsi            | 8 ++++----
 6 files changed, 16 insertions(+), 12 deletions(-)
arch/arm/boot/dts/qcom-apq8074-dragonboard.dts +2 -0
index 835bdc71c5ba..c0e205315042 100644
@@ -8,6 +8,8 @@
 
 	aliases {
 		serial0 = &blsp1_uart2;
+		usid0 = &pm8941_0;
+		usid4 = &pm8841_0;
 	};
 
 	chosen {
arch/arm/boot/dts/qcom-apq8084-ifc6540.dts +1 -0
index 32aaa9d45228..2052b84a77c6 100644
@@ -7,6 +7,7 @@
 
 	aliases {
 		serial0 = &blsp2_uart2;
+		usid0 = &pma8084_0;
 	};
 
 	chosen {
arch/arm/boot/dts/qcom-apq8084-mtp.dts +1 -0
index 3016c7048d44..d174d15bcf70 100644
@@ -7,6 +7,7 @@
 
 	aliases {
 		serial0 = &blsp2_uart2;
+		usid0 = &pma8084_0;
 	};
 
 	chosen {
arch/arm/boot/dts/qcom-pm8841.dtsi +4 -4
index 8f1a0b162017..523bee959f98 100644
@@ -3,8 +3,8 @@
 
 &spmi_bus {
 
-	usid4: pm8841 at 4 {
-		compatible = "qcom,spmi-pmic";
+	pm8841_0: pm8841 at 4 {
+		compatible = "qcom,pm8841", "qcom,spmi-pmic";
 		reg = <0x4 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -27,8 +27,8 @@
 		};
 	};
 
-	usid5: pm8841 at 5 {
-		compatible = "qcom,spmi-pmic";
+	pm8841_1: pm8841 at 5 {
+		compatible = "qcom,pm8841", "qcom,spmi-pmic";
 		reg = <0x5 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
arch/arm/boot/dts/qcom-pm8941.dtsi +4 -4
index c19a48732b2d..12c1202ba2ca 100644
@@ -4,8 +4,8 @@
 
 &spmi_bus {
 
-	usid0: pm8941 at 0 {
-		compatible ="qcom,spmi-pmic";
+	pm8941_0: pm8941 at 0 {
+		compatible = "qcom,pm8941", "qcom,spmi-pmic";
 		reg = <0x0 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -153,8 +153,8 @@
 		};
 	};
 
-	usid1: pm8941 at 1 {
-		compatible = "qcom,spmi-pmic";
+	pm8941_1: pm8941 at 1 {
+		compatible = "qcom,pm8941", "qcom,spmi-pmic";
 		reg = <0x1 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
arch/arm/boot/dts/qcom-pma8084.dtsi +4 -4
index 5e240ccc08b7..10b8f9e6d60b 100644
@@ -4,8 +4,8 @@
 
 &spmi_bus {
 
-	usid0: pma8084 at 0 {
-		compatible = "qcom,spmi-pmic";
+	pma8084_0: pma8084 at 0 {
+		compatible = "qcom,pma8084", "qcom,spmi-pmic";
 		reg = <0x0 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -101,8 +101,8 @@
 		};
 	};
 
-	usid1: pma8084 at 1 {
-		compatible = "qcom,spmi-pmic";
+	pma8084_1: pma8084 at 1 {
+		compatible = "qcom,pma8084", "qcom,spmi-pmic";
 		reg = <0x1 SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project