Commit 6bbea83a authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge tag 'sunxi-clk-for-5.12' of...

Merge tag 'sunxi-clk-for-5.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner

Pull Allwinner clk driver updates from Maxime Ripard:

"Our usual PR for the Allwinner SoCs, this time adding support for the
Allwinner H616 SoC, and a few H6 fixes."

* tag 'sunxi-clk-for-5.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: Add support for the Allwinner H616 CCU
  clk: sunxi-ng: Add support for the Allwinner H616 R-CCU
  dt-bindings: clk: sunxi-ccu: Add compatible string for Allwinner H616
  clk: sunxi-ng: h6: Fix clock divider range on some clocks
  clk: sunxi: clk-mod0: Demote non-conformant kernel-doc header
  clk: sunxi: clk-a10-ve: Demote obvious kernel-doc abuse
  clk: sunxi: clk-sunxi: Demote a bunch of non-conformant kernel-doc headers
  clk: sunxi-ng: h6: Fix CEC clock
  clk: sunxi-ng: h6-r: Add R_APB2_RSB clock and reset
parents 5c8fe583 88dde5e2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ properties:
      - allwinner,sun50i-h5-ccu
      - allwinner,sun50i-h6-ccu
      - allwinner,sun50i-h6-r-ccu
      - allwinner,sun50i-h616-ccu
      - allwinner,sun50i-h616-r-ccu
      - allwinner,suniv-f1c100s-ccu
      - nextthing,gr8-ccu

@@ -82,6 +84,7 @@ if:
        - allwinner,sun50i-a64-r-ccu
        - allwinner,sun50i-a100-r-ccu
        - allwinner,sun50i-h6-r-ccu
        - allwinner,sun50i-h616-r-ccu

then:
  properties:
@@ -100,6 +103,7 @@ else:
        enum:
          - allwinner,sun50i-a100-ccu
          - allwinner,sun50i-h6-ccu
          - allwinner,sun50i-h616-ccu

  then:
    properties:
+6 −1
Original line number Diff line number Diff line
@@ -32,8 +32,13 @@ config SUN50I_H6_CCU
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50I_H616_CCU
	bool "Support for the Allwinner H616 CCU"
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50I_H6_R_CCU
	bool "Support for the Allwinner H6 PRCM CCU"
	bool "Support for the Allwinner H6 and H616 PRCM CCU"
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o
obj-$(CONFIG_SUN50I_A100_CCU)	+= ccu-sun50i-a100.o
obj-$(CONFIG_SUN50I_A100_R_CCU)	+= ccu-sun50i-a100-r.o
obj-$(CONFIG_SUN50I_H6_CCU)	+= ccu-sun50i-h6.o
obj-$(CONFIG_SUN50I_H616_CCU)	+= ccu-sun50i-h616.o
obj-$(CONFIG_SUN50I_H6_R_CCU)	+= ccu-sun50i-h6-r.o
obj-$(CONFIG_SUN4I_A10_CCU)	+= ccu-sun4i-a10.o
obj-$(CONFIG_SUN5I_CCU)		+= ccu-sun5i.o
+53 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ static SUNXI_CCU_GATE(r_apb2_uart_clk, "r-apb2-uart", "r-apb2",
		      0x18c, BIT(0), 0);
static SUNXI_CCU_GATE(r_apb2_i2c_clk,	"r-apb2-i2c",	"r-apb2",
		      0x19c, BIT(0), 0);
static SUNXI_CCU_GATE(r_apb2_rsb_clk,	"r-apb2-rsb",	"r-apb2",
		      0x1bc, BIT(0), 0);
static SUNXI_CCU_GATE(r_apb1_ir_clk,	"r-apb1-ir",	"r-apb1",
		      0x1cc, BIT(0), 0);
