Basic clock and reset support for StarFive JH8100 RISC-V SoC
Subsystems (7)
v3 cover Basic clock and reset support for StarFive JH8100 RISC-V SoC
This patch series enabled basic clock & reset support for StarFive JH8100 SoC.
This patch series depends on the Initial device tree support for StarFive JH8100 SoC patch series which can be found at [1].
As it is recommended to refrain from merging fundamental patches like Device Tree, Clock & Reset, and PINCTRL tested on FPGA/Emulator, into the RISC-V Mainline, this patch series has been renamed to "RFC" patches. Yet, thanks to the reviewers who have reviewed the patches at [2]. The changes are captured below.
StarFive JH8100 shares a similar clock and reset design with JH7110. To facilitate the reuse of the file and its functionalities, files containing the 'jh71x0' naming convention are renamed to use the 'common' wording. Internal functions that contain the 'jh71x0' naming convention are renamed to use 'starfive.' This is accomplished through patches 1, 2, 3, and 4.
Patch 5 adds documentation to describe System (SYSCRG) Clock & Reset binding.
Patch 6 adds SYSCRG clock driver.
patch 7 adds documentation to describe North-West (NWCRG) Clock & Reset binding.
Patch 8 adds NWCRG clock driver.
patch 9 adds documentation to describe North-East (NECRG) Clock & Reset binding.
Patch 10 adds NECRG clock driver.
patch 11 adds documentation to describe South-West (SWCRG) Clock & Reset binding.
Patch 12 adds SWCRG clock driver.
patch 13 adds documentation to describe Always-On (AON) Clock & Reset binding.
Patch 14 adds AON clock driver.
Patch 15 adds support for the auxiliary reset driver.
Patch 16 adds clocks and reset nodes to the JH8100 device tree.
Changes since RFC V2:
- Renamed the patch series to "RFC v3" because the reviewer suggested patch series at [3] to be RFC v2 instead.
- Added the "Reviewed-by" tag from Krzysztof for patches 5, 7, 9, 11, and 13.
- Renamed the clock nodes to clock-controller to align with the name in the dt-binding YAML documentation.
Changes since [2]:
- Renamed the patch series to "RFC" patches.
- Added the "Reviewed-by" tag from Emil for patches 1, 2 3 & 4.
- Removed clk_ prefixes.
- Used 4 spaces for example indentation in dt-binding documentation.
- Used the same license in dt-binding.
- Moved number of clocks from binding to source file.
- Moved number of resets from binding ro source file.
- Removed the subfolder for new clock files.
- Followed the JH71xx files naming convention.
- Followed the JH71xx clock naming conventions.
- Followed the JH71xx resets naming conventions.
- Moved the PLL fixed clock from the source file to Device Tree.
- Dropped clk.dtsi and moved the clocks node to SoC.dtsi.
[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/
Sia Jee Heng (16):
reset: starfive: Rename file name "jh71x0" to "common"
reset: starfive: Convert the word "jh71x0" to "starfive"
clk: starfive: Rename file name "jh71x0" to "common"
clk: starfive: Convert the word "jh71x0" to "starfive"
dt-bindings: clock: Add StarFive JH8100 System clock and reset
generator
clk: starfive: Add JH8100 System clock generator driver
dt-bindings: clock: Add StarFive JH8100 North-West clock and reset
generator
clk: starfive: Add JH8100 North-West clock generator driver
dt-bindings: clock: Add StarFive JH8100 North-East clock and reset
generator
clk: starfive: Add JH8100 North-East clock generator driver
dt-bindings: clock: Add StarFive JH8100 South-West clock and reset
generator
clk: starfive: Add JH8100 South-West clock generator driver
dt-bindings: clock: Add StarFive JH8100 Always-On clock and reset
generator
clk: starfive: Add JH8100 Always-On clock generator driver
reset: starfive: Add StarFive JH8100 reset driver
riscv: dts: starfive: jh8100: Add clocks and resets nodes
.../clock/starfive,jh8100-aoncrg.yaml | 74 +++
.../bindings/clock/starfive,jh8100-necrg.yaml | 153 +++++
.../bindings/clock/starfive,jh8100-nwcrg.yaml | 119 ++++
.../bindings/clock/starfive,jh8100-swcrg.yaml | 64 +++
.../clock/starfive,jh8100-syscrg.yaml | 77 +++
MAINTAINERS | 15 +
arch/riscv/boot/dts/starfive/jh8100.dtsi | 313 +++++++++++
drivers/clk/starfive/Kconfig | 45 +-
drivers/clk/starfive/Makefile | 8 +-
drivers/clk/starfive/clk-starfive-common.c | 327 +++++++++++
drivers/clk/starfive/clk-starfive-common.h | 130 +++++
.../clk/starfive/clk-starfive-jh7100-audio.c | 127 ++---
drivers/clk/starfive/clk-starfive-jh7100.c | 503 ++++++++---------
.../clk/starfive/clk-starfive-jh7110-aon.c | 62 +--
.../clk/starfive/clk-starfive-jh7110-isp.c | 72 +--
.../clk/starfive/clk-starfive-jh7110-stg.c | 94 ++--
.../clk/starfive/clk-starfive-jh7110-sys.c | 523 +++++++++---------
.../clk/starfive/clk-starfive-jh7110-vout.c | 74 +--
drivers/clk/starfive/clk-starfive-jh7110.h | 4 +-
drivers/clk/starfive/clk-starfive-jh71x0.c | 327 -----------
drivers/clk/starfive/clk-starfive-jh71x0.h | 123 ----
.../clk/starfive/clk-starfive-jh8100-aon.c | 256 +++++++++
drivers/clk/starfive/clk-starfive-jh8100-ne.c | 499 +++++++++++++++++
drivers/clk/starfive/clk-starfive-jh8100-nw.c | 237 ++++++++
drivers/clk/starfive/clk-starfive-jh8100-sw.c | 134 +++++
.../clk/starfive/clk-starfive-jh8100-sys.c | 415 ++++++++++++++
drivers/clk/starfive/clk-starfive-jh8100.h | 11 +
drivers/reset/starfive/Kconfig | 14 +-
drivers/reset/starfive/Makefile | 4 +-
...rfive-jh71x0.c => reset-starfive-common.c} | 68 +--
.../reset/starfive/reset-starfive-common.h | 14 +
.../reset/starfive/reset-starfive-jh7100.c | 4 +-
.../reset/starfive/reset-starfive-jh7110.c | 8 +-
.../reset/starfive/reset-starfive-jh71x0.h | 14 -
.../reset/starfive/reset-starfive-jh8100.c | 108 ++++
.../dt-bindings/clock/starfive,jh8100-crg.h | 421 ++++++++++++++
.../dt-bindings/reset/starfive,jh8100-crg.h | 118 ++++
...rfive-jh71x0.h => reset-starfive-common.h} | 10 +-
38 files changed, 4327 insertions(+), 1242 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-aoncrg.yaml
create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-necrg.yaml
create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-nwcrg.yaml
create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-swcrg.yaml
create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-syscrg.yaml
create mode 100644 drivers/clk/starfive/clk-starfive-common.c
create mode 100644 drivers/clk/starfive/clk-starfive-common.h
delete mode 100644 drivers/clk/starfive/clk-starfive-jh71x0.c
delete mode 100644 drivers/clk/starfive/clk-starfive-jh71x0.h
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-aon.c
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-ne.c
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-nw.c
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-sw.c
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-sys.c
create mode 100644 drivers/clk/starfive/clk-starfive-jh8100.h
rename drivers/reset/starfive/{reset-starfive-jh71x0.c => reset-starfive-common.c} (55%)
create mode 100644 drivers/reset/starfive/reset-starfive-common.h
delete mode 100644 drivers/reset/starfive/reset-starfive-jh71x0.h
create mode 100644 drivers/reset/starfive/reset-starfive-jh8100.c
create mode 100644 include/dt-bindings/clock/starfive,jh8100-crg.h
create mode 100644 include/dt-bindings/reset/starfive,jh8100-crg.h
rename include/soc/starfive/{reset-starfive-jh71x0.h => reset-starfive-common.h} (50%)Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC v3 1/16 reset: starfive: Rename file name "jh71x0" to "common"
StarFive JH8100 shares a similar clock and reset design with JH7110. To facilitate the reuse of the file and its functionalities, files containing the "jh71x0" naming convention are renamed to use the "common" wording.
---
drivers/clk/starfive/clk-starfive-jh7110-sys.c | 2 +-
drivers/reset/starfive/Kconfig | 6 +++---
drivers/reset/starfive/Makefile | 2 +-
.../{reset-starfive-jh71x0.c => reset-starfive-common.c} | 4 ++--
.../{reset-starfive-jh71x0.h => reset-starfive-common.h} | 6 +++---
drivers/reset/starfive/reset-starfive-jh7100.c | 2 +-
drivers/reset/starfive/reset-starfive-jh7110.c | 4 ++--
.../{reset-starfive-jh71x0.h => reset-starfive-common.h} | 4 ++--
8 files changed, 15 insertions(+), 15 deletions(-)
rename drivers/reset/starfive/{reset-starfive-jh71x0.c => reset-starfive-common.c} (97%)
rename drivers/reset/starfive/{reset-starfive-jh71x0.h => reset-starfive-common.h} (75%)
rename include/soc/starfive/{reset-starfive-jh71x0.h => reset-starfive-common.h} (81%)drivers/clk/starfive/clk-starfive-jh7110-sys.c +1 -1
@@ -14,7 +14,7 @@#include <linux/platform_device.h> #include <linux/slab.h> -#include <soc/starfive/reset-starfive-jh71x0.h> +#include <soc/starfive/reset-starfive-common.h> #include <dt-bindings/clock/starfive,jh7110-crg.h>
drivers/reset/starfive/Kconfig +3 -3
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: GPL-2.0-only -config RESET_STARFIVE_JH71X0 +config RESET_STARFIVE_COMMON bool config RESET_STARFIVE_JH7100 bool "StarFive JH7100 Reset Driver" depends on ARCH_STARFIVE || COMPILE_TEST - select RESET_STARFIVE_JH71X0 + select RESET_STARFIVE_COMMON default ARCH_STARFIVE help This enables the reset controller driver for the StarFive JH7100 SoC.
@@ -15,7 +15,7 @@ config RESET_STARFIVE_JH7110 bool "StarFive JH7110 Reset Driver" depends on CLK_STARFIVE_JH7110_SYS select AUXILIARY_BUS - select RESET_STARFIVE_JH71X0 + select RESET_STARFIVE_COMMON default ARCH_STARFIVE help This enables the reset controller driver for the StarFive JH7110 SoC.
drivers/reset/starfive/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_RESET_STARFIVE_JH71X0) += reset-starfive-jh71x0.o +obj-$(CONFIG_RESET_STARFIVE_COMMON) += reset-starfive-common.o obj-$(CONFIG_RESET_STARFIVE_JH7100) += reset-starfive-jh7100.o obj-$(CONFIG_RESET_STARFIVE_JH7110) += reset-starfive-jh7110.o
drivers/reset/starfive/reset-starfive-common.c renamed from drivers/reset/starfive/reset-starfive-jh71x0.c +2 -2
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later /* -* Reset driver for the StarFive JH71X0 SoCs +* Reset driver for the StarFive SoCs * * Copyright (C) 2021 Emil Renner Berthing <[email protected]> */
@@ -12,7 +12,7 @@#include <linux/reset-controller.h> #include <linux/spinlock.h> -#include "reset-starfive-jh71x0.h" +#include "reset-starfive-common.h" struct jh71x0_reset {struct reset_controller_dev rcdev;
drivers/reset/starfive/reset-starfive-common.h renamed from drivers/reset/starfive/reset-starfive-jh71x0.h +3 -3
@@ -3,12 +3,12 @@* Copyright (C) 2021 Emil Renner Berthing <[email protected]> */ -#ifndef __RESET_STARFIVE_JH71X0_H -#define __RESET_STARFIVE_JH71X0_H +#ifndef __RESET_STARFIVE_COMMON_H +#define __RESET_STARFIVE_COMMON_Hint reset_starfive_jh71x0_register (struct device *dev,struct device_node *of_node,void __iomem *assert,void __iomem *status,const u32 *asserted,unsigned int nr_resets,struct module *owner); -#endif /* __RESET_STARFIVE_JH71X0_H */ +#endif /* __RESET_STARFIVE_COMMON_H */
drivers/reset/starfive/reset-starfive-jh7100.c +1 -1
@@ -8,7 +8,7 @@#include <linux/mod_devicetable.h> #include <linux/platform_device.h> -#include "reset-starfive-jh71x0.h" +#include "reset-starfive-common.h" #include <dt-bindings/reset/starfive-jh7100.h>
drivers/reset/starfive/reset-starfive-jh7110.c +2 -2
@@ -7,9 +7,9 @@#include <linux/auxiliary_bus.h> -#include <soc/starfive/reset-starfive-jh71x0.h> +#include <soc/starfive/reset-starfive-common.h> -#include "reset-starfive-jh71x0.h" +#include "reset-starfive-common.h" #include <dt-bindings/reset/starfive,jh7110-crg.h>
include/soc/starfive/reset-starfive-common.h renamed from include/soc/starfive/reset-starfive-jh71x0.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __SOC_STARFIVE_RESET_JH71X0_H -#define __SOC_STARFIVE_RESET_JH71X0_H +#ifndef __SOC_STARFIVE_RESET_COMMON_H +#define __SOC_STARFIVE_RESET_COMMON_H#include <linux/auxiliary_bus.h> #include <linux/compiler_types.h>
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RE: [RFC v3 01/16] reset: starfive: Rename file name "jh71x0" to "common"
Quoted 9 lines · JeeHeng Sia
StarFive JH8100 shares a similar clock and reset design with JH7110. To facilitate the reuse of the file and its functionalities, files containing the "jh71x0" naming convention are renamed to use the "common" wording.
Signed-off-by Sia Jee Heng <[email protected]>Reviewed-by Ley Foon Tan <[email protected]>Reviewed-by Emil Renner Berthing <[email protected]>
RFC v3 2/16 reset: starfive: Convert the word "jh71x0" to "starfive"
In reply to Sia Jee HengFunction names that consist of the 'jh71x0' naming convention are renamed to use the 'starfive' wording.
--- .../clk/starfive/clk-starfive-jh7110-sys.c | 4 +- .../reset/starfive/reset-starfive-common.c | 64 +++++++++---------- .../reset/starfive/reset-starfive-common.h | 8 +-- .../reset/starfive/reset-starfive-jh7100.c | 2 +- .../reset/starfive/reset-starfive-jh7110.c | 4 +- include/soc/starfive/reset-starfive-common.h | 6 +- 6 files changed, 44 insertions(+), 44 deletions(-)
drivers/clk/starfive/clk-starfive-jh7110-sys.c +2 -2
@@ -345,7 +345,7 @@ static void jh7110_reset_unregister_adev(void *_adev)static void jh7110_reset_adev_release (struct device *dev) {struct auxiliary_device *adev =to_auxiliary_dev (dev); -struct jh71x0_reset_adev *rdev =to_jh71x0_reset_adev (adev); +struct starfive_reset_adev *rdev =to_starfive_reset_adev (adev);kfree (rdev); }
@@ -354,7 +354,7 @@ int jh7110_reset_controller_register(struct jh71x0_clk_priv *priv, const char *adev_name, u32 adev_id) { -struct jh71x0_reset_adev *rdev; +struct starfive_reset_adev *rdev;struct auxiliary_device *adev;int ret;
drivers/reset/starfive/reset-starfive-common.c +32 -32
118 lines not on this page · raw message
drivers/reset/starfive/reset-starfive-common.h +4 -4
@@ -6,9 +6,9 @@#ifndef __RESET_STARFIVE_COMMON_H#define __RESET_STARFIVE_COMMON_H -int reset_starfive_jh71x0_register (struct device *dev,struct device_node *of_node, -void __iomem *assert,void __iomem *status, -const u32 *asserted,unsigned int nr_resets, -struct module *owner); +int reset_starfive_register (struct device *dev,struct device_node *of_node, +void __iomem *assert,void __iomem *status, +const u32 *asserted,unsigned int nr_resets, +struct module *owner);#endif /* __RESET_STARFIVE_COMMON_H */
drivers/reset/starfive/reset-starfive-jh7100.c +1 -1
@@ -51,7 +51,7 @@ static int __init jh7100_reset_probe(struct platform_device *pdev)if (IS_ERR (base))return PTR_ERR (base); - return reset_starfive_jh71x0_register(&pdev->dev, pdev->dev.of_node, + return reset_starfive_register(&pdev->dev, pdev->dev.of_node, base + JH7100_RESET_ASSERT0, base + JH7100_RESET_STATUS0, jh7100_reset_asserted,
drivers/reset/starfive/reset-starfive-jh7110.c +2 -2
@@ -53,13 +53,13 @@ static int jh7110_reset_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id) {struct jh7110_reset_info *info = (struct jh7110_reset_info *)(id->driver_data); -struct jh71x0_reset_adev *rdev =to_jh71x0_reset_adev (adev); +struct starfive_reset_adev *rdev =to_starfive_reset_adev (adev);void __iomem *base = rdev->base;if (!info || !base)return -ENODEV ; - return reset_starfive_jh71x0_register(&adev->dev, adev->dev.parent->of_node, + return reset_starfive_register(&adev->dev, adev->dev.parent->of_node, base + info->assert_offset, base + info->status_offset, NULL,
include/soc/starfive/reset-starfive-common.h +3 -3
@@ -6,12 +6,12 @@#include <linux/compiler_types.h> #include <linux/container_of.h> -struct jh71x0_reset_adev { +struct starfive_reset_adev {void __iomem *base;struct auxiliary_device adev; }; -#define to_jh71x0_reset_adev (_adev) \ - container_of((_adev), struct jh71x0_reset_adev, adev) +#define to_starfive_reset_adev (_adev) \ + container_of((_adev), struct starfive_reset_adev, adev)#endif
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RE: [RFC v3 02/16] reset: starfive: Convert the word "jh71x0" to "starfive"
Quoted 8 lines · JeeHeng Sia
Function names that consist of the 'jh71x0' naming convention are renamed to use the 'starfive' wording.
Signed-off-by Sia Jee Heng <[email protected]>Reviewed-by Ley Foon Tan <[email protected]>Reviewed-by Emil Renner Berthing <[email protected]>
RFC v3 3/16 clk: starfive: Rename file name "jh71x0" to "common"
In reply to Sia Jee HengStarFive JH8100 shares a similar clock and reset design with JH7110. To facilitate the reuse of the file and its functionalities, files containing the "jh71x0" naming convention are renamed to use the "common" wording.
---
drivers/clk/starfive/Kconfig | 8 ++++----
drivers/clk/starfive/Makefile | 2 +-
.../{clk-starfive-jh71x0.c => clk-starfive-common.c} | 4 ++--
.../{clk-starfive-jh71x0.h => clk-starfive-common.h} | 4 ++--
drivers/clk/starfive/clk-starfive-jh7100-audio.c | 2 +-
drivers/clk/starfive/clk-starfive-jh7100.c | 2 +-
drivers/clk/starfive/clk-starfive-jh7110.h | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
rename drivers/clk/starfive/{clk-starfive-jh71x0.c => clk-starfive-common.c} (99%)
rename drivers/clk/starfive/{clk-starfive-jh71x0.h => clk-starfive-common.h} (97%)drivers/clk/starfive/Kconfig +4 -4
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 -config CLK_STARFIVE_JH71X0 +config CLK_STARFIVE_COMMON bool config CLK_STARFIVE_JH7100 bool "StarFive JH7100 clock support" depends on ARCH_STARFIVE || COMPILE_TEST - select CLK_STARFIVE_JH71X0 + select CLK_STARFIVE_COMMON default ARCH_STARFIVE help Say yes here to support the clock controller on the StarFive JH7100
@@ -15,7 +15,7 @@ config CLK_STARFIVE_JH7100 config CLK_STARFIVE_JH7100_AUDIO tristate "StarFive JH7100 audio clock support" depends on CLK_STARFIVE_JH7100 - select CLK_STARFIVE_JH71X0 + select CLK_STARFIVE_COMMON default m if ARCH_STARFIVE help Say Y or M here to support the audio clocks on the StarFive JH7100
@@ -33,7 +33,7 @@ config CLK_STARFIVE_JH7110_SYS bool "StarFive JH7110 system clock support" depends on ARCH_STARFIVE || COMPILE_TEST select AUXILIARY_BUS - select CLK_STARFIVE_JH71X0 + select CLK_STARFIVE_COMMON select RESET_STARFIVE_JH7110 if RESET_CONTROLLER select CLK_STARFIVE_JH7110_PLL default ARCH_STARFIVE
drivers/clk/starfive/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_CLK_STARFIVE_JH71X0) += clk-starfive-jh71x0.o +obj-$(CONFIG_CLK_STARFIVE_COMMON) += clk-starfive-common.o obj-$(CONFIG_CLK_STARFIVE_JH7100) += clk-starfive-jh7100.o obj-$(CONFIG_CLK_STARFIVE_JH7100_AUDIO) += clk-starfive-jh7100-audio.o
drivers/clk/starfive/clk-starfive-common.c renamed from drivers/clk/starfive/clk-starfive-jh71x0.c +2 -2
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* StarFive JH71X0 Clock Generator Driver +* StarFive Clock Generator Driver * * Copyright (C) 2021-2022 Emil Renner Berthing <[email protected]> */
@@ -10,7 +10,7 @@#include <linux/device.h> #include <linux/io.h> -#include "clk-starfive-jh71x0.h" +#include "clk-starfive-common.h" static struct jh71x0_clk *jh71x0_clk_from (struct clk_hw *hw) {
drivers/clk/starfive/clk-starfive-common.h renamed from drivers/clk/starfive/clk-starfive-jh71x0.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __CLK_STARFIVE_JH71X0_H -#define __CLK_STARFIVE_JH71X0_H +#ifndef __CLK_STARFIVE_COMMON_H +#define __CLK_STARFIVE_COMMON_H#include <linux/bits.h> #include <linux/clk-provider.h>
drivers/clk/starfive/clk-starfive-jh7100-audio.c +1 -1
@@ -15,7 +15,7 @@#include <dt-bindings/clock/starfive-jh7100-audio.h> -#include "clk-starfive-jh71x0.h" +#include "clk-starfive-common.h" /* external clocks */ #define JH7100_AUDCLK_AUDIO_SRC (JH7100_AUDCLK_END + 0)
drivers/clk/starfive/clk-starfive-jh7100.c +1 -1
@@ -15,7 +15,7 @@#include <dt-bindings/clock/starfive-jh7100.h> -#include "clk-starfive-jh71x0.h" +#include "clk-starfive-common.h" /* external clocks */ #define JH7100_CLK_OSC_SYS (JH7100_CLK_END + 0)
drivers/clk/starfive/clk-starfive-jh7110.h +1 -1
@@ -2,7 +2,7 @@#ifndef __CLK_STARFIVE_JH7110_H#define __CLK_STARFIVE_JH7110_H -#include "clk-starfive-jh71x0.h" +#include "clk-starfive-common.h" /* top clocks of ISP/VOUT domain from JH7110 SYSCRG */ struct jh7110_top_sysclk {
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RE: [RFC v3 03/16] clk: starfive: Rename file name "jh71x0" to "common"
Quoted 9 lines · JeeHeng Sia
StarFive JH8100 shares a similar clock and reset design with JH7110. To facilitate the reuse of the file and its functionalities, files containing the "jh71x0" naming convention are renamed to use the "common" wording.
Signed-off-by Sia Jee Heng <[email protected]>Reviewed-by Ley Foon Tan <[email protected]>Reviewed-by Emil Renner Berthing <[email protected]>
RFC v3 4/16 clk: starfive: Convert the word "jh71x0" to "starfive"
In reply to Sia Jee HengFunction names that consist of the 'jh71x0' naming convention are renamed to use the 'starfive' wording.
--- drivers/clk/starfive/clk-starfive-common.c | 290 +++++----- drivers/clk/starfive/clk-starfive-common.h | 68 +-- .../clk/starfive/clk-starfive-jh7100-audio.c | 125 ++--- drivers/clk/starfive/clk-starfive-jh7100.c | 501 ++++++++--------- .../clk/starfive/clk-starfive-jh7110-aon.c | 62 +-- .../clk/starfive/clk-starfive-jh7110-isp.c | 72 +-- .../clk/starfive/clk-starfive-jh7110-stg.c | 94 ++-- .../clk/starfive/clk-starfive-jh7110-sys.c | 517 +++++++++--------- .../clk/starfive/clk-starfive-jh7110-vout.c | 74 +-- drivers/clk/starfive/clk-starfive-jh7110.h | 2 +- 10 files changed, 908 insertions(+), 897 deletions(-)
drivers/clk/starfive/clk-starfive-common.c +145 -145
@@ -12,27 +12,27 @@#include "clk-starfive-common.h" -static struct jh71x0_clk *jh71x0_clk_from (struct clk_hw *hw) +static struct starfive_clk *starfive_clk_from (struct clk_hw *hw) { - return container_of(hw, struct jh71x0_clk, hw); + return container_of(hw, struct starfive_clk, hw); } -static struct jh71x0_clk_priv *jh71x0_priv_from (struct jh71x0_clk *clk) +static struct starfive_clk_priv *starfive_priv_from (struct starfive_clk *clk) { - return container_of(clk, struct jh71x0_clk_priv, reg[clk->idx]); + return container_of(clk, struct starfive_clk_priv, reg[clk->idx]); } -static u32 jh71x0_clk_reg_get (struct jh71x0_clk *clk) +static u32 starfive_clk_reg_get (struct starfive_clk *clk) { -struct jh71x0_clk_priv *priv =jh71x0_priv_from (clk); +struct starfive_clk_priv *priv =starfive_priv_from (clk);void __iomem *reg = priv->base +4 * clk->idx;return readl_relaxed (reg); } -static void jh71x0_clk_reg_rmw (struct jh71x0_clk *clk,u32 mask,u32 value) +static void starfive_clk_reg_rmw (struct starfive_clk *clk,u32 mask,u32 value) { -struct jh71x0_clk_priv *priv =jh71x0_priv_from (clk); +struct starfive_clk_priv *priv =starfive_priv_from (clk);void __iomem *reg = priv->base +4 * clk->idx;unsigned long flags;
@@ -42,41 +42,41 @@ static void jh71x0_clk_reg_rmw(struct jh71x0_clk *clk, u32 mask, u32 value)spin_unlock_irqrestore (&priv->rmw_lock, flags); } -static int jh71x0_clk_enable (struct clk_hw *hw) +static int starfive_clk_enable (struct clk_hw *hw) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw); -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_ENABLE ,JH71X0_CLK_ENABLE ); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_ENABLE ,STARFIVE_CLK_ENABLE );return 0 ; } -static void jh71x0_clk_disable (struct clk_hw *hw) +static void starfive_clk_disable (struct clk_hw *hw) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw); -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_ENABLE ,0 ); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_ENABLE ,0 ); } -static int jh71x0_clk_is_enabled (struct clk_hw *hw) +static int starfive_clk_is_enabled (struct clk_hw *hw) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw); -return !!(jh71x0_clk_reg_get (clk) &JH71X0_CLK_ENABLE ); +return !!(starfive_clk_reg_get (clk) &STARFIVE_CLK_ENABLE ); } -static unsigned long jh71x0_clk_recalc_rate (struct clk_hw *hw, -unsigned long parent_rate) +static unsigned long starfive_clk_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -u32 div =jh71x0_clk_reg_get (clk) &JH71X0_CLK_DIV_MASK ; +struct starfive_clk *clk =starfive_clk_from (hw); +u32 div =starfive_clk_reg_get (clk) &STARFIVE_CLK_DIV_MASK ;return div ? parent_rate / div :0 ; } -static int jh71x0_clk_determine_rate (struct clk_hw *hw, -struct clk_rate_request *req) +static int starfive_clk_determine_rate (struct clk_hw *hw, +struct clk_rate_request *req) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw);unsigned long parent = req->best_parent_rate;unsigned long rate =clamp (req->rate, req->min_rate, req->max_rate); unsigned long div = min_t(unsigned long, DIV_ROUND_UP(parent, rate), clk->max_div);
@@ -102,226 +102,226 @@ static int jh71x0_clk_determine_rate(struct clk_hw *hw,return 0 ; } -static int jh71x0_clk_set_rate (struct clk_hw *hw, -unsigned long rate, -unsigned long parent_rate) +static int starfive_clk_set_rate (struct clk_hw *hw, +unsigned long rate, +unsigned long parent_rate) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw);unsigned long div =clamp (DIV_ROUND_CLOSEST (parent_rate, rate),1UL , (unsigned long )clk->max_div); -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_DIV_MASK , div); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_DIV_MASK , div);return 0 ; } -static unsigned long jh71x0_clk_frac_recalc_rate (struct clk_hw *hw, -unsigned long parent_rate) +static unsigned long starfive_clk_frac_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -u32 reg =jh71x0_clk_reg_get (clk); -unsigned long div100 =100 * (reg &JH71X0_CLK_INT_MASK ) + - ((reg &JH71X0_CLK_FRAC_MASK ) >>JH71X0_CLK_FRAC_SHIFT ); +struct starfive_clk *clk =starfive_clk_from (hw); +u32 reg =starfive_clk_reg_get (clk); +unsigned long div100 =100 * (reg &STARFIVE_CLK_INT_MASK ) + + ((reg &STARFIVE_CLK_FRAC_MASK ) >>STARFIVE_CLK_FRAC_SHIFT ); -return (div100 >=JH71X0_CLK_FRAC_MIN ) ?100 * parent_rate / div100 :0 ; +return (div100 >=STARFIVE_CLK_FRAC_MIN ) ?100 * parent_rate / div100 :0 ; } -static int jh71x0_clk_frac_determine_rate (struct clk_hw *hw, -struct clk_rate_request *req) +static int starfive_clk_frac_determine_rate (struct clk_hw *hw, +struct clk_rate_request *req) {unsigned long parent100 =100 * req->best_parent_rate;unsigned long rate =clamp (req->rate, req->min_rate, req->max_rate);unsigned long div100 =clamp (DIV_ROUND_CLOSEST (parent100, rate), -JH71X0_CLK_FRAC_MIN ,JH71X0_CLK_FRAC_MAX ); +STARFIVE_CLK_FRAC_MIN ,STARFIVE_CLK_FRAC_MAX );unsigned long result = parent100 / div100; -/* clamp the result as in jh71x0_clk_determine_rate() above */ -if (result > req->max_rate && div100 <JH71X0_CLK_FRAC_MAX ) +/* clamp the result as in starfive_clk_determine_rate() above */ +if (result > req->max_rate && div100 <STARFIVE_CLK_FRAC_MAX ) result = parent100 / (div100 +1 ); -if (result < req->min_rate && div100 >JH71X0_CLK_FRAC_MIN ) +if (result < req->min_rate && div100 >STARFIVE_CLK_FRAC_MIN ) result = parent100 / (div100 -1 ); req->rate = result;return 0 ; } -static int jh71x0_clk_frac_set_rate (struct clk_hw *hw, -unsigned long rate, -unsigned long parent_rate) +static int starfive_clk_frac_set_rate (struct clk_hw *hw, +unsigned long rate, +unsigned long parent_rate) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw);unsigned long div100 =clamp (DIV_ROUND_CLOSEST (100 * parent_rate, rate), -JH71X0_CLK_FRAC_MIN ,JH71X0_CLK_FRAC_MAX ); -u32 value = ((div100 %100 ) <<JH71X0_CLK_FRAC_SHIFT ) | (div100 /100 ); +STARFIVE_CLK_FRAC_MIN ,STARFIVE_CLK_FRAC_MAX ); +u32 value = ((div100 %100 ) <<STARFIVE_CLK_FRAC_SHIFT ) | (div100 /100 ); -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_DIV_MASK , value); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_DIV_MASK , value);return 0 ; } -static u8 jh71x0_clk_get_parent (struct clk_hw *hw) +static u8 starfive_clk_get_parent (struct clk_hw *hw) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -u32 value =jh71x0_clk_reg_get (clk); +struct starfive_clk *clk =starfive_clk_from (hw); +u32 value =starfive_clk_reg_get (clk); -return (value &JH71X0_CLK_MUX_MASK ) >>JH71X0_CLK_MUX_SHIFT ; +return (value &STARFIVE_CLK_MUX_MASK ) >>STARFIVE_CLK_MUX_SHIFT ; } -static int jh71x0_clk_set_parent (struct clk_hw *hw,u8 index) +static int starfive_clk_set_parent (struct clk_hw *hw,u8 index) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -u32 value = (u32 )index <<JH71X0_CLK_MUX_SHIFT ; +struct starfive_clk *clk =starfive_clk_from (hw); +u32 value = (u32 )index <<STARFIVE_CLK_MUX_SHIFT ; -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_MUX_MASK , value); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_MUX_MASK , value);return 0 ; } -static int jh71x0_clk_get_phase (struct clk_hw *hw) +static int starfive_clk_get_phase (struct clk_hw *hw) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -u32 value =jh71x0_clk_reg_get (clk); +struct starfive_clk *clk =starfive_clk_from (hw); +u32 value =starfive_clk_reg_get (clk); -return (value &JH71X0_CLK_INVERT ) ?180 :0 ; +return (value &STARFIVE_CLK_INVERT ) ?180 :0 ; } -static int jh71x0_clk_set_phase (struct clk_hw *hw,int degrees) +static int starfive_clk_set_phase (struct clk_hw *hw,int degrees) { -struct jh71x0_clk *clk =jh71x0_clk_from (hw); +struct starfive_clk *clk =starfive_clk_from (hw);u32 value;if (degrees ==0 ) value =0 ;else if (degrees ==180 ) - value =JH71X0_CLK_INVERT ; + value =STARFIVE_CLK_INVERT ;else return -EINVAL ; -jh71x0_clk_reg_rmw (clk,JH71X0_CLK_INVERT , value); +starfive_clk_reg_rmw (clk,STARFIVE_CLK_INVERT , value);return 0 ; }#ifdef CONFIG_DEBUG_FS -static void jh71x0_clk_debug_init (struct clk_hw *hw,struct dentry *dentry) +static void starfive_clk_debug_init (struct clk_hw *hw,struct dentry *dentry) { -static const struct debugfs_reg32 jh71x0_clk_reg = { +static const struct debugfs_reg32 starfive_clk_reg = { .name ="CTRL" , .offset =0 , }; -struct jh71x0_clk *clk =jh71x0_clk_from (hw); -struct jh71x0_clk_priv *priv =jh71x0_priv_from (clk); +struct starfive_clk *clk =starfive_clk_from (hw); +struct starfive_clk_priv *priv =starfive_priv_from (clk);struct debugfs_regset32 *regset; regset =devm_kzalloc (priv->dev,sizeof (*regset),GFP_KERNEL );if (!regset)return ; - regset->regs = &jh71x0_clk_reg; + regset->regs = &starfive_clk_reg; regset->nregs =1 ; regset->base = priv->base +4 * clk->idx;debugfs_create_regset32 ("registers" ,0400 , dentry, regset); }#else -#define jh71x0_clk_debug_init NULL +#define starfive_clk_debug_init NULL#endif -static const struct clk_ops jh71x0_clk_gate_ops = { - .enable = jh71x0_clk_enable, - .disable = jh71x0_clk_disable, - .is_enabled = jh71x0_clk_is_enabled, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_gate_ops = { + .enable = starfive_clk_enable, + .disable = starfive_clk_disable, + .is_enabled = starfive_clk_is_enabled, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_div_ops = { - .recalc_rate = jh71x0_clk_recalc_rate, - .determine_rate = jh71x0_clk_determine_rate, - .set_rate = jh71x0_clk_set_rate, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_div_ops = { + .recalc_rate = starfive_clk_recalc_rate, + .determine_rate = starfive_clk_determine_rate, + .set_rate = starfive_clk_set_rate, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_fdiv_ops = { - .recalc_rate = jh71x0_clk_frac_recalc_rate, - .determine_rate = jh71x0_clk_frac_determine_rate, - .set_rate = jh71x0_clk_frac_set_rate, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_fdiv_ops = { + .recalc_rate = starfive_clk_frac_recalc_rate, + .determine_rate = starfive_clk_frac_determine_rate, + .set_rate = starfive_clk_frac_set_rate, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_gdiv_ops = { - .enable = jh71x0_clk_enable, - .disable = jh71x0_clk_disable, - .is_enabled = jh71x0_clk_is_enabled, - .recalc_rate = jh71x0_clk_recalc_rate, - .determine_rate = jh71x0_clk_determine_rate, - .set_rate = jh71x0_clk_set_rate, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_gdiv_ops = { + .enable = starfive_clk_enable, + .disable = starfive_clk_disable, + .is_enabled = starfive_clk_is_enabled, + .recalc_rate = starfive_clk_recalc_rate, + .determine_rate = starfive_clk_determine_rate, + .set_rate = starfive_clk_set_rate, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_mux_ops = { +static const struct clk_ops starfive_clk_mux_ops = { .determine_rate = __clk_mux_determine_rate, - .set_parent = jh71x0_clk_set_parent, - .get_parent = jh71x0_clk_get_parent, - .debug_init = jh71x0_clk_debug_init, + .set_parent = starfive_clk_set_parent, + .get_parent = starfive_clk_get_parent, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_gmux_ops = { - .enable = jh71x0_clk_enable, - .disable = jh71x0_clk_disable, - .is_enabled = jh71x0_clk_is_enabled, +static const struct clk_ops starfive_clk_gmux_ops = { + .enable = starfive_clk_enable, + .disable = starfive_clk_disable, + .is_enabled = starfive_clk_is_enabled, .determine_rate = __clk_mux_determine_rate, - .set_parent = jh71x0_clk_set_parent, - .get_parent = jh71x0_clk_get_parent, - .debug_init = jh71x0_clk_debug_init, + .set_parent = starfive_clk_set_parent, + .get_parent = starfive_clk_get_parent, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_mdiv_ops = { - .recalc_rate = jh71x0_clk_recalc_rate, - .determine_rate = jh71x0_clk_determine_rate, - .get_parent = jh71x0_clk_get_parent, - .set_parent = jh71x0_clk_set_parent, - .set_rate = jh71x0_clk_set_rate, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_mdiv_ops = { + .recalc_rate = starfive_clk_recalc_rate, + .determine_rate = starfive_clk_determine_rate, + .get_parent = starfive_clk_get_parent, + .set_parent = starfive_clk_set_parent, + .set_rate = starfive_clk_set_rate, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_gmd_ops = { - .enable = jh71x0_clk_enable, - .disable = jh71x0_clk_disable, - .is_enabled = jh71x0_clk_is_enabled, - .recalc_rate = jh71x0_clk_recalc_rate, - .determine_rate = jh71x0_clk_determine_rate, - .get_parent = jh71x0_clk_get_parent, - .set_parent = jh71x0_clk_set_parent, - .set_rate = jh71x0_clk_set_rate, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_gmd_ops = { + .enable = starfive_clk_enable, + .disable = starfive_clk_disable, + .is_enabled = starfive_clk_is_enabled, + .recalc_rate = starfive_clk_recalc_rate, + .determine_rate = starfive_clk_determine_rate, + .get_parent = starfive_clk_get_parent, + .set_parent = starfive_clk_set_parent, + .set_rate = starfive_clk_set_rate, + .debug_init = starfive_clk_debug_init, }; -static const struct clk_ops jh71x0_clk_inv_ops = { - .get_phase = jh71x0_clk_get_phase, - .set_phase = jh71x0_clk_set_phase, - .debug_init = jh71x0_clk_debug_init, +static const struct clk_ops starfive_clk_inv_ops = { + .get_phase = starfive_clk_get_phase, + .set_phase = starfive_clk_set_phase, + .debug_init = starfive_clk_debug_init, }; -const struct clk_ops *starfive_jh71x0_clk_ops (u32 max) +const struct clk_ops *starfive_clk_ops (u32 max) { -if (max &JH71X0_CLK_DIV_MASK ) { -if (max &JH71X0_CLK_MUX_MASK ) { -if (max &JH71X0_CLK_ENABLE ) -return &jh71x0_clk_gmd_ops; -return &jh71x0_clk_mdiv_ops; +if (max &STARFIVE_CLK_DIV_MASK ) { +if (max &STARFIVE_CLK_MUX_MASK ) { +if (max &STARFIVE_CLK_ENABLE ) +return &starfive_clk_gmd_ops; +return &starfive_clk_mdiv_ops; } -if (max &JH71X0_CLK_ENABLE ) -return &jh71x0_clk_gdiv_ops; -if (max ==JH71X0_CLK_FRAC_MAX ) -return &jh71x0_clk_fdiv_ops; -return &jh71x0_clk_div_ops; +if (max &STARFIVE_CLK_ENABLE ) +return &starfive_clk_gdiv_ops; +if (max ==STARFIVE_CLK_FRAC_MAX ) +return &starfive_clk_fdiv_ops; +return &starfive_clk_div_ops; } -if (max &JH71X0_CLK_MUX_MASK ) { -if (max &JH71X0_CLK_ENABLE ) -return &jh71x0_clk_gmux_ops; -return &jh71x0_clk_mux_ops; +if (max &STARFIVE_CLK_MUX_MASK ) { +if (max &STARFIVE_CLK_ENABLE ) +return &starfive_clk_gmux_ops; +return &starfive_clk_mux_ops; } -if (max &JH71X0_CLK_ENABLE ) -return &jh71x0_clk_gate_ops; +if (max &STARFIVE_CLK_ENABLE ) +return &starfive_clk_gate_ops; -return &jh71x0_clk_inv_ops; +return &starfive_clk_inv_ops; } -EXPORT_SYMBOL_GPL (starfive_jh71x0_clk_ops); +EXPORT_SYMBOL_GPL (starfive_clk_ops);
drivers/clk/starfive/clk-starfive-common.h +34 -34
149 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7100-audio.c +64 -61
156 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7100.c +253 -248
532 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110-aon.c +31 -31
98 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110-isp.c +36 -36
111 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110-stg.c +47 -47
133 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110-sys.c +260 -257
592 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110-vout.c +37 -37
116 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh7110.h +1 -1
@@ -10,7 +10,7 @@ struct jh7110_top_sysclk {int top_clks_num; }; -int jh7110_reset_controller_register (struct jh71x0_clk_priv *priv, +int jh7110_reset_controller_register (struct starfive_clk_priv *priv,const char *adev_name,u32 adev_id);
Signature · 1 line
2.34.1
RE: [RFC v3 04/16] clk: starfive: Convert the word "jh71x0" to "starfive"
Quoted 8 lines · JeeHeng Sia
Function names that consist of the 'jh71x0' naming convention are renamed to use the 'starfive' wording.
Signed-off-by Sia Jee Heng <[email protected]>Reviewed-by Ley Foon Tan <[email protected]>Reviewed-by Emil Renner Berthing <[email protected]>
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC v3 5/16 dt-bindings: clock: Add StarFive JH8100 System clock and reset generator
In reply to Sia Jee HengAdd bindings for the System clocks and reset generator (SYSCRG) on JH8100 SoC.
--- .../clock/starfive,jh8100-syscrg.yaml | 77 +++++++++++ .../dt-bindings/clock/starfive,jh8100-crg.h | 122 ++++++++++++++++++ .../dt-bindings/reset/starfive,jh8100-crg.h | 21 +++ 3 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-syscrg.yaml create mode 100644 include/dt-bindings/clock/starfive,jh8100-crg.h create mode 100644 include/dt-bindings/reset/starfive,jh8100-crg.h
Documentation/devicetree/bindings/clock/starfive,jh8100-syscrg.yaml new file +77 -0
@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh8100-syscrg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 System Clock and Reset Generator + +maintainers: + - Sia Jee Heng <[email protected]> + +properties: + compatible: + const: starfive,jh8100-syscrg + + reg: + maxItems: 1 + + clocks: + items: + - description: Main Oscillator (24 MHz) + - description: External MCLK clock + - description: PLL0 + - description: PLL1 + - description: PLL2 + - description: PLL3 + - description: PLL4 + - description: PLL6 + - description: PLL7 + + clock-names: + items: + - const: osc + - const: mclk-ext + - const: pll0 + - const: pll1 + - const: pll2 + - const: pll3 + - const: pll4 + - const: pll6 + - const: pll7 + + '#clock-cells': + const: 1 + description: + See <dt-bindings/clock/starfive,jh8100-crg.h> for valid indices. + + '#reset-cells': + const: 1 + description: + See <dt-bindings/reset/starfive,jh8100-crg.h> for valid indices. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh8100-crg.h> + + clock-controller@126d0000 { + compatible = "starfive,jh8100-syscrg"; + reg = <0x126d0000 0x10000>; + clocks = <&osc>, <&mclk_ext>, <&pll0>, <&pll1>, + <&pll2>, <&pll3>, <&pll4>, <&pll6>, <&pll7>; + clock-names = "osc", "mclk-ext", "pll0", "pll1", + "pll2", "pll3", "pll4", + "pll6", "pll7"; + #clock-cells = <1>; + #reset-cells = <1>; + };
include/dt-bindings/clock/starfive,jh8100-crg.h new file +122 -0
122 lines not on this page · raw message
include/dt-bindings/reset/starfive,jh8100-crg.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ +/* +* Copyright (c) 2022-2023 StarFive Technology Co., Ltd. +*/ + +#ifndef __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ +#define __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ + +/* +* SYSCRG resets: assert0 +*/ +#define JH8100_SYSRST_SYS_SYSCON 0 +#define JH8100_SYSRST_CLK_MOD 1 +#define JH8100_SYSRST_GPU 2 +#define JH8100_SYSRST_GPU_SPU 3 +#define JH8100_SYSRST_GPU_TVSENSOR 4 +#define JH8100_SYSRST_PPU_OP_NORET_GPU_RESET 5 +#define JH8100_SYSRST_NNE 6 +#define JH8100_SYSRST_HD_AUDIO 7 + +#endif /* __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ */
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC v3 6/16 clk: starfive: Add JH8100 System clock generator driver
In reply to Sia Jee HengAdd support for JH8100 System clock generator (SYSCRG).
--- MAINTAINERS | 8 + drivers/clk/starfive/Kconfig | 10 + drivers/clk/starfive/Makefile | 2 + .../clk/starfive/clk-starfive-jh8100-sys.c | 415 ++++++++++++++++++ drivers/clk/starfive/clk-starfive-jh8100.h | 11 + 5 files changed, 446 insertions(+) create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-sys.c create mode 100644 drivers/clk/starfive/clk-starfive-jh8100.h
MAINTAINERS +8 -0
@@ -20730,6 +20730,14 @@ F: Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml F: drivers/phy/starfive/phy-jh7110-pcie.c F: drivers/phy/starfive/phy-jh7110-usb.c +STARFIVE JH8100 CLOCK DRIVERS +M: Sia Jee Heng <[email protected]> +M: Ley Foon Tan <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/clock/starfive,jh81*.yaml +F: drivers/clk/starfive/clk-starfive-jh81* +F: include/dt-bindings/clock/starfive?jh81*.h + STATIC BRANCH/CALL M: Peter Zijlstra <[email protected]> M: Josh Poimboeuf <[email protected]>
drivers/clk/starfive/Kconfig +10 -0
@@ -72,3 +72,13 @@ config CLK_STARFIVE_JH7110_VOUT help Say yes here to support the Video-Output clock controller on the StarFive JH7110 SoC. + +config CLK_STARFIVE_JH8100_SYS + bool "StarFive JH8100 System clock support" + depends on SOC_STARFIVE || COMPILE_TEST + select AUXILIARY_BUS + select CLK_STARFIVE_COMMON + default ARCH_STARFIVE + help + Say yes here to support the System clock controller on the StarFive JH8100 SoC. +
drivers/clk/starfive/Makefile +2 -0
@@ -10,3 +10,5 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_AON) += clk-starfive-jh7110-aon.o obj-$(CONFIG_CLK_STARFIVE_JH7110_STG) += clk-starfive-jh7110-stg.o obj-$(CONFIG_CLK_STARFIVE_JH7110_ISP) += clk-starfive-jh7110-isp.o obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) += clk-starfive-jh7110-vout.o + +obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += clk-starfive-jh8100-sys.o
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +415 -0
415 lines not on this page · raw message
drivers/clk/starfive/clk-starfive-jh8100.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __CLK_STARFIVE_JH8100_H +#define __CLK_STARFIVE_JH8100_H + +#include "clk-starfive-common.h" + +int jh8100_reset_controller_register (struct starfive_clk_priv *priv, +const char *adev_name, +u32 adev_id); + +#endif
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Stephen Boyd
maintainerRe: [RFC v3 06/16] clk: starfive: Add JH8100 System clock generator driver
Quoting Sia Jee Heng (2024-01-10 05:31:18)
Quoted 7 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +1
-0@@ -0,0 +1,415 @@ +// SPDX-License-Identifier: GPL-2.0
drivers/clk/starfive/clk-starfive-jh8100-sys.c line 11
Quoted 10 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +10
-0+/* +* StarFive JH8100 System Clock Driver +* +* Copyright (C) 2023 StarFive Technology Co., Ltd. +* +* Author: Jee Heng Sia <[email protected]> +* +*/ + +#include <linux/clk.h>
Drop this unused include.
drivers/clk/starfive/clk-starfive-jh8100-sys.c line 15
Quoted 4 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +4
-0+#include <linux/auxiliary_bus.h> +#include <linux/clk-provider.h> +#include <linux/init.h> +#include <linux/io.h>
Is this include used in this file?
Quoted 11 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +11
-0+#include <linux/platform_device.h> +#include <linux/slab.h> + +#include <soc/starfive/reset-starfive-common.h> + +#include <dt-bindings/clock/starfive,jh8100-crg.h> + +#include "clk-starfive-jh8100.h" + +#define JH8100_SYSCLK_NUM_CLKS (JH8100_SYSCLK_NNE_ICG_EN + 1) +
[...]
drivers/clk/starfive/clk-starfive-jh8100-sys.c line 295
Quoted 10 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +10
-0+ +static void jh8100_reset_adev_release (struct device *dev) +{ +struct auxiliary_device *adev =to_auxiliary_dev (dev); +struct starfive_reset_adev *rdev =to_starfive_reset_adev (adev); + +kfree (rdev); +} + +int jh8100_reset_controller_register(struct starfive_clk_priv *priv,
Just pass 'dev' and 'base' instead.
Quoted 23 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +23
-0+ const char *adev_name, + u32 adev_id) +{ +struct starfive_reset_adev *rdev; +struct auxiliary_device *adev; +int ret; + + rdev =kzalloc (sizeof (*rdev),GFP_KERNEL ); +if (!rdev) +return -ENOMEM ; + + rdev->base = priv->base; + + adev = &rdev->adev; + adev->name = adev_name; + adev->dev.parent = priv->dev; + adev->dev.release = jh8100_reset_adev_release; + adev->id = adev_id; + + ret =auxiliary_device_init (adev); +if (ret) +return ret; +
drivers/clk/starfive/clk-starfive-jh8100-sys.c line 328
Quoted 10 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +10
-0+ ret =auxiliary_device_add (adev); +if (ret) { +auxiliary_device_uninit (adev); +return ret; + } + +return devm_add_action_or_reset (priv->dev, + jh8100_reset_unregister_adev, adev); +} +EXPORT_SYMBOL_GPL (jh8100_reset_controller_register);
Move this to drivers/reset/ please.
Quoted 18 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +18
-0+ +static int __init jh8100_syscrg_probe (struct platform_device *pdev) +{ +struct starfive_clk_priv *priv; +unsigned int idx; +int ret; + + priv =devm_kzalloc (&pdev->dev, +struct_size (priv, reg,JH8100_SYSCLK_NUM_CLKS ), +GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +spin_lock_init (&priv->rmw_lock); + priv->dev = &pdev->dev; + priv->base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (priv->base)) +return PTR_ERR (priv->base);
[...]
Quoted 27 lines
drivers/clk/starfive/clk-starfive-jh8100-sys.c new file +21
-0+ + ret =devm_of_clk_add_hw_provider (&pdev->dev, jh8100_sysclk_get, priv); +if (ret) +return ret; + +return jh8100_reset_controller_register (priv,"rst-sys" ,0 ); +} + +static const struct of_device_id jh8100_syscrg_match[] = { + { .compatible ="starfive,jh8100-syscrg" }, + {/* sentinel */ } +}; + +static struct platform_driver jh8100_syscrg_driver = { + .driver = { + .name ="clk-starfive-jh8100-sys" , + .of_match_table = jh8100_syscrg_match, + .suppress_bind_attrs = true, + }, +}; +builtin_platform_driver_probe (jh8100_syscrg_driver, jh8100_syscrg_probe);drivers/clk/starfive/clk-starfive-jh8100.h new file +0
-0
drivers/clk/starfive/clk-starfive-jh8100.h line 5
Quoted 5 lines
drivers/clk/starfive/clk-starfive-jh8100.h new file +5
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __CLK_STARFIVE_JH8100_H +#define __CLK_STARFIVE_JH8100_H + +#include "clk-starfive-common.h"
Drop this include.
drivers/clk/starfive/clk-starfive-jh8100.h line 7
Quoted 2 lines
drivers/clk/starfive/clk-starfive-jh8100.h new file +2
-0+ +int jh8100_reset_controller_register(struct starfive_clk_priv *priv,
Forward declare starfive_clk_priv instead.
drivers/clk/starfive/clk-starfive-jh8100.h line 9
Quoted 2 lines
drivers/clk/starfive/clk-starfive-jh8100.h new file +2
-0+const char *adev_name, + u32 adev_id);
Why is this header here at all?
RFC v3 7/16 dt-bindings: clock: Add StarFive JH8100 North-West clock and reset generator
In reply to Sia Jee HengAdd bindings for the North-West clock and reset generator (NWCRG) on JH8100 SoC.
--- .../bindings/clock/starfive,jh8100-nwcrg.yaml | 119 ++++++++++++++++++ .../dt-bindings/clock/starfive,jh8100-crg.h | 43 +++++++ .../dt-bindings/reset/starfive,jh8100-crg.h | 14 +++ 3 files changed, 176 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-nwcrg.yaml
Documentation/devicetree/bindings/clock/starfive,jh8100-nwcrg.yaml new file +119 -0
@@ -0,0 +1,119 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh8100-nwcrg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 North-West Clock and Reset Generator + +maintainers: + - Sia Jee Heng <[email protected]> + +properties: + compatible: + const: starfive,jh8100-nwcrg + + reg: + maxItems: 1 + + clocks: + items: + - description: Main Oscillator (24 MHz) + - description: APB_BUS clock from SYSCRG + - description: APB_BUS_PER4 clock from SYSCRG + - description: SPI_CORE_100 clock from SYSCRG + - description: ISP_2X clock from SYSCRG + - description: ISP_AXI clock from SYSCRG + - description: VOUT_ROOT0 clock from SYSCRG + - description: VOUT_ROOT1 clock from SYSCRG + - description: VOUT_SCAN_ATS clock from SYSCRG + - description: VOUT_DC_CORE clock from SYSCRG + - description: VOUT_AXI clock from SYSCRG + - description: AXI_400 clock from SYSCRG + - description: AHB0 clock from SYSCRG + - description: PERH_ROOT_PREOSC from SYSCRG + - description: External DVP clock + - description: External ISP DPHY TAP TCK clock + - description: External golbal clock + - description: External VOUT MIPI DPHY TAP TCK + - description: External VOUT eDP TAP TCK + - description: External SPI In2 clock + - description: PLL5 + + clock-names: + items: + - const: osc + - const: apb_bus + - const: apb_bus_per4 + - const: spi_core_100 + - const: isp_2x + - const: isp_axi + - const: vout_root0 + - const: vout_root1 + - const: vout_scan_ats + - const: vout_dc_core + - const: vout_axi + - const: axi_400 + - const: ahb0 + - const: perh_root_preosc + - const: dvp-ext + - const: isp-dphy-tap-tck-ext + - const: glb-ext-clk + - const: vout-mipi-dphy-tap-tck-ext + - const: vout-edp-tap-tck-ext + - const: spi-in2-ext + - const: pll5 + + '#clock-cells': + const: 1 + description: + See <dt-bindings/clock/starfive,jh8100-crg.h> for valid indices. + + '#reset-cells': + const: 1 + description: + See <dt-bindings/reset/starfive,jh8100-crg.h> for valid indices. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh8100-crg.h> + + clock-controller@123c0000 { + compatible = "starfive,jh8100-nwcrg"; + reg = <0x123c0000 0x10000>; + clocks = <&osc>, <&syscrg JH8100_SYSCLK_APB_BUS>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER4>, + <&syscrh JH8100_SYSCLK_SPI_CORE_100>, + <&syscrg JH8100_SYSCLK_ISP_2X>, + <&syscrg JH8100_SYSCLK_ISP_AXI>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT0>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT1>, + <&syscrg JH8100_SYSCLK_VOUT_SCAN_ATS>, + <&syscrg JH8100_SYSCLK_VOUT_DC_CORE>, + <&syscrg JH8100_SYSCLK_VOUT_AXI>, + <&syscrg JH8100_SYSCLK_AXI_400>, + <&syscrg JH8100_SYSCLK_AHB0>, + <&syscrg JH8100_SYSCLK_PERH_ROOT_PREOSC>, + <&dvp_ext>, <&isp_dphy_tap_tck_ext>, + <&glb_ext_clk>, <&vout_mipi_dphy_tap_tck_ext>, + <&vout_edp_tap_tck_ext>, <&spi_in2_ext>, <&pll5>; + clock-names = "osc", "apb_bus", "apb_bus_per4", "spi_core_100", + "isp_2x", "isp_axi", "vout_root0", "vout_root1", + "vout_scan_ats", "vout_dc_core", "vout_axi", + "axi_400", "ahb0", "perh_root_preosc", "dvp-ext", + "isp-dphy-tap-tck-ext", "glb-ext-clk", + "vout-mipi-dphy-tap-tck-ext", "vout-edp-tap-tck-ext", + "spi-in2-ext", "pll5"; + #clock-cells = <1>; + #reset-cells = <1>; + };
include/dt-bindings/clock/starfive,jh8100-crg.h +43 -0
47 lines not on this page · raw message
include/dt-bindings/reset/starfive,jh8100-crg.h +14 -0
@@ -18,4 +18,18 @@#define JH8100_SYSRST_NNE 6#define JH8100_SYSRST_HD_AUDIO 7 +/* +* NWCRG resets: assert0 +*/ +#define JH8100_NWRST_PRESETN 0 +#define JH8100_NWRST_SYS_IOMUX_W 1 +#define JH8100_NWRST_I2C6 2 +#define JH8100_NWRST_I2C7 3 +#define JH8100_NWRST_SPI2 4 +#define JH8100_NWRST_SMBUS1 5 +#define JH8100_NWRST_UART5 6 +#define JH8100_NWRST_UART6 7 +#define JH8100_NWRST_MERAK0_TVSENSOR 8 +#define JH8100_NWRST_MERAK1_TVSENSOR 9 +#endif /* __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ */
Signature · 1 line
2.34.1
RFC v3 8/16 clk: starfive: Add JH8100 North-West clock generator driver
In reply to Sia Jee HengAdd support for JH8100 North-West (NWCRG) clock generator.
--- drivers/clk/starfive/Makefile | 1 + drivers/clk/starfive/clk-starfive-jh8100-nw.c | 237 ++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-nw.c
drivers/clk/starfive/Makefile +1 -0
@@ -12,3 +12,4 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_ISP) += clk-starfive-jh7110-isp.o obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) += clk-starfive-jh7110-vout.o obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += clk-starfive-jh8100-sys.o +obj-$(CONFIG_CLK_STARFIVE_JH8100_NW) += clk-starfive-jh8100-nw.o
drivers/clk/starfive/clk-starfive-jh8100-nw.c new file +237 -0
237 lines not on this page · raw message
Signature · 1 line
2.34.1
Stephen Boyd
maintainerRe: [RFC v3 08/16] clk: starfive: Add JH8100 North-West clock generator driver
Quoting Sia Jee Heng (2024-01-10 05:31:20)
Quoted 11 lines
drivers/clk/starfive/clk-starfive-jh8100-nw.c new file +5
-0@@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* StarFive JH8100 North-West Clock Driver +* +* Copyright (C) 2023 StarFive Technology Co., Ltd.
[...]
Quoted 30 lines
drivers/clk/starfive/clk-starfive-jh8100-nw.c new file +30
-0+ +static int jh8100_nwcrg_probe (struct platform_device *pdev) +{ +struct starfive_clk_priv *priv; +unsigned int idx; +int ret; + + priv =devm_kzalloc (&pdev->dev, +struct_size (priv, reg,JH8100_NWCLK_NUM_CLKS ), +GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +spin_lock_init (&priv->rmw_lock); + priv->dev = &pdev->dev; + priv->base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (priv->base)) +return PTR_ERR (priv->base); + +for (idx =0 ; idx <JH8100_NWCLK_NUM_CLKS ; idx++) { +u32 max = jh8100_nwcrg_clk_data[idx].max; +struct clk_parent_data parents[4 ] = {}; +struct clk_init_data init = { + .name = jh8100_nwcrg_clk_data[idx].name, + .ops =starfive_clk_ops (max), + .parent_data = parents, + .num_parents = + ((max &STARFIVE_CLK_MUX_MASK ) >>STARFIVE_CLK_MUX_SHIFT ) +1 , + .flags = jh8100_nwcrg_clk_data[idx].flags, + };
drivers/clk/starfive/clk-starfive-jh8100-nw.c line 166
Quoted 10 lines
drivers/clk/starfive/clk-starfive-jh8100-nw.c new file +10
-0+struct starfive_clk *clk = &priv->reg[idx]; +unsigned int i; + +for (i =0 ; i < init.num_parents; i++) { +unsigned int pidx = jh8100_nwcrg_clk_data[idx].parents[i]; + +if (pidx <JH8100_NWCLK_NUM_CLKS ) + parents[i].hw = &priv->reg[pidx].hw; +else if (pidx ==JH8100_NWCLK_OSC ) + parents[i].fw_name ="osc" ;
Please generate this one time with structures and use an index instead of string names. This is faster in multiple ways, and the parent data is copied anyway.
Quoted 4 lines
drivers/clk/starfive/clk-starfive-jh8100-nw.c new file +4
-0+else if (pidx ==JH8100_NWCLK_APB_BUS ) + parents[i].fw_name ="apb_bus" ; +else if (pidx ==JH8100_NWCLK_APB_BUS_PER4 ) + parents[i].fw_name ="apb_bus_per4" ;
RFC v3 9/16 dt-bindings: clock: Add StarFive JH8100 North-East clock and reset generator
In reply to Sia Jee HengAdd bindings for the North-East clock and reset generator (NECRG) on JH8100 SoC.
--- .../bindings/clock/starfive,jh8100-necrg.yaml | 153 +++++++++++++++ .../dt-bindings/clock/starfive,jh8100-crg.h | 177 ++++++++++++++++++ .../dt-bindings/reset/starfive,jh8100-crg.h | 59 ++++++ 3 files changed, 389 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-necrg.yaml
Documentation/devicetree/bindings/clock/starfive,jh8100-necrg.yaml new file +153 -0
@@ -0,0 +1,153 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh8100-necrg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 North-East Clock and Reset Generator + +maintainers: + - Sia Jee Heng <[email protected]> + +properties: + compatible: + const: starfive,jh8100-necrg + + reg: + maxItems: 1 + + clocks: + items: + - description: Main Oscillator (24 MHz) + - description: AXI_400 clock from SYSCRG + - description: VOUT_ROOT0 clock from SYSCRG + - description: VOUT_ROOT1 clock from SYSCRG + - description: USB_WRAP_480 clock from SYSCRG + - description: USB_WRAP_625 clock from SYSCRG + - description: USB_WRAP_240 clock from SYSCRG + - description: USB_WRAP_60 clock from SYSCRG + - description: USB_WRAP_156P25 clock from SYSCRG + - description: USB_WRAP_312P5 clock from SYSCRG + - description: USB_125M clock from SYSCRG + - description: GPIO_100 clock from NWCRG + - description: PERH_ROOT clock from SYSCRG + - description: Master clock from SYSCRG + - description: PERH_ROOT_PREOSC clock from SYSCRG + - description: AHB0 clock from SYSCRG + - description: APB_BUS_PER1 clock from SYSCRG + - description: APB_BUS PER2 clock from SYSCRG + - description: APB_BUS_PER3 clock from SYSCRG + - description: APB_BUS_PER5 clock from SYSCRG + - description: VENC_ROOT clock from SYSCRG + - description: SPI_CORE_100 clock from SYSCRG + - description: External global clock + - description: External USB3_TAP_TCK clock + - description: External USB1_TAP_TCK clock + - description: External USB2_TAP_TCK clock + - description: External TYPEC_TAP_TCK clock + - description: External SPI_IN0 clock + - description: External SPI_IN1 clock + - description: External I2STX_BCLK clock + - description: External I2STX_LRCK clock + + clock-names: + items: + - const: osc + - const: axi_400 + - const: vout_root0 + - const: vout_root1 + - const: usb_wrap_480 + - const: usb_wrap_625 + - const: usb_wrap_240 + - const: usb_wrap_60 + - const: usb_wrap_156p25 + - const: usb_wrap_312p5 + - const: usb_125m + - const: gpio_100 + - const: perh_root + - const: mclk + - const: perh_root_preosc + - const: ahb0 + - const: apb_bus_per1 + - const: apb_bus_per2 + - const: apb_bus_per3 + - const: apb_bus_per5 + - const: venc_root + - const: spi_core_100 + - const: glb-ext-clk + - const: usb3-tap-tck-ext + - const: usb1-tap-tck-ext + - const: usb2-tap-tck-ext + - const: typec-tap-tck-ext + - const: spi-in0-ext + - const: spi-in1-ext + - const: i2stx-bclk-ext + - const: i2stx-lrck-ext + + '#clock-cells': + const: 1 + description: + See <dt-bindings/clock/starfive,jh8100-crg.h> for valid indices. + + '#reset-cells': + const: 1 + description: + See <dt-bindings/reset/starfive,jh8100-crg.h> for valid indices. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh8100-crg.h> + + clock-controller@12320000 { + compatible = "starfive,jh8100-necrg"; + reg = <0x12320000 0x10000>; + clocks = <&osc>, <&syscrg JH8100_SYSCLK_AXI_400>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT0>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT1>, + <&syscrg JH8100_SYSCLK_USB_WRAP_480>, + <&syscrg JH8100_SYSCLK_USB_WRAP_625>, + <&syscrg JH8100_SYSCLK_USB_WRAP_240>, + <&syscrg JH8100_SYSCLK_USB_WRAP_60>, + <&syscrg JH8100_SYSCLK_USB_WRAP_156P25>, + <&syscrg JH8100_SYSCLK_USB_WRAP_312P5>, + <&syscrg JH8100_SYSCLK_USB_125M>, + <&nwcrg JH8100_NWCLK_GPIO_100>, + <&syscrg JH8100_SYSCLK_PERH_ROOT>, + <&syscrg JH8100_SYSCLK_MCLK>, + <&syscrg JH8100_SYSCLK_PERH_ROOT_PREOSC>, + <&syscrg JH8100_SYSCLK_AHB0>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER1>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER2>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER3>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER5>, + <&syscrg JH8100_SYSCLK_VENC_ROOT>, + <&syscrg JH8100_SYSCLK_SPI_CORE_100>, + <&glb_ext_clk>, <&usb3_tap_tck_ext>, + <&usb1_tap_tck_ext>, <&usb2_tap_tck_ext>, + <&typec_tap_tck_ext>, <&spi_in0_ext>, + <&spi_in1_ext>, <&i2stx_bclk_ext>, + <&i2stx_lrck_ext>; + clock-names = "osc", "axi_400", "vout_root0", "vout_root1", + "usb_wrap_480", "usb_wrap_625", "usb_wrap_240", + "usb_wrap_60", "usb_wrap_156p25", "usb_wrap_312p5", + "usb_125m", "gpio_100", "perh_root", "mclk", + "perh_root_preosc", "ahb0", "apb_bus_per1", + "apb_bus_per2", "apb_bus_per3", "apb_bus_per5", + "venc_root", "spi_core_100", "glb-ext-clk", + "usb3-tap-tck-ext", "usb1-tap-tck-ext", + "usb2-tap-tck-ext", "typec-tap-tck-ext", + "spi-in0-ext", "spi-in1-ext", "i2stx-bclk-ext", + "i2stx-lrck-ext"; + #clock-cells = <1>; + #reset-cells = <1>; + };
include/dt-bindings/clock/starfive,jh8100-crg.h +177 -0
181 lines not on this page · raw message
include/dt-bindings/reset/starfive,jh8100-crg.h +59 -0
63 lines not on this page · raw message
Signature · 1 line
2.34.1
RFC v3 10/16 clk: starfive: Add JH8100 North-East clock generator driver
In reply to Sia Jee HengAdd support for JH8100 North-East (NECRG) clock generator.
--- drivers/clk/starfive/Makefile | 1 + drivers/clk/starfive/clk-starfive-common.h | 7 + drivers/clk/starfive/clk-starfive-jh8100-ne.c | 499 ++++++++++++++++++ 4 files changed, 513 insertions(+) create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-ne.c
drivers/clk/starfive/Makefile +1 -0
@@ -13,3 +13,4 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) += clk-starfive-jh7110-vout.o obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += clk-starfive-jh8100-sys.o obj-$(CONFIG_CLK_STARFIVE_JH8100_NW) += clk-starfive-jh8100-nw.o +obj-$(CONFIG_CLK_STARFIVE_JH8100_NE) += clk-starfive-jh8100-ne.o
drivers/clk/starfive/clk-starfive-common.h +7 -0
@@ -103,6 +103,13 @@ struct starfive_clk_data { .parents = { [0] = _parent }, \ } +#define STARFIVE_GINV (_idx, _name, _flags, _parent)[_idx] = { \ + .name = _name, \ + .flags = _flags, \ + .max = STARFIVE_CLK_ENABLE | STARFIVE_CLK_INVERT, \ + .parents = { [0] = _parent }, \ +} +struct starfive_clk {struct clk_hw hw;unsigned int idx;
drivers/clk/starfive/clk-starfive-jh8100-ne.c new file +499 -0
499 lines not on this page · raw message
Signature · 1 line
2.34.1
RFC v3 11/16 dt-bindings: clock: Add StarFive JH8100 South-West clock and reset generator
In reply to Sia Jee HengAdd bindings for the South-West clock and reset generator (SWCRG) on JH8100 SoC.
--- .../bindings/clock/starfive,jh8100-swcrg.yaml | 64 +++++++++++++++++++ .../dt-bindings/clock/starfive,jh8100-crg.h | 12 ++++ .../dt-bindings/reset/starfive,jh8100-crg.h | 8 +++ 3 files changed, 84 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-swcrg.yaml
Documentation/devicetree/bindings/clock/starfive,jh8100-swcrg.yaml new file +64 -0
@@ -0,0 +1,64 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh8100-swcrg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 South-West Clock And Reset Generator + +maintainers: + - Sia Jee Heng <[email protected]> + +properties: + compatible: + const: starfive,jh8100-swcrg + + reg: + maxItems: 1 + + clocks: + items: + - description: APB_BUS clock from SYSCRG + - description: VDEC_ROOT clock from SYSCRG + - description: FLEXNOC1 clock from SYSCRG + + clock-names: + items: + - const: apb_bus + - const: vdec_root + - const: flexnoc1 + + '#clock-cells': + const: 1 + description: + See <dt-bindings/clock/starfive,jh8100-crg.h> for valid indices. + + '#reset-cells': + const: 1 + description: + See <dt-bindings/reset/starfive,jh8100-crg.h> for valid indices. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh8100-crg.h> + + clock-controller@12720000 { + compatible = "starfive,jh8100-swcrg"; + reg = <0x12720000 0x10000>; + clocks = <&syscrg JH8100_SYSCLK_APB_BUS>, + <&syscrg JH8100_SYSCLK_VDEC_ROOT>, + <&syscrg JH8100_SYSCLK_FLEXNOC1>; + clock-names = "apb_bus", "vdec_root", "flexnoc1"; + #clock-cells = <1>; + #reset-cells = <1>; + };
include/dt-bindings/clock/starfive,jh8100-crg.h +12 -0
@@ -339,4 +339,16 @@#define JH8100_NECLK_CAN1_ICG_EN 173#define JH8100_NECLK_SMBUS0_ICG_EN 174 +/* SWCRG clocks */ +#define JH8100_SWCLK_JPEG_AXI 0 +#define JH8100_SWCLK_VC9000DJ_AXI 1 +#define JH8100_SWCLK_VC9000DJ_VDEC 2 +#define JH8100_SWCLK_VC9000DJ_APB 3 +#define JH8100_SWCLK_VDEC_AXI 4 +#define JH8100_SWCLK_VC9000D_AXI 5 +#define JH8100_SWCLK_VC9000D_VDEC 6 +#define JH8100_SWCLK_VC9000D_APB 7 +#define JH8100_SWCLK_JPEG_ICG_EN 8 +#define JH8100_SWCLK_VDEC_ICG_EN 9 +#endif /* __DT_BINDINGS_CLOCK_STARFIVE_JH8100_H__ */
include/dt-bindings/reset/starfive,jh8100-crg.h +8 -0
@@ -91,4 +91,12 @@#define JH8100_NERST_SYS_IOMUX_E 48#define JH8100_NERST_DUBHE_TVSENSOR 49 +/* +* SWCRG resets: assert0 +*/ +#define JH8100_SWRST_PRESETN 0 +#define JH8100_SWRST_VC9000DJ 1 +#define JH8100_SWRST_VC9000D 2 +#define JH8100_SWRST_DDR_TVSENSOR 3 +#endif /* __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ */
Signature · 1 line
2.34.1
RFC v3 12/16 clk: starfive: Add JH8100 South-West clock generator driver
In reply to Sia Jee HengAdd support for JH8100 South-West (SWCRG) clock generator.
--- drivers/clk/starfive/Kconfig | 7 + drivers/clk/starfive/Makefile | 1 + drivers/clk/starfive/clk-starfive-jh8100-sw.c | 134 ++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-sw.c
drivers/clk/starfive/Kconfig +7 -0
@@ -95,3 +95,10 @@ config CLK_STARFIVE_JH8100_NE default ARCH_STARFIVE help Say yes here to support the North-East clock controller on the StarFive JH8100 SoC. + +config CLK_STARFIVE_JH8100_SW + bool "StarFive JH8100 South-West clock support" + depends on CLK_STARFIVE_JH8100_SYS + default ARCH_STARFIVE + help + Say yes here to support the South-West clock controller on the StarFive JH8100 SoC.
drivers/clk/starfive/Makefile +1 -0
@@ -14,3 +14,4 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) += clk-starfive-jh7110-vout.o obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += clk-starfive-jh8100-sys.o obj-$(CONFIG_CLK_STARFIVE_JH8100_NW) += clk-starfive-jh8100-nw.o obj-$(CONFIG_CLK_STARFIVE_JH8100_NE) += clk-starfive-jh8100-ne.o +obj-$(CONFIG_CLK_STARFIVE_JH8100_SW) += clk-starfive-jh8100-sw.o
drivers/clk/starfive/clk-starfive-jh8100-sw.c new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
2.34.1
RFC v3 13/16 dt-bindings: clock: Add StarFive JH8100 Always-On clock and reset generator
In reply to Sia Jee HengAdd bindings for the Always-On clock and reset generator (AONCRG) on JH8100 SoC.
--- .../clock/starfive,jh8100-aoncrg.yaml | 74 +++++++++++++++++++ .../dt-bindings/clock/starfive,jh8100-crg.h | 67 +++++++++++++++++ .../dt-bindings/reset/starfive,jh8100-crg.h | 16 ++++ 3 files changed, 157 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh8100-aoncrg.yaml
Documentation/devicetree/bindings/clock/starfive,jh8100-aoncrg.yaml new file +74 -0
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh8100-aoncrg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH8100 Always-On Clock and Reset Generator + +maintainers: + - Sia Jee Heng <[email protected]> + +properties: + compatible: + const: starfive,jh8100-aoncrg + + reg: + maxItems: 1 + + clocks: + items: + - description: Main Oscillator (24 MHz) + - description: GMAC0 RMII func + - description: GMAC0 RGMII func + - description: AON 125MHz clock + - description: AON 2000MHz clock + - description: AON 200MHz clock + - description: AON 667MHz clock + - description: RTC clock + + clock-names: + items: + - const: osc + - const: gmac0-rmii-func + - const: gmac0-rgmii-func + - const: aon125 + - const: aon2000 + - const: aon200 + - const: aon667 + - const: rtc + + '#clock-cells': + const: 1 + description: + See <dt-bindings/clock/starfive,jh8100-crg.h> for valid indices. + + '#reset-cells': + const: 1 + description: + See <dt-bindings/reset/starfive,jh8100-crg.h> for valid indices. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh8100-crg.h> + + clock-controller@1f310000 { + compatible = "starfive,jh8100-aoncrg"; + reg = <0x1f310000 0x10000>; + clocks = <&osc>, <&gmac0_rmii_func>, <&gmac0_rgmii_func>, <&aon125>, + <&aon2000>, <&aon200>, <&aon667>, <&rtc>; + clock-names = "osc", "gmac0-rmii-func", "gmac0-rgmii-func", "aon125", + "aon2000", "aon200", "aon667", "rtc"; + #clock-cells = <1>; + #reset-cells = <1>; + };
include/dt-bindings/clock/starfive,jh8100-crg.h +67 -0
71 lines not on this page · raw message
include/dt-bindings/reset/starfive,jh8100-crg.h +16 -0
@@ -99,4 +99,20 @@#define JH8100_SWRST_VC9000D 2#define JH8100_SWRST_DDR_TVSENSOR 3 +/* +* AONCRG resets: assert0 +*/ +#define JH8100_AONRST_AON_IOMUX_PRESETN 0 +#define JH8100_AONRST_RTC 1 +#define JH8100_AONRST_GMAC0 2 +#define JH8100_AONRST_XSPI 3 +#define JH8100_AONRST_TVSENSOR 4 +#define JH8100_AONRST_MEU 5 +#define JH8100_AONRST_AXIMEM_128B_ARESET 6 +#define JH8100_AONRST_DFT_APB2BISR_APB 7 +#define JH8100_AONRST_SDIO0 8 +#define JH8100_AONRST_EMMC 9 +#define JH8100_AONRST_TOP 10 +#define JH8100_AONRST_IRQ_CTRL 11 +#endif /* __DT_BINDINGS_RESET_STARFIVE_JH8100_H__ */
Signature · 1 line
2.34.1
RFC v3 14/16 clk: starfive: Add JH8100 Always-On clock generator driver
In reply to Sia Jee HengAdd support for JH8100 Always-On (AONCRG) clock generator.
--- drivers/clk/starfive/Kconfig | 7 + drivers/clk/starfive/Makefile | 1 + .../clk/starfive/clk-starfive-jh8100-aon.c | 256 ++++++++++++++++++ 3 files changed, 264 insertions(+) create mode 100644 drivers/clk/starfive/clk-starfive-jh8100-aon.c
drivers/clk/starfive/Kconfig +7 -0
@@ -102,3 +102,10 @@ config CLK_STARFIVE_JH8100_SW default ARCH_STARFIVE help Say yes here to support the South-West clock controller on the StarFive JH8100 SoC. + +config CLK_STARFIVE_JH8100_AON + bool "StarFive JH8100 Always-On clock support" + depends on CLK_STARFIVE_JH8100_SYS + default ARCH_STARFIVE + help + Say yes here to support the Always-On clock controller on the StarFive JH8100 SoC.
drivers/clk/starfive/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += clk-starfive-jh8100-sys.o obj-$(CONFIG_CLK_STARFIVE_JH8100_NW) += clk-starfive-jh8100-nw.o obj-$(CONFIG_CLK_STARFIVE_JH8100_NE) += clk-starfive-jh8100-ne.o obj-$(CONFIG_CLK_STARFIVE_JH8100_SW) += clk-starfive-jh8100-sw.o +obj-$(CONFIG_CLK_STARFIVE_JH8100_AON) += clk-starfive-jh8100-aon.o
drivers/clk/starfive/clk-starfive-jh8100-aon.c new file +256 -0
256 lines not on this page · raw message
Signature · 1 line
2.34.1
RFC v3 15/16 reset: starfive: Add StarFive JH8100 reset driver
In reply to Sia Jee HengAdd auxiliary reset driver to support StarFive JH8100 SoC.
--- MAINTAINERS | 7 ++ drivers/reset/starfive/Kconfig | 8 ++ drivers/reset/starfive/Makefile | 2 + .../reset/starfive/reset-starfive-jh8100.c | 108 ++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 drivers/reset/starfive/reset-starfive-jh8100.c
MAINTAINERS +7 -0
@@ -20738,6 +20738,13 @@ F: Documentation/devicetree/bindings/clock/starfive,jh81*.yaml F: drivers/clk/starfive/clk-starfive-jh81* F: include/dt-bindings/clock/starfive?jh81*.h +STARFIVE JH8100 RESET CONTROLLER DRIVERS +M: Sia Jee Heng <[email protected]> +M: Ley Foon Tan <[email protected]> +S: Maintained +F: drivers/reset/starfive/reset-starfive-jh81* +F: include/dt-bindings/reset/starfive?jh81*.h + STATIC BRANCH/CALL M: Peter Zijlstra <[email protected]> M: Josh Poimboeuf <[email protected]>
drivers/reset/starfive/Kconfig +8 -0
@@ -19,3 +19,11 @@ config RESET_STARFIVE_JH7110 default ARCH_STARFIVE help This enables the reset controller driver for the StarFive JH7110 SoC. + +config RESET_STARFIVE_JH8100 + bool "StarFive JH8100 Reset Driver" + depends on AUXILIARY_BUS && CLK_STARFIVE_JH8100_SYS + select RESET_STARFIVE_COMMON + default ARCH_STARFIVE + help + This enables the reset controller driver for the StarFive JH8100 SoC.
drivers/reset/starfive/Makefile +2 -0
@@ -3,3 +3,5 @@ obj-$(CONFIG_RESET_STARFIVE_COMMON) += reset-starfive-common.o obj-$(CONFIG_RESET_STARFIVE_JH7100) += reset-starfive-jh7100.o obj-$(CONFIG_RESET_STARFIVE_JH7110) += reset-starfive-jh7110.o + +obj-$(CONFIG_RESET_STARFIVE_JH8100) += reset-starfive-jh8100.o
drivers/reset/starfive/reset-starfive-jh8100.c new file +108 -0
108 lines not on this page · raw message
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
RFC v3 16/16 riscv: dts: starfive: jh8100: Add clocks and resets nodes
In reply to Sia Jee HengAdd SYSCRG/SYSCRG-NE/SYSCRG-NW/SYSCRG-SW/AONCRG clock and reset nodes for JH8100 RISC-V SoC.
--- arch/riscv/boot/dts/starfive/jh8100.dtsi | 313 +++++++++++++++++++++++ 1 file changed, 313 insertions(+)
arch/riscv/boot/dts/starfive/jh8100.dtsi +313 -0
@@ -4,6 +4,8 @@ */ /dts-v1/; +#include <dt-bindings/clock/starfive,jh8100-crg.h> +#include <dt-bindings/reset/starfive,jh8100-crg.h> / { compatible = "starfive,jh8100";
@@ -279,6 +281,210 @@ clk_uart: clk-uart { clock-frequency = <24000000>; }; + osc: osc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + }; + + i2srx_bclk_ext: i2srx-bclk-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; + + i2srx_lrck_ext: i2srx-lrck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <192000>; + }; + + mclk_ext: mclk-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <49152000>; + }; + + usb3_tap_tck_ext: usb3-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + glb_ext_clk: glb-ext-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <30000000>; + }; + + usb1_tap_tck_ext: usb1-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + usb2_tap_tck_ext: usb2-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + typec_tap_tck_ext: typec-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + spi_in0_ext: spi-in0-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + spi_in1_ext: spi-in1-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + spi_in2_ext: spi-in2-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + i2stx_bclk_ext: i2stx-bclk-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; + + i2stx_lrck_ext: i2stx-lrck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <192000>; + }; + + dvp_ext: dvp-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <150000000>; + }; + + isp_dphy_tap_tck_ext: isp-dphy-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + vout_mipi_dphy_tap_tck_ext: vout-mipi-dphy-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + vout_edp_tap_tck_ext: vout-edp-tap-tck-ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + rtc: rtc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + gmac0_rmii_func: gmac0-rmii-func { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + gmac0_rgmii_func: gmac0-rgmii-func { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + }; + + aon50: aon50 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + aon125: aon125 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + }; + + aon2000: aon2000 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2000000000>; + }; + + aon200: aon200 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <200000000>; + }; + + aon667: aon667 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <667000000>; + }; + + pll0: pll0 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2000000000>; + }; + + pll1: pll1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1782000000>; + }; + + pll2: pll2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1843200000>; + }; + + pll3: pll3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1866000000>; + }; + + pll4: pll4 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2000000000>; + }; + + pll5: pll5 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1500000000>; + }; + + pll6: pll6 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1782000000>; + }; + + pll7: pll7 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2400000000>; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&plic>;
@@ -357,6 +563,99 @@ uart4: serial@121a0000 { status = "disabled"; }; + necrg: clock-controller@12320000 { + compatible = "starfive,jh8100-necrg"; + reg = <0x0 0x12320000 0x0 0x10000>; + clocks = <&osc>, <&syscrg JH8100_SYSCLK_AXI_400>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT0>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT1>, + <&syscrg JH8100_SYSCLK_USB_WRAP_480>, + <&syscrg JH8100_SYSCLK_USB_WRAP_625>, + <&syscrg JH8100_SYSCLK_USB_WRAP_240>, + <&syscrg JH8100_SYSCLK_USB_WRAP_60>, + <&syscrg JH8100_SYSCLK_USB_WRAP_156P25>, + <&syscrg JH8100_SYSCLK_USB_WRAP_312P5>, + <&syscrg JH8100_SYSCLK_USB_125M>, + <&nwcrg JH8100_NWCLK_GPIO_100>, + <&syscrg JH8100_SYSCLK_PERH_ROOT>, + <&syscrg JH8100_SYSCLK_MCLK>, + <&syscrg JH8100_SYSCLK_PERH_ROOT_PREOSC>, + <&syscrg JH8100_SYSCLK_AHB0>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER1>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER2>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER3>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER5>, + <&syscrg JH8100_SYSCLK_VENC_ROOT>, + <&syscrg JH8100_SYSCLK_SPI_CORE_100>, + <&glb_ext_clk>, <&usb3_tap_tck_ext>, + <&usb1_tap_tck_ext>, <&usb2_tap_tck_ext>, + <&typec_tap_tck_ext>, <&spi_in0_ext>, + <&spi_in1_ext>, <&i2stx_bclk_ext>, <&i2stx_lrck_ext>; + clock-names = "osc", "axi_400", "vout_root0", "vout_root1", + "usb_wrap_480", "usb_wrap_625", "usb_wrap_240", + "usb_wrap_60", "usb_wrap_156p25", "usb_wrap_312p5", + "usb_125m", "gpio_100", "perh_root", "mclk", + "perh_root_preosc", "ahb0", "apb_bus_per1", + "apb_bus_per2", "apb_bus_per3", "apb_bus_per5", + "venc_root", "spi_core_100", "glb-ext-clk", + "usb3-tap-tck-ext", "usb1-tap-tck-ext", + "usb2-tap-tck-ext", "typec-tap-tck-ext", "spi-in0-ext", + "spi-in1-ext", "i2stx-bclk-ext", "i2stx-lrck-ext"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + nwcrg: clock-controller@123c0000 { + compatible = "starfive,jh8100-nwcrg"; + reg = <0x0 0x123c0000 0x0 0x10000>; + clocks = <&osc>, <&syscrg JH8100_SYSCLK_APB_BUS>, + <&syscrg JH8100_SYSCLK_APB_BUS_PER4>, + <&syscrg JH8100_SYSCLK_SPI_CORE_100>, + <&syscrg JH8100_SYSCLK_ISP_2X>, + <&syscrg JH8100_SYSCLK_ISP_AXI>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT0>, + <&syscrg JH8100_SYSCLK_VOUT_ROOT1>, + <&syscrg JH8100_SYSCLK_VOUT_SCAN_ATS>, + <&syscrg JH8100_SYSCLK_VOUT_DC_CORE>, + <&syscrg JH8100_SYSCLK_VOUT_AXI>, + <&syscrg JH8100_SYSCLK_AXI_400>, <&syscrg JH8100_SYSCLK_AHB0>, + <&syscrg JH8100_SYSCLK_PERH_ROOT_PREOSC>, + <&dvp_ext>, <&isp_dphy_tap_tck_ext>, <&glb_ext_clk>, + <&vout_mipi_dphy_tap_tck_ext>, <&vout_edp_tap_tck_ext>, + <&spi_in2_ext>, <&pll5>; + clock-names = "osc", "apb_bus", "apb_bus_per4", "spi_core_100", + "isp_2x", "isp_axi", "vout_root0", "vout_root1", + "vout_scan_ats", "vout_dc_core", "vout_axi", "axi_400", + "ahb0", "perh_root_preosc", "dvp-ext", + "isp-dphy-tap-tck-ext", "glb-ext-clk", + "vout-mipi-dphy-tap-tck-ext", "vout-edp-tap-tck-ext", + "spi-in2-ext", "pll5"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + syscrg: clock-controller@126d0000 { + compatible = "starfive,jh8100-syscrg"; + reg = <0x0 0x126d0000 0x0 0x10000>; + clocks = <&osc>, <&mclk_ext>, <&pll0>, <&pll1>, + <&pll2>, <&pll3>, <&pll4>, <&pll6>, <&pll7>; + clock-names = "osc", "mclk-ext", "pll0", "pll1", "pll2", + "pll3", "pll4", "pll6", "pll7"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + swcrg: clock-controller@12720000 { + compatible = "starfive,jh8100-swcrg"; + reg = <0x0 0x12720000 0x0 0x10000>; + clocks = <&syscrg JH8100_SYSCLK_APB_BUS>, + <&syscrg JH8100_SYSCLK_VDEC_ROOT>, + <&syscrg JH8100_SYSCLK_FLEXNOC1>; + clock-names = "apb_bus", "vdec_root", "flexnoc1"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + uart5: serial@127d0000 { compatible = "starfive,jh8100-uart", "cdns,uart-r1p8"; reg = <0x0 0x127d0000 0x0 0x10000>;
@@ -374,5 +673,19 @@ uart6: serial@127e0000 { interrupts = <73>; status = "disabled"; }; + + aoncrg: clock-controller@1f310000 { + compatible = "starfive,jh8100-aoncrg"; + reg = <0x0 0x1f310000 0x0 0x10000>; + clocks = <&osc>, <&gmac0_rmii_func>, + <&gmac0_rgmii_func>, <&aon125>, + <&aon2000>, <&aon200>, + <&aon667>, <&rtc>; + clock-names = "osc", "gmac0-rmii-func", "gmac0-rgmii-func", + "aon125", "aon2000", "aon200", + "aon667", "rtc"; + #clock-cells = <1>; + #reset-cells = <1>; + }; }; };
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Stephen Boyd
maintainerQuoting Sia Jee Heng (2024-01-10 05:31:12)
Quoted 11 lines
This patch series enabled basic clock & reset support for StarFive JH8100 SoC.
This patch series depends on the Initial device tree support for StarFive JH8100 SoC patch series which can be found at [1].
As it is recommended to refrain from merging fundamental patches like Device Tree, Clock & Reset, and PINCTRL tested on FPGA/Emulator, into the RISC-V Mainline, this patch series has been renamed to "RFC" patches. Yet, thanks to the reviewers who have reviewed the patches at [2]. The changes are captured below.
I don't think that's what should be happening. Instead, clk patches should be sent to clk maintainers, reset patches to reset maintainers, pinctrl patches to pinctrl maintainers, etc. The DTS can be sent later when it's no longer an FPGA/Emulator? Right now I'm ignoring this series because it's tagged as an RFC.
Quoted 13 lines · Stephen Boyd
Quoting Sia Jee Heng (2024-01-10 05:31:12)
Quoted 11 lines
This patch series enabled basic clock & reset support for StarFive JH8100 SoC.
This patch series depends on the Initial device tree support for StarFive JH8100 SoC patch series which can be found at [1].
As it is recommended to refrain from merging fundamental patches like Device Tree, Clock & Reset, and PINCTRL tested on FPGA/Emulator, into the RISC-V Mainline, this patch series has been renamed to "RFC" patches. Yet, thanks to the reviewers who have reviewed the patches at [2]. The changes are captured below.
Quoted 5 lines
I don't think that's what should be happening. Instead, clk patches should be sent to clk maintainers, reset patches to reset maintainers, pinctrl patches to pinctrl maintainers, etc. The DTS can be sent later when it's no longer an FPGA/Emulator? Right now I'm ignoring this series because it's tagged as an RFC.
Since this comes back to something I said, what I didn't want to happen was a bunch of pinctrl/clock/reset dt-binding headers that getting merged (and therefore exported to other projects) and then have those change later on when the chip was taped out. I don't really care if the drivers themselves get merged. If the JH8100 is being taped out soon (or already has been internally) and there's unlikely to be any changes, there's not really a reason to block the binding headers any more.
Stephen Boyd
maintainerQuoting Conor Dooley (2024-04-11 03:29:51)
Quoted 20 lines · Stephen Boyd
Quoted 13 lines
Quoting Sia Jee Heng (2024-01-10 05:31:12)
Quoted 11 lines
This patch series enabled basic clock & reset support for StarFive JH8100 SoC.
This patch series depends on the Initial device tree support for StarFive JH8100 SoC patch series which can be found at [1].
As it is recommended to refrain from merging fundamental patches like Device Tree, Clock & Reset, and PINCTRL tested on FPGA/Emulator, into the RISC-V Mainline, this patch series has been renamed to "RFC" patches. Yet, thanks to the reviewers who have reviewed the patches at [2]. The changes are captured below.
Quoted 5 lines
I don't think that's what should be happening. Instead, clk patches should be sent to clk maintainers, reset patches to reset maintainers, pinctrl patches to pinctrl maintainers, etc. The DTS can be sent later when it's no longer an FPGA/Emulator? Right now I'm ignoring this series because it's tagged as an RFC.
Quoted 4 lines
Since this comes back to something I said, what I didn't want to happen was a bunch of pinctrl/clock/reset dt-binding headers that getting merged (and therefore exported to other projects) and then have those change later on when the chip was taped out.
Ah ok.
Quoted 5 lines
I don't really care if the drivers
themselves get merged. If the JH8100 is being taped out soon (or already has been internally) and there's unlikely to be any changes, there's not really a reason to block the binding headers any more.
The binding headers are sometimes required for the drivers, so the driver can't be merged then.