Re: [PATCH 2/2] clk: meson: a1: add support for Amlogic A1 clock driver

From: Jian Hu
Date: Tue Oct 08 2019 - 04:04:00 EST


Hi, Jerome

PLL clocks and peripheral clocks rely on each other.

for fixed_pll, we can describe its parent like this:

xtal-->xtal_fixpll-->fixed_dco-->fixed_pll

xtal fixpll is belong to peripheral region.
fixed_pll/fclk_div2/fclk_div3 is belong to PLL region.

if PLL clocks probe first, it will fail to get xtal_fixpll.
we can not get fixed_dco's parent clock.

if peripheral clocks probe first, it will fail to get
fixed_pll clocks. A lot of peripheral clocks parent are fclk_div2/3/5/7.
and we can not get fclk_div2/3/5/7 clocks.

I can think of two solutions:
1) Do not describe xtal_fixpll, xtal_hifipll.
that is to say, do not decribe the SYS_OSCIN_CTRL register.

2) Put peripheral and pll clock driver in one driver.

And which sulution is better above two?

Or maybe other good ideas for it?

On 2019/9/29 17:38, Jian Hu wrote:


On 2019/9/27 21:32, Jerome Brunet wrote:

On Fri 27 Sep 2019 at 11:52, Jian Hu <jian.hu@xxxxxxxxxxx> wrote:

Hi, Jerome

Thank you for review.

On 2019/9/25 23:09, Jerome Brunet wrote:
On Wed 25 Sep 2019 at 19:44, Jian Hu <jian.hu@xxxxxxxxxxx> wrote:

The Amlogic A1 clock includes three parts:
peripheral clocks, pll clocks, CPU clocks.
sys pll and CPU clocks will be sent in next patch.

Unlike the previous series, there is no EE/AO domain
in A1 CLK controllers.

Signed-off-by: Jian Hu <jian.hu@xxxxxxxxxxx>
Signed-off-by: Jianxin Pan <jianxin.pan@xxxxxxxxxxx>
---
ÂÂ arch/arm64/Kconfig.platforms |ÂÂÂ 1 +
ÂÂ drivers/clk/meson/KconfigÂÂÂ |ÂÂ 10 +
ÂÂ drivers/clk/meson/MakefileÂÂ |ÂÂÂ 1 +
ÂÂ drivers/clk/meson/a1.cÂÂÂÂÂÂ | 2617 ++++++++++++++++++++++++++++++++++++++++++
ÂÂ drivers/clk/meson/a1.hÂÂÂÂÂÂ |Â 172 +++
ÂÂ 5 files changed, 2801 insertions(+)
ÂÂ create mode 100644 drivers/clk/meson/a1.c
ÂÂ create mode 100644 drivers/clk/meson/a1.h

[...]
diff --git a/drivers/clk/meson/a1.c b/drivers/clk/meson/a1.c
new file mode 100644
index 0000000..26edae0f
--- /dev/null
+++ b/drivers/clk/meson/a1.c
@@ -0,0 +1,2617 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/init.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include "clk-mpll.h"
+#include "clk-pll.h"
+#include "clk-regmap.h"
+#include "vid-pll-div.h"
+#include "clk-dualdiv.h"
+#include "meson-eeclk.h"
+#include "a1.h"
+
+/* PLLs clock in gates, its parent is xtal */
+static struct clk_regmap a1_xtal_clktree = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 0,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_clktree",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,

Is CCF even expected to touch this ever ? what about RO ops ?
Please review your other clocks with this in mind

the clock should not be changed at runtime.clk_regmap_gate_ro_ops
is a good idea. Set RO ops and remove the CLK_IS_CRITICAL flag.
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_xtal_fixpll = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 1,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_fixpll",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_xtal_usb_phy = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 2,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_usb_phy",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,

How is an USB clock critical to the system ?
Please review your other clocks with comment in mind ...
the usb clock does not affect the system,
remove the CLK_IS_CRITICAL flag

+ÂÂÂ },
+};
+
+static struct clk_regmap a1_xtal_usb_ctrl = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 3,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_usb_ctrl",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
the usb clock does not affect the system,
remove the CLK_IS_CRITICAL flag
+
+static struct clk_regmap a1_xtal_hifipll = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 4,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_hifipll",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
CLK_IS_CRITICAL is need to lock hifi pll.

That's not how CCF works, this falg is not ok here.
CCF will enable this clock before calling enable on your hifi pll

okï I will remove it.
+
+static struct clk_regmap a1_xtal_syspll = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 5,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_syspll",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
when CPU clock is at fixed clock, sys pll
will be disabled, xtal_syspll will be disabled too.
when setting sys pll, call clk_set_rate to lock
sys pll, add RO ops to avoid disabling the clock

