add clk controller driver for Meson-AXG SoC
Subsystems (5)
v5 cover add clk controller driver for Meson-AXG SoC
Add driver for the clk controller which found in Meson AXG SoC
Note, we deliberately create a seperate source file for the Meson AXG
series, instead of sharing code with previous GXBB/GXL - the file axg.c It would help us maintaining the code more easily.
Changes since v4 [4]:
- use devm_ioremap instead of devm_ioremap_resource
- rename DT node using generic name 'bus'
Changes since v3 [3]:
- separate dt-bindings header file
- adjust license note as standard way
- replace of_iomap with platform/devm API
- add Rob's Ack to Patch 1,4
Changes since v2 [2]:
- drop register offset calculation
- update dt-bindings for new compatible variant
Changes since v1 [1]:
- rework register definion, use '(offset << 2)' to better match the description from data sheet
- drop "#include dt-bindings/clock/gxbb-aoclkc.h" from dts
- rebase code to v4.15-rc1
[4]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005522.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005525.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005526.html
[3]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005487.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005488.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005489.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005490.html
[2]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005468.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005469.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005470.html
[1]
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005239.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005240.html
http://lists.infradead.org/pipermail/linux-amlogic/2017-November/005241.html
Qiufang Dai (3):
clk: meson-axg: add clocks dt-bindings required header
clk: meson-axg: add clock controller drivers
arm64: dts: meson-axg: add clock DT info for Meson AXG SoC
Yixun Lan (1):
dt-bindings: clock: add compatible variant for the Meson-AXG
.../bindings/clock/amlogic,gxbb-clkc.txt | 7 +- arch/arm64/Kconfig.platforms | 1 + arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 15 + drivers/clk/meson/Kconfig | 8 + drivers/clk/meson/Makefile | 1 + drivers/clk/meson/axg.c | 944 +++++++++++++++++++++ drivers/clk/meson/axg.h | 126 +++ include/dt-bindings/clock/axg-clkc.h | 71 ++ 8 files changed, 1171 insertions(+), 2 deletions(-) create mode 100644 drivers/clk/meson/axg.c create mode 100644 drivers/clk/meson/axg.h create mode 100644 include/dt-bindings/clock/axg-clkc.h
Signature · 1 line
2.15.0
PATCH v5 1/4 dt-bindings: clock: add compatible variant for the Meson-AXG
Update the documentation to support clock driver for the Amlogic's Meson-AXG SoC.
--- Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt +5 -2
@@ -5,8 +5,11 @@ controllers within the SoC. Required Properties: -- compatible: should be "amlogic,gxbb-clkc" for GXBB SoC, - or "amlogic,gxl-clkc" for GXL and GXM SoC. +- compatible: should be: + "amlogic,gxbb-clkc" for GXBB SoC, + "amlogic,gxl-clkc" for GXL and GXM SoC, + "amlogic,axg-clkc" for AXG SoC. + - reg: physical base address of the clock controller and length of memory mapped region.
Signature · 1 line
2.15.0
PATCH v5 2/4 clk: meson-axg: add clocks dt-bindings required header
In reply to Yixun LanFrom: Qiufang Dai <[email protected]>
Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.
--- include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/axg-clkc.h
include/dt-bindings/clock/axg-clkc.h new file +71 -0
@@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ +/* +* Meson-AXG clock tree IDs +* +* Copyright (c) 2017 Amlogic, Inc. All rights reserved. +*/ + +#ifndef __AXG_CLKC_H +#define __AXG_CLKC_H + +#define CLKID_SYS_PLL 0 +#define CLKID_FIXED_PLL 1 +#define CLKID_FCLK_DIV2 2 +#define CLKID_FCLK_DIV3 3 +#define CLKID_FCLK_DIV4 4 +#define CLKID_FCLK_DIV5 5 +#define CLKID_FCLK_DIV7 6 +#define CLKID_GP0_PLL 7 +#define CLKID_CLK81 10 +#define CLKID_MPLL0 11 +#define CLKID_MPLL1 12 +#define CLKID_MPLL2 13 +#define CLKID_MPLL3 14 +#define CLKID_DDR 15 +#define CLKID_AUDIO_LOCKER 16 +#define CLKID_MIPI_DSI_HOST 17 +#define CLKID_ISA 18 +#define CLKID_PL301 19 +#define CLKID_PERIPHS 20 +#define CLKID_SPICC0 21 +#define CLKID_I2C 22 +#define CLKID_RNG0 23 +#define CLKID_UART0 24 +#define CLKID_MIPI_DSI_PHY 25 +#define CLKID_SPICC1 26 +#define CLKID_PCIE_A 27 +#define CLKID_PCIE_B 28 +#define CLKID_HIU_IFACE 29 +#define CLKID_ASSIST_MISC 30 +#define CLKID_SD_EMMC_B 31 +#define CLKID_SD_EMMC_C 32 +#define CLKID_DMA 33 +#define CLKID_SPI 34 +#define CLKID_AUDIO 35 +#define CLKID_ETH 36 +#define CLKID_UART1 37 +#define CLKID_G2D 38 +#define CLKID_USB0 39 +#define CLKID_USB1 40 +#define CLKID_RESET 41 +#define CLKID_USB 42 +#define CLKID_AHB_ARB0 43 +#define CLKID_EFUSE 44 +#define CLKID_BOOT_ROM 45 +#define CLKID_AHB_DATA_BUS 46 +#define CLKID_AHB_CTRL_BUS 47 +#define CLKID_USB1_DDR_BRIDGE 48 +#define CLKID_USB0_DDR_BRIDGE 49 +#define CLKID_MMC_PCLK 50 +#define CLKID_VPU_INTR 51 +#define CLKID_SEC_AHB_AHB3_BRIDGE 52 +#define CLKID_GIC 53 +#define CLKID_AO_MEDIA_CPU 54 +#define CLKID_AO_AHB_SRAM 55 +#define CLKID_AO_AHB_BUS 56 +#define CLKID_AO_IFACE 57 +#define CLKID_AO_I2C 58 +#define CLKID_SD_EMMC_B_CLK0 59 +#define CLKID_SD_EMMC_C_CLK0 60 + +#endif /* __AXG_CLKC_H */
Signature · 1 line
2.15.0
Rob Herring
maintainerRe: [PATCH v5 2/4] clk: meson-axg: add clocks dt-bindings required header
Quoted 11 lines · Yixun Lan
From: Qiufang Dai <[email protected]>
Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.
Signed-off-by Qiufang Dai <[email protected]>Signed-off-by Yixun Lan <[email protected]>--- include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/axg-clkc.h
Please add acks when posting new versions.
Rob
Re: [PATCH v5 2/4] clk: meson-axg: add clocks dt-bindings required header
Quoted 6 lines · Rob Herring
Quoted 5 lines · Yixun Lan
From: Qiufang Dai <[email protected]>
Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.
Quoted 9 lines
Quoted 6 lines
Signed-off-by Qiufang Dai <[email protected]>Signed-off-by Yixun Lan <[email protected]>--- include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/axg-clkc.hPlease add acks when posting new versions.
HI Rob
thanks for the suggestion, I will keep this in mind
Jerome Brunet
maintainerRe: [PATCH v5 2/4] clk: meson-axg: add clocks dt-bindings required header
In reply to Rob HerringQuoted 14 lines · Rob Herring
Quoted 5 lines · Yixun Lan
From: Qiufang Dai <[email protected]>
Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.
Quoted 7 lines
Signed-off-by Qiufang Dai <[email protected]>Signed-off-by Yixun Lan <[email protected]>--- include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/axg-clkc.h
Quoted 3 lines
Please add acks when posting new versions.
Rob
Yixun, please be consistent about this. Maintainers are not going to dig through your previous revision to collect Tags
I believe Neil acked patch 3, didn't he ?
Please resend your series with the Tags collected
If not already done, please make sure patches 1-3 apply on top of rc1 and patch 4 on Kevin's dt64 branch.
Thanks
Jerome
Re: [PATCH v5 2/4] clk: meson-axg: add clocks dt-bindings required header
Quoted 17 lines · Jerome Brunet
Quoted 16 lines · Rob Herring
Quoted 5 lines · Yixun Lan
From: Qiufang Dai <[email protected]>
Add the required header for the clocks ID dt-bindings exported from various subsystem in the Meson-AXG SoC.
Quoted 7 lines
Signed-off-by Qiufang Dai <[email protected]>Signed-off-by Yixun Lan <[email protected]>--- include/dt-bindings/clock/axg-clkc.h | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/axg-clkc.hPlease add acks when posting new versions.
Quoted 8 lines
Quoted 1 line
Rob
Yixun, please be consistent about this. Maintainers are not going to dig through your previous revision to collect Tags
I believe Neil acked patch 3, didn't he ?
Please resend your series with the Tags collected
sorry, I missed Neil's ACK for the pacth [3/4]
let's just wait for a few more days, to see if there are more comments coming up, then I would fold them together
Quoted 3 lines
If not already done, please make sure patches 1-3 apply on top of rc1 and patch 4 on Kevin's dt64 branch.
the above is already base on -rc2, and patch 4 can apply to kevin's dt64 cleanly
Quoted 5 lines
Thanks
Jerome.
Jerome Brunet
maintainerRe: [PATCH v5 2/4] clk: meson-axg: add clocks dt-bindings required header
Quoted 2 lines · Yixun Lan
let's just wait for a few more days, to see if there are more comments coming up, then I would fold them together
That's up to you. Keep in mind that rc4 is coming up and I'll need some time to test/verify the final version
PATCH v5 3/4 clk: meson-axg: add clock controller drivers
In reply to Yixun LanFrom: Qiufang Dai <[email protected]>
Add clock controller drivers for Amlogic Meson-AXG SoC.
--- arch/arm64/Kconfig.platforms | 1 + drivers/clk/meson/Kconfig | 8 + drivers/clk/meson/Makefile | 1 + drivers/clk/meson/axg.c | 944 +++++++++++++++++++++++++++++++++++++++++++ drivers/clk/meson/axg.h | 126 ++++++ 5 files changed, 1080 insertions(+) create mode 100644 drivers/clk/meson/axg.c create mode 100644 drivers/clk/meson/axg.h
arch/arm64/Kconfig.platforms +1 -0
@@ -105,6 +105,7 @@ config ARCH_MESON select PINCTRL_MESON select COMMON_CLK_AMLOGIC select COMMON_CLK_GXBB + select COMMON_CLK_AXG select MESON_IRQ_GPIO help This enables support for the Amlogic S905 SoCs.
drivers/clk/meson/Kconfig +8 -0
@@ -19,3 +19,11 @@ config COMMON_CLK_GXBB help Support for the clock controller on AmLogic S905 devices, aka gxbb. Say Y if you want peripherals and CPU frequency scaling to work. + +config COMMON_CLK_AXG + bool + depends on COMMON_CLK_AMLOGIC + select RESET_CONTROLLER + help + Support for the clock controller on AmLogic A113D devices, aka axg. + Say Y if you want peripherals and CPU frequency scaling to work.
drivers/clk/meson/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o clk-audio-divider.o obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-regmap.o gxbb-aoclk-32k.o +obj-$(CONFIG_COMMON_CLK_AXG) += axg.o
drivers/clk/meson/axg.c new file +944 -0
944 lines not on this page · raw message
drivers/clk/meson/axg.h new file +126 -0
126 lines not on this page · raw message
Signature · 1 line
2.15.0
PATCH v5 4/4 arm64: dts: meson-axg: add clock DT info for Meson AXG SoC
In reply to Yixun LanFrom: Qiufang Dai <[email protected]>
Try to add Hiubus DT info, and also enable clock DT info for the Amlogic's Meson-AXG SoC.
--- arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +15 -0
@@ -7,6 +7,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/clock/axg-clkc.h> / { compatible = "amlogic,meson-axg";
@@ -148,6 +149,20 @@ #address-cells = <0>; }; + hiubus: bus at ff63c000 { + compatible = "simple-bus"; + reg = <0x0 0xff63c000 0x0 0x1c00>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x1c00>; + + clkc: clock-controller at 0 { + compatible = "amlogic,axg-clkc"; + #clock-cells = <1>; + reg = <0x0 0x0 0x0 0x320>; + }; + }; + mailbox: mailbox at ff63dc00 { compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu"; reg = <0 0xff63dc00 0 0x400>;
Signature · 1 line
2.15.0