iommu: msm: Add label as required property
IOMMUs need to have a label naming the IOMMU device. This label
is used to create debugfs directory for performance monitor
interface.
Change-Id: I3ed1578ec296eaaae3e17dd513b3202e482b6c50
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
diff --git a/Documentation/devicetree/bindings/iommu/msm_iommu.txt b/Documentation/devicetree/bindings/iommu/msm_iommu.txt
index 313f0a3..dede14a 100644
--- a/Documentation/devicetree/bindings/iommu/msm_iommu.txt
+++ b/Documentation/devicetree/bindings/iommu/msm_iommu.txt
@@ -7,6 +7,7 @@
offset and length for clock register for additional clock that
needs to be turned on for access to this IOMMU.
- reg-names: "iommu_base", "clk_base" (optional)
+- label: name of this IOMMU instance.
Optional properties:
- qcom,iommu-secure-id : Secure identifier for the IOMMU block
@@ -51,6 +52,7 @@
vdd-supply = <&gdsc_iommu>;
qcom,iommu-bfb-regs = <0x204c 0x2050>;
qcom,iommu-bfb-data = <0xffff 0xffce>;
+ label = "iommu_0";
qcom,iommu-ctx@fda6c000 {
reg = <0xfda6c000 0x1000>;
diff --git a/arch/arm/boot/dts/msm-iommu.dtsi b/arch/arm/boot/dts/msm-iommu.dtsi
index 3c65491..024c11f 100755
--- a/arch/arm/boot/dts/msm-iommu.dtsi
+++ b/arch/arm/boot/dts/msm-iommu.dtsi
@@ -20,6 +20,7 @@
reg-names = "iommu_base";
vdd-supply = <&gdsc_jpeg>;
qcom,needs-alt-core-clk;
+ label = "jpeg_iommu";
status = "disabled";
qcom,iommu-bfb-regs = <0x204c
@@ -85,6 +86,7 @@
reg-names = "iommu_base";
vdd-supply = <&gdsc_mdss>;
qcom,iommu-secure-id = <1>;
+ label = "mdp_iommu";
status = "disabled";
qcom,iommu-bfb-regs = <0x204c
@@ -152,6 +154,7 @@
vdd-supply = <&gdsc_venus>;
qcom,iommu-secure-id = <0>;
qcom,needs-alt-core-clk;
+ label = "venus_iommu";
status = "disabled";
qcom,iommu-bfb-regs = <0x204c
@@ -238,6 +241,7 @@
vdd-supply = <&gdsc_oxili_cx>;
qcom,alt-vdd-supply = <&gdsc_oxili_gx>;
qcom,needs-alt-core-clk;
+ label = "kgsl_iommu";
status = "disabled";
qcom,iommu-bfb-regs = <0x204c
@@ -290,6 +294,7 @@
reg-names = "iommu_base";
vdd-supply = <&gdsc_vfe>;
qcom,needs-alt-core-clk;
+ label = "vfe_iommu";
status = "disabled";
qcom,iommu-bfb-regs = <0x204c
diff --git a/drivers/iommu/msm_iommu_dev-v2.c b/drivers/iommu/msm_iommu_dev-v2.c
index 9b6dc0e..6ba810d 100644
--- a/drivers/iommu/msm_iommu_dev-v2.c
+++ b/drivers/iommu/msm_iommu_dev-v2.c
@@ -108,7 +108,11 @@
pr_err("Failed to create %s device\n", child->name);
}
- drvdata->name = dev_name(&pdev->dev);
+ ret = of_property_read_string(pdev->dev.of_node, "label",
+ &drvdata->name);
+ if (ret)
+ goto fail;
+
drvdata->sec_id = -1;
of_property_read_u32(pdev->dev.of_node, "qcom,iommu-secure-id",
&drvdata->sec_id);