Skip to content

Commit

Permalink
clk: sunxi-ng: Add A33 CCU support
Browse files Browse the repository at this point in the history
This commit introduces the clocks found in the Allwinner A33 CCU.

Since this SoC is very similar to the A23, and we share a significant share
of the DTSI, the clock IDs that are going to be used will also be shared
with the A23, hence the name of the various header files.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
  • Loading branch information
Maxime Ripard committed Sep 10, 2016
1 parent aa15233 commit d05c748
Show file tree
Hide file tree
Showing 7 changed files with 1,071 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/clock/sunxi-ccu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Allwinner Clock Control Unit Binding
Required properties :
- compatible: must contain one of the following compatibles:
- "allwinner,sun6i-a31-ccu"
- "allwinner,sun8i-a33-ccu"
- "allwinner,sun8i-h3-ccu"

- reg: Must contain the registers base address and length
Expand Down
12 changes: 12 additions & 0 deletions drivers/clk/sunxi-ng/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ config SUN6I_A31_CCU
select SUNXI_CCU_PHASE
default MACH_SUN6I

config SUN8I_A33_CCU
bool "Support for the Allwinner A33 CCU"
select SUNXI_CCU_DIV
select SUNXI_CCU_MULT
select SUNXI_CCU_NK
select SUNXI_CCU_NKM
select SUNXI_CCU_NKMP
select SUNXI_CCU_NM
select SUNXI_CCU_MP
select SUNXI_CCU_PHASE
default MACH_SUN8I

config SUN8I_H3_CCU
bool "Support for the Allwinner H3 CCU"
select SUNXI_CCU_DIV
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/sunxi-ng/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ obj-$(CONFIG_SUNXI_CCU_MP) += ccu_mp.o

# SoC support
obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o
obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o
obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o
63 changes: 63 additions & 0 deletions drivers/clk/sunxi-ng/ccu-sun8i-a23-a33.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright 2016 Maxime Ripard
*
* Maxime Ripard <maxime.ripard@free-electrons.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

#ifndef _CCU_SUN8I_A23_A33_H_
#define _CCU_SUN8I_A23_A33_H_

#include <dt-bindings/clock/sun8i-a23-a33-ccu.h>
#include <dt-bindings/reset/sun8i-a23-a33-ccu.h>

#define CLK_PLL_CPUX 0
#define CLK_PLL_AUDIO_BASE 1
#define CLK_PLL_AUDIO 2
#define CLK_PLL_AUDIO_2X 3
#define CLK_PLL_AUDIO_4X 4
#define CLK_PLL_AUDIO_8X 5
#define CLK_PLL_VIDEO 6
#define CLK_PLL_VIDEO_2X 7
#define CLK_PLL_VE 8
#define CLK_PLL_DDR0 9
#define CLK_PLL_PERIPH 10
#define CLK_PLL_PERIPH_2X 11
#define CLK_PLL_GPU 12
#define CLK_PLL_MIPI 13
#define CLK_PLL_HSIC 14
#define CLK_PLL_DE 15
#define CLK_PLL_DDR1 16
#define CLK_PLL_DDR 17

/* The CPUX clock is exported */

#define CLK_AXI 19
#define CLK_AHB1 20
#define CLK_APB1 21
#define CLK_APB2 22

/* All the bus gates are exported */

/* The first part of the mod clocks is exported */

#define CLK_DRAM 79

/* Some more module clocks are exported */

#define CLK_MBUS 95

/* And the last module clocks are exported */

#define CLK_NUMBER (CLK_ATS + 1)

#endif /* _CCU_SUN8I_A23_A33_H_ */
Loading

0 comments on commit d05c748

Please sign in to comment.