Commit 54cb3bb4 authored by Stephen Boyd's avatar Stephen Boyd

Merge tag 'riscv-sg2042-clk-for-v6.11' of https://github.com/sophgo/linux into clk-sophgo

Pull RISC-V SG2042 clock driver changes from Chen Wang:

 - Add sg2042 clk driver

* tag 'riscv-sg2042-clk-for-v6.11' of https://github.com/sophgo/linux:
  clk: sophgo: Add SG2042 clock driver
  dt-bindings: clock: sophgo: add clkgen for SG2042
  dt-bindings: clock: sophgo: add RP gate clocks for SG2042
  dt-bindings: clock: sophgo: add pll clocks for SG2042
parents 1613e604 48cf7e01
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/sophgo,sg2042-clkgen.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Sophgo SG2042 Clock Generator for divider/mux/gate
maintainers:
- Chen Wang <unicorn_wang@outlook.com>
properties:
compatible:
const: sophgo,sg2042-clkgen
reg:
maxItems: 1
clocks:
items:
- description: Main PLL
- description: Fixed PLL
- description: DDR PLL 0
- description: DDR PLL 1
clock-names:
items:
- const: mpll
- const: fpll
- const: dpll0
- const: dpll1
'#clock-cells':
const: 1
description:
See <dt-bindings/clock/sophgo,sg2042-clkgen.h> for valid indices.
required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
additionalProperties: false
examples:
- |
clock-controller@30012000 {
compatible = "sophgo,sg2042-clkgen";
reg = <0x30012000 0x1000>;
clocks = <&pllclk 0>,
<&pllclk 1>,
<&pllclk 2>,
<&pllclk 3>;
clock-names = "mpll",
"fpll",
"dpll0",
"dpll1";
#clock-cells = <1>;
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/sophgo,sg2042-pll.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Sophgo SG2042 PLL Clock Generator
maintainers:
- Chen Wang <unicorn_wang@outlook.com>
properties:
compatible:
const: sophgo,sg2042-pll
reg:
maxItems: 1
clocks:
items:
- description: Oscillator(Clock Generation IC) for Main/Fixed PLL (25 MHz)
- description: Oscillator(Clock Generation IC) for DDR PLL 0 (25 MHz)
- description: Oscillator(Clock Generation IC) for DDR PLL 1 (25 MHz)
clock-names:
items:
- const: cgi_main
- const: cgi_dpll0
- const: cgi_dpll1
'#clock-cells':
const: 1
description:
See <dt-bindings/clock/sophgo,sg2042-pll.h> for valid indices.
required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
additionalProperties: false
examples:
- |
clock-controller@10000000 {
compatible = "sophgo,sg2042-pll";
reg = <0x10000000 0x10000>;
clocks = <&cgi_main>, <&cgi_dpll0>, <&cgi_dpll1>;
clock-names = "cgi_main", "cgi_dpll0", "cgi_dpll1";
#clock-cells = <1>;
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/sophgo,sg2042-rpgate.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Sophgo SG2042 Gate Clock Generator for RP(riscv processors) subsystem
maintainers:
- Chen Wang <unicorn_wang@outlook.com>
properties:
compatible:
const: sophgo,sg2042-rpgate
reg:
maxItems: 1
clocks:
items:
- description: Gate clock for RP subsystem
clock-names:
items:
- const: rpgate
'#clock-cells':
const: 1
description:
See <dt-bindings/clock/sophgo,sg2042-rpgate.h> for valid indices.
required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
additionalProperties: false
examples:
- |
clock-controller@20000000 {
compatible = "sophgo,sg2042-rpgate";
reg = <0x20000000 0x10000>;
clocks = <&clkgen 85>;
clock-names = "rpgate";
#clock-cells = <1>;
};
......@@ -9,3 +9,31 @@ config CLK_SOPHGO_CV1800
The driver require a 25MHz Oscillator to function generate clock.
It includes PLLs, common clock function and some vendor clock for
IPs of CV18XX series SoC
config CLK_SOPHGO_SG2042_PLL
tristate "Sophgo SG2042 PLL clock support"
depends on ARCH_SOPHGO || COMPILE_TEST
help
This driver supports the PLL clock controller on the
Sophgo SG2042 SoC. This clock IP uses three oscillators with
frequency of 25 MHz as input, which are used for Main/Fixed
PLL, DDR PLL 0 and DDR PLL 1 respectively.
config CLK_SOPHGO_SG2042_CLKGEN
tristate "Sophgo SG2042 Clock Generator support"
depends on CLK_SOPHGO_SG2042_PLL
help
This driver supports the Clock Generator on the
Sophgo SG2042 SoC. This clock IP depends on SG2042 PLL clock
because it uses PLL clocks as input.
This driver provides clock function such as DIV/Mux/Gate.
config CLK_SOPHGO_SG2042_RPGATE
tristate "Sophgo SG2042 RP subsystem clock controller support"
depends on CLK_SOPHGO_SG2042_CLKGEN
help
This driver supports the RP((Riscv Processors)) subsystem clock
controller on the Sophgo SG2042 SoC.
This clock IP depends on SG2042 Clock Generator because it uses
clock from Clock Generator IP as input.
This driver provides Gate function for RP.
......@@ -5,3 +5,7 @@ clk-sophgo-cv1800-y += clk-cv1800.o
clk-sophgo-cv1800-y += clk-cv18xx-common.o
clk-sophgo-cv1800-y += clk-cv18xx-ip.o
clk-sophgo-cv1800-y += clk-cv18xx-pll.o
obj-$(CONFIG_CLK_SOPHGO_SG2042_CLKGEN) += clk-sg2042-clkgen.o
obj-$(CONFIG_CLK_SOPHGO_SG2042_PLL) += clk-sg2042-pll.o
obj-$(CONFIG_CLK_SOPHGO_SG2042_RPGATE) += clk-sg2042-rpgate.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _CLK_SOPHGO_SG2042_H_
#define _CLK_SOPHGO_SG2042_H_
#include <linux/io.h>
#include <linux/clk-provider.h>
/**
* struct sg2042_clk_data - Common data of clock-controller
* @iobase: base address of clock-controller
* @onecell_data: used for adding providers.
*/
struct sg2042_clk_data {
void __iomem *iobase;
struct clk_hw_onecell_data onecell_data;
};
#endif /* _CLK_SOPHGO_SG2042_H_ */
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright (C) 2023 Sophgo Technology Inc. All rights reserved.
*/
#ifndef __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__
#define __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__
#define DIV_CLK_MPLL_RP_CPU_NORMAL_0 0
#define DIV_CLK_MPLL_AXI_DDR_0 1
#define DIV_CLK_FPLL_DDR01_1 2
#define DIV_CLK_FPLL_DDR23_1 3
#define DIV_CLK_FPLL_RP_CPU_NORMAL_1 4
#define DIV_CLK_FPLL_50M_A53 5
#define DIV_CLK_FPLL_TOP_RP_CMN_DIV2 6
#define DIV_CLK_FPLL_UART_500M 7
#define DIV_CLK_FPLL_AHB_LPC 8
#define DIV_CLK_FPLL_EFUSE 9
#define DIV_CLK_FPLL_TX_ETH0 10
#define DIV_CLK_FPLL_PTP_REF_I_ETH0 11
#define DIV_CLK_FPLL_REF_ETH0 12
#define DIV_CLK_FPLL_EMMC 13
#define DIV_CLK_FPLL_SD 14
#define DIV_CLK_FPLL_TOP_AXI0 15
#define DIV_CLK_FPLL_TOP_AXI_HSPERI 16
#define DIV_CLK_FPLL_AXI_DDR_1 17
#define DIV_CLK_FPLL_DIV_TIMER1 18
#define DIV_CLK_FPLL_DIV_TIMER2 19
#define DIV_CLK_FPLL_DIV_TIMER3 20
#define DIV_CLK_FPLL_DIV_TIMER4 21
#define DIV_CLK_FPLL_DIV_TIMER5 22
#define DIV_CLK_FPLL_DIV_TIMER6 23
#define DIV_CLK_FPLL_DIV_TIMER7 24
#define DIV_CLK_FPLL_DIV_TIMER8 25
#define DIV_CLK_FPLL_100K_EMMC 26
#define DIV_CLK_FPLL_100K_SD 27
#define DIV_CLK_FPLL_GPIO_DB 28
#define DIV_CLK_DPLL0_DDR01_0 29
#define DIV_CLK_DPLL1_DDR23_0 30
#define GATE_CLK_RP_CPU_NORMAL_DIV0 31
#define GATE_CLK_AXI_DDR_DIV0 32
#define GATE_CLK_RP_CPU_NORMAL_DIV1 33
#define GATE_CLK_A53_50M 34
#define GATE_CLK_TOP_RP_CMN_DIV2 35
#define GATE_CLK_HSDMA 36
#define GATE_CLK_EMMC_100M 37
#define GATE_CLK_SD_100M 38
#define GATE_CLK_TX_ETH0 39
#define GATE_CLK_PTP_REF_I_ETH0 40
#define GATE_CLK_REF_ETH0 41
#define GATE_CLK_UART_500M 42
#define GATE_CLK_EFUSE 43
#define GATE_CLK_AHB_LPC 44
#define GATE_CLK_AHB_ROM 45
#define GATE_CLK_AHB_SF 46
#define GATE_CLK_APB_UART 47
#define GATE_CLK_APB_TIMER 48
#define GATE_CLK_APB_EFUSE 49
#define GATE_CLK_APB_GPIO 50
#define GATE_CLK_APB_GPIO_INTR 51
#define GATE_CLK_APB_SPI 52
#define GATE_CLK_APB_I2C 53
#define GATE_CLK_APB_WDT 54
#define GATE_CLK_APB_PWM 55
#define GATE_CLK_APB_RTC 56
#define GATE_CLK_AXI_PCIE0 57
#define GATE_CLK_AXI_PCIE1 58
#define GATE_CLK_SYSDMA_AXI 59
#define GATE_CLK_AXI_DBG_I2C 60
#define GATE_CLK_AXI_SRAM 61
#define GATE_CLK_AXI_ETH0 62
#define GATE_CLK_AXI_EMMC 63
#define GATE_CLK_AXI_SD 64
#define GATE_CLK_TOP_AXI0 65
#define GATE_CLK_TOP_AXI_HSPERI 66
#define GATE_CLK_TIMER1 67
#define GATE_CLK_TIMER2 68
#define GATE_CLK_TIMER3 69
#define GATE_CLK_TIMER4 70
#define GATE_CLK_TIMER5 71
#define GATE_CLK_TIMER6 72
#define GATE_CLK_TIMER7 73
#define GATE_CLK_TIMER8 74
#define GATE_CLK_100K_EMMC 75
#define GATE_CLK_100K_SD 76
#define GATE_CLK_GPIO_DB 77
#define GATE_CLK_AXI_DDR_DIV1 78
#define GATE_CLK_DDR01_DIV1 79
#define GATE_CLK_DDR23_DIV1 80
#define GATE_CLK_DDR01_DIV0 81
#define GATE_CLK_DDR23_DIV0 82
#define GATE_CLK_DDR01 83
#define GATE_CLK_DDR23 84
#define GATE_CLK_RP_CPU_NORMAL 85
#define GATE_CLK_AXI_DDR 86
#define MUX_CLK_DDR01 87
#define MUX_CLK_DDR23 88
#define MUX_CLK_RP_CPU_NORMAL 89
#define MUX_CLK_AXI_DDR 90
#endif /* __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__ */
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright (C) 2023 Sophgo Technology Inc. All rights reserved.
*/
#ifndef __DT_BINDINGS_SOPHGO_SG2042_PLL_H__
#define __DT_BINDINGS_SOPHGO_SG2042_PLL_H__
#define MPLL_CLK 0
#define FPLL_CLK 1
#define DPLL0_CLK 2
#define DPLL1_CLK 3
#endif /* __DT_BINDINGS_SOPHGO_SG2042_PLL_H__ */
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright (C) 2023 Sophgo Technology Inc. All rights reserved.
*/
#ifndef __DT_BINDINGS_SOPHGO_SG2042_RPGATE_H__
#define __DT_BINDINGS_SOPHGO_SG2042_RPGATE_H__
#define GATE_CLK_RXU0 0
#define GATE_CLK_RXU1 1
#define GATE_CLK_RXU2 2
#define GATE_CLK_RXU3 3
#define GATE_CLK_RXU4 4
#define GATE_CLK_RXU5 5
#define GATE_CLK_RXU6 6
#define GATE_CLK_RXU7 7
#define GATE_CLK_RXU8 8
#define GATE_CLK_RXU9 9
#define GATE_CLK_RXU10 10
#define GATE_CLK_RXU11 11
#define GATE_CLK_RXU12 12
#define GATE_CLK_RXU13 13
#define GATE_CLK_RXU14 14
#define GATE_CLK_RXU15 15
#define GATE_CLK_RXU16 16
#define GATE_CLK_RXU17 17
#define GATE_CLK_RXU18 18
#define GATE_CLK_RXU19 19
#define GATE_CLK_RXU20 20
#define GATE_CLK_RXU21 21
#define GATE_CLK_RXU22 22
#define GATE_CLK_RXU23 23
#define GATE_CLK_RXU24 24
#define GATE_CLK_RXU25 25
#define GATE_CLK_RXU26 26
#define GATE_CLK_RXU27 27
#define GATE_CLK_RXU28 28
#define GATE_CLK_RXU29 29
#define GATE_CLK_RXU30 30
#define GATE_CLK_RXU31 31
#define GATE_CLK_MP0 32
#define GATE_CLK_MP1 33
#define GATE_CLK_MP2 34
#define GATE_CLK_MP3 35
#define GATE_CLK_MP4 36
#define GATE_CLK_MP5 37
#define GATE_CLK_MP6 38
#define GATE_CLK_MP7 39
#define GATE_CLK_MP8 40
#define GATE_CLK_MP9 41
#define GATE_CLK_MP10 42
#define GATE_CLK_MP11 43
#define GATE_CLK_MP12 44
#define GATE_CLK_MP13 45
#define GATE_CLK_MP14 46
#define GATE_CLK_MP15 47
#endif /* __DT_BINDINGS_SOPHGO_SG2042_RPGATE_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment