From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 1/5] clk: mvebu: support for 98DX3236 SoC
Date: Thu, 5 Jan 2017 13:53:02 +0000 [thread overview]
Message-ID: <20170105135302.GB25333@leverpostej> (raw)
In-Reply-To: <20170105033641.6212-2-chris.packham@alliedtelesis.co.nz>
On Thu, Jan 05, 2017 at 04:36:37PM +1300, Chris Packham wrote:
> The 98DX3236, 98DX3336, 98DX4521 and variants have a different TCLK from
> the Armada XP (200MHz vs 250MHz). The CPU core clock is fixed at 800MHz.
>
> The clock gating options are a subset of those on the Armada XP.
>
> The core clock divider is different to the Armada XP also.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> Changes in v2:
> - Update devicetree binding documentation for new compatible string
>
> .../devicetree/bindings/clock/mvebu-cpu-clock.txt | 1 +
> drivers/clk/mvebu/Makefile | 2 +-
> drivers/clk/mvebu/armada-xp.c | 42 +++++
> drivers/clk/mvebu/clk-cpu.c | 33 +++-
> drivers/clk/mvebu/mv98dx3236-corediv.c | 207 +++++++++++++++++++++
> 5 files changed, 281 insertions(+), 4 deletions(-)
> create mode 100644 drivers/clk/mvebu/mv98dx3236-corediv.c
It looks like you also need to update
Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt for the
addition of "marvell,mv98dx3236-corediv-clock".
>
> diff --git a/Documentation/devicetree/bindings/clock/mvebu-cpu-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-cpu-clock.txt
> index 99c214660bdc..7f28506eaee7 100644
> --- a/Documentation/devicetree/bindings/clock/mvebu-cpu-clock.txt
> +++ b/Documentation/devicetree/bindings/clock/mvebu-cpu-clock.txt
> @@ -3,6 +3,7 @@ Device Tree Clock bindings for cpu clock of Marvell EBU platforms
> Required properties:
> - compatible : shall be one of the following:
> "marvell,armada-xp-cpu-clock" - cpu clocks for Armada XP
> + "marvell,mv98dx3236-cpu-clock" - cpu clocks for 98DX3236 SoC
> - reg : Address and length of the clock complex register set, followed
> by address and length of the PMU DFS registers
> - #clock-cells : should be set to 1.
[...]
> +static void __init mv98dx3236_corediv_clk_init(struct device_node *node)
> +{
> + struct clk_init_data init;
> + struct clk_corediv *corediv;
> + struct clk **clks;
> + void __iomem *base;
> + const __be32 *off;
> + const char *parent_name;
> + const char *clk_name;
> + int len;
> + struct device_node *dfx_node;
> +
> + dfx_node = of_parse_phandle(node, "base", 0);
> + if (WARN_ON(!dfx_node))
What's going on here? The existing bingings don't mention a "base"
phandle, and nothing was added to describe it.
> + return;
> +
> + off = of_get_property(node, "reg", &len);
> + if (WARN_ON(!off))
> + return;
Please don't use of_get_property directly; generally you should use the
existing higher-level helpers like of_proeprty_read_u32().
> +
> + base = of_iomap(dfx_node, 0);
> + if (WARN_ON(!base))
> + return;
> +
> + of_node_put(dfx_node);
> +
> + parent_name = of_clk_get_parent_name(node, 0);
> +
> + clk_data.clk_num = 1;
> +
> + /* clks holds the clock array */
> + clks = kcalloc(clk_data.clk_num, sizeof(struct clk *),
> + GFP_KERNEL);
> + if (WARN_ON(!clks))
> + goto err_unmap;
> + /* corediv holds the clock specific array */
> + corediv = kcalloc(clk_data.clk_num, sizeof(struct clk_corediv),
> + GFP_KERNEL);
> + if (WARN_ON(!corediv))
> + goto err_free_clks;
> +
> + spin_lock_init(&corediv->lock);
> +
> + of_property_read_string_index(node, "clock-output-names",
> + 0, &clk_name);
> +
> + init.num_parents = 1;
> + init.parent_names = &parent_name;
> + init.name = clk_name;
> + init.ops = &ops;
> + init.flags = 0;
> +
> + corediv[0].reg = (void *)((int)base + be32_to_cpu(*off));
I don't understand this, but I guess this has something to do with that
base phandle. Is the corediv clock a sub-component of some "base" clock?
I don't think this binding is the best way of describing that.
Thanks,
Mark.
next prev parent reply other threads:[~2017-01-05 13:53 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 3:36 [PATCHv2 0/5] Support for Marvell switches with integrated CPUs Chris Packham
2017-01-05 3:36 ` [PATCHv2 1/5] clk: mvebu: support for 98DX3236 SoC Chris Packham
2017-01-05 13:53 ` Mark Rutland [this message]
2017-01-05 23:05 ` Chris Packham
2017-01-05 3:36 ` [PATCHv2 2/5] arm: mvebu: support for SMP on 98DX3336 SoC Chris Packham
2017-01-05 4:04 ` Florian Fainelli
2017-01-05 4:46 ` Chris Packham
2017-01-05 20:49 ` Chris Packham
2017-01-05 3:36 ` [PATCHv2 3/5] pinctrl: mvebu: pinctrl driver for 98DX3236 SoC Chris Packham
2017-01-05 3:36 ` [PATCHv2 4/5] arm: mvebu: Add device tree for 98DX3236 SoCs Chris Packham
2017-01-05 4:06 ` Florian Fainelli
2017-01-05 4:34 ` Chris Packham
2017-01-05 13:58 ` Mark Rutland
2017-01-05 20:10 ` Chris Packham
2017-01-05 3:36 ` [PATCHv2 5/5] arm: mvebu: Add device tree for db-dxbc2 and db-xc3-24g4xg boards Chris Packham
2017-01-05 4:07 ` [PATCHv2 0/5] Support for Marvell switches with integrated CPUs Florian Fainelli
2017-01-05 4:24 ` Chris Packham
2017-01-05 13:09 ` Andrew Lunn
2017-01-05 14:07 ` Marcin Wojtas
2017-01-05 19:46 ` Chris Packham
2017-01-05 19:52 ` Florian Fainelli
2017-01-05 14:09 ` Marcin Wojtas
2017-01-05 20:02 ` Chris Packham
2017-01-06 4:14 ` Chris Packham
2017-01-06 4:14 ` [PATCHv3 1/5] clk: mvebu: support for 98DX3236 SoC Chris Packham
2017-01-09 18:39 ` Rob Herring
2017-01-06 4:14 ` [PATCHv3 2/5] arm: mvebu: support for SMP on 98DX3336 SoC Chris Packham
2017-01-06 6:36 ` Stephen Boyd
2017-01-06 8:41 ` Chris Packham
2017-01-09 18:40 ` Rob Herring
2017-01-06 4:15 ` [PATCHv3 3/5] pinctrl: mvebu: pinctrl driver for 98DX3236 SoC Chris Packham
2017-01-09 18:41 ` Rob Herring
2017-01-11 14:44 ` Linus Walleij
2017-01-11 20:55 ` Sebastian Hesselbarth
2017-01-12 9:13 ` Chris Packham
2017-01-06 4:15 ` [PATCHv3 4/5] arm: mvebu: Add device tree for 98DX3236 SoCs Chris Packham
2017-01-09 18:44 ` Rob Herring
2017-01-26 15:09 ` Gregory CLEMENT
2017-01-26 20:07 ` Chris Packham
2017-01-26 20:24 ` Chris Packham
2017-01-26 22:52 ` Chris Packham
2017-01-06 4:15 ` [PATCHv3 5/5] arm: mvebu: Add device tree for db-dxbc2 and db-xc3-24g4xg boards Chris Packham
2017-01-26 15:12 ` Gregory CLEMENT
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170105135302.GB25333@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox