2022-05-02 08:06:43

by Christian Marangi

[permalink] [raw]
Subject: [PATCH v2 0/2] PXO fixes for ipq8064 dtsi

This small series is a fix for a long lasting error present in ipq8064
dtsi. At times the kpss-gcc driver was defined in the dts with
<&gcc PXO_SRC> a pxo clock. While PXO_SRC exist in the includes, the gcc
driver never expose it and if a driver try to actually use it the result
is a kernel panic even before any log is init.

To prepare for correct conversion of the different krait drivers to
parent data and to reflect what is defined in the Documentation with
actual driver and dts implementation, fix this error by using the now
defined pxo_board fixed clock.

v2:
- Swap patch 1 with patch 2 (fixes first changes second)
- Add fixes tag

Ansuel Smith (2):
ARM: dts: qcom: replace gcc PXO with pxo_board fixed clock
ARM: dts: qcom: add syscon and cxo/pxo clock to gcc node for ipq8064

arch/arm/boot/dts/qcom-ipq8064.dtsi | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

--
2.34.1


2022-05-02 23:51:56

by Christian Marangi

[permalink] [raw]
Subject: [PATCH v2 2/2] ARM: dts: qcom: add syscon and cxo/pxo clock to gcc node for ipq8064

Add syscon compatible required for tsens driver to correctly probe driver
and access the reg. Also add cxo and pxo tag and declare them as gcc clock
now requires them for the ipq8064 gcc driver that has now been modernized.

Signed-off-by: Ansuel Smith <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm/boot/dts/qcom-ipq8064.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index e6ca8d1d1c5f..ad30f7c8a5a7 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -298,7 +298,7 @@ smem: smem@41000000 {
};

clocks {
- cxo_board {
+ cxo_board: cxo_board {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
@@ -736,7 +736,9 @@ tsens_calib_backup: calib_backup@410 {
};

gcc: clock-controller@900000 {
- compatible = "qcom,gcc-ipq8064";
+ compatible = "qcom,gcc-ipq8064", "syscon";
+ clocks = <&pxo_board>, <&cxo_board>;
+ clock-names = "pxo", "cxo";
reg = <0x00900000 0x4000>;
#clock-cells = <1>;
#reset-cells = <1>;
--
2.34.1

2022-05-03 00:55:37

by Christian Marangi

[permalink] [raw]
Subject: [PATCH v2 1/2] ARM: dts: qcom: replace gcc PXO with pxo_board fixed clock

Replace gcc PXO phandle to pxo_board fixed clock declared in the dts.
gcc driver doesn't provide PXO_SRC as it's a fixed-clock. This cause a
kernel panic if any driver actually try to use it.

Fixes: 40cf5c884a96 ("ARM: dts: qcom: add L2CC and RPM for IPQ8064")
Signed-off-by: Ansuel Smith <[email protected]>
---
arch/arm/boot/dts/qcom-ipq8064.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 996f4458d9fc..e6ca8d1d1c5f 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -304,7 +304,7 @@ cxo_board {
clock-frequency = <25000000>;
};

- pxo_board {
+ pxo_board: pxo_board {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
@@ -782,7 +782,7 @@ tcsr: syscon@1a400000 {
l2cc: clock-controller@2011000 {
compatible = "qcom,kpss-gcc", "syscon";
reg = <0x2011000 0x1000>;
- clocks = <&gcc PLL8_VOTE>, <&gcc PXO_SRC>;
+ clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
clock-names = "pll8_vote", "pxo";
clock-output-names = "acpu_l2_aux";
};
--
2.34.1

2022-05-03 01:11:17

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ARM: dts: qcom: add syscon and cxo/pxo clock to gcc node for ipq8064

On Sat, 30 Apr 2022 at 15:59, Ansuel Smith <[email protected]> wrote:
>
> Add syscon compatible required for tsens driver to correctly probe driver
> and access the reg. Also add cxo and pxo tag and declare them as gcc clock
> now requires them for the ipq8064 gcc driver that has now been modernized.
>
> Signed-off-by: Ansuel Smith <[email protected]>
> Reviewed-by: Bjorn Andersson <[email protected]>
> Reviewed-by: Stephen Boyd <[email protected]>

Reviewed-by: Dmitry Baryshkov <[email protected]>

> ---
> arch/arm/boot/dts/qcom-ipq8064.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index e6ca8d1d1c5f..ad30f7c8a5a7 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -298,7 +298,7 @@ smem: smem@41000000 {
> };
>
> clocks {
> - cxo_board {
> + cxo_board: cxo_board {
> compatible = "fixed-clock";
> #clock-cells = <0>;
> clock-frequency = <25000000>;
> @@ -736,7 +736,9 @@ tsens_calib_backup: calib_backup@410 {
> };
>
> gcc: clock-controller@900000 {
> - compatible = "qcom,gcc-ipq8064";
> + compatible = "qcom,gcc-ipq8064", "syscon";
> + clocks = <&pxo_board>, <&cxo_board>;
> + clock-names = "pxo", "cxo";
> reg = <0x00900000 0x4000>;
> #clock-cells = <1>;
> #reset-cells = <1>;
> --
> 2.34.1
>


--
With best wishes
Dmitry

2022-07-03 03:58:23

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] PXO fixes for ipq8064 dtsi

On Sat, 30 Apr 2022 07:51:16 +0200, Ansuel Smith wrote:
> This small series is a fix for a long lasting error present in ipq8064
> dtsi. At times the kpss-gcc driver was defined in the dts with
> <&gcc PXO_SRC> a pxo clock. While PXO_SRC exist in the includes, the gcc
> driver never expose it and if a driver try to actually use it the result
> is a kernel panic even before any log is init.
>
> To prepare for correct conversion of the different krait drivers to
> parent data and to reflect what is defined in the Documentation with
> actual driver and dts implementation, fix this error by using the now
> defined pxo_board fixed clock.
>
> [...]

Applied, thanks!

[1/2] ARM: dts: qcom: replace gcc PXO with pxo_board fixed clock
commit: eb9e93937756a05787977875830c0dc482cb57e0
[2/2] ARM: dts: qcom: add syscon and cxo/pxo clock to gcc node for ipq8064
(no commit info)

Best regards,
--
Bjorn Andersson <[email protected]>