Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Documentation/devicetree/bindings/clock/anlogic,dr1v90-cru.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/anlogic,dr1v90-cru.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Anlogic DR1V90 Clock and Reset Unit (CRU)

maintainers:
- Junhui Liu <junhui.liu@pigmoral.tech>

properties:
compatible:
const: anlogic,dr1v90-cru

reg:
maxItems: 1

clocks:
items:
- description: Main oscillator
- description: External CAN clock
- description: External WDT clock

clock-names:
items:
- const: osc
- const: can_ext
- const: wdt_ext

"#clock-cells":
const: 1
description:
Refer <dt-bindings/clock/anlogic,dr1v90-cru.h> for valid indices.

"#reset-cells":
const: 1
description:
Refer <dt-bindings/reset/anlogic,dr1v90-cru.h> for valid indices.

required:
- compatible
- reg
- clocks
- clock-names
- "#clock-cells"
- "#reset-cells"

additionalProperties: false

examples:
- |
clock-controller@f8801000 {
compatible = "anlogic,dr1v90-cru";
reg = <0xf8801000 0x400>;
clocks = <&osc>, <&can_ext>, <&wdt_ext>;
clock-names = "osc", "can_ext", "wdt_ext";
#clock-cells = <1>;
#reset-cells = <1>;
};
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,15 @@ M: Jiaxun Yang <jiaxun.yang@flygoat.com>
S: Supported
F: drivers/rtc/rtc-goldfish.c

ANLOGIC DR1V90 CRU DRIVER
M: Junhui Liu <junhui.liu@pigmoral.tech>
S: Maintained
F: Documentation/devicetree/bindings/clock/anlogic,dr1v90-cru.yaml
F: drivers/clk/anlogic/cru?dr1*
F: drivers/reset/reset-dr1v90.c
F: include/dt-bindings/clock/anlogic,dr1v90-cru.h
F: include/dt-bindings/reset/anlogic,dr1v90-cru.h

AOA (Apple Onboard Audio) ALSA DRIVER
M: Johannes Berg <johannes@sipsolutions.net>
L: linuxppc-dev@lists.ozlabs.org
Expand Down
4 changes: 4 additions & 0 deletions arch/riscv/boot/dts/anlogic/dr1v90-mlkpai-fs01.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
};
};

&osc {
clock-frequency = <33333333>;
};

&uart1 {
status = "okay";
};
40 changes: 38 additions & 2 deletions arch/riscv/boot/dts/anlogic/dr1v90.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* Copyright (C) 2025 Junhui Liu <junhui.liu@pigmoral.tech>
*/

#include <dt-bindings/clock/anlogic,dr1v90-cru.h>
#include <dt-bindings/reset/anlogic,dr1v90-cru.h>

/dts-v1/;
/ {
#address-cells = <2>;
Expand Down Expand Up @@ -40,6 +43,26 @@
};
};

clocks {
can_ext: clock-ext-can {
compatible = "fixed-clock";
clock-output-names = "can_ext";
#clock-cells = <0>;
};

osc: clock-osc {
compatible = "fixed-clock";
clock-output-names = "osc";
#clock-cells = <0>;
};

wdt_ext: clock-ext-wdt {
compatible = "fixed-clock";
clock-output-names = "wdt_ext";
#clock-cells = <0>;
};
};

soc {
compatible = "simple-bus";
interrupt-parent = <&plic>;
Expand Down Expand Up @@ -81,21 +104,34 @@
uart0: serial@f8400000 {
compatible = "anlogic,dr1v90-uart", "snps,dw-apb-uart";
reg = <0x0 0xf8400000 0x0 0x1000>;
clock-frequency = <50000000>;
clocks = <&cru CLK_IO_400M_DIV8>, <&cru CLK_CPU_1X>;
clock-names = "baudclk", "apb_pclk";
interrupts = <71>;
reg-io-width = <4>;
reg-shift = <2>;
resets = <&cru RESET_UART0>;
status = "disabled";
};

uart1: serial@f8401000 {
compatible = "anlogic,dr1v90-uart", "snps,dw-apb-uart";
reg = <0x0 0xf8401000 0x0 0x1000>;
clock-frequency = <50000000>;
clocks = <&cru CLK_IO_400M_DIV8>, <&cru CLK_CPU_1X>;
clock-names = "baudclk", "apb_pclk";
interrupts = <72>;
reg-io-width = <4>;
reg-shift = <2>;
resets = <&cru RESET_UART1>;
status = "disabled";
};

cru: clock-controller@f8801000 {
compatible = "anlogic,dr1v90-cru";
reg = <0x0 0xf8801000 0 0x400>;
clocks = <&osc>, <&can_ext>, <&wdt_ext>;
clock-names = "osc", "can_ext", "wdt_ext";
#clock-cells = <1>;
#reset-cells = <1>;
};
};
};
1 change: 1 addition & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ config COMMON_CLK_RPMI

source "drivers/clk/actions/Kconfig"
source "drivers/clk/analogbits/Kconfig"
source "drivers/clk/anlogic/Kconfig"
source "drivers/clk/aspeed/Kconfig"
source "drivers/clk/bcm/Kconfig"
source "drivers/clk/eswin/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
# please keep this section sorted lexicographically by directory path name
obj-y += actions/
obj-y += analogbits/
obj-y += anlogic/
obj-y += aspeed/
obj-$(CONFIG_COMMON_CLK_AT91) += at91/
obj-$(CONFIG_ARCH_ARTPEC) += axis/
Expand Down
21 changes: 21 additions & 0 deletions drivers/clk/anlogic/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-2.0-only

config ANLOGIC_DR1_CRU
tristate "Clock support for Anlogic DR1 series SoCs"
depends on ARCH_ANLOGIC || COMPILE_TEST
select AUXILIARY_BUS
default ARCH_ANLOGIC
help
Say Y to enable clock controller unit support for Anlogic DR1 series
SoCs.

if ANLOGIC_DR1_CRU

config ANLOGIC_DR1V90_CRU
tristate "Anlogic DR1V90 clock support"
depends on ARCH_ANLOGIC || COMPILE_TEST
default ARCH_ANLOGIC
help
Support for the Clock and Reset Unit in Anlogic DR1V90 SoCs.

endif
7 changes: 7 additions & 0 deletions drivers/clk/anlogic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_ANLOGIC_DR1_CRU) += anlogic-dr1-cru.o
anlogic-dr1-cru-y += cru_dr1.o

obj-$(CONFIG_ANLOGIC_DR1V90_CRU) += anlogic-dr1v90-cru.o
anlogic-dr1v90-cru-y += cru-dr1v90.o
Loading
Loading