Again not Ok.
If you mechanism to lock the PLL is properly implemented in the enable
callback of the sys pll, still kind of work around are not needed

This has worked on the pll we had so far.

ok, I will remove it.

+static struct clk_regmap a1_xtal_dds = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = SYS_OSCIN_CTRL,
+ÂÂÂÂÂÂÂ .bit_idx = 6,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "xtal_dds",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_data = &(const struct clk_parent_data) {
+ÂÂÂÂÂÂÂÂÂÂÂ .fw_name = "xtal",
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
CLK_IS_CRITICAL is need to lock dds
+
+/* fixed pll = 1536M
+ *
+ * fixed pll ----- fclk_div2 = 768M
+ *ÂÂÂÂÂÂÂÂÂÂ |
+ *ÂÂÂÂÂÂÂÂÂÂ ----- fclk_div3 = 512M
+ *ÂÂÂÂÂÂÂÂÂÂ |
+ *ÂÂÂÂÂÂÂÂÂÂ ----- fclk_div5 = 307.2M
+ *ÂÂÂÂÂÂÂÂÂÂ |
+ *ÂÂÂÂÂÂÂÂÂÂ ----- fclk_div7 = 219.4M
+ */

The framework will make those calculation ... you can remove this

ok, I will remote the comment.
+static struct clk_regmap a1_fixed_pll_dco = {
+ÂÂÂ .data = &(struct meson_clk_pll_data){
+ÂÂÂÂÂÂÂ .en = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 28,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 1,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .m = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 0,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 8,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .n = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 10,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 5,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .frac = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL1,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 0,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 19,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .l = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 31,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 1,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .rst = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 29,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 1,
+ÂÂÂÂÂÂÂ },
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fixed_pll_dco",
+ÂÂÂÂÂÂÂ .ops = &meson_clk_pll_ro_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_xtal_fixpll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_fixed_pll = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂ .bit_idx = 20,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data) {
+ÂÂÂÂÂÂÂ .name = "fixed_pll",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fixed_pll_dco.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ .flags = CLK_IGNORE_UNUSED,
+ÂÂÂ },
+};
+
+static const struct pll_params_table a1_hifi_pll_params_table[] = {
+ÂÂÂ PLL_PARAMS(128, 5), /* DCO = 614.4M */
+};
+
+static const struct reg_sequence a1_hifi_init_regs[] = {
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL1,ÂÂÂ .def = 0x01800000 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL2,ÂÂÂ .def = 0x00001100 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL3,ÂÂÂ .def = 0x10022200 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL4,ÂÂÂ .def = 0x00301000 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL0, .def = 0x01f19480 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL0, .def = 0x11f19480, .delay_us = 10 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL0,ÂÂÂ .def = 0x15f11480, .delay_us = 40 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL2,ÂÂÂ .def = 0x00001140 },
+ÂÂÂ { .reg = ANACTRL_HIFIPLL_CTRL2,ÂÂÂ .def = 0x00001100 },
+};
+
+/*
+ * The Meson A1 HIFI PLL is 614.4M, it requires
+ * a strict register sequence to enable the PLL.
+ * set meson_clk_pcie_pll_ops as its ops
+ */

Could you elaborate on this ? What need to be done to enable the clock ?
Also the HIFI PLL used to be able to do a *LOT* of different rate which
might be desirable for audio use case. Why is this one restricted to one
particular rate ?

The audio working frequency are 44.1khz, 48khz and 192khz.

614.4M can meet the three frequency.

after the hifi pll, there are two dividers in Audio clock.

614.4M/3200 = 192khz

614.4M/12800 = 48khz

614,4M/13932 = 44.0999khz

It does not really answer my question though.
You are locking a use case here, which is 32 bit sample width

We have other constraint with the upstream audio driver, and we usually
looking for base frequency that a multiple of 768 (24*32).

If you need your PLL to be set to a particular rate for a use case, the
correct way is "assigned-rate" in DT

so the question still stands, the HIFI pll before was pretty easy to set
at a wide variety of rate (same as GP0) ... is it not the case anymore ?
If yes, could you decribe the constraints.

All this took us a long time to figure out on our own, which is why I'd
prefer to get the proper constraints in from the beginning this time

ok, I will verify it and describe the constraints about it


+static struct clk_regmap a1_hifi_pll = {
+ÂÂÂ .data = &(struct meson_clk_pll_data){
+ÂÂÂÂÂÂÂ .en = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_HIFIPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 28,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 1,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .m = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_HIFIPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 0,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 8,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .n = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_HIFIPLL_CTRL0,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 10,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 5,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .frac = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_HIFIPLL_CTRL1,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 0,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 19,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .l = {
+ÂÂÂÂÂÂÂÂÂÂÂ .reg_off = ANACTRL_HIFIPLL_STS,
+ÂÂÂÂÂÂÂÂÂÂÂ .shiftÂÂ = 31,
+ÂÂÂÂÂÂÂÂÂÂÂ .widthÂÂ = 1,
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .table = a1_hifi_pll_params_table,
+ÂÂÂÂÂÂÂ .init_regs = a1_hifi_init_regs,
+ÂÂÂÂÂÂÂ .init_count = ARRAY_SIZE(a1_hifi_init_regs),
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "hifi_pll",
+ÂÂÂÂÂÂÂ .ops = &meson_clk_pcie_pll_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_xtal_hifipll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_fixed_factor a1_fclk_div2_div = {
+ÂÂÂ .mult = 1,
+ÂÂÂ .div = 2,
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div2_div",
+ÂÂÂÂÂÂÂ .ops = &clk_fixed_factor_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fixed_pll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_fclk_div2 = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂ .bit_idx = 21,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div2",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fclk_div2_div.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ /*
+ÂÂÂÂÂÂÂÂ * add CLK_IS_CRITICAL flag to avoid being disabled by clk core
+ÂÂÂÂÂÂÂÂ * or its children clocks.
+ÂÂÂÂÂÂÂÂ */

The meaning of this flag is already documented in clk-provider.h
The reason why you need this flag is lot more interesting here ...

Same below
ok, I will replace new comments here.

+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
+static struct clk_fixed_factor a1_fclk_div3_div = {
+ÂÂÂ .mult = 1,
+ÂÂÂ .div = 3,
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div3_div",
+ÂÂÂÂÂÂÂ .ops = &clk_fixed_factor_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fixed_pll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_fclk_div3 = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂ .bit_idx = 22,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div3",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fclk_div3_div.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ /*
+ÂÂÂÂÂÂÂÂ * add CLK_IS_CRITICAL flag to avoid being disabled by clk core
+ÂÂÂÂÂÂÂÂ * its children clocks.
+ÂÂÂÂÂÂÂÂ */
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
+static struct clk_fixed_factor a1_fclk_div5_div = {
+ÂÂÂ .mult = 1,
+ÂÂÂ .div = 5,
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div5_div",
+ÂÂÂÂÂÂÂ .ops = &clk_fixed_factor_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fixed_pll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_fclk_div5 = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂ .bit_idx = 23,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div5",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fclk_div5_div.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ /*
+ÂÂÂÂÂÂÂÂ * add CLK_IS_CRITICAL flag to avoid being disabled by clk core
+ÂÂÂÂÂÂÂÂ * its children clocks.
+ÂÂÂÂÂÂÂÂ */
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
+static struct clk_fixed_factor a1_fclk_div7_div = {
+ÂÂÂ .mult = 1,
+ÂÂÂ .div = 7,
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div7_div",
+ÂÂÂÂÂÂÂ .ops = &clk_fixed_factor_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fixed_pll.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂ },
+};
+
+static struct clk_regmap a1_fclk_div7 = {
+ÂÂÂ .data = &(struct clk_regmap_gate_data){
+ÂÂÂÂÂÂÂ .offset = ANACTRL_FIXPLL_CTRL0,
+ÂÂÂÂÂÂÂ .bit_idx = 23,
+ÂÂÂ },
+ÂÂÂ .hw.init = &(struct clk_init_data){
+ÂÂÂÂÂÂÂ .name = "fclk_div7",
+ÂÂÂÂÂÂÂ .ops = &clk_regmap_gate_ops,
+ÂÂÂÂÂÂÂ .parent_hws = (const struct clk_hw *[]) {
+ÂÂÂÂÂÂÂÂÂÂÂ &a1_fclk_div7_div.hw
+ÂÂÂÂÂÂÂ },
+ÂÂÂÂÂÂÂ .num_parents = 1,
+ÂÂÂÂÂÂÂ /*
+ÂÂÂÂÂÂÂÂ * add CLK_IS_CRITICAL flag to avoid being disabled by clk core
+ÂÂÂÂÂÂÂÂ * or its children clock.
+ÂÂÂÂÂÂÂÂ */
+ÂÂÂÂÂÂÂ .flags = CLK_IS_CRITICAL,
+ÂÂÂ },
+};
+
[...]
--
1.9.1

.


.