summaryrefslogtreecommitdiff
path: root/arch/arm/mach-rockchip/rk3288
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-17 15:23:16 -0600
committerSimon Glass <sjg@chromium.org>2016-07-25 20:46:45 -0600
commita617c5d3e2c22355ee9abc455bbb0b36e124a00a (patch)
treea9eb407a044c2b5c4f06e0812a33dfb5a9889cfd /arch/arm/mach-rockchip/rk3288
parentc57f806bf2e745c4273dc33c9827781cff46427c (diff)
downloadu-boot-imx-a617c5d3e2c22355ee9abc455bbb0b36e124a00a.zip
u-boot-imx-a617c5d3e2c22355ee9abc455bbb0b36e124a00a.tar.gz
u-boot-imx-a617c5d3e2c22355ee9abc455bbb0b36e124a00a.tar.bz2
rockchip: Add a way to obtain the main clock device
On Rockchip SoCs we typically have a main clock device that uses the Soc clock driver. There is also a fixed clock for the oscillator. Add a function to obtain the core clock. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/mach-rockchip/rk3288')
-rw-r--r--arch/arm/mach-rockchip/rk3288/Makefile1
-rw-r--r--arch/arm/mach-rockchip/rk3288/clk_rk3288.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3288/Makefile b/arch/arm/mach-rockchip/rk3288/Makefile
index 6f62375..82b00a1 100644
--- a/arch/arm/mach-rockchip/rk3288/Makefile
+++ b/arch/arm/mach-rockchip/rk3288/Makefile
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
+obj-y += clk_rk3288.o
obj-y += reset_rk3288.o
obj-y += sdram_rk3288.o
obj-y += syscon_rk3288.o
diff --git a/arch/arm/mach-rockchip/rk3288/clk_rk3288.c b/arch/arm/mach-rockchip/rk3288/clk_rk3288.c
new file mode 100644
index 0000000..2099e34
--- /dev/null
+++ b/arch/arm/mach-rockchip/rk3288/clk_rk3288.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch/clock.h>
+
+int rockchip_get_clk(struct udevice **devp)
+{
+ return uclass_get_device_by_driver(UCLASS_CLK,
+ DM_GET_DRIVER(rockchip_rk3288_cru), devp);
+}