Skip to content

Commit

Permalink
Merge branches 'clk-airoha', 'clk-rockchip', 'clk-stm', 'clk-thead' a…
Browse files Browse the repository at this point in the history
…nd 'clk-bcm' into clk-next

* clk-airoha:
  clk: en7523: Add clock for eMMC for EN7581
  dt-bindings: clock: add ID for eMMC for EN7581
  dt-bindings: clock: drop NUM_CLOCKS define for EN7581
  clk: en7523: Rework clock handling for different clock numbers
  clk: en7523: Initialize num before accessing hws in en7523_register_clocks()
  clk: en7523: Fix wrong BUS clock for EN7581
  clk: amlogic: axg-audio: revert reset implementation
  Revert "clk: Fix invalid execution of clk_set_rate"

* clk-rockchip:
  clk: rockchip: rk3588: make refclko25m_ethX critical
  clk: rockchip: rk3588: drop RK3588_LINKED_CLK
  clk: rockchip: implement linked gate clock support
  clk: rockchip: expose rockchip_clk_set_lookup
  clk: rockchip: rk3588: register GATE_LINK later
  clk: rockchip: support clocks registered late

* clk-stm:
  clk: stm32f4: support spread spectrum clock generation
  clk: stm32f4: use FIELD helpers to access the PLLCFGR fields
  dt-bindings: clock: st,stm32-rcc: support spread spectrum clocking
  dt-bindings: clock: convert stm32 rcc bindings to json-schema

* clk-thead:
  clk: thead: Fix cpu2vp_clk for TH1520 AP_SUBSYS clocks
  clk: thead: Add CLK_IGNORE_UNUSED to fix TH1520 boot
  clk: thead: Fix clk gate registration to pass flags

* clk-bcm:
  clk: bcm: rpi: Add disp clock
  clk: bcm: rpi: Create helper to retrieve private data
  clk: bcm: rpi: Enable minimize for all firmware clocks
  clk: bcm: rpi: Allow cpufreq driver to also adjust gpu clocks
  clk: bcm: rpi: Add ISP to exported clocks
  • Loading branch information
bebarino committed Jan 21, 2025
6 parents b2fee97 + bfe257f + 57ea142 + 65b3516 + 3a43cd1 + e7d0b02 commit 1d2da92
Show file tree
Hide file tree
Showing 18 changed files with 739 additions and 241 deletions.
138 changes: 0 additions & 138 deletions Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

This file was deleted.

144 changes: 144 additions & 0 deletions Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/st,stm32-rcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: STMicroelectronics STM32 Reset Clock Controller

maintainers:
- Dario Binacchi <[email protected]>

description: |
The RCC IP is both a reset and a clock controller.
The reset phandle argument is the bit number within the RCC registers bank,
starting from RCC base address.
properties:
compatible:
oneOf:
- items:
- enum:
- st,stm32f42xx-rcc
- st,stm32f746-rcc
- st,stm32h743-rcc
- const: st,stm32-rcc
- items:
- enum:
- st,stm32f469-rcc
- const: st,stm32f42xx-rcc
- const: st,stm32-rcc
- items:
- enum:
- st,stm32f769-rcc
- const: st,stm32f746-rcc
- const: st,stm32-rcc

reg:
maxItems: 1

'#reset-cells':
const: 1

'#clock-cells':
enum: [1, 2]

clocks:
minItems: 2
maxItems: 3

st,syscfg:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Phandle to system configuration controller. It can be used to control the
power domain circuitry.

st,ssc-modfreq-hz:
description:
The modulation frequency for main PLL (in Hz)

st,ssc-moddepth-permyriad:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The modulation rate for main PLL (in permyriad, i.e. 0.01%)
minimum: 25
maximum: 200

st,ssc-modmethod:
$ref: /schemas/types.yaml#/definitions/string
description:
The modulation techniques for main PLL.
items:
enum:
- center-spread
- down-spread

required:
- compatible
- reg
- '#reset-cells'
- '#clock-cells'
- clocks
- st,syscfg

allOf:
- if:
properties:
compatible:
contains:
const: st,stm32h743-rcc
then:
properties:
'#clock-cells':
const: 1
description: |
The clock index for the specified type.
clocks:
items:
- description: high speed external (HSE) clock input
- description: low speed external (LSE) clock input
- description: Inter-IC sound (I2S) clock input
st,ssc-modfreq-hz: false
st,ssc-moddepth-permyriad: false
st,ssc-modmethod: false

else:
properties:
'#clock-cells':
const: 2
description: |
- The first cell is the clock type, possible values are 0 for
gated clocks and 1 otherwise.
- The second cell is the clock index for the specified type.
clocks:
items:
- description: high speed external (HSE) clock input
- description: Inter-IC sound (I2S) clock input

additionalProperties: false

examples:
# Reset and Clock Control Module node:
- |
clock-controller@40023800 {
compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
reg = <0x40023800 0x400>;
#clock-cells = <2>;
#reset-cells = <1>;
clocks = <&clk_hse>, <&clk_i2s_ckin>;
st,syscfg = <&pwrcfg>;
st,ssc-modfreq-hz = <10000>;
st,ssc-moddepth-permyriad = <200>;
st,ssc-modmethod = "center-spread";
};
- |
clock-controller@58024400 {
compatible = "st,stm32h743-rcc", "st,stm32-rcc";
reg = <0x58024400 0x400>;
#clock-cells = <1>;
#reset-cells = <1>;
clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s>;
st,syscfg = <&pwrcfg>;
};
...
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/reset/st,stm32-rcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ STMicroelectronics STM32 Peripheral Reset Controller

The RCC IP is both a reset and a clock controller.

Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml
33 changes: 24 additions & 9 deletions drivers/clk/bcm/clk-raspberrypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static char *rpi_firmware_clk_names[] = {
[RPI_FIRMWARE_M2MC_CLK_ID] = "m2mc",
[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = "pixel-bvb",
[RPI_FIRMWARE_VEC_CLK_ID] = "vec",
[RPI_FIRMWARE_DISP_CLK_ID] = "disp",
};

#define RPI_FIRMWARE_STATE_ENABLE_BIT BIT(0)
Expand All @@ -56,6 +57,12 @@ struct raspberrypi_clk_data {
struct raspberrypi_clk *rpi;
};

static inline
const struct raspberrypi_clk_data *clk_hw_to_data(const struct clk_hw *hw)
{
return container_of(hw, struct raspberrypi_clk_data, hw);
}

struct raspberrypi_clk_variant {
bool export;
char *clkdev;
Expand Down Expand Up @@ -111,18 +118,31 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
},
[RPI_FIRMWARE_V3D_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_PIXEL_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_HEVC_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_ISP_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_VEC_CLK_ID] = {
.export = true,
.minimize = true,
},
[RPI_FIRMWARE_DISP_CLK_ID] = {
.export = true,
.minimize = true,
},
};

Expand Down Expand Up @@ -153,7 +173,6 @@ static int raspberrypi_clock_property(struct rpi_firmware *firmware,
struct raspberrypi_firmware_prop msg = {
.id = cpu_to_le32(data->id),
.val = cpu_to_le32(*val),
.disable_turbo = cpu_to_le32(1),
};
int ret;

Expand All @@ -168,8 +187,7 @@ static int raspberrypi_clock_property(struct rpi_firmware *firmware,

static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
{
struct raspberrypi_clk_data *data =
container_of(hw, struct raspberrypi_clk_data, hw);
const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
struct raspberrypi_clk *rpi = data->rpi;
u32 val = 0;
int ret;
Expand All @@ -186,8 +204,7 @@ static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct raspberrypi_clk_data *data =
container_of(hw, struct raspberrypi_clk_data, hw);
const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
struct raspberrypi_clk *rpi = data->rpi;
u32 val = 0;
int ret;
Expand All @@ -203,8 +220,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct raspberrypi_clk_data *data =
container_of(hw, struct raspberrypi_clk_data, hw);
const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
struct raspberrypi_clk *rpi = data->rpi;
u32 _rate = rate;
int ret;
Expand All @@ -221,8 +237,7 @@ static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
static int raspberrypi_fw_dumb_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct raspberrypi_clk_data *data =
container_of(hw, struct raspberrypi_clk_data, hw);
const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
struct raspberrypi_clk_variant *variant = data->variant;

/*
Expand Down
Loading

0 comments on commit 1d2da92

Please sign in to comment.