static SUNXI_CCU_GATE(r_apb1_w1_clk,	"r-apb1-w1",	"r-apb1",
@@ -130,12 +132,23 @@ static struct ccu_common *sun50i_h6_r_ccu_clks[] = {
	&r_apb1_pwm_clk.common,
	&r_apb2_uart_clk.common,
	&r_apb2_i2c_clk.common,
	&r_apb2_rsb_clk.common,
	&r_apb1_ir_clk.common,
	&r_apb1_w1_clk.common,
	&ir_clk.common,
	&w1_clk.common,
};

static struct ccu_common *sun50i_h616_r_ccu_clks[] = {
	&r_apb1_clk.common,
	&r_apb2_clk.common,
	&r_apb1_twd_clk.common,
	&r_apb2_i2c_clk.common,
	&r_apb2_rsb_clk.common,
	&r_apb1_ir_clk.common,
	&ir_clk.common,
};

static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
	.hws	= {
		[CLK_AR100]		= &ar100_clk.common.hw,
@@ -147,6 +160,7 @@ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
		[CLK_R_APB1_PWM]	= &r_apb1_pwm_clk.common.hw,
		[CLK_R_APB2_UART]	= &r_apb2_uart_clk.common.hw,
		[CLK_R_APB2_I2C]	= &r_apb2_i2c_clk.common.hw,
		[CLK_R_APB2_RSB]	= &r_apb2_rsb_clk.common.hw,
		[CLK_R_APB1_IR]		= &r_apb1_ir_clk.common.hw,
		[CLK_R_APB1_W1]		= &r_apb1_w1_clk.common.hw,
		[CLK_IR]		= &ir_clk.common.hw,
@@ -155,16 +169,38 @@ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
	.num	= CLK_NUMBER,
};

static struct clk_hw_onecell_data sun50i_h616_r_hw_clks = {
	.hws	= {
		[CLK_R_AHB]		= &r_ahb_clk.hw,
		[CLK_R_APB1]		= &r_apb1_clk.common.hw,
		[CLK_R_APB2]		= &r_apb2_clk.common.hw,
		[CLK_R_APB1_TWD]	= &r_apb1_twd_clk.common.hw,
		[CLK_R_APB2_I2C]	= &r_apb2_i2c_clk.common.hw,
		[CLK_R_APB2_RSB]	= &r_apb2_rsb_clk.common.hw,
		[CLK_R_APB1_IR]		= &r_apb1_ir_clk.common.hw,
		[CLK_IR]		= &ir_clk.common.hw,
	},
	.num	= CLK_NUMBER,
};

static struct ccu_reset_map sun50i_h6_r_ccu_resets[] = {
	[RST_R_APB1_TIMER]	=  { 0x11c, BIT(16) },
	[RST_R_APB1_TWD]	=  { 0x12c, BIT(16) },
	[RST_R_APB1_PWM]	=  { 0x13c, BIT(16) },
	[RST_R_APB2_UART]	=  { 0x18c, BIT(16) },
	[RST_R_APB2_I2C]	=  { 0x19c, BIT(16) },
	[RST_R_APB2_RSB]	=  { 0x1bc, BIT(16) },
	[RST_R_APB1_IR]		=  { 0x1cc, BIT(16) },
	[RST_R_APB1_W1]		=  { 0x1ec, BIT(16) },
};

static struct ccu_reset_map sun50i_h616_r_ccu_resets[] = {
	[RST_R_APB1_TWD]	=  { 0x12c, BIT(16) },
	[RST_R_APB2_I2C]	=  { 0x19c, BIT(16) },
	[RST_R_APB2_RSB]	=  { 0x1bc, BIT(16) },
	[RST_R_APB1_IR]		=  { 0x1cc, BIT(16) },
};

static const struct sunxi_ccu_desc sun50i_h6_r_ccu_desc = {
	.ccu_clks	= sun50i_h6_r_ccu_clks,
	.num_ccu_clks	= ARRAY_SIZE(sun50i_h6_r_ccu_clks),
@@ -175,6 +211,16 @@ static const struct sunxi_ccu_desc sun50i_h6_r_ccu_desc = {
	.num_resets	= ARRAY_SIZE(sun50i_h6_r_ccu_resets),
};

static const struct sunxi_ccu_desc sun50i_h616_r_ccu_desc = {
	.ccu_clks	= sun50i_h616_r_ccu_clks,
	.num_ccu_clks	= ARRAY_SIZE(sun50i_h616_r_ccu_clks),

	.hw_clks	= &sun50i_h616_r_hw_clks,

	.resets		= sun50i_h616_r_ccu_resets,
	.num_resets	= ARRAY_SIZE(sun50i_h616_r_ccu_resets),
};

static void __init sunxi_r_ccu_init(struct device_node *node,
				    const struct sunxi_ccu_desc *desc)
{
@@ -195,3 +241,10 @@ static void __init sun50i_h6_r_ccu_setup(struct device_node *node)
}
CLK_OF_DECLARE(sun50i_h6_r_ccu, "allwinner,sun50i-h6-r-ccu",
	       sun50i_h6_r_ccu_setup);

static void __init sun50i_h616_r_ccu_setup(struct device_node *node)
{
	sunxi_r_ccu_init(node, &sun50i_h616_r_ccu_desc);
}
CLK_OF_DECLARE(sun50i_h616_r_ccu, "allwinner,sun50i-h616-r-ccu",
	       sun50i_h616_r_ccu_setup);
+1 −1
Original line number Diff line number Diff line
@@ -14,6 +14,6 @@

#define CLK_R_APB2	3

#define CLK_NUMBER	(CLK_W1 + 1)
#define CLK_NUMBER	(CLK_R_APB2_RSB + 1)

#endif /* _CCU_SUN50I_H6_R_H */
Loading