dt-bindings: clock: Add Qualcomm SC8280XP GCC bindings
PATCH v2 1/2 dt-bindings: clock: Add Qualcomm SC8280XP GCC bindings
Add binding for the Qualcomm SC8280XP Global Clock controller.
---
Changes since v1:
- None
.../bindings/clock/qcom,gcc-sc8280xp.yaml | 199 +++++++ include/dt-bindings/clock/qcom,gcc-sc8280xp.h | 496 ++++++++++++++++++ 2 files changed, 695 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml create mode 100644 include/dt-bindings/clock/qcom,gcc-sc8280xp.h
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +199 -0
@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,gcc-sc8280xp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Global Clock & Reset Controller Binding for SC8280xp + +maintainers: + - Bjorn Andersson <[email protected]> + +description: | + Qualcomm global clock control module which supports the clocks, resets and + power domains on SC8280xp. + + See also: + - dt-bindings/clock/qcom,gcc-sc8280xp.h + +properties: + compatible: + const: qcom,gcc-sc8280xp + + clocks: + items: + - description: XO reference clock + - description: Sleep clock + - description: UFS memory first RX symbol clock + - description: UFS memory second RX symbol clock + - description: UFS memory first TX symbol clock + - description: UFS card first RX symbol clock + - description: UFS card second RX symbol clock + - description: UFS card first TX symbol clock + - description: Primary USB SuperSpeed pipe clock + - description: gcc_usb4_phy_pipegmux_clk_src + - description: gcc_usb4_phy_dp_gmux_clk_src + - description: gcc_usb4_phy_sys_pipegmux_clk_src + - description: usb4_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_phy_gcc_usb4rtr_max_pipe_clk + - description: Primary USB4 RX0 clock + - description: Primary USB4 RX1 clock + - description: Secondary USB SuperSpeed pipe clock + - description: gcc_usb4_1_phy_pipegmux_clk_src + - description: gcc_usb4_1_phy_dp_gmux_clk_src + - description: gcc_usb4_1_phy_sys_pipegmux_clk_src + - description: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - description: Secondary USB4 RX0 clock + - description: Secondary USB4 RX0 clock + - description: Multiport USB first SupserSpeed pipe clock + - description: Multiport USB second SuperSpeed pipe clock + - description: PCIe 2a pipe clock + - description: PCIe 2b pipe clock + - description: PCIe 3a pipe clock + - description: PCIe 3b pipe clock + - description: PCIe 4 pipe clock + - description: First EMAC controller reference clock + - description: Second EMAC controller reference clock + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clk + - const: ufs_phy_rx_symbol_0_clk + - const: ufs_phy_rx_symbol_1_clk + - const: ufs_phy_tx_symbol_0_clk + - const: ufs_card_rx_symbol_0_clk + - const: ufs_card_rx_symbol_1_clk + - const: ufs_card_tx_symbol_0_clk + - const: usb3_phy_wrapper_gcc_usb30_pipe_clk + - const: gcc_usb4_phy_pipegmux_clk_src + - const: gcc_usb4_phy_dp_gmux_clk_src + - const: gcc_usb4_phy_sys_pipegmux_clk_src + - const: usb4_phy_gcc_usb4_pcie_pipe_clk + - const: usb4_phy_gcc_usb4rtr_max_pipe_clk + - const: qusb4phy_gcc_usb4_rx0_clk + - const: qusb4phy_gcc_usb4_rx1_clk + - const: usb3_uni_phy_sec_gcc_usb30_pipe_clk + - const: gcc_usb4_1_phy_pipegmux_clk_src + - const: gcc_usb4_1_phy_dp_gmux_clk_src + - const: gcc_usb4_1_phy_sys_pipegmux_clk_src + - const: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - const: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - const: qusb4phy_1_gcc_usb4_rx0_clk + - const: qusb4phy_1_gcc_usb4_rx1_clk + - const: usb3_uni_phy_mp_gcc_usb30_pipe_0_clk + - const: usb3_uni_phy_mp_gcc_usb30_pipe_1_clk + - const: pcie_2a_pipe_clk + - const: pcie_2b_pipe_clk + - const: pcie_3a_pipe_clk + - const: pcie_3b_pipe_clk + - const: pcie_4_pipe_clk + - const: rxc0_ref_clk + - const: rxc1_ref_clk + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + + protected-clocks: + description: + Protected clock specifier list as per common clock binding. + +required: + - compatible + - clocks + - clock-names + - reg + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@100000 { + compatible = "qcom,gcc-sc8280xp"; + reg = <0x00100000 0x1f0000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&sleep_clk>, + <&ufs_phy_rx_symbol_0_clk>, + <&ufs_phy_rx_symbol_1_clk>, + <&ufs_phy_tx_symbol_0_clk>, + <&ufs_card_rx_symbol_0_clk>, + <&ufs_card_rx_symbol_1_clk>, + <&ufs_card_tx_symbol_0_clk>, + <&usb_0_ssphy>, + <&gcc_usb4_phy_pipegmux_clk_src>, + <&gcc_usb4_phy_dp_gmux_clk_src>, + <&gcc_usb4_phy_sys_pipegmux_clk_src>, + <&usb4_phy_gcc_usb4_pcie_pipe_clk>, + <&usb4_phy_gcc_usb4rtr_max_pipe_clk>, + <&qusb4phy_gcc_usb4_rx0_clk>, + <&qusb4phy_gcc_usb4_rx1_clk>, + <&usb_1_ssphy>, + <&gcc_usb4_1_phy_pipegmux_clk_src>, + <&gcc_usb4_1_phy_dp_gmux_clk_src>, + <&gcc_usb4_1_phy_sys_pipegmux_clk_src>, + <&usb4_1_phy_gcc_usb4_pcie_pipe_clk>, + <&usb4_1_phy_gcc_usb4rtr_max_pipe_clk>, + <&qusb4phy_1_gcc_usb4_rx0_clk>, + <&qusb4phy_1_gcc_usb4_rx1_clk>, + <&usb_2_ssphy>, + <&usb_3_ssphy>, + <&pcie2a_lane>, + <&pcie2b_lane>, + <&pcie3a_lane>, + <&pcie3b_lane>, + <&pcie4_lane>, + <&rxc0_ref_clk>, + <&rxc1_ref_clk>; + clock-names = "bi_tcxo", + "sleep_clk", + "ufs_phy_rx_symbol_0_clk", + "ufs_phy_rx_symbol_1_clk", + "ufs_phy_tx_symbol_0_clk", + "ufs_card_rx_symbol_0_clk", + "ufs_card_rx_symbol_1_clk", + "ufs_card_tx_symbol_0_clk", + "usb3_phy_wrapper_gcc_usb30_pipe_clk", + "gcc_usb4_phy_pipegmux_clk_src", + "gcc_usb4_phy_dp_gmux_clk_src", + "gcc_usb4_phy_sys_pipegmux_clk_src", + "usb4_phy_gcc_usb4_pcie_pipe_clk", + "usb4_phy_gcc_usb4rtr_max_pipe_clk", + "qusb4phy_gcc_usb4_rx0_clk", + "qusb4phy_gcc_usb4_rx1_clk", + "usb3_uni_phy_sec_gcc_usb30_pipe_clk", + "gcc_usb4_1_phy_pipegmux_clk_src", + "gcc_usb4_1_phy_dp_gmux_clk_src", + "gcc_usb4_1_phy_sys_pipegmux_clk_src", + "usb4_1_phy_gcc_usb4_pcie_pipe_clk", + "usb4_1_phy_gcc_usb4rtr_max_pipe_clk", + "qusb4phy_1_gcc_usb4_rx0_clk", + "qusb4phy_1_gcc_usb4_rx1_clk", + "usb3_uni_phy_mp_gcc_usb30_pipe_0_clk", + "usb3_uni_phy_mp_gcc_usb30_pipe_1_clk", + "pcie_2a_pipe_clk", + "pcie_2b_pipe_clk", + "pcie_3a_pipe_clk", + "pcie_3b_pipe_clk", + "pcie_4_pipe_clk", + "rxc0_ref_clk", + "rxc1_ref_clk"; + + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...
include/dt-bindings/clock/qcom,gcc-sc8280xp.h new file +496 -0
496 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH v2 2/2 clk: qcom: add sc8280xp GCC driver
Add support for the Global Clock Controller found in the Qualcomm SC8280XP platform.
---
Changes since v1:
- Extracted gcc_parent_data_tcxo
- Dropped some leftover comments
drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 7451 +++++++++++++++++++++++++++++++ 3 files changed, 7461 insertions(+) create mode 100644 drivers/clk/qcom/gcc-sc8280xp.c
drivers/clk/qcom/Kconfig +9 -0
@@ -419,6 +419,15 @@ config SC_GCC_8180X Say Y if you want to use peripheral devices such as UART, SPI, I2C, USB, UFS, SDCC, etc. +config SC_GCC_8280XP + tristate "SC8280XP Global Clock Controller" + select QCOM_GDSC + depends on COMMON_CLK_QCOM + help + Support for the global clock controller on SC8280XP devices. + Say Y if you want to use peripheral devices such as UART, SPI, + I2C, USB, UFS, SDCC, etc. + config SC_GPUCC_7180 tristate "SC7180 Graphics Clock Controller" select SC_GCC_7180
drivers/clk/qcom/Makefile +1 -0
@@ -67,6 +67,7 @@ obj-$(CONFIG_SC_DISPCC_7280) += dispcc-sc7280.o obj-$(CONFIG_SC_GCC_7180) += gcc-sc7180.o obj-$(CONFIG_SC_GCC_7280) += gcc-sc7280.o obj-$(CONFIG_SC_GCC_8180X) += gcc-sc8180x.o +obj-$(CONFIG_SC_GCC_8280XP) += gcc-sc8280xp.o obj-$(CONFIG_SC_GPUCC_7180) += gpucc-sc7180.o obj-$(CONFIG_SC_GPUCC_7280) += gpucc-sc7280.o obj-$(CONFIG_SC_LPASSCC_7280) += lpasscc-sc7280.o
drivers/clk/qcom/gcc-sc8280xp.c new file +7451 -0
2,978 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.35.1
Part of the diff is not shown here. View the raw message.
Stephen Boyd
maintainerRe: [PATCH v2 2/2] clk: qcom: add sc8280xp GCC driver
Quoting Bjorn Andersson (2022-04-22 16:00:13)
Quoted 6 lines
drivers/clk/qcom/gcc-sc8280xp.c new file +0
-0@@ -0,0 +1,7451 @@
[...]
drivers/clk/qcom/gcc-sc8280xp.c line 6764
Quoted 9 lines
drivers/clk/qcom/gcc-sc8280xp.c new file +9
-0+static struct clk_branch gcc_video_vcodec_throttle_clk = { + .halt_reg =0x28020 , + .halt_check =BRANCH_HALT_SKIP , + .hwcg_reg =0x28020 , + .hwcg_bit =1 , + .clkr = { + .enable_reg =0x28020 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){
The clk_init_data can be const too, right?
Quoted 5 lines
drivers/clk/qcom/gcc-sc8280xp.c new file +5
-0+ .name = "gcc_video_vcodec_throttle_clk", + .ops = &clk_branch2_ops, + }, + }, +};
Stephen Boyd
maintainerQuoting Bjorn Andersson (2022-04-22 16:00:12)
Quoted 3 lines
Add binding for the Qualcomm SC8280XP Global Clock controller.
Signed-off-by Bjorn Andersson <[email protected]>
Why no cover letter?
Quoted 21 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +15
-0@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,gcc-sc8280xp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Global Clock & Reset Controller Binding for SC8280xp + +maintainers: + - Bjorn Andersson <[email protected]> + +description: | + Qualcomm global clock control module which supports the clocks, resets and + power domains on SC8280xp. +
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 25
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +10
-0+ See also: + - dt-bindings/clock/qcom,gcc-sc8280xp.h + +properties: + compatible: + const: qcom,gcc-sc8280xp + + clocks: + items: + - description: XO reference clock
"clock" is redundant in all these descriptions. Please remove.
Quoted 27 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +27
-0+ - description: Sleep clock + - description: UFS memory first RX symbol clock + - description: UFS memory second RX symbol clock + - description: UFS memory first TX symbol clock + - description: UFS card first RX symbol clock + - description: UFS card second RX symbol clock + - description: UFS card first TX symbol clock + - description: Primary USB SuperSpeed pipe clock + - description: gcc_usb4_phy_pipegmux_clk_src + - description: gcc_usb4_phy_dp_gmux_clk_src + - description: gcc_usb4_phy_sys_pipegmux_clk_src + - description: usb4_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_phy_gcc_usb4rtr_max_pipe_clk + - description: Primary USB4 RX0 clock + - description: Primary USB4 RX1 clock + - description: Secondary USB SuperSpeed pipe clock + - description: gcc_usb4_1_phy_pipegmux_clk_src + - description: gcc_usb4_1_phy_dp_gmux_clk_src + - description: gcc_usb4_1_phy_sys_pipegmux_clk_src + - description: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - description: Secondary USB4 RX0 clock + - description: Secondary USB4 RX0 clock + - description: Multiport USB first SupserSpeed pipe clock + - description: Multiport USB second SuperSpeed pipe clock + - description: PCIe 2a pipe clock + - description: PCIe 2b pipe clock
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 62
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +10
-0+ - description: PCIe 3a pipe clock + - description: PCIe 3b pipe clock + - description: PCIe 4 pipe clock + - description: First EMAC controller reference clock + - description: Second EMAC controller reference clock + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clk
And "_clk" postfix is redundant in all these strings. Remove?
Quoted 15 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +15
-0+ - const: ufs_phy_rx_symbol_0_clk + - const: ufs_phy_rx_symbol_1_clk + - const: ufs_phy_tx_symbol_0_clk + - const: ufs_card_rx_symbol_0_clk + - const: ufs_card_rx_symbol_1_clk + - const: ufs_card_tx_symbol_0_clk + - const: usb3_phy_wrapper_gcc_usb30_pipe_clk + - const: gcc_usb4_phy_pipegmux_clk_src + - const: gcc_usb4_phy_dp_gmux_clk_src + - const: gcc_usb4_phy_sys_pipegmux_clk_src + - const: usb4_phy_gcc_usb4_pcie_pipe_clk + - const: usb4_phy_gcc_usb4rtr_max_pipe_clk + - const: qusb4phy_gcc_usb4_rx0_clk + - const: qusb4phy_gcc_usb4_rx1_clk + - const: usb3_uni_phy_sec_gcc_usb30_pipe_clk
Quoted 7 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 16:00:12)
Quoted 3 lines
Add binding for the Qualcomm SC8280XP Global Clock controller.
Signed-off-by Bjorn Andersson <[email protected]>Why no cover letter?
I didn't have anything useful to write in it. Will provide you one in the future...
Quoted 25 lines
Quoted 25 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +19
-0@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,gcc-sc8280xp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Global Clock & Reset Controller Binding for SC8280xp + +maintainers: + - Bjorn Andersson <[email protected]> + +description: | + Qualcomm global clock control module which supports the clocks, resets and + power domains on SC8280xp. + + See also: + - dt-bindings/clock/qcom,gcc-sc8280xp.h + +properties:
Quoted 9 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 25
Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +6
-0+ compatible: + const: qcom,gcc-sc8280xp + + clocks: + items: + - description: XO reference clock"clock" is redundant in all these descriptions. Please remove.
You don't think it's a little bit odd to have description such as "Sleep", "PCIe 2a pipe" or First EMAC controller reference"?
I mean I agree that it's obviously clocks we're talking about, but to me that makes it seems like the descriptions are cut short, just for the sake of avoiding "clock".
Quoted 38 lines
Quoted 27 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +27
-0+ - description: Sleep clock + - description: UFS memory first RX symbol clock + - description: UFS memory second RX symbol clock + - description: UFS memory first TX symbol clock + - description: UFS card first RX symbol clock + - description: UFS card second RX symbol clock + - description: UFS card first TX symbol clock + - description: Primary USB SuperSpeed pipe clock + - description: gcc_usb4_phy_pipegmux_clk_src + - description: gcc_usb4_phy_dp_gmux_clk_src + - description: gcc_usb4_phy_sys_pipegmux_clk_src + - description: usb4_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_phy_gcc_usb4rtr_max_pipe_clk + - description: Primary USB4 RX0 clock + - description: Primary USB4 RX1 clock + - description: Secondary USB SuperSpeed pipe clock + - description: gcc_usb4_1_phy_pipegmux_clk_src + - description: gcc_usb4_1_phy_dp_gmux_clk_src + - description: gcc_usb4_1_phy_sys_pipegmux_clk_src + - description: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - description: Secondary USB4 RX0 clock + - description: Secondary USB4 RX0 clock + - description: Multiport USB first SupserSpeed pipe clock + - description: Multiport USB second SuperSpeed pipe clock + - description: PCIe 2a pipe clock + - description: PCIe 2b pipe clockDocumentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 62
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +10
-0+ - description: PCIe 3a pipe clock + - description: PCIe 3b pipe clock + - description: PCIe 4 pipe clock + - description: First EMAC controller reference clock + - description: Second EMAC controller reference clock + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clk
Quoted 2 lines
And "
_clk" postfix is redundant in all these strings. Remove?
In this case I think they should include _clk, as they actually matches the clock names in the documentation.
Regards,
Bjorn
Quoted 15 lines
Quoted 15 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +15
-0+ - const: ufs_phy_rx_symbol_0_clk + - const: ufs_phy_rx_symbol_1_clk + - const: ufs_phy_tx_symbol_0_clk + - const: ufs_card_rx_symbol_0_clk + - const: ufs_card_rx_symbol_1_clk + - const: ufs_card_tx_symbol_0_clk + - const: usb3_phy_wrapper_gcc_usb30_pipe_clk + - const: gcc_usb4_phy_pipegmux_clk_src + - const: gcc_usb4_phy_dp_gmux_clk_src + - const: gcc_usb4_phy_sys_pipegmux_clk_src + - const: usb4_phy_gcc_usb4_pcie_pipe_clk + - const: usb4_phy_gcc_usb4rtr_max_pipe_clk + - const: qusb4phy_gcc_usb4_rx0_clk + - const: qusb4phy_gcc_usb4_rx1_clk + - const: usb3_uni_phy_sec_gcc_usb30_pipe_clk
Stephen Boyd
maintainerQuoting Bjorn Andersson (2022-04-22 20:02:57)
Quoted 5 lines · Stephen Boyd
Quoted 4 lines
Quoting Bjorn Andersson (2022-04-22 16:00:12)
Quoted 2 lines
Add binding for the Qualcomm SC8280XP Global Clock controller.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Bjorn Andersson <[email protected]>Why no cover letter?
I didn't have anything useful to write in it. Will provide you one in the future...
Thanks!
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 25
Quoted 3 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +3
-0+ clocks: + items: + - description: XO reference clock"clock" is redundant in all these descriptions. Please remove.
Quoted 6 lines
You don't think it's a little bit odd to have description such as "Sleep", "PCIe 2a pipe" or First EMAC controller reference"?
I mean I agree that it's obviously clocks we're talking about, but to me that makes it seems like the descriptions are cut short, just for the sake of avoiding "clock".
Alright, keeping clock is OK as long as
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 34
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +9
-0+ - description: Sleep clock + - description: UFS memory first RX symbol clock + - description: UFS memory second RX symbol clock + - description: UFS memory first TX symbol clock + - description: UFS card first RX symbol clock + - description: UFS card second RX symbol clock + - description: UFS card first TX symbol clock + - description: Primary USB SuperSpeed pipe clock + - description: gcc_usb4_phy_pipegmux_clk_src
there is a better name for this and the other non-word descriptions.
USB4 phy pipe gmux clock source?
Quoted 29 lines
Quoted 29 lines
Quoted 28 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +28
-0+ - description: gcc_usb4_phy_dp_gmux_clk_src + - description: gcc_usb4_phy_sys_pipegmux_clk_src + - description: usb4_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_phy_gcc_usb4rtr_max_pipe_clk + - description: Primary USB4 RX0 clock + - description: Primary USB4 RX1 clock + - description: Secondary USB SuperSpeed pipe clock + - description: gcc_usb4_1_phy_pipegmux_clk_src + - description: gcc_usb4_1_phy_dp_gmux_clk_src + - description: gcc_usb4_1_phy_sys_pipegmux_clk_src + - description: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - description: Secondary USB4 RX0 clock + - description: Secondary USB4 RX0 clock + - description: Multiport USB first SupserSpeed pipe clock + - description: Multiport USB second SuperSpeed pipe clock + - description: PCIe 2a pipe clock + - description: PCIe 2b pipe clock + - description: PCIe 3a pipe clock + - description: PCIe 3b pipe clock + - description: PCIe 4 pipe clock + - description: First EMAC controller reference clock + - description: Second EMAC controller reference clock + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clk
Quoted 6 lines
Quoted 2 lines
And "
_clk" postfix is redundant in all these strings. Remove?In this case I think they should include
_clk, as they actually matches the clock names in the documentation.
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
Quoted 43 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 20:02:57)
Quoted 5 lines · Stephen Boyd
Quoted 4 lines
Quoting Bjorn Andersson (2022-04-22 16:00:12)
Quoted 2 lines
Add binding for the Qualcomm SC8280XP Global Clock controller.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Bjorn Andersson <[email protected]>Why no cover letter?
I didn't have anything useful to write in it. Will provide you one in the future...
Thanks!
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 25
Quoted 3 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +3
-0+ clocks: + items: + - description: XO reference clock"clock" is redundant in all these descriptions. Please remove.
Quoted 6 lines
You don't think it's a little bit odd to have description such as "Sleep", "PCIe 2a pipe" or First EMAC controller reference"?
I mean I agree that it's obviously clocks we're talking about, but to me that makes it seems like the descriptions are cut short, just for the sake of avoiding "clock".
Alright, keeping clock is OK as long as
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 34
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +9
-0+ - description: Sleep clock + - description: UFS memory first RX symbol clock + - description: UFS memory second RX symbol clock + - description: UFS memory first TX symbol clock + - description: UFS card first RX symbol clock + - description: UFS card second RX symbol clock + - description: UFS card first TX symbol clock + - description: Primary USB SuperSpeed pipe clock + - description: gcc_usb4_phy_pipegmux_clk_src
Quoted 4 lines
there is a better name for this and the other non-word descriptions.
USB4 phy pipe gmux clock source?
Sounds good, I'll make sure to fill these out.
Quoted 32 lines
Quoted 32 lines
Quoted 31 lines
Quoted 18 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +18
-0+ - description: gcc_usb4_phy_dp_gmux_clk_src + - description: gcc_usb4_phy_sys_pipegmux_clk_src + - description: usb4_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_phy_gcc_usb4rtr_max_pipe_clk + - description: Primary USB4 RX0 clock + - description: Primary USB4 RX1 clock + - description: Secondary USB SuperSpeed pipe clock + - description: gcc_usb4_1_phy_pipegmux_clk_src + - description: gcc_usb4_1_phy_dp_gmux_clk_src + - description: gcc_usb4_1_phy_sys_pipegmux_clk_src + - description: usb4_1_phy_gcc_usb4_pcie_pipe_clk + - description: usb4_1_phy_gcc_usb4rtr_max_pipe_clk + - description: Secondary USB4 RX0 clock + - description: Secondary USB4 RX0 clock + - description: Multiport USB first SupserSpeed pipe clock + - description: Multiport USB second SuperSpeed pipe clock + - description: PCIe 2a pipe clock + - description: PCIe 2b pipe clockDocumentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml line 62
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml new file +10
-0+ - description: PCIe 3a pipe clock + - description: PCIe 3b pipe clock + - description: PCIe 4 pipe clock + - description: First EMAC controller reference clock + - description: Second EMAC controller reference clock + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clkAnd "
_clk" postfix is redundant in all these strings. Remove?
Quoted 7 lines
Quoted 3 lines
In this case I think they should include
_clk, as they actually matches the clock names in the documentation.I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at gcc_pcie_4_pipe_clk_src, its parents today are pcie_4_pipe_clk and bi_tcxo. Something I can reason about being correct or not.
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = {
{ .index = 30 },
{ .index = 0 },
};Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
Regards,
Bjorn
Stephen Boyd
maintainerQuoting Bjorn Andersson (2022-04-22 20:43:18)
Quoted 14 lines · Stephen Boyd
Quoted 4 lines
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at
gcc_pcie_4_pipe_clk_src, its parents today arepcie_4_pipe_clkandbi_tcxo. Something I can reason about being correct or not.
Quoted 5 lines
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = { { .index = 30 }, { .index = 0 },
Those numbers could have some #define.
{ .index = PCIE_4_PIPE_CLK_DT }
{ .index = BI_TCXO_DT }Quoted 8 lines
};
Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
I dunno. Maybe a macro in the dt-binding header could be used to specify the 'clocks' property of the DT node that is providing the other side? The idea is to make a bunch of macros that insert the arguments of the macro in the right place for the clocks property and then define the order of arguments otherwise. It would be similar to how CREATE_TRACE_POINTS is used in include/trace/define_trace.h
In the dt-bindings/qcom,gcc-soc.h file:
#ifdef IN_DTSI #undef GCC_DT_NODE_CLOCKS #define GCC_DT_NODE_CLOCKS clocks = <BI_TCXO_DT>, <SLEEP_CLK_DT>; #endif /* IN_DTSI */ #define BI_TCXO_DT 0 #define SLEEP_CLK_DT 1
And then in the SoC.dtsi file have
#define IN_DTSI
#include <dt-bindings/qcom,gcc-soc.h>
#define BI_TCXO_DT &xo_board
#define SLEEP_CLK_DT &sleep_clk
...
clock-controller@a000000 {
compatible = "qcom,gcc-soc";
reg = <0xa000000 0x10000>;
GCC_DT_NODE_CLOCKS
};and then in drivers/clk/qcom/gcc-soc.c file:
#include <dt-bindings/qcom,gcc-soc.h>
static const struct clk_parent_data gcc_parent_data_14[] = {
{ .index = PCIE_4_PIPE_CLK_DT },
{ .index = BI_TCXO_DT },
};The benefit I see to this is that the index for each clock is in the header file (BI_TCXO_DT is 0) and it's next to the clocks property. Someone could still mess up the index based on where the macro is used in the clocks property though.
Quoted 44 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 20:43:18)
Quoted 14 lines · Stephen Boyd
Quoted 4 lines
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at
gcc_pcie_4_pipe_clk_src, its parents today arepcie_4_pipe_clkandbi_tcxo. Something I can reason about being correct or not.Quoted 5 lines
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = { { .index = 30 }, { .index = 0 },Those numbers could have some #define.
{ .index = PCIE_4_PIPE_CLK_DT } { .index = BI_TCXO_DT }Quoted 8 lines
};
Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
I dunno. Maybe a macro in the dt-binding header could be used to specify the 'clocks' property of the DT node that is providing the other side? The idea is to make a bunch of macros that insert the arguments of the macro in the right place for the clocks property and then define the order of arguments otherwise. It would be similar to how
CREATE_TRACE_POINTSis used ininclude/trace/define_trace.hIn the
dt-bindings/qcom,gcc-soc.hfile:
Quoted 11 lines
#ifdef IN_DTSI #undef GCC_DT_NODE_CLOCKS #define GCC_DT_NODE_CLOCKS clocks = <BI_TCXO_DT>, <SLEEP_CLK_DT>; #endif /* IN_DTSI */ #define BI_TCXO_DT 0 #define SLEEP_CLK_DT 1
Isn't this being an overkill, to define exact properties in the bindings header? Also this would mean that we'd have to add dt-binding headers for all _consumers_ of clocks. And to make things more complex, e.g. for PCIe devices different instances of the device would use different amount of clocks. This would mean that we'd have to define SM8250_PCI0_CLOCKS, SM8250_PCIE1_CLOCKS and SM8250_PCIE2_CLOCKS.
If we were to switch to this fragile path of using indices (yes I consider it to be very fragile), I'd consider something like the following to work in the platform dtsi file:
clocks =BEGIN_CLOCKCLOCK(BI_TCXO_DT, &bi_tcxo)CLOCK(SLEEP_CLK_DT, &sleep_clk)END_CLOCK;
While the following should give an error:
clocks =BEGIN_CLOCKCLOCK(SLEEP_CLK_DT, &sleep_clk)CLOCK(BI_TCXO_DT, &bi_tcxo)END_CLOCK;
I think we can make this error out by using some additional tool (or additional preprocessor pass over the sources)
Quoted 26 lines
And then in the
SoC.dtsifile have#define IN_DTSI #include <dt-bindings/qcom,gcc-soc.h> #define BI_TCXO_DT &xo_board #define SLEEP_CLK_DT &sleep_clk ... clock-controller@a000000 { compatible = "qcom,gcc-soc"; reg = <0xa000000 0x10000>; GCC_DT_NODE_CLOCKS };and then in
drivers/clk/qcom/gcc-soc.cfile:#include <dt-bindings/qcom,gcc-soc.h> static const struct clk_parent_data gcc_parent_data_14[] = { { .index = PCIE_4_PIPE_CLK_DT }, { .index = BI_TCXO_DT }, };
Quoted 4 lines
The benefit I see to this is that the index for each clock is in the header file (
BI_TCXO_DTis 0) and it's next to the clocks property. Someone could still mess up the index based on where the macro is used in the clocks property though.
And actually might I suggest an alternative approach to manually using indices everywhere? What about spending the time once during the boot to convert .fw_name and clock_names to parent indices during clock registration and then using them for all the further operations?
Signature · 2 lines
With best wishes Dmitry
Quoted 52 lines · Dmitry Baryshkov
Quoted 51 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 20:43:18)
Quoted 14 lines · Stephen Boyd
Quoted 4 lines
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at
gcc_pcie_4_pipe_clk_src, its parents today arepcie_4_pipe_clkandbi_tcxo. Something I can reason about being correct or not.Quoted 5 lines
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = { { .index = 30 }, { .index = 0 },Those numbers could have some #define.
{ .index = PCIE_4_PIPE_CLK_DT } { .index = BI_TCXO_DT }Quoted 8 lines
};
Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
I dunno. Maybe a macro in the dt-binding header could be used to specify the 'clocks' property of the DT node that is providing the other side? The idea is to make a bunch of macros that insert the arguments of the macro in the right place for the clocks property and then define the order of arguments otherwise. It would be similar to how
CREATE_TRACE_POINTSis used ininclude/trace/define_trace.hIn the
dt-bindings/qcom,gcc-soc.hfile:#ifdef IN_DTSI #undef GCC_DT_NODE_CLOCKS #define GCC_DT_NODE_CLOCKS clocks = <BI_TCXO_DT>, <SLEEP_CLK_DT>;
Quoted 4 lines
Quoted 4 lines
#endif /* IN_DTSI */ #define BI_TCXO_DT 0 #define SLEEP_CLK_DT 1
BI_TCXO_DT is not the value, its the index of the entry in the clocks array. And the actual values of the clock controller's clocks property is not a property of the clock controller, but the system definition.
I.e. that should be clear and explicitly expressed in the dts.
Quoted 26 lines
Isn't this being an overkill, to define exact properties in the bindings header? Also this would mean that we'd have to add dt-binding headers for all _consumers_ of clocks. And to make things more complex, e.g. for PCIe devices different instances of the device would use different amount of clocks. This would mean that we'd have to define
SM8250_PCI0_CLOCKS,SM8250_PCIE1_CLOCKSandSM8250_PCIE2_CLOCKS.If we were to switch to this fragile path of using indices (yes I consider it to be very fragile), I'd consider something like the following to work in the platform dtsi file:
clocks =
BEGIN_CLOCKCLOCK(BI_TCXO_DT, &bi_tcxo)CLOCK(SLEEP_CLK_DT, &sleep_clk)END_CLOCK;While the following should give an error:
clocks =BEGIN_CLOCKCLOCK(SLEEP_CLK_DT, &sleep_clk)CLOCK(BI_TCXO_DT, &bi_tcxo)END_CLOCK;
Quoted 3 lines
I think we can make this error out by using some additional tool (or additional preprocessor pass over the sources)
Let's not invent some magical syntax for describing the clocks in the DT.
These macros can't expand to sparse arrays anyways, so iiuc this would give a sense that the ordering might not be significant, when it really is.
Quoted 31 lines
Quoted 26 lines
And then in the
SoC.dtsifile have#define IN_DTSI #include <dt-bindings/qcom,gcc-soc.h> #define BI_TCXO_DT &xo_board #define SLEEP_CLK_DT &sleep_clk ... clock-controller@a000000 { compatible = "qcom,gcc-soc"; reg = <0xa000000 0x10000>; GCC_DT_NODE_CLOCKS };and then in
drivers/clk/qcom/gcc-soc.cfile:#include <dt-bindings/qcom,gcc-soc.h> static const struct clk_parent_data gcc_parent_data_14[] = { { .index = PCIE_4_PIPE_CLK_DT }, { .index = BI_TCXO_DT }, };Quoted 4 lines
The benefit I see to this is that the index for each clock is in the header file (
BI_TCXO_DTis 0) and it's next to the clocks property. Someone could still mess up the index based on where the macro is used in the clocks property though.
Quoted 5 lines
And actually might I suggest an alternative approach to manually using indices everywhere? What about spending the time once during the boot to convert .fw_name and
clock_namesto parent indices during clock registration and then using them for all the further operations?
I'm pretty sure that's what clk_core_fill_parent_index() already does.
Regards,
Bjorn
Quoted 135 lines · Bjorn Andersson
Quoted 52 lines · Dmitry Baryshkov
Quoted 51 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 20:43:18)
Quoted 14 lines · Stephen Boyd
Quoted 4 lines
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at
gcc_pcie_4_pipe_clk_src, its parents today arepcie_4_pipe_clkandbi_tcxo. Something I can reason about being correct or not.Quoted 5 lines
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = { { .index = 30 }, { .index = 0 },Those numbers could have some #define.
{ .index = PCIE_4_PIPE_CLK_DT } { .index = BI_TCXO_DT }Quoted 8 lines
};
Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
I dunno. Maybe a macro in the dt-binding header could be used to specify the 'clocks' property of the DT node that is providing the other side? The idea is to make a bunch of macros that insert the arguments of the macro in the right place for the clocks property and then define the order of arguments otherwise. It would be similar to how
CREATE_TRACE_POINTSis used ininclude/trace/define_trace.hIn the
dt-bindings/qcom,gcc-soc.hfile:#ifdef IN_DTSI #undef GCC_DT_NODE_CLOCKS #define GCC_DT_NODE_CLOCKS clocks = <BI_TCXO_DT>, <SLEEP_CLK_DT>;Quoted 4 lines
Quoted 4 lines
#endif /* IN_DTSI */ #define BI_TCXO_DT 0 #define SLEEP_CLK_DT 1
BI_TCXO_DTis not the value, its the index of the entry in the clocks array. And the actual values of the clock controller's clocks property is not a property of the clock controller, but the system definition.I.e. that should be clear and explicitly expressed in the dts.
Quoted 26 lines
Isn't this being an overkill, to define exact properties in the bindings header? Also this would mean that we'd have to add dt-binding headers for all _consumers_ of clocks. And to make things more complex, e.g. for PCIe devices different instances of the device would use different amount of clocks. This would mean that we'd have to define
SM8250_PCI0_CLOCKS,SM8250_PCIE1_CLOCKSandSM8250_PCIE2_CLOCKS.If we were to switch to this fragile path of using indices (yes I consider it to be very fragile), I'd consider something like the following to work in the platform dtsi file:
clocks =
BEGIN_CLOCKCLOCK(BI_TCXO_DT, &bi_tcxo)CLOCK(SLEEP_CLK_DT, &sleep_clk)END_CLOCK;While the following should give an error:
clocks =BEGIN_CLOCKCLOCK(SLEEP_CLK_DT, &sleep_clk)CLOCK(BI_TCXO_DT, &bi_tcxo)END_CLOCK;Quoted 3 lines
I think we can make this error out by using some additional tool (or additional preprocessor pass over the sources)
Let's not invent some magical syntax for describing the clocks in the DT.
These macros can't expand to sparse arrays anyways, so iiuc this would give a sense that the ordering might not be significant, when it really is.
Quoted 31 lines
Quoted 30 lines
And then in the
SoC.dtsifile have#define IN_DTSI #include <dt-bindings/qcom,gcc-soc.h> #define BI_TCXO_DT &xo_board #define SLEEP_CLK_DT &sleep_clk ... clock-controller@a000000 { compatible = "qcom,gcc-soc"; reg = <0xa000000 0x10000>; GCC_DT_NODE_CLOCKS };and then in
drivers/clk/qcom/gcc-soc.cfile:#include <dt-bindings/qcom,gcc-soc.h> static const struct clk_parent_data gcc_parent_data_14[] = { { .index = PCIE_4_PIPE_CLK_DT }, { .index = BI_TCXO_DT }, };The benefit I see to this is that the index for each clock is in the header file (
BI_TCXO_DTis 0) and it's next to the clocks property. Someone could still mess up the index based on where the macro is used in the clocks property though.
Quoted 7 lines
Quoted 5 lines
And actually might I suggest an alternative approach to manually using indices everywhere? What about spending the time once during the boot to convert .fw_name and
clock_namesto parent indices during clock registration and then using them for all the further operations?I'm pretty sure that's what
clk_core_fill_parent_index()already does.
In this case I think we should go for clock-name in the DT and auto-flled indices inside. Stephen, WDYT? Would that fix your concern for comparing strings each and every time?
Signature · 2 lines
With best wishes Dmitry
Quoted 143 lines · Dmitry Baryshkov
Quoted 141 lines · Bjorn Andersson
Quoted 52 lines · Dmitry Baryshkov
Quoted 51 lines · Stephen Boyd
Quoting Bjorn Andersson (2022-04-22 20:43:18)
Quoted 14 lines · Stephen Boyd
Quoted 4 lines
I'd really rather not have clock-names at all because we spend a bunch of time comparing strings with them when we could just as easily use a number.
I know that you would like to get rid of the clock-names for the clock controllers. I've looked at it since and while it will be faster to execute I still feel that it's going to be harder to write and maintain.
E.g. look at
gcc_pcie_4_pipe_clk_src, its parents today arepcie_4_pipe_clkandbi_tcxo. Something I can reason about being correct or not.Quoted 5 lines
If we ditch the clock-names I will have:
static const struct clk_parent_data gcc_parent_data_14[] = { { .index = 30 }, { .index = 0 },Those numbers could have some #define.
{ .index = PCIE_4_PIPE_CLK_DT } { .index = BI_TCXO_DT }Quoted 8 lines
};
Generally we would perhaps use some compile time constant, but that won't work here because we're talking about the index in the clocks array in the yaml.
But perhaps I'm missing something that would make this manageable?
I dunno. Maybe a macro in the dt-binding header could be used to specify the 'clocks' property of the DT node that is providing the other side? The idea is to make a bunch of macros that insert the arguments of the macro in the right place for the clocks property and then define the order of arguments otherwise. It would be similar to how
CREATE_TRACE_POINTSis used ininclude/trace/define_trace.hIn the
dt-bindings/qcom,gcc-soc.hfile:#ifdef IN_DTSI #undef GCC_DT_NODE_CLOCKS #define GCC_DT_NODE_CLOCKS clocks = <BI_TCXO_DT>, <SLEEP_CLK_DT>;Quoted 4 lines
Quoted 4 lines
#endif /* IN_DTSI */ #define BI_TCXO_DT 0 #define SLEEP_CLK_DT 1
BI_TCXO_DTis not the value, its the index of the entry in the clocks array. And the actual values of the clock controller's clocks property is not a property of the clock controller, but the system definition.I.e. that should be clear and explicitly expressed in the dts.
Quoted 26 lines
Isn't this being an overkill, to define exact properties in the bindings header? Also this would mean that we'd have to add dt-binding headers for all _consumers_ of clocks. And to make things more complex, e.g. for PCIe devices different instances of the device would use different amount of clocks. This would mean that we'd have to define
SM8250_PCI0_CLOCKS,SM8250_PCIE1_CLOCKSandSM8250_PCIE2_CLOCKS.If we were to switch to this fragile path of using indices (yes I consider it to be very fragile), I'd consider something like the following to work in the platform dtsi file:
clocks =
BEGIN_CLOCKCLOCK(BI_TCXO_DT, &bi_tcxo)CLOCK(SLEEP_CLK_DT, &sleep_clk)END_CLOCK;While the following should give an error:
clocks =BEGIN_CLOCKCLOCK(SLEEP_CLK_DT, &sleep_clk)CLOCK(BI_TCXO_DT, &bi_tcxo)END_CLOCK;Quoted 3 lines
I think we can make this error out by using some additional tool (or additional preprocessor pass over the sources)
Let's not invent some magical syntax for describing the clocks in the DT.
These macros can't expand to sparse arrays anyways, so iiuc this would give a sense that the ordering might not be significant, when it really is.
Quoted 36 lines
Quoted 26 lines
And then in the
SoC.dtsifile have#define IN_DTSI #include <dt-bindings/qcom,gcc-soc.h> #define BI_TCXO_DT &xo_board #define SLEEP_CLK_DT &sleep_clk ... clock-controller@a000000 { compatible = "qcom,gcc-soc"; reg = <0xa000000 0x10000>; GCC_DT_NODE_CLOCKS };and then in
drivers/clk/qcom/gcc-soc.cfile:#include <dt-bindings/qcom,gcc-soc.h> static const struct clk_parent_data gcc_parent_data_14[] = { { .index = PCIE_4_PIPE_CLK_DT }, { .index = BI_TCXO_DT }, };Quoted 4 lines
The benefit I see to this is that the index for each clock is in the header file (
BI_TCXO_DTis 0) and it's next to the clocks property. Someone could still mess up the index based on where the macro is used in the clocks property though.And actually might I suggest an alternative approach to manually using indices everywhere? What about spending the time once during the boot to convert .fw_name and
clock_namesto parent indices during clock registration and then using them for all the further operations?
Quoted 6 lines
Quoted 1 line
I'm pretty sure that's what
clk_core_fill_parent_index()already does.In this case I think we should go for clock-name in the DT and auto-flled indices inside. Stephen, WDYT? Would that fix your concern for comparing strings each and every time?
You mean, just continue doing what we've been doing lately with fw_name etc?
That lookup is the one that Stephen wants to avoid.
Regards,
Bjorn
Stephen Boyd
maintainerQuoting Bjorn Andersson (2022-04-28 12:12:49)
Quoted 16 lines · Dmitry Baryshkov
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
And actually might I suggest an alternative approach to manually using indices everywhere? What about spending the time once during the boot to convert .fw_name and
clock_namesto parent indices during clock registration and then using them for all the further operations?Quoted 6 lines
Quoted 1 line
I'm pretty sure that's what
clk_core_fill_parent_index()already does.In this case I think we should go for clock-name in the DT and auto-flled indices inside. Stephen, WDYT? Would that fix your concern for comparing strings each and every time?
Quoted 5 lines
You mean, just continue doing what we've been doing lately with
fw_nameetc?That lookup is the one that Stephen wants to avoid.
Right. Translating .fw_name to indices isn't a solution because I want to
1. Reduce the number of string comparisons
2. Shrink the kernel's data section by removing strings
and having there still be strings works against both points.