Skip to content

Commit 4ec6a2f

Browse files
committed
Merge branches 'clk-cleanup', 'clk-aspeed', 'clk-dt', 'clk-renesas' and 'clk-skyworks' into clk-next
- Support for i3c clks on Aspeed ast2600 SoCs - Clock driver for Skyworks Si521xx I2C PCIe clock generators * clk-cleanup: clk: microchip: fix potential UAF in auxdev release callback clk: sifive: make SiFive clk drivers depend on ARCH_ symbols clk: stm32h7: Remove an unused field in struct stm32_fractional_divider clk: tegra20: fix gcc-7 constant overflow warning clock: milbeaut: use devm_platform_get_and_ioremap_resource() clk: Print an info line before disabling unused clocks clk: ti: Use of_address_to_resource() clk: remove unnecessary (void*) conversions clk: at91: clk-sam9x60-pll: fix return value check clk: visconti: remove unused visconti_pll_provider::regmap * clk-aspeed: dt-bindings: clock: ast2600: Expand comment on reset definitions clk: ast2600: Add comment about combined clock + reset handling dt-bindings: clock: ast2600: remove IC36 & I3C7 clock definitions clk: ast2600: Add full configs for I3C clocks dt-bindings: clock: ast2600: Add top-level I3C clock clk: ast2600: allow empty entries in aspeed_g6_gates * clk-dt: clk: mediatek: clk-pllfh: fix missing of_node_put() in fhctl_parse_dt() clk: Use of_property_present() for testing DT property presence * clk-renesas: clk: renesas: r8a77980: Add I2C5 clock clk: rs9: Add support for 9FGV0441 clk: rs9: Support device specific dif bit calculation dt-bindings: clk: rs9: Add 9FGV0441 clk: rs9: Check for vendor/device ID clk: renesas: Convert to platform remove callback returning void clk: renesas: r9a06g032: Improve clock tables clk: renesas: r9a06g032: Document structs clk: renesas: r9a06g032: Drop unused fields clk: renesas: r9a06g032: Improve readability clk: renesas: r8a77980: Add Z2 clock clk: renesas: r8a77970: Add Z2 clock clk: renesas: r8a77995: Fix VIN parent clock clk: renesas: r8a77980: Add VIN clocks clk: renesas: r8a779g0: Add VIN clocks clk: renesas: r8a779g0: Add ISPCS clocks clk: renesas: r8a779g0: Add CSI-2 clocks clk: renesas: r8a779g0: Add thermal clock clk: renesas: r8a779g0: Add Audio clocks clk: renesas: cpg-mssr: Update MSSR register range for R-Car V4H * clk-skyworks: clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators dt-bindings: clk: si521xx: Add Skyworks Si521xx I2C PCIe clock generators
6 parents eeac8ed + 7455b70 + ced8a02 + f1d97a3 + 6aa252a + edc1276 commit 4ec6a2f

26 files changed

+1216
-265
lines changed

Documentation/devicetree/bindings/clock/renesas,9series.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ description: |
1616
- 9FGV0241:
1717
0 -- DIF0
1818
1 -- DIF1
19+
- 9FGV0441:
20+
0 -- DIF0
21+
1 -- DIF1
22+
2 -- DIF2
23+
3 -- DIF3
1924
2025
maintainers:
2126
- Marek Vasut <marex@denx.de>
@@ -24,6 +29,7 @@ properties:
2429
compatible:
2530
enum:
2631
- renesas,9fgv0241
32+
- renesas,9fgv0441
2733

2834
reg:
2935
description: I2C device address
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/skyworks,si521xx.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Skyworks Si521xx I2C PCIe clock generators
8+
9+
description: |
10+
The Skyworks Si521xx are I2C PCIe clock generators providing
11+
from 4 to 9 output clocks.
12+
13+
maintainers:
14+
- Marek Vasut <marex@denx.de>
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- skyworks,si52144
20+
- skyworks,si52146
21+
- skyworks,si52147
22+
23+
reg:
24+
const: 0x6b
25+
26+
'#clock-cells':
27+
const: 1
28+
29+
clocks:
30+
items:
31+
- description: XTal input clock
32+
33+
skyworks,out-amplitude-microvolt:
34+
enum: [ 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000 ]
35+
description: Output clock signal amplitude
36+
37+
required:
38+
- compatible
39+
- reg
40+
- clocks
41+
- '#clock-cells'
42+
43+
additionalProperties: false
44+
45+
examples:
46+
- |
47+
i2c {
48+
#address-cells = <1>;
49+
#size-cells = <0>;
50+
51+
clock-generator@6b {
52+
compatible = "skyworks,si52144";
53+
reg = <0x6b>;
54+
#clock-cells = <1>;
55+
clocks = <&ref25m>;
56+
};
57+
};
58+
59+
...

drivers/clk/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,15 @@ config COMMON_CLK_RS9_PCIE
367367
This driver supports the Renesas 9-series PCIe clock generator
368368
models 9FGV/9DBV/9DMV/9FGL/9DML/9QXL/9SQ.
369369

370+
config COMMON_CLK_SI521XX
371+
tristate "Clock driver for SkyWorks Si521xx PCIe clock generators"
372+
depends on I2C
373+
depends on OF
374+
select REGMAP_I2C
375+
help
376+
This driver supports the SkyWorks Si521xx PCIe clock generator
377+
models Si52144/Si52146/Si52147.
378+
370379
config COMMON_CLK_VC5
371380
tristate "Clock driver for IDT VersaClock 5,6 devices"
372381
depends on I2C

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ obj-$(CONFIG_COMMON_CLK_TPS68470) += clk-tps68470.o
7272
obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
7373
obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
7474
obj-$(CONFIG_COMMON_CLK_RS9_PCIE) += clk-renesas-pcie.o
75+
obj-$(CONFIG_COMMON_CLK_SI521XX) += clk-si521xx.o
7576
obj-$(CONFIG_COMMON_CLK_VC5) += clk-versaclock5.o
7677
obj-$(CONFIG_COMMON_CLK_VC7) += clk-versaclock7.o
7778
obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o

drivers/clk/at91/clk-sam9x60-pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
668668

669669
ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN,
670670
parent_rate, true);
671-
if (ret <= 0) {
671+
if (ret < 0) {
672672
hw = ERR_PTR(ret);
673673
goto free;
674674
}

drivers/clk/clk-ast2600.c

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
#include "clk-aspeed.h"
1717

18-
#define ASPEED_G6_NUM_CLKS 71
18+
/*
19+
* This includes the gates (configured from aspeed_g6_gates), plus the
20+
* explicitly-configured clocks (ASPEED_CLK_HPLL and up).
21+
*/
22+
#define ASPEED_G6_NUM_CLKS 72
1923

2024
#define ASPEED_G6_SILICON_REV 0x014
2125
#define CHIP_REVISION_ID GENMASK(23, 16)
@@ -32,6 +36,20 @@
3236
#define ASPEED_G6_CLK_SELECTION1 0x300
3337
#define ASPEED_G6_CLK_SELECTION2 0x304
3438
#define ASPEED_G6_CLK_SELECTION4 0x310
39+
#define ASPEED_G6_CLK_SELECTION5 0x314
40+
#define I3C_CLK_SELECTION_SHIFT 31
41+
#define I3C_CLK_SELECTION BIT(31)
42+
#define I3C_CLK_SELECT_HCLK (0 << I3C_CLK_SELECTION_SHIFT)
43+
#define I3C_CLK_SELECT_APLL_DIV (1 << I3C_CLK_SELECTION_SHIFT)
44+
#define APLL_DIV_SELECTION_SHIFT 28
45+
#define APLL_DIV_SELECTION GENMASK(30, 28)
46+
#define APLL_DIV_2 (0b001 << APLL_DIV_SELECTION_SHIFT)
47+
#define APLL_DIV_3 (0b010 << APLL_DIV_SELECTION_SHIFT)
48+
#define APLL_DIV_4 (0b011 << APLL_DIV_SELECTION_SHIFT)
49+
#define APLL_DIV_5 (0b100 << APLL_DIV_SELECTION_SHIFT)
50+
#define APLL_DIV_6 (0b101 << APLL_DIV_SELECTION_SHIFT)
51+
#define APLL_DIV_7 (0b110 << APLL_DIV_SELECTION_SHIFT)
52+
#define APLL_DIV_8 (0b111 << APLL_DIV_SELECTION_SHIFT)
3553

3654
#define ASPEED_HPLL_PARAM 0x200
3755
#define ASPEED_APLL_PARAM 0x210
@@ -55,6 +73,27 @@ static void __iomem *scu_g6_base;
5573
static u8 soc_rev;
5674

5775
/*
76+
* The majority of the clocks in the system are gates paired with a reset
77+
* controller that holds the IP in reset; this is represented by the @reset_idx
78+
* member of entries here.
79+
*
80+
* This borrows from clk_hw_register_gate, but registers two 'gates', one
81+
* to control the clock enable register and the other to control the reset
82+
* IP. This allows us to enforce the ordering:
83+
*
84+
* 1. Place IP in reset
85+
* 2. Enable clock
86+
* 3. Delay
87+
* 4. Release reset
88+
*
89+
* Consequently, if reset_idx is set, reset control is implicit: the clock
90+
* consumer does not need its own reset handling, as enabling the clock will
91+
* also deassert reset.
92+
*
93+
* There are some gates that do not have an associated reset; these are
94+
* handled by using -1 as the index for the reset, and the consumer must
95+
* explictly assert/deassert reset lines as required.
96+
*
5897
* Clocks marked with CLK_IS_CRITICAL:
5998
*
6099
* ref0 and ref1 are essential for the SoC to operate
@@ -97,14 +136,13 @@ static const struct aspeed_gate_data aspeed_g6_gates[] = {
97136
[ASPEED_CLK_GATE_LHCCLK] = { 37, -1, "lhclk-gate", "lhclk", 0 }, /* LPC master/LPC+ */
98137
/* Reserved 38 RSA: no longer used */
99138
/* Reserved 39 */
100-
[ASPEED_CLK_GATE_I3C0CLK] = { 40, 40, "i3c0clk-gate", NULL, 0 }, /* I3C0 */
101-
[ASPEED_CLK_GATE_I3C1CLK] = { 41, 41, "i3c1clk-gate", NULL, 0 }, /* I3C1 */
102-
[ASPEED_CLK_GATE_I3C2CLK] = { 42, 42, "i3c2clk-gate", NULL, 0 }, /* I3C2 */
103-
[ASPEED_CLK_GATE_I3C3CLK] = { 43, 43, "i3c3clk-gate", NULL, 0 }, /* I3C3 */
104-
[ASPEED_CLK_GATE_I3C4CLK] = { 44, 44, "i3c4clk-gate", NULL, 0 }, /* I3C4 */
105-
[ASPEED_CLK_GATE_I3C5CLK] = { 45, 45, "i3c5clk-gate", NULL, 0 }, /* I3C5 */
106-
[ASPEED_CLK_GATE_I3C6CLK] = { 46, 46, "i3c6clk-gate", NULL, 0 }, /* I3C6 */
107-
[ASPEED_CLK_GATE_I3C7CLK] = { 47, 47, "i3c7clk-gate", NULL, 0 }, /* I3C7 */
139+
[ASPEED_CLK_GATE_I3C0CLK] = { 40, 40, "i3c0clk-gate", "i3cclk", 0 }, /* I3C0 */
140+
[ASPEED_CLK_GATE_I3C1CLK] = { 41, 41, "i3c1clk-gate", "i3cclk", 0 }, /* I3C1 */
141+
[ASPEED_CLK_GATE_I3C2CLK] = { 42, 42, "i3c2clk-gate", "i3cclk", 0 }, /* I3C2 */
142+
[ASPEED_CLK_GATE_I3C3CLK] = { 43, 43, "i3c3clk-gate", "i3cclk", 0 }, /* I3C3 */
143+
[ASPEED_CLK_GATE_I3C4CLK] = { 44, 44, "i3c4clk-gate", "i3cclk", 0 }, /* I3C4 */
144+
[ASPEED_CLK_GATE_I3C5CLK] = { 45, 45, "i3c5clk-gate", "i3cclk", 0 }, /* I3C5 */
145+
/* Reserved: 46 & 47 */
108146
[ASPEED_CLK_GATE_UART1CLK] = { 48, -1, "uart1clk-gate", "uart", 0 }, /* UART1 */
109147
[ASPEED_CLK_GATE_UART2CLK] = { 49, -1, "uart2clk-gate", "uart", 0 }, /* UART2 */
110148
[ASPEED_CLK_GATE_UART3CLK] = { 50, -1, "uart3clk-gate", "uart", 0 }, /* UART3 */
@@ -652,6 +690,9 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev)
652690
const struct aspeed_gate_data *gd = &aspeed_g6_gates[i];
653691
u32 gate_flags;
654692

693+
if (!gd->name)
694+
continue;
695+
655696
/*
656697
* Special case: the USB port 1 clock (bit 14) is always
657698
* working the opposite way from the other ones.
@@ -772,6 +813,14 @@ static void __init aspeed_g6_cc(struct regmap *map)
772813
/* USB 2.0 port1 phy 40MHz clock */
773814
hw = clk_hw_register_fixed_rate(NULL, "usb-phy-40m", NULL, 0, 40000000);
774815
aspeed_g6_clk_data->hws[ASPEED_CLK_USBPHY_40M] = hw;
816+
817+
/* i3c clock: source from apll, divide by 8 */
818+
regmap_update_bits(map, ASPEED_G6_CLK_SELECTION5,
819+
I3C_CLK_SELECTION | APLL_DIV_SELECTION,
820+
I3C_CLK_SELECT_APLL_DIV | APLL_DIV_8);
821+
822+
hw = clk_hw_register_fixed_factor(NULL, "i3cclk", "apll", 0, 1, 8);
823+
aspeed_g6_clk_data->hws[ASPEED_CLK_I3C] = hw;
775824
};
776825

777826
static void __init aspeed_g6_cc_init(struct device_node *np)

drivers/clk/clk-milbeaut.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,12 @@ static void m10v_reg_mux_pre(const struct m10v_clk_mux_factors *factors,
560560
static int m10v_clk_probe(struct platform_device *pdev)
561561
{
562562
int id;
563-
struct resource *res;
564563
struct device *dev = &pdev->dev;
565564
struct device_node *np = dev->of_node;
566565
void __iomem *base;
567566
const char *parent_name;
568567

569-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
570-
base = devm_ioremap_resource(dev, res);
568+
base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
571569
if (IS_ERR(base))
572570
return PTR_ERR(base);
573571

0 commit comments

Comments
 (0)