1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2020 Stefan Roese <sr@denx.de>
6 #include <clk-uclass.h>
8 #include <asm/global_data.h>
9 #include <dt-bindings/clock/octeon-clock.h>
11 DECLARE_GLOBAL_DATA_PTR;
13 struct octeon_clk_priv {
18 static int octeon_clk_enable(struct clk *clk)
20 /* Nothing to do on Octeon */
24 static ulong octeon_clk_get_rate(struct clk *clk)
26 struct octeon_clk_priv *priv = dev_get_priv(clk->dev);
30 return priv->core_clk;
42 static struct clk_ops octeon_clk_ops = {
43 .enable = octeon_clk_enable,
44 .get_rate = octeon_clk_get_rate,
47 static const struct udevice_id octeon_clk_ids[] = {
48 { .compatible = "mrvl,octeon-clk" },
52 static int octeon_clk_probe(struct udevice *dev)
54 struct octeon_clk_priv *priv = dev_get_priv(dev);
57 * The clock values are already read into GD, lets just store them
60 priv->core_clk = gd->cpu_clk;
61 priv->io_clk = gd->bus_clk;
66 U_BOOT_DRIVER(clk_octeon) = {
69 .of_match = octeon_clk_ids,
70 .ops = &octeon_clk_ops,
71 .probe = octeon_clk_probe,
72 .priv_auto = sizeof(struct octeon_clk_priv),