On 2024-11-30 03:44:12, Dmitry Baryshkov wrote: > Multiple Qualcomm platforms play strange tricks with board-level clocks > (XO, sleep) definitions. On some (older) platforms such clocks are > completely defined within SoC.dtsi file (although these clocks are not a > part of the SoC). On other platforms definitions of such clocks are > split between the SoC dtsi file and the board file. Several obscure > platforms define those clocks completely in the board files. Unify the > design and move complete description of those clocks to the SoC DTSI > file. > > The XO clock is (usually) an external crystal used by the external PMIC, > which then provides RF CLK and LN BB CLK to the main SoC. However for > technical reasons this part of the PMIC is modelled as a part of the SoC > as RPM or RPMh clock controllers. It makes it impractical to describe XO > clock as being used or being connected to the PMIC. > > Sleep clock is a 32.764 kHz RC oscillator provided by one of > PMICs. However pushing it into the PMIC might interact badly with fw > devlink, causing unnecessary probe delays and/or devlink loops. One of > the possible solutions might be to move it to the corresponding > PMIC.dtsi, but model the clock outside of the PMIC node, providing > /clocks/sleep-clk node from that file. > > Note, the series includes a set of fixes for the sleep clocks > frequencies. For several platforms I wasn't able to find corresponding > document and as such I didn't change defined clocks. These platforms > are: IPQ5018, IPQ5332, IPQ5424, IPQ6018, IPQ8074, IPQ9574, MSM8953. > > Also several MSM8996 / MSM8994 devices define divisor clocks at > 32.768 kHz. Most likely these clocks are also generated by dividing the > 19.2 MHz clock and should have the frequency 32.764 kHz, but being not > 100% sure I decided to leave those as is for now. > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> > --- > Changes in v2: > - Move clocks to SoC DTSI (offline discussion with Bjorn) > - Link to v1: https://lore.kernel.org/r/20241115-fix-board-clocks-v1-0-8cb00a4f57c2@xxxxxxxxxx > > --- > Dmitry Baryshkov (31): > arm64: dts: qcom: msm8916: correct sleep clock frequency > arm64: dts: qcom: msm8939: correct sleep clock frequency > arm64: dts: qcom: msm8994: correct sleep clock frequency > arm64: dts: qcom: qcs404: correct sleep clock frequency > arm64: dts: qcom: q[dr]u1000: correct sleep clock frequency > arm64: dts: qcom: qrb4210-rb2: correct sleep clock frequency > arm64: dts: qcom: sar2130p: correct sleep clock frequency > arm64: dts: qcom: sc7280: correct sleep clock frequency > arm64: dts: qcom: sdx75: correct sleep clock frequency > arm64: dts: qcom: sm4450: correct sleep clock frequency > arm64: dts: qcom: sm6125: correct sleep clock frequency > arm64: dts: qcom: sm6375: correct sleep clock frequency > arm64: dts: qcom: sm8250: correct sleep clock frequency > arm64: dts: qcom: sm8350: correct sleep clock frequency > arm64: dts: qcom: sm8450: correct sleep clock frequency > arm64: dts: qcom: sm8550: correct sleep clock frequency > arm64: dts: qcom: sm8650: correct sleep clock frequency > arm64: dts: qcom: x1e80100: correct sleep clock frequency > arm64: dts: qcom: sc8180x: drop extra XO clock frequencies > arm64: dts: qcom: ipq5018: move board clocks to ipq5018.dtsi file > arm64: dts: qcom: ipq5332: move board clocks to ipq5332.dtsi file > arm64: dts: qcom: ipq5424: move board clocks to ipq5424.dtsi file > arm64: dts: qcom: ipq9574: move board clocks to ipq9574.dtsi file > arm64: dts: qcom: qcm2290: move board clocks to qcm2290.dtsi file > arm64: dts: qcom: sc8280xp: move board clocks to sc8280xp.dtsi file > arm64: dts: qcom: sm6115: move board clocks to sm6115.dtsi file > arm64: dts: qcom: sm6375: move board clocks to sm6375.dtsi file > arm64: dts: qcom: sm8550: move board clocks to sm8550.dtsi file > arm64: dts: qcom: sm8650: move board clocks to sm8650.dtsi file > arm64: dts: qcom: sdm670: move board clocks to sdm670.dtsi file > arm64: dts: qcom: q[dr]u1000: move board clocks to qdu1000.dtsi file > > arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts | 8 -------- > arch/arm64/boot/dts/qcom/ipq5018-tplink-archer-ax55-v1.dts | 8 -------- > arch/arm64/boot/dts/qcom/ipq5018.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi | 8 -------- > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/ipq5424-rdp466.dts | 9 --------- > arch/arm64/boot/dts/qcom/ipq5424.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi | 8 -------- > arch/arm64/boot/dts/qcom/ipq9574.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- > arch/arm64/boot/dts/qcom/msm8939.dtsi | 2 +- > arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +- > arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 + > arch/arm64/boot/dts/qcom/qcs404.dtsi | 2 +- > arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi | 8 -------- > arch/arm64/boot/dts/qcom/qdu1000-idp.dts | 14 -------------- > arch/arm64/boot/dts/qcom/qdu1000.dtsi | 14 ++++++++++++++ > arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 4 ---- > arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 8 -------- > arch/arm64/boot/dts/qcom/qru1000-idp.dts | 14 -------------- > arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 4 ---- > arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 4 ---- > arch/arm64/boot/dts/qcom/sar2130p.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 4 ---- > arch/arm64/boot/dts/qcom/sc8180x-primus.dts | 4 ---- > arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 4 ---- > arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 4 ---- > arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts | 4 ---- > arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 1 + > arch/arm64/boot/dts/qcom/sdm670-google-sargo.dts | 14 -------------- > arch/arm64/boot/dts/qcom/sdm670.dtsi | 14 ++++++++++++++ > arch/arm64/boot/dts/qcom/sdx75.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm4450.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm6115.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm6125.dtsi | 2 +- > .../boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts | 4 ---- > arch/arm64/boot/dts/qcom/sm6375.dtsi | 3 ++- > arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm8350.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm8450.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm8550-hdk.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts | 8 -------- > .../arm64/boot/dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/sm8650-hdk.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8650-mtp.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 8 -------- > arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 ++ > arch/arm64/boot/dts/qcom/x1e80100.dtsi | 2 +- > 55 files changed, 59 insertions(+), 237 deletions(-) It looks like MSM8956/MSM8976 is missing from this list, which most recently had the its frequency moved out to the loire board in 4a2c9b9e1215 ("arm64: dts: qcom: msm8976: Add and provide xo clk to rpmcc"). Searching for the `^&sleep_clk` and `^&xo_board` patterns shows `sa8775p-ride.dtsi` is still overriding these clocks as well, noting that the label is named `xo_board_clk` on sa8775p and a few platforms but `xo_board` on everything else... - Marijn > --- > base-commit: cfba9f07a1d6aeca38f47f1f472cfb0ba133d341 > change-id: 20241115-fix-board-clocks-e3afe520627c > > Best regards, > -- > Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> >