From c2e322ae9f06be31ab5db1f29630f81469a37d75 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 27 Nov 2022 13:32:57 +0100 Subject: [PATCH 01/12] dt-bindings: soc: samsung: exynos-sysreg: split from syscon Split Samsung Exynos SoC SYSREG bindings to own file to narrow the bindings and do not allow other parts of syscon.yaml. This allows further customization of Samsung SoC bindings. Acked-by: Lee Jones Reviewed-by: Sam Protsenko Reviewed-by: Alim Akhtar Reviewed-by: Sriranjani P Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20221127123259.20339-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/mfd/syscon.yaml | 6 --- .../soc/samsung/samsung,exynos-sysreg.yaml | 39 +++++++++++++++++++ 2 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml index 1b01bd010431..b73ba1ea08f7 100644 --- a/Documentation/devicetree/bindings/mfd/syscon.yaml +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml @@ -64,12 +64,6 @@ properties: - rockchip,rk3568-qos - rockchip,rk3588-qos - rockchip,rv1126-qos - - samsung,exynos3-sysreg - - samsung,exynos4-sysreg - - samsung,exynos5-sysreg - - samsung,exynos5433-sysreg - - samsung,exynos850-sysreg - - samsung,exynosautov9-sysreg - const: syscon diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml new file mode 100644 index 000000000000..68064a5e339c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/samsung/samsung,exynos-sysreg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos SoC series System Registers (SYSREG) + +maintainers: + - Krzysztof Kozlowski + +properties: + compatible: + oneOf: + - items: + - enum: + - samsung,exynos3-sysreg + - samsung,exynos4-sysreg + - samsung,exynos5-sysreg + - samsung,exynos5433-sysreg + - samsung,exynos850-sysreg + - samsung,exynosautov9-sysreg + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + system-controller@10010000 { + compatible = "samsung,exynos4-sysreg", "syscon"; + reg = <0x10010000 0x400>; + }; From 7b35b6b8aab2fd4249fe2828f108e88e9279eadd Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 27 Nov 2022 13:32:58 +0100 Subject: [PATCH 02/12] dt-bindings: soc: samsung: exynos-sysreg: add dedicated SYSREG compatibles to Exynos5433 Exynos5433 has several different SYSREGs, so use dedicated compatibles for them and deprecate usage of generic Exynos5433 compatible alone (as it is too generic). Reviewed-by: Sam Protsenko Reviewed-by: Sriranjani P Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20221127123259.20339-3-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../bindings/soc/samsung/samsung,exynos-sysreg.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 68064a5e339c..42357466005e 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -17,10 +17,21 @@ properties: - samsung,exynos3-sysreg - samsung,exynos4-sysreg - samsung,exynos5-sysreg - - samsung,exynos5433-sysreg - samsung,exynos850-sysreg - samsung,exynosautov9-sysreg - const: syscon + - items: + - enum: + - samsung,exynos5433-cam0-sysreg + - samsung,exynos5433-cam1-sysreg + - samsung,exynos5433-disp-sysreg + - samsung,exynos5433-fsys-sysreg + - const: samsung,exynos5433-sysreg + - const: syscon + - items: + - const: samsung,exynos5433-sysreg + - const: syscon + deprecated: true reg: maxItems: 1 From af7354c7c02249276ceb3011eecddd469246b2bf Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 27 Nov 2022 13:32:59 +0100 Subject: [PATCH 03/12] dt-bindings: soc: samsung: exynos-sysreg: add clocks for Exynos850 Exynos850 has dedicated clock for accessing SYSREGs. Allow it, even though Linux currently does not enable it and relies on bootloader. Reviewed-by: Rob Herring Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20221127123259.20339-4-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../soc/samsung/samsung,exynos-sysreg.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 42357466005e..9f3fc6406d9d 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -36,10 +36,27 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + required: - compatible - reg +allOf: + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos850-sysreg + then: + required: + - clocks + else: + properties: + clocks: false + additionalProperties: false examples: From 7e03ca7429b23105b740eb79364dc410f214848b Mon Sep 17 00:00:00 2001 From: Sriranjani P Date: Tue, 29 Nov 2022 17:25:30 +0530 Subject: [PATCH 04/12] dt-bindings: soc: samsung: exynos-sysreg: Add tesla FSD sysreg compatibles Add compatible for Tesla SYSREG controllers found on FSD SoC. Signed-off-by: Sriranjani P Reviewed-by: Ravi Patel Link: https://lore.kernel.org/r/20221129115531.102932-2-sriranjani.p@samsung.com Signed-off-by: Krzysztof Kozlowski --- .../bindings/soc/samsung/samsung,exynos-sysreg.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 9f3fc6406d9d..23c54aba0a90 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -19,6 +19,10 @@ properties: - samsung,exynos5-sysreg - samsung,exynos850-sysreg - samsung,exynosautov9-sysreg + - tesla,fsd-cam-sysreg + - tesla,fsd-fsys0-sysreg + - tesla,fsd-fsys1-sysreg + - tesla,fsd-peric-sysreg - const: syscon - items: - enum: From 0a2af7bdeeb498e68771f9bb744aac79999f5980 Mon Sep 17 00:00:00 2001 From: Sriranjani P Date: Wed, 14 Dec 2022 10:13:39 +0530 Subject: [PATCH 05/12] dt-bindings: soc: samsung: exynos-sysreg: add dedicated SYSREG compatibles to Exynos850 Exynos850 has two different SYSREGs, hence add dedicated compatibles for them and deprecate usage of generic Exynos850 compatible alone. Signed-off-by: Sriranjani P Acked-by: Rob Herring Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20221214044342.49766-2-sriranjani.p@samsung.com Signed-off-by: Krzysztof Kozlowski --- .../soc/samsung/samsung,exynos-sysreg.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 23c54aba0a90..b44aa4c84782 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -17,7 +17,6 @@ properties: - samsung,exynos3-sysreg - samsung,exynos4-sysreg - samsung,exynos5-sysreg - - samsung,exynos850-sysreg - samsung,exynosautov9-sysreg - tesla,fsd-cam-sysreg - tesla,fsd-fsys0-sysreg @@ -33,9 +32,17 @@ properties: - const: samsung,exynos5433-sysreg - const: syscon - items: - - const: samsung,exynos5433-sysreg + - enum: + - samsung,exynos5433-sysreg + - samsung,exynos850-sysreg + - const: syscon + deprecated: true + - items: + - enum: + - samsung,exynos850-cmgp-sysreg + - samsung,exynos850-peri-sysreg + - const: samsung,exynos850-sysreg - const: syscon - deprecated: true reg: maxItems: 1 @@ -53,6 +60,8 @@ allOf: compatible: contains: enum: + - samsung,exynos850-cmgp-sysreg + - samsung,exynos850-peri-sysreg - samsung,exynos850-sysreg then: required: From dd5cc8072a3f285cff4f9a3869012557d547fb9d Mon Sep 17 00:00:00 2001 From: Sriranjani P Date: Wed, 14 Dec 2022 10:13:41 +0530 Subject: [PATCH 06/12] dt-bindings: soc: samsung: exynos-sysreg: add dedicated SYSREG compatibles to Exynosautov9 Exynosautov9 has several different SYSREGs, so use dedicated compatibles for them and deprecate usage of generic Exynosautov9 compatible alone. Signed-off-by: Sriranjani P Acked-by: Rob Herring Reviewed-by: Chanho Park Link: https://lore.kernel.org/r/20221214044342.49766-4-sriranjani.p@samsung.com Signed-off-by: Krzysztof Kozlowski --- .../bindings/soc/samsung/samsung,exynos-sysreg.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index b44aa4c84782..60958dac0345 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -17,7 +17,6 @@ properties: - samsung,exynos3-sysreg - samsung,exynos4-sysreg - samsung,exynos5-sysreg - - samsung,exynosautov9-sysreg - tesla,fsd-cam-sysreg - tesla,fsd-fsys0-sysreg - tesla,fsd-fsys1-sysreg @@ -35,6 +34,7 @@ properties: - enum: - samsung,exynos5433-sysreg - samsung,exynos850-sysreg + - samsung,exynosautov9-sysreg - const: syscon deprecated: true - items: @@ -43,6 +43,13 @@ properties: - samsung,exynos850-peri-sysreg - const: samsung,exynos850-sysreg - const: syscon + - items: + - enum: + - samsung,exynosautov9-fsys2-sysreg + - samsung,exynosautov9-peric0-sysreg + - samsung,exynosautov9-peric1-sysreg + - const: samsung,exynosautov9-sysreg + - const: syscon reg: maxItems: 1 From c14f161c1feda6f654978025fb64efd7280c3223 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 9 Jan 2023 09:39:48 +0100 Subject: [PATCH 07/12] dt-bindings: soc: samsung: exynos-sysreg: correct indentation for deprecated "deprecated" keyword was indentend wrong - entire list of compatibles starting with generic Exynos SoC compatible is deprecated. Reported-by: Rob Herring Fixes: 0a2af7bdeeb4 ("dt-bindings: soc: samsung: exynos-sysreg: add dedicated SYSREG compatibles to Exynos850") Link: https://lore.kernel.org/r/20230109083948.77462-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 60958dac0345..163e912e9cad 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -36,7 +36,7 @@ properties: - samsung,exynos850-sysreg - samsung,exynosautov9-sysreg - const: syscon - deprecated: true + deprecated: true - items: - enum: - samsung,exynos850-cmgp-sysreg From 5e487164afbcd917225fb701e8956f388f43b601 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 13 Jan 2023 11:40:50 +0100 Subject: [PATCH 08/12] MAINTAINERS: arm64: tesla: correct pattern for directory The path is actually not a pattern but a directory, so correct it to be effective. Acked-by: Alim Akhtar Link: https://lore.kernel.org/r/20230113104050.30856-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f61eb221415b..78f2cd951656 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3010,7 +3010,7 @@ M: linux-fsd@tesla.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-samsung-soc@vger.kernel.org S: Maintained -F: arch/arm64/boot/dts/tesla* +F: arch/arm64/boot/dts/tesla/ ARM/TETON BGA MACHINE SUPPORT M: "Mark F. Brown" From 2f22aafa0d3587a60248834891b988ccf014840f Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 27 Jan 2023 20:40:51 +0100 Subject: [PATCH 09/12] dt-bindings: phy: samsung,dp-video-phy: deprecate syscon phandle The DisplayPort phy is actually part of the Power Management Unit system controller, thus it should be its child, instead of sibling node with syscon phandle. Acked-by: Vinod Koul Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230127194057.186458-3-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/phy/samsung,dp-video-phy.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/samsung,dp-video-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,dp-video-phy.yaml index b03b2f00cc5b..3bee3f8733f7 100644 --- a/Documentation/devicetree/bindings/phy/samsung,dp-video-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,dp-video-phy.yaml @@ -22,13 +22,13 @@ properties: samsung,pmu-syscon: $ref: /schemas/types.yaml#/definitions/phandle + deprecated: true description: - Phandle to PMU system controller interface. + Phandle to PMU system controller interface (if not a child of PMU). required: - compatible - "#phy-cells" - - samsung,pmu-syscon additionalProperties: false @@ -36,6 +36,5 @@ examples: - | phy { compatible = "samsung,exynos5420-dp-video-phy"; - samsung,pmu-syscon = <&pmu_system_controller>; #phy-cells = <0>; }; From e179fc990129118c40267e923b6a35a59c47d588 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 27 Jan 2023 20:40:52 +0100 Subject: [PATCH 10/12] dt-bindings: phy: samsung,mipi-video-phy: deprecate syscon phandle The MIPI phy is actually part of the Power Management Unit system controller, thus it should be its child, instead of sibling node with syscon phandle. Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230127194057.186458-4-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- .../bindings/phy/samsung,mipi-video-phy.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/samsung,mipi-video-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,mipi-video-phy.yaml index 415440aaad89..b2250e4a6b1b 100644 --- a/Documentation/devicetree/bindings/phy/samsung,mipi-video-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,mipi-video-phy.yaml @@ -35,15 +35,18 @@ properties: syscon: $ref: /schemas/types.yaml#/definitions/phandle + deprecated: true description: Phandle to PMU system controller interface, valid only for - samsung,s5pv210-mipi-video-phy and samsung,exynos5420-mipi-video-phy. + samsung,s5pv210-mipi-video-phy and samsung,exynos5420-mipi-video-phy (if + not a child of PMU). samsung,pmu-syscon: $ref: /schemas/types.yaml#/definitions/phandle + deprecated: true description: Phandle to PMU system controller interface, valid for - samsung,exynos5433-mipi-video-phy. + samsung,exynos5433-mipi-video-phy (if not a child of PMU). samsung,disp-sysreg: $ref: /schemas/types.yaml#/definitions/phandle @@ -81,13 +84,10 @@ allOf: samsung,disp-sysreg: false samsung,cam0-sysreg: false samsung,cam1-sysreg: false - required: - - syscon else: properties: syscon: false required: - - samsung,pmu-syscon - samsung,disp-sysreg - samsung,cam0-sysreg - samsung,cam1-sysreg @@ -99,7 +99,6 @@ examples: phy { compatible = "samsung,exynos5433-mipi-video-phy"; #phy-cells = <1>; - samsung,pmu-syscon = <&pmu_system_controller>; samsung,cam0-sysreg = <&syscon_cam0>; samsung,cam1-sysreg = <&syscon_cam1>; samsung,disp-sysreg = <&syscon_disp>; From 220fc39815e13b1af901a61e5992c1a96b1dca78 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 27 Jan 2023 20:40:53 +0100 Subject: [PATCH 11/12] phy: samsung,dp-video-phy: deprecate syscon phandle The DisplayPort phy is actually part of the Power Management Unit system controller, thus it should be its child, instead of sibling node with syscon phandle. Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230127194057.186458-5-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- drivers/phy/samsung/phy-exynos-dp-video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos-dp-video.c b/drivers/phy/samsung/phy-exynos-dp-video.c index 2b670ef91deb..6069fedbd8f3 100644 --- a/drivers/phy/samsung/phy-exynos-dp-video.c +++ b/drivers/phy/samsung/phy-exynos-dp-video.c @@ -83,8 +83,11 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) if (!state) return -ENOMEM; - state->regs = syscon_regmap_lookup_by_phandle(dev->of_node, - "samsung,pmu-syscon"); + state->regs = syscon_node_to_regmap(dev->parent->of_node); + if (IS_ERR(state->regs)) + /* Backwards compatible way */ + state->regs = syscon_regmap_lookup_by_phandle(dev->of_node, + "samsung,pmu-syscon"); if (IS_ERR(state->regs)) { dev_err(dev, "Failed to lookup PMU regmap\n"); return PTR_ERR(state->regs); From 7ecd4e5f5de23022d1a1c92058949ddf1a2113ff Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 27 Jan 2023 20:40:54 +0100 Subject: [PATCH 12/12] phy: samsung,mipi-video-phy: deprecate syscon phandle The MIPI phy is actually part of the Power Management Unit system controller, thus it should be its child, instead of sibling node with syscon phandle. Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230127194057.186458-6-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski --- drivers/phy/samsung/phy-exynos-mipi-video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos-mipi-video.c b/drivers/phy/samsung/phy-exynos-mipi-video.c index c1df1ef3ee3c..a7f67857e5b2 100644 --- a/drivers/phy/samsung/phy-exynos-mipi-video.c +++ b/drivers/phy/samsung/phy-exynos-mipi-video.c @@ -298,7 +298,7 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; struct phy_provider *phy_provider; - unsigned int i; + unsigned int i = 0; phy_dev = of_device_get_match_data(dev); if (!phy_dev) @@ -308,7 +308,10 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) if (!state) return -ENOMEM; - for (i = 0; i < phy_dev->num_regmaps; i++) { + state->regmaps[i] = syscon_node_to_regmap(dev->parent->of_node); + if (!IS_ERR(state->regmaps[i])) + i++; + for (; i < phy_dev->num_regmaps; i++) { state->regmaps[i] = syscon_regmap_lookup_by_phandle(np, phy_dev->regmap_names[i]); if (IS_ERR(state->regmaps[i]))