Skip to content

Commit

Permalink
ARC: clk: introduce HSDK CGU clock driver
Browse files Browse the repository at this point in the history
Synopsys HSDK clock controller generates and supplies clocks to various
controllers and peripherals within the SoC.

Each clock has assigned identifier and client device tree nodes can use
this identifier to specify the clock which they consume. All available
clocks are defined as preprocessor macros in the
dt-bindings/clock/snps,hsdk-cgu.h header and can be used in device
tree sources.

Signed-off-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Alexey Brodkin <[email protected]>
  • Loading branch information
Eugeniy Paltsev authored and abrodkin committed Dec 11, 2017
1 parent 3cf2393 commit e80dac0
Show file tree
Hide file tree
Showing 6 changed files with 654 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ S: Maintained
L: [email protected]
F: drivers/gpio/hsdk-creg-gpio.c

ARC HSDK CGU CLOCK
M: Eugeniy Paltsev <[email protected]>
S: Maintained
L: [email protected]
F: drivers/clk/clk-hsdk-cgu.c
F: include/dt-bindings/clock/snps,hsdk-cgu.h
F: doc/device-tree-bindings/clock/snps,hsdk-cgu.txt

ARM
M: Albert Aribaud <[email protected]>
S: Maintained
Expand Down
35 changes: 35 additions & 0 deletions doc/device-tree-bindings/clock/snps,hsdk-cgu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
* Synopsys HSDK clock generation unit

The Synopsys HSDK clock controller generates and supplies clock to various
controllers and peripherals within the SoC.

Required Properties:

- compatible: should be "snps,hsdk-cgu-clock"
- reg: the pair of physical base address and length of clock generation unit
memory mapped region and creg arc core divider memory mapped region.
- #clock-cells: should be 1.

Each clock is assigned an identifier and client nodes can use this identifier
to specify the clock which they consume. All available clocks are defined as
preprocessor macros in the dt-bindings/clock/snps,hsdk-cgu.h headers and can be
used in device tree sources.

Example: Clock controller node:

cgu_clk: cgu-clk@f0000000 {
compatible = "snps,hsdk-cgu-clock";
reg = <0xf0000000 0x1000>, <0xf00014B8 0x4>;
#clock-cells = <1>;
};

Example: UART controller node that consumes the clock generated by the clock
controller:

uart0: serial0@f0005000 {
compatible = "snps,dw-apb-uart";
reg = <0xf0005000 0x1000>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&cgu_clk CLK_SYS_UART_REF>;
};
6 changes: 6 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ config CLK_STM32F
This clock driver adds support for RCC clock management
for STM32F4 and STM32F7 SoCs.

config CLK_HSDK
bool "Enable cgu clock driver for HSDK"
depends on CLK
help
Enable this to support the cgu clocks on Synopsys ARC HSDK

config CLK_ZYNQ
bool "Enable clock driver support for Zynq"
depends on CLK && ARCH_ZYNQ
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ obj-$(CONFIG_CLK_EXYNOS) += exynos/
obj-$(CONFIG_CLK_AT91) += at91/
obj-$(CONFIG_CLK_BCM6345) += clk_bcm6345.o
obj-$(CONFIG_CLK_BOSTON) += clk_boston.o
obj-$(CONFIG_CLK_HSDK) += clk-hsdk-cgu.o
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
obj-$(CONFIG_STM32H7) += clk_stm32h7.o
Loading

0 comments on commit e80dac0

Please sign in to comment.