diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2018-05-07 07:26:48 +0000 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2018-05-07 07:26:48 +0000 |
commit | 178f57b14385313166cd5d70c56387f5d2c7cab4 (patch) | |
tree | a8a7edc3f5f3e61e75aba30879cb58fbad9b59b0 /sys/arm64 | |
parent | b732ceb6cadbf2e703ee56ea64e216bdb4fdd640 (diff) | |
download | src-178f57b14385313166cd5d70c56387f5d2c7cab4.tar.gz src-178f57b14385313166cd5d70c56387f5d2c7cab4.zip |
arm64: rockchip: rk3328: Add armclk clock
Add the clock definition for the arm clock.
While here remove the indexes in the clock table as we will need clock
with a 0 index (non-exported clocks).
Notes
Notes:
svn path=/head/; revision=333314
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/rockchip/clk/rk3328_cru.c | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/sys/arm64/rockchip/clk/rk3328_cru.c b/sys/arm64/rockchip/clk/rk3328_cru.c index a7cdaf3679c9..5aabb6850b5f 100644 --- a/sys/arm64/rockchip/clk/rk3328_cru.c +++ b/sys/arm64/rockchip/clk/rk3328_cru.c @@ -191,6 +191,25 @@ static struct rk_clk_composite_def aclk_bus_pre = { .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, }; +#define ARMCLK 6 +static const char *armclk_parents[] = {"apll", "gpll", "dpll", "npll" }; +static struct rk_clk_composite_def armclk = { + .clkdef = { + .id = ARMCLK, + .name = "armclk", + .parent_names = armclk_parents, + .parent_cnt = nitems(armclk_parents), + }, + .muxdiv_offset = 0x100, + .mux_shift = 6, + .mux_width = 2, + + .div_shift = 0, + .div_width = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX, +}; + /* CRU_CLKSEL_CON1 */ #define PCLK_BUS_PRE 216 @@ -377,61 +396,65 @@ static struct rk_clk_composite_def emmc = { }; static struct rk_clk rk3328_clks[] = { - [PLL_APLL] = { + { .type = RK_CLK_PLL, .clk.pll = &apll }, - [PLL_DPLL] = { + { .type = RK_CLK_PLL, .clk.pll = &dpll }, - [PLL_CPLL] = { + { .type = RK_CLK_PLL, .clk.pll = &cpll }, - [PLL_GPLL] = { + { .type = RK_CLK_PLL, .clk.pll = &gpll }, - [PLL_NPLL] = { + { .type = RK_CLK_PLL, .clk.pll = &npll }, - [ACLK_BUS_PRE] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &aclk_bus_pre }, - [HCLK_BUS_PRE] = { + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &armclk + }, + { .type = RK_CLK_COMPOSITE, .clk.composite = &hclk_bus_pre }, - [PCLK_BUS_PRE] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &pclk_bus_pre }, - [ACLK_PERI_PRE] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &aclk_peri_pre, }, - [PCLK_PERI] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &pclk_peri, }, - [HCLK_PERI] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &hclk_peri, }, - [SCLK_SDMMC] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &sdmmc }, - [SCLK_SDIO] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &sdio }, - [SCLK_EMMC] = { + { .type = RK_CLK_COMPOSITE, .clk.composite = &emmc }, |