* [PATCH 0/4] Glymur USB4 clock fixups
@ 2026-11-23 18:34 Konrad Dybcio
2026-11-23 18:34 ` [PATCH 1/4] dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets Konrad Dybcio
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Konrad Dybcio @ 2026-11-23 18:34 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Taniya Das, Dmitry Baryshkov
Cc: usb4-upstream, linux-arm-msm, linux-clk, devicetree,
Konrad Dybcio
In preparation for supporting USB4, some clock driver fixups are
necessary. This is an echo of a previous series regarding Hamoa.
No dependencies.
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Konrad Dybcio (4):
dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets
clk: qcom: gcc-glymur: Add missing USB4 resets
clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks
clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops
drivers/clk/qcom/gcc-glymur.c | 184 ++++++++++++----------------
include/dt-bindings/clock/qcom,glymur-gcc.h | 36 ++++++
2 files changed, 112 insertions(+), 108 deletions(-)
---
base-commit: 3191063649dbf7c0d0b768e1f3655e4c5fc6edb5
change-id: 20261123-topic-usb4_clks-9cf2449ef86f
Best regards,
--
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets
2026-11-23 18:34 [PATCH 0/4] Glymur USB4 clock fixups Konrad Dybcio
@ 2026-11-23 18:34 ` Konrad Dybcio
2026-11-23 18:34 ` [PATCH 2/4] clk: qcom: gcc-glymur: " Konrad Dybcio
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2026-11-23 18:34 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Taniya Das, Dmitry Baryshkov
Cc: usb4-upstream, linux-arm-msm, linux-clk, devicetree,
Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Some of the USB4 resets were not initially described.
Add indices for them to allow extending the driver.
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
include/dt-bindings/clock/qcom,glymur-gcc.h | 36 +++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/include/dt-bindings/clock/qcom,glymur-gcc.h b/include/dt-bindings/clock/qcom,glymur-gcc.h
index 6907653c7992..79ab3e353423 100644
--- a/include/dt-bindings/clock/qcom,glymur-gcc.h
+++ b/include/dt-bindings/clock/qcom,glymur-gcc.h
@@ -575,5 +575,41 @@
#define GCC_VIDEO_AXI1_CLK_ARES 90
#define GCC_VIDEO_BCR 91
#define GCC_VIDEO_AXI0C_CLK_ARES 92
+#define GCC_USB4_0_MISC_USB4_SYS_BCR 93
+#define GCC_USB4_0_MISC_RX_CLK_0_BCR 94
+#define GCC_USB4_0_MISC_RX_CLK_1_BCR 95
+#define GCC_USB4_0_MISC_USB_PIPE_BCR 96
+#define GCC_USB4_0_MISC_PCIE_PIPE_BCR 97
+#define GCC_USB4_0_MISC_TMU_BCR 98
+#define GCC_USB4_0_MISC_SB_IF_BCR 99
+#define GCC_USB4_0_MISC_HIA_MSTR_BCR 100
+#define GCC_USB4_0_MISC_AHB_BCR 101
+#define GCC_USB4_0_MISC_DP0_MAX_PCLK_BCR 102
+#define GCC_USB4_0_MISC_DP1_MAX_PCLK_BCR 103
+#define GCC_USB4_0_MISC_HRR_BCR 104
+#define GCC_USB4_1_MISC_USB4_SYS_BCR 105
+#define GCC_USB4_1_MISC_RX_CLK_0_BCR 106
+#define GCC_USB4_1_MISC_RX_CLK_1_BCR 107
+#define GCC_USB4_1_MISC_USB_PIPE_BCR 108
+#define GCC_USB4_1_MISC_PCIE_PIPE_BCR 109
+#define GCC_USB4_1_MISC_TMU_BCR 110
+#define GCC_USB4_1_MISC_SB_IF_BCR 111
+#define GCC_USB4_1_MISC_HIA_MSTR_BCR 112
+#define GCC_USB4_1_MISC_AHB_BCR 113
+#define GCC_USB4_1_MISC_DP0_MAX_PCLK_BCR 114
+#define GCC_USB4_1_MISC_DP1_MAX_PCLK_BCR 115
+#define GCC_USB4_1_MISC_HRR_BCR 116
+#define GCC_USB4_2_MISC_USB4_SYS_BCR 117
+#define GCC_USB4_2_MISC_RX_CLK_0_BCR 118
+#define GCC_USB4_2_MISC_RX_CLK_1_BCR 119
+#define GCC_USB4_2_MISC_USB_PIPE_BCR 120
+#define GCC_USB4_2_MISC_PCIE_PIPE_BCR 121
+#define GCC_USB4_2_MISC_TMU_BCR 122
+#define GCC_USB4_2_MISC_SB_IF_BCR 123
+#define GCC_USB4_2_MISC_HIA_MSTR_BCR 124
+#define GCC_USB4_2_MISC_AHB_BCR 125
+#define GCC_USB4_2_MISC_DP0_MAX_PCLK_BCR 126
+#define GCC_USB4_2_MISC_DP1_MAX_PCLK_BCR 127
+#define GCC_USB4_2_MISC_HRR_BCR 128
#endif
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] clk: qcom: gcc-glymur: Add missing USB4 resets
2026-11-23 18:34 [PATCH 0/4] Glymur USB4 clock fixups Konrad Dybcio
2026-11-23 18:34 ` [PATCH 1/4] dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets Konrad Dybcio
@ 2026-11-23 18:34 ` Konrad Dybcio
2026-11-23 18:34 ` [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks Konrad Dybcio
2026-11-23 18:34 ` [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops Konrad Dybcio
3 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2026-11-23 18:34 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Taniya Das, Dmitry Baryshkov
Cc: usb4-upstream, linux-arm-msm, linux-clk, devicetree,
Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
A number of the USB4-related resets were left undescribed. Plumb them
in.
Fixes: efe504300a17 ("clk: qcom: gcc: Add support for Global Clock Controller")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
drivers/clk/qcom/gcc-glymur.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
index d8d33eff419e..031ed806a38e 100644
--- a/drivers/clk/qcom/gcc-glymur.c
+++ b/drivers/clk/qcom/gcc-glymur.c
@@ -8432,6 +8432,42 @@ static const struct qcom_reset_map gcc_glymur_resets[] = {
[GCC_USB4_0_DP0_PHY_PRIM_BCR] = { 0xdb010 },
[GCC_USB4_1_BCR] = { 0x2d004 },
[GCC_USB4_2_BCR] = { 0xe0004 },
+ [GCC_USB4_0_MISC_USB4_SYS_BCR] = { .reg = 0x600c0, .bit = 0 },
+ [GCC_USB4_0_MISC_RX_CLK_0_BCR] = { .reg = 0x600c0, .bit = 1 },
+ [GCC_USB4_0_MISC_RX_CLK_1_BCR] = { .reg = 0x600c0, .bit = 2 },
+ [GCC_USB4_0_MISC_USB_PIPE_BCR] = { .reg = 0x600c0, .bit = 3 },
+ [GCC_USB4_0_MISC_PCIE_PIPE_BCR] = { .reg = 0x600c0, .bit = 4 },
+ [GCC_USB4_0_MISC_TMU_BCR] = { .reg = 0x600c0, .bit = 5 },
+ [GCC_USB4_0_MISC_SB_IF_BCR] = { .reg = 0x600c0, .bit = 6 },
+ [GCC_USB4_0_MISC_HIA_MSTR_BCR] = { .reg = 0x600c0, .bit = 7 },
+ [GCC_USB4_0_MISC_AHB_BCR] = { .reg = 0x600c0, .bit = 8 },
+ [GCC_USB4_0_MISC_DP0_MAX_PCLK_BCR] = { .reg = 0x600c0, .bit = 9 },
+ [GCC_USB4_0_MISC_DP1_MAX_PCLK_BCR] = { .reg = 0x600c0, .bit = 10 },
+ [GCC_USB4_0_MISC_HRR_BCR] = { .reg = 0x600c0, .bit = 11 },
+ [GCC_USB4_1_MISC_USB4_SYS_BCR] = { .reg = 0x600ac, .bit = 0 },
+ [GCC_USB4_1_MISC_RX_CLK_0_BCR] = { .reg = 0x600ac, .bit = 1 },
+ [GCC_USB4_1_MISC_RX_CLK_1_BCR] = { .reg = 0x600ac, .bit = 2 },
+ [GCC_USB4_1_MISC_USB_PIPE_BCR] = { .reg = 0x600ac, .bit = 3 },
+ [GCC_USB4_1_MISC_PCIE_PIPE_BCR] = { .reg = 0x600ac, .bit = 4 },
+ [GCC_USB4_1_MISC_TMU_BCR] = { .reg = 0x600ac, .bit = 5 },
+ [GCC_USB4_1_MISC_SB_IF_BCR] = { .reg = 0x600ac, .bit = 6 },
+ [GCC_USB4_1_MISC_HIA_MSTR_BCR] = { .reg = 0x600ac, .bit = 7 },
+ [GCC_USB4_1_MISC_AHB_BCR] = { .reg = 0x600ac, .bit = 8 },
+ [GCC_USB4_1_MISC_DP0_MAX_PCLK_BCR] = { .reg = 0x600ac, .bit = 9 },
+ [GCC_USB4_1_MISC_DP1_MAX_PCLK_BCR] = { .reg = 0x600ac, .bit = 10 },
+ [GCC_USB4_1_MISC_HRR_BCR] = { .reg = 0x600ac, .bit = 11 },
+ [GCC_USB4_2_MISC_USB4_SYS_BCR] = { .reg = 0x600c4, .bit = 0 },
+ [GCC_USB4_2_MISC_RX_CLK_0_BCR] = { .reg = 0x600c4, .bit = 1 },
+ [GCC_USB4_2_MISC_RX_CLK_1_BCR] = { .reg = 0x600c4, .bit = 2 },
+ [GCC_USB4_2_MISC_USB_PIPE_BCR] = { .reg = 0x600c4, .bit = 3 },
+ [GCC_USB4_2_MISC_PCIE_PIPE_BCR] = { .reg = 0x600c4, .bit = 4 },
+ [GCC_USB4_2_MISC_TMU_BCR] = { .reg = 0x600c4, .bit = 5 },
+ [GCC_USB4_2_MISC_SB_IF_BCR] = { .reg = 0x600c4, .bit = 6 },
+ [GCC_USB4_2_MISC_HIA_MSTR_BCR] = { .reg = 0x600c4, .bit = 7 },
+ [GCC_USB4_2_MISC_AHB_BCR] = { .reg = 0x600c4, .bit = 8 },
+ [GCC_USB4_2_MISC_DP0_MAX_PCLK_BCR] = { .reg = 0x600c4, .bit = 9 },
+ [GCC_USB4_2_MISC_DP1_MAX_PCLK_BCR] = { .reg = 0x600c4, .bit = 10 },
+ [GCC_USB4_2_MISC_HRR_BCR] = { .reg = 0x600c4, .bit = 11 },
[GCC_USB_0_PHY_BCR] = { 0xdb020 },
[GCC_USB_1_PHY_BCR] = { 0x2c020 },
[GCC_USB_2_PHY_BCR] = { 0xbe020 },
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks
2026-11-23 18:34 [PATCH 0/4] Glymur USB4 clock fixups Konrad Dybcio
2026-11-23 18:34 ` [PATCH 1/4] dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets Konrad Dybcio
2026-11-23 18:34 ` [PATCH 2/4] clk: qcom: gcc-glymur: " Konrad Dybcio
@ 2026-11-23 18:34 ` Konrad Dybcio
2026-11-23 18:43 ` sashiko-bot
2026-11-23 18:34 ` [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops Konrad Dybcio
3 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2026-11-23 18:34 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Taniya Das, Dmitry Baryshkov
Cc: usb4-upstream, linux-arm-msm, linux-clk, devicetree,
Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
On Glymur and Mahua, the USB4 uC's RAM contents may not be retained
correctly by default. Set the corresponding signals to force it.
Fixes: efe504300a17 ("clk: qcom: gcc: Add support for Global Clock Controller")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
drivers/clk/qcom/gcc-glymur.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
index 031ed806a38e..96d1c07348bc 100644
--- a/drivers/clk/qcom/gcc-glymur.c
+++ b/drivers/clk/qcom/gcc-glymur.c
@@ -8542,6 +8542,10 @@ static void clk_glymur_regs_configure(struct device *dev, struct regmap *regmap)
qcom_branch_set_force_periph_on(regmap, gcc_pcie_5_pipe_clk, true);
qcom_branch_set_force_mem_core(regmap, gcc_pcie_6_pipe_clk, true);
qcom_branch_set_force_periph_on(regmap, gcc_pcie_6_pipe_clk, true);
+
+ qcom_branch_set_force_mem_core(regmap, gcc_usb4_0_sys_clk, true);
+ qcom_branch_set_force_mem_core(regmap, gcc_usb4_1_uc_hrr_clk, true);
+ qcom_branch_set_force_mem_core(regmap, gcc_usb4_2_sys_clk, true);
}
static const struct qcom_cc_driver_data gcc_glymur_driver_data = {
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops
2026-11-23 18:34 [PATCH 0/4] Glymur USB4 clock fixups Konrad Dybcio
` (2 preceding siblings ...)
2026-11-23 18:34 ` [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks Konrad Dybcio
@ 2026-11-23 18:34 ` Konrad Dybcio
2026-11-23 18:57 ` sashiko-bot
3 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2026-11-23 18:34 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Taniya Das, Dmitry Baryshkov
Cc: usb4-upstream, linux-arm-msm, linux-clk, devicetree,
Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Almost all of the USB4 clocks fall into the "phymux" category, with a
glitch-free mux switching between an XO source and the "fast clock"
derived from one of the connected PHY's outputs. That allows for
running the downstream devices (at reduced capacity) even without the
PHY being oneline.
Convert such USB4 clocks over.
Fixes: efe504300a17 ("clk: qcom: gcc: Add support for Global Clock Controller")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
drivers/clk/qcom/gcc-glymur.c | 144 +++++++++++-------------------------------
1 file changed, 36 insertions(+), 108 deletions(-)
diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
index 96d1c07348bc..186c779e3084 100644
--- a/drivers/clk/qcom/gcc-glymur.c
+++ b/drivers/clk/qcom/gcc-glymur.c
@@ -104,12 +104,6 @@ enum {
P_PCIE_4_PIPE_CLK,
P_PCIE_5_PIPE_CLK,
P_PCIE_6_PIPE_CLK,
- P_QUSB4PHY_0_GCC_USB4_RX0_CLK,
- P_QUSB4PHY_0_GCC_USB4_RX1_CLK,
- P_QUSB4PHY_1_GCC_USB4_RX0_CLK,
- P_QUSB4PHY_1_GCC_USB4_RX1_CLK,
- P_QUSB4PHY_2_GCC_USB4_RX0_CLK,
- P_QUSB4PHY_2_GCC_USB4_RX1_CLK,
P_SLEEP_CLK,
P_UFS_PHY_RX_SYMBOL_0_CLK,
P_UFS_PHY_RX_SYMBOL_1_CLK,
@@ -623,26 +617,6 @@ static const struct clk_parent_data gcc_parent_data_33[] = {
{ .index = DT_USB4_0_PHY_GCC_USB4_PCIE_PIPE_CLK },
};
-static const struct parent_map gcc_parent_map_34[] = {
- { P_QUSB4PHY_0_GCC_USB4_RX0_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_34[] = {
- { .index = DT_QUSB4PHY_0_GCC_USB4_RX0_CLK },
- { .index = DT_BI_TCXO },
-};
-
-static const struct parent_map gcc_parent_map_35[] = {
- { P_QUSB4PHY_0_GCC_USB4_RX1_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_35[] = {
- { .index = DT_QUSB4PHY_0_GCC_USB4_RX1_CLK },
- { .index = DT_BI_TCXO },
-};
-
static const struct parent_map gcc_parent_map_36[] = {
{ P_GCC_USB4_0_PHY_SYS_PIPEGMUX_CLK_SRC, 0 },
{ P_USB4_0_PHY_GCC_USB4_PCIE_PIPE_CLK, 2 },
@@ -707,26 +681,6 @@ static const struct clk_parent_data gcc_parent_data_41[] = {
{ .hw = &gcc_gpll0_out_even.clkr.hw },
};
-static const struct parent_map gcc_parent_map_42[] = {
- { P_QUSB4PHY_1_GCC_USB4_RX0_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_42[] = {
- { .index = DT_QUSB4PHY_1_GCC_USB4_RX0_CLK },
- { .index = DT_BI_TCXO },
-};
-
-static const struct parent_map gcc_parent_map_43[] = {
- { P_QUSB4PHY_1_GCC_USB4_RX1_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_43[] = {
- { .index = DT_QUSB4PHY_1_GCC_USB4_RX1_CLK },
- { .index = DT_BI_TCXO },
-};
-
static const struct parent_map gcc_parent_map_44[] = {
{ P_GCC_USB4_1_PHY_SYS_PIPEGMUX_CLK_SRC, 0 },
{ P_USB4_1_PHY_GCC_USB4_PCIE_PIPE_CLK, 2 },
@@ -777,26 +731,6 @@ static const struct clk_parent_data gcc_parent_data_48[] = {
{ .index = DT_USB4_2_PHY_GCC_USB4_PCIE_PIPE_CLK },
};
-static const struct parent_map gcc_parent_map_49[] = {
- { P_QUSB4PHY_2_GCC_USB4_RX0_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_49[] = {
- { .index = DT_QUSB4PHY_2_GCC_USB4_RX0_CLK },
- { .index = DT_BI_TCXO },
-};
-
-static const struct parent_map gcc_parent_map_50[] = {
- { P_QUSB4PHY_2_GCC_USB4_RX1_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_50[] = {
- { .index = DT_QUSB4PHY_2_GCC_USB4_RX1_CLK },
- { .index = DT_BI_TCXO },
-};
-
static const struct parent_map gcc_parent_map_51[] = {
{ P_GCC_USB4_2_PHY_SYS_PIPEGMUX_CLK_SRC, 0 },
{ P_USB4_2_PHY_GCC_USB4_PCIE_PIPE_CLK, 2 },
@@ -1099,32 +1033,30 @@ static struct clk_regmap_mux gcc_usb4_0_phy_pcie_pipe_mux_clk_src = {
},
};
-static struct clk_regmap_mux gcc_usb4_0_phy_rx0_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_0_phy_rx0_clk_src = {
.reg = 0x2b0c0,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_34,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_0_phy_rx0_clk_src",
- .parent_data = gcc_parent_data_34,
- .num_parents = ARRAY_SIZE(gcc_parent_data_34),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_0_GCC_USB4_RX0_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
-static struct clk_regmap_mux gcc_usb4_0_phy_rx1_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_0_phy_rx1_clk_src = {
.reg = 0x2b0d4,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_35,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_0_phy_rx1_clk_src",
- .parent_data = gcc_parent_data_35,
- .num_parents = ARRAY_SIZE(gcc_parent_data_35),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_0_GCC_USB4_RX1_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
@@ -1204,32 +1136,30 @@ static struct clk_regmap_mux gcc_usb4_1_phy_pcie_pipe_mux_clk_src = {
},
};
-static struct clk_regmap_mux gcc_usb4_1_phy_rx0_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_1_phy_rx0_clk_src = {
.reg = 0x2d0e4,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_42,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_1_phy_rx0_clk_src",
- .parent_data = gcc_parent_data_42,
- .num_parents = ARRAY_SIZE(gcc_parent_data_42),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_1_GCC_USB4_RX0_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
-static struct clk_regmap_mux gcc_usb4_1_phy_rx1_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_1_phy_rx1_clk_src = {
.reg = 0x2d0f8,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_43,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_1_phy_rx1_clk_src",
- .parent_data = gcc_parent_data_43,
- .num_parents = ARRAY_SIZE(gcc_parent_data_43),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_1_GCC_USB4_RX1_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
@@ -1309,32 +1239,30 @@ static struct clk_regmap_mux gcc_usb4_2_phy_pcie_pipe_mux_clk_src = {
},
};
-static struct clk_regmap_mux gcc_usb4_2_phy_rx0_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_2_phy_rx0_clk_src = {
.reg = 0xe00c4,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_49,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_2_phy_rx0_clk_src",
- .parent_data = gcc_parent_data_49,
- .num_parents = ARRAY_SIZE(gcc_parent_data_49),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_2_GCC_USB4_RX0_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
-static struct clk_regmap_mux gcc_usb4_2_phy_rx1_clk_src = {
+static struct clk_regmap_phy_mux gcc_usb4_2_phy_rx1_clk_src = {
.reg = 0xe00d8,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_50,
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gcc_usb4_2_phy_rx1_clk_src",
- .parent_data = gcc_parent_data_50,
- .num_parents = ARRAY_SIZE(gcc_parent_data_50),
- .ops = &clk_regmap_mux_closest_ops,
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_QUSB4PHY_2_GCC_USB4_RX1_CLK,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_phy_mux_ops,
},
},
};
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks
2026-11-23 18:34 ` [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks Konrad Dybcio
@ 2026-11-23 18:43 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-23 18:43 UTC (permalink / raw)
To: Konrad Dybcio; +Cc: linux-clk, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] clk: qcom: gcc-glymur: wrong USB4 clocks in
clk_glymur_regs_configure()
--
commit 81f271b4a5a581eaebcc7fd24442cd3d1ce247ae
Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks
This commit sets CBCR_FORCE_MEM_CORE_ON on three USB4 clock branches in
clk_glymur_regs_configure() to retain USB4 uC RAM contents on Glymur and
Mahua.
> diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
> index 031ed806a38ed..96d1c07348bcb 100644
> --- a/drivers/clk/qcom/gcc-glymur.c
> +++ b/drivers/clk/qcom/gcc-glymur.c
> @@ -8542,6 +8542,10 @@ static void clk_glymur_regs_configure(struct device *dev, struct regmap *regmap)
> qcom_branch_set_force_periph_on(regmap, gcc_pcie_5_pipe_clk, true);
> qcom_branch_set_force_mem_core(regmap, gcc_pcie_6_pipe_clk, true);
> qcom_branch_set_force_periph_on(regmap, gcc_pcie_6_pipe_clk, true);
> +
> + qcom_branch_set_force_mem_core(regmap, gcc_usb4_0_sys_clk, true);
> + qcom_branch_set_force_mem_core(regmap, gcc_usb4_1_uc_hrr_clk, true);
> + qcom_branch_set_force_mem_core(regmap, gcc_usb4_2_sys_clk, true);
> }
>
> static const struct qcom_cc_driver_data gcc_glymur_driver_data = {
[Severity: High]
Should USB4 instances 0 and 2 pass gcc_usb4_0_uc_hrr_clk (0x2b06c) and
gcc_usb4_2_uc_hrr_clk (0xe006c) instead of gcc_usb4_0_sys_clk (0x2b05c)
and gcc_usb4_2_sys_clk (0xe005c)? With sys_clk passed for controllers 0
and 2, their uC clocks never have CBCR_FORCE_MEM_CORE_ON set, leaving the
USB4 uC RAM contents unretained on those two controllers.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-topic-usb4_clks-v1-0-531ab5635c03@oss.qualcomm.com?part=3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops
2026-11-23 18:34 ` [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops Konrad Dybcio
@ 2026-11-23 18:57 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-23 18:57 UTC (permalink / raw)
To: Konrad Dybcio; +Cc: linux-clk, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] clk: qcom: gcc-glymur: USB4 PHY RX branch clocks poll halt with
phymux parent
- [Medium] clk: qcom: gcc-glymur:
gcc_usb4_{0,1,2}_phy_p2rr2p_pipe_clk_src not converted
--
commit b685bd7088c460b8ed23d2168b56f940cdb682c3
Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops
This commit converts gcc_usb4_{0,1,2}_phy_rx{0,1}_clk_src from
clk_regmap_mux with clk_regmap_mux_closest_ops to clk_regmap_phy_mux with
clk_regmap_phy_mux_ops.
> diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
> index 96d1c07348bcb..186c779e30846 100644
> --- a/drivers/clk/qcom/gcc-glymur.c
> +++ b/drivers/clk/qcom/gcc-glymur.c
[ ... ]
> @@ -1099,32 +1033,30 @@ static struct clk_regmap_mux gcc_usb4_0_phy_pcie_pipe_mux_clk_src = {
> },
> };
>
> -static struct clk_regmap_mux gcc_usb4_0_phy_rx0_clk_src = {
> +static struct clk_regmap_phy_mux gcc_usb4_0_phy_rx0_clk_src = {
> .reg = 0x2b0c0,
> - .shift = 0,
> - .width = 2,
> - .parent_map = gcc_parent_map_34,
> .clkr = {
> .hw.init = &(const struct clk_init_data) {
> .name = "gcc_usb4_0_phy_rx0_clk_src",
> - .parent_data = gcc_parent_data_34,
> - .num_parents = ARRAY_SIZE(gcc_parent_data_34),
> - .ops = &clk_regmap_mux_closest_ops,
> + .parent_data = &(const struct clk_parent_data){
> + .index = DT_QUSB4PHY_0_GCC_USB4_RX0_CLK,
> + },
> + .num_parents = 1,
> + .ops = &clk_regmap_phy_mux_ops,
> },
> },
> };
[Severity: High]
Should the child branches gcc_usb4_{0,1,2}_phy_rx{0,1}_clk use
BRANCH_HALT_SKIP instead of BRANCH_HALT now that their parents use
clk_regmap_phy_mux_ops?
With clk_regmap_phy_mux_ops, phy_mux_enable() switches the parent mux from
BI_TCXO to the external PHY RX clock before enabling the child branch, and
clk_branch2_disable() disables the child branch before phy_mux_disable()
parks the mux back on BI_TCXO. If the PHY is not actively driving the RX
clock when the branch is toggled, clk_branch_wait() will time out polling
CBCR_CLK_OFF, trigger a WARN, and fail with -EBUSY.
[Severity: Medium]
Should gcc_usb4_{0,1,2}_phy_p2rr2p_pipe_clk_src also be converted to
clk_regmap_phy_mux with clk_regmap_phy_mux_ops (as in
drivers/clk/qcom/gcc-x1e80100.c)?
Those three muxes have the same 2-bit phymux layout switching between
P_USB4_{0,1,2}_PHY_GCC_USB4_PCIE_PIPE_CLK (0) and P_BI_TCXO (2). Because
qmp_combo_usb4_init() and qmp_combo_usb4_exit() only call
clk_prepare_enable() and clk_disable_unprepare() on qmp->p2rr2p_pipe_clk
without calling clk_set_parent(), leaving them on
clk_regmap_mux_closest_ops prevents the mux from switching between the PHY
pipe clock and BI_TCXO.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-topic-usb4_clks-v1-0-531ab5635c03@oss.qualcomm.com?part=4
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-23 18:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 18:34 [PATCH 0/4] Glymur USB4 clock fixups Konrad Dybcio
2026-11-23 18:34 ` [PATCH 1/4] dt-bindings: clock: qcom,glymur-gcc: Add missing USB4 resets Konrad Dybcio
2026-11-23 18:34 ` [PATCH 2/4] clk: qcom: gcc-glymur: " Konrad Dybcio
2026-11-23 18:34 ` [PATCH 3/4] clk: qcom: gcc-glymur: Set FORCE_MEM_ON for USB4 uC clocks Konrad Dybcio
2026-11-23 18:43 ` sashiko-bot
2026-11-23 18:34 ` [PATCH 4/4] clk: qcom: gcc-glymur: Convert USB4 clocks to use phymux ops Konrad Dybcio
2026-11-23 18:57 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox