Skip to content

Commit d33050a

Browse files
committed
Merge branches 'clk-debugfs', 'clk-spreadtrum', 'clk-sifive', 'clk-counted' and 'clk-qcom' into clk-next
- Add consumer info to clk debugfs - Fix various clk drivers that have clk_hw_onecell_data not at the end of an allocation * clk-debugfs: clk: Allow phase adjustment from debugfs clk: Show active consumers of clocks in debugfs * clk-spreadtrum: clk: sprd: Composite driver support offset config * clk-sifive: clk: sifive: Allow building the driver as a module clk: analogbits: Allow building the library as a module * clk-counted: clk: socfpga: agilex: Add bounds-checking coverage for struct stratix10_clock_data clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data clk: visconti: Add bounds-checking coverage for struct visconti_pll_provider clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider * clk-qcom: (36 commits) clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock provider clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: gcc-ipq6018: add QUP6 I2C clock clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll clk: qcom: clk-alpha-pll: introduce stromer plus ops clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM clk: qcom: videocc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: gpucc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: Replace of_device.h with explicit includes clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect clk: qcom: cbf-msm8996: Convert to platform remove callback returning void clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src clk: qcom: Add GCC driver support for SM4450 dt-bindings: clock: qcom: Add GCC clocks for SM4450 ...
6 parents 702a582 + e43d319 + 48a8748 + c8e1d8a + 65f9e1b + 0dea4e3 commit d33050a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7364
-366
lines changed

Documentation/devicetree/bindings/clock/qcom,hfpll.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ PROPERTIES
1212
"qcom,hfpll-apq8064", "qcom,hfpll"
1313
"qcom,hfpll-msm8974", "qcom,hfpll"
1414
"qcom,hfpll-msm8960", "qcom,hfpll"
15+
"qcom,msm8976-hfpll-a53", "qcom,hfpll"
16+
"qcom,msm8976-hfpll-a72", "qcom,hfpll"
17+
"qcom,msm8976-hfpll-cci", "qcom,hfpll"
1518

1619
- reg:
1720
Usage: required

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- qcom,sdx55-rpmh-clk
2929
- qcom,sdx65-rpmh-clk
3030
- qcom,sdx75-rpmh-clk
31+
- qcom,sm4450-rpmh-clk
3132
- qcom,sm6350-rpmh-clk
3233
- qcom,sm8150-rpmh-clk
3334
- qcom,sm8250-rpmh-clk
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/qcom,sm4450-gcc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Global Clock & Reset Controller on SM4450
8+
9+
maintainers:
10+
- Ajit Pandey <[email protected]>
11+
- Taniya Das <[email protected]>
12+
13+
description: |
14+
Qualcomm global clock control module provides the clocks, resets and power
15+
domains on SM4450
16+
17+
See also:: include/dt-bindings/clock/qcom,sm4450-gcc.h
18+
19+
properties:
20+
compatible:
21+
const: qcom,sm4450-gcc
22+
23+
clocks:
24+
items:
25+
- description: Board XO source
26+
- description: Sleep clock source
27+
- description: UFS Phy Rx symbol 0 clock source
28+
- description: UFS Phy Rx symbol 1 clock source
29+
- description: UFS Phy Tx symbol 0 clock source
30+
- description: USB3 Phy wrapper pipe clock source
31+
32+
required:
33+
- compatible
34+
- clocks
35+
36+
allOf:
37+
- $ref: qcom,gcc.yaml#
38+
39+
unevaluatedProperties: false
40+
41+
examples:
42+
- |
43+
#include <dt-bindings/clock/qcom,rpmh.h>
44+
clock-controller@100000 {
45+
compatible = "qcom,sm4450-gcc";
46+
reg = <0x00100000 0x001f4200>;
47+
clocks = <&rpmhcc RPMH_CXO_CLK>, <&sleep_clk>,
48+
<&ufs_mem_phy 0>, <&ufs_mem_phy 1>,
49+
<&ufs_mem_phy 2>, <&usb_1_qmpphy>;
50+
#clock-cells = <1>;
51+
#reset-cells = <1>;
52+
#power-domain-cells = <1>;
53+
};
54+
55+
...

Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ description: |
1313
Qualcomm camera clock control module provides the clocks, resets and power
1414
domains on SM8450.
1515
16-
See also:: include/dt-bindings/clock/qcom,sm8450-camcc.h
16+
See also::
17+
include/dt-bindings/clock/qcom,sm8450-camcc.h
18+
include/dt-bindings/clock/qcom,sm8550-camcc.h
1719
1820
properties:
1921
compatible:
20-
const: qcom,sm8450-camcc
22+
enum:
23+
- qcom,sm8450-camcc
24+
- qcom,sm8550-camcc
2125

2226
clocks:
2327
items:

drivers/clk/analogbits/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config CLK_ANALOGBITS_WRPLL_CLN28HPC
3-
bool
3+
tristate

drivers/clk/analogbits/wrpll-cln28hpc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/math64.h>
2929
#include <linux/math.h>
3030
#include <linux/minmax.h>
31+
#include <linux/module.h>
3132

3233
#include <linux/clk/analogbits-wrpll-cln28hpc.h>
3334

@@ -312,6 +313,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate,
312313

313314
return 0;
314315
}
316+
EXPORT_SYMBOL_GPL(wrpll_configure_for_rate);
315317

316318
/**
317319
* wrpll_calc_output_rate() - calculate the PLL's target output rate
@@ -349,6 +351,7 @@ unsigned long wrpll_calc_output_rate(const struct wrpll_cfg *c,
349351

350352
return n;
351353
}
354+
EXPORT_SYMBOL_GPL(wrpll_calc_output_rate);
352355

353356
/**
354357
* wrpll_calc_max_lock_us() - return the time for the PLL to lock
@@ -366,3 +369,8 @@ unsigned int wrpll_calc_max_lock_us(const struct wrpll_cfg *c)
366369
{
367370
return MAX_LOCK_US;
368371
}
372+
EXPORT_SYMBOL_GPL(wrpll_calc_max_lock_us);
373+
374+
MODULE_AUTHOR("Paul Walmsley <[email protected]>");
375+
MODULE_DESCRIPTION("Analog Bits Wide-Range PLL library");
376+
MODULE_LICENSE("GPL");

drivers/clk/clk.c

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,28 +3188,41 @@ static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
31883188
int level)
31893189
{
31903190
int phase;
3191+
struct clk *clk_user;
3192+
int multi_node = 0;
31913193

3192-
seq_printf(s, "%*s%-*s %7d %8d %8d %11lu %10lu ",
3194+
seq_printf(s, "%*s%-*s %-7d %-8d %-8d %-11lu %-10lu ",
31933195
level * 3 + 1, "",
3194-
30 - level * 3, c->name,
3196+
35 - level * 3, c->name,
31953197
c->enable_count, c->prepare_count, c->protect_count,
31963198
clk_core_get_rate_recalc(c),
31973199
clk_core_get_accuracy_recalc(c));
31983200

31993201
phase = clk_core_get_phase(c);
32003202
if (phase >= 0)
3201-
seq_printf(s, "%5d", phase);
3203+
seq_printf(s, "%-5d", phase);
32023204
else
32033205
seq_puts(s, "-----");
32043206

3205-
seq_printf(s, " %6d", clk_core_get_scaled_duty_cycle(c, 100000));
3207+
seq_printf(s, " %-6d", clk_core_get_scaled_duty_cycle(c, 100000));
32063208

32073209
if (c->ops->is_enabled)
3208-
seq_printf(s, " %9c\n", clk_core_is_enabled(c) ? 'Y' : 'N');
3210+
seq_printf(s, " %5c ", clk_core_is_enabled(c) ? 'Y' : 'N');
32093211
else if (!c->ops->enable)
3210-
seq_printf(s, " %9c\n", 'Y');
3212+
seq_printf(s, " %5c ", 'Y');
32113213
else
3212-
seq_printf(s, " %9c\n", '?');
3214+
seq_printf(s, " %5c ", '?');
3215+
3216+
hlist_for_each_entry(clk_user, &c->clks, clks_node) {
3217+
seq_printf(s, "%*s%-*s %-25s\n",
3218+
level * 3 + 2 + 105 * multi_node, "",
3219+
30,
3220+
clk_user->dev_id ? clk_user->dev_id : "deviceless",
3221+
clk_user->con_id ? clk_user->con_id : "no_connection_id");
3222+
3223+
multi_node = 1;
3224+
}
3225+
32133226
}
32143227

32153228
static void clk_summary_show_subtree(struct seq_file *s, struct clk_core *c,
@@ -3230,9 +3243,10 @@ static int clk_summary_show(struct seq_file *s, void *data)
32303243
struct clk_core *c;
32313244
struct hlist_head **lists = s->private;
32323245

3233-
seq_puts(s, " enable prepare protect duty hardware\n");
3234-
seq_puts(s, " clock count count count rate accuracy phase cycle enable\n");
3235-
seq_puts(s, "-------------------------------------------------------------------------------------------------------\n");
3246+
seq_puts(s, " enable prepare protect duty hardware connection\n");
3247+
seq_puts(s, " clock count count count rate accuracy phase cycle enable consumer id\n");
3248+
seq_puts(s, "---------------------------------------------------------------------------------------------------------------------------------------------\n");
3249+
32363250

32373251
clk_prepare_lock();
32383252

@@ -3329,6 +3343,21 @@ static int clk_rate_set(void *data, u64 val)
33293343

33303344
#define clk_rate_mode 0644
33313345

3346+
static int clk_phase_set(void *data, u64 val)
3347+
{
3348+
struct clk_core *core = data;
3349+
int degrees = do_div(val, 360);
3350+
int ret;
3351+
3352+
clk_prepare_lock();
3353+
ret = clk_core_set_phase_nolock(core, degrees);
3354+
clk_prepare_unlock();
3355+
3356+
return ret;
3357+
}
3358+
3359+
#define clk_phase_mode 0644
3360+
33323361
static int clk_prepare_enable_set(void *data, u64 val)
33333362
{
33343363
struct clk_core *core = data;
@@ -3356,6 +3385,9 @@ DEFINE_DEBUGFS_ATTRIBUTE(clk_prepare_enable_fops, clk_prepare_enable_get,
33563385
#else
33573386
#define clk_rate_set NULL
33583387
#define clk_rate_mode 0444
3388+
3389+
#define clk_phase_set NULL
3390+
#define clk_phase_mode 0644
33593391
#endif
33603392

33613393
static int clk_rate_get(void *data, u64 *val)
@@ -3371,6 +3403,16 @@ static int clk_rate_get(void *data, u64 *val)
33713403

33723404
DEFINE_DEBUGFS_ATTRIBUTE(clk_rate_fops, clk_rate_get, clk_rate_set, "%llu\n");
33733405

3406+
static int clk_phase_get(void *data, u64 *val)
3407+
{
3408+
struct clk_core *core = data;
3409+
3410+
*val = core->phase;
3411+
return 0;
3412+
}
3413+
3414+
DEFINE_DEBUGFS_ATTRIBUTE(clk_phase_fops, clk_phase_get, clk_phase_set, "%llu\n");
3415+
33743416
static const struct {
33753417
unsigned long flag;
33763418
const char *name;
@@ -3564,7 +3606,8 @@ static void clk_debug_create_one(struct clk_core *core, struct dentry *pdentry)
35643606
debugfs_create_file("clk_min_rate", 0444, root, core, &clk_min_rate_fops);
35653607
debugfs_create_file("clk_max_rate", 0444, root, core, &clk_max_rate_fops);
35663608
debugfs_create_ulong("clk_accuracy", 0444, root, &core->accuracy);
3567-
debugfs_create_u32("clk_phase", 0444, root, &core->phase);
3609+
debugfs_create_file("clk_phase", clk_phase_mode, root, core,
3610+
&clk_phase_fops);
35683611
debugfs_create_file("clk_flags", 0444, root, core, &clk_flags_fops);
35693612
debugfs_create_u32("clk_prepare_count", 0444, root, &core->prepare_count);
35703613
debugfs_create_u32("clk_enable_count", 0444, root, &core->enable_count);

drivers/clk/qcom/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ config IPQ_APSS_6018
131131
tristate "IPQ APSS Clock Controller"
132132
select IPQ_APSS_PLL
133133
depends on QCOM_APCS_IPC || COMPILE_TEST
134+
depends on QCOM_SMEM
134135
help
135136
Support for APSS clock controller on IPQ platforms. The
136137
APSS clock controller manages the Mux and enable block that feeds the
@@ -764,6 +765,13 @@ config SM_CAMCC_8450
764765
Support for the camera clock controller on SM8450 devices.
765766
Say Y if you want to support camera devices and camera functionality.
766767

768+
config SM_CAMCC_8550
769+
tristate "SM8550 Camera Clock Controller"
770+
select SM_GCC_8550
771+
help
772+
Support for the camera clock controller on SM8550 devices.
773+
Say Y if you want to support camera devices and camera functionality.
774+
767775
config SM_DISPCC_6115
768776
tristate "SM6115 Display Clock Controller"
769777
depends on ARM64 || COMPILE_TEST
@@ -834,6 +842,15 @@ config SM_DISPCC_8550
834842
Say Y if you want to support display devices and functionality such as
835843
splash screen.
836844

845+
config SM_GCC_4450
846+
tristate "SM4450 Global Clock Controller"
847+
depends on ARM64 || COMPILE_TEST
848+
select QCOM_GDSC
849+
help
850+
Support for the global clock controller on SM4450 devices.
851+
Say Y if you want to use peripheral devices such as UART, SPI,
852+
I2C, USB, SD/UFS, PCIe, etc.
853+
837854
config SM_GCC_6115
838855
tristate "SM6115 and SM4250 Global Clock Controller"
839856
depends on ARM64 || COMPILE_TEST

drivers/clk/qcom/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ obj-$(CONFIG_SDX_GCC_75) += gcc-sdx75.o
102102
obj-$(CONFIG_SM_CAMCC_6350) += camcc-sm6350.o
103103
obj-$(CONFIG_SM_CAMCC_8250) += camcc-sm8250.o
104104
obj-$(CONFIG_SM_CAMCC_8450) += camcc-sm8450.o
105+
obj-$(CONFIG_SM_CAMCC_8550) += camcc-sm8550.o
105106
obj-$(CONFIG_SM_DISPCC_6115) += dispcc-sm6115.o
106107
obj-$(CONFIG_SM_DISPCC_6125) += dispcc-sm6125.o
107108
obj-$(CONFIG_SM_DISPCC_6350) += dispcc-sm6350.o
108109
obj-$(CONFIG_SM_DISPCC_6375) += dispcc-sm6375.o
109110
obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o
110111
obj-$(CONFIG_SM_DISPCC_8450) += dispcc-sm8450.o
111112
obj-$(CONFIG_SM_DISPCC_8550) += dispcc-sm8550.o
113+
obj-$(CONFIG_SM_GCC_4450) += gcc-sm4450.o
112114
obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o
113115
obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o
114116
obj-$(CONFIG_SM_GCC_6350) += gcc-sm6350.o

drivers/clk/qcom/apss-ipq-pll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ static struct clk_alpha_pll ipq_pll_stromer_plus = {
6868
.fw_name = "xo",
6969
},
7070
.num_parents = 1,
71-
.ops = &clk_alpha_pll_stromer_ops,
71+
.ops = &clk_alpha_pll_stromer_plus_ops,
7272
},
7373
},
7474
};
7575

7676
static const struct alpha_pll_config ipq5332_pll_config = {
77-
.l = 0x3e,
77+
.l = 0x2d,
7878
.config_ctl_val = 0x4001075b,
7979
.config_ctl_hi_val = 0x304,
8080
.main_output_mask = BIT(0),

0 commit comments

Comments
 (0)