summaryrefslogtreecommitdiff
path: root/arch/arm/mach-rockchip/rk3128
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2017-11-28 16:04:17 +0800
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-11-30 22:55:26 +0100
commit9246d9e54194c3aab917bf4243f7e190dfd4b1fb (patch)
treec3d4e989d27f40ee231f00a9339cd6997f0b3e14 /arch/arm/mach-rockchip/rk3128
parentdaeed1dbb5026de081298d1e39c290625d71f137 (diff)
downloadu-boot-9246d9e54194c3aab917bf4243f7e190dfd4b1fb.tar.gz
u-boot-9246d9e54194c3aab917bf4243f7e190dfd4b1fb.tar.bz2
u-boot-9246d9e54194c3aab917bf4243f7e190dfd4b1fb.zip
rockchip: rk3128: add clock driver
Add rk3128 clock driver and cru structure definition. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'arch/arm/mach-rockchip/rk3128')
-rw-r--r--arch/arm/mach-rockchip/rk3128/Makefile1
-rw-r--r--arch/arm/mach-rockchip/rk3128/clk_rk3128.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3128/Makefile b/arch/arm/mach-rockchip/rk3128/Makefile
index 0f63d921de..50e1117542 100644
--- a/arch/arm/mach-rockchip/rk3128/Makefile
+++ b/arch/arm/mach-rockchip/rk3128/Makefile
@@ -6,3 +6,4 @@
obj-y += rk3128.o
obj-y += syscon_rk3128.o
+obj-y += clk_rk3128.o
diff --git a/arch/arm/mach-rockchip/rk3128/clk_rk3128.c b/arch/arm/mach-rockchip/rk3128/clk_rk3128.c
new file mode 100644
index 0000000000..7ca5fd3484
--- /dev/null
+++ b/arch/arm/mach-rockchip/rk3128/clk_rk3128.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cru_rk3128.h>
+
+int rockchip_get_clk(struct udevice **devp)
+{
+ return uclass_get_device_by_driver(UCLASS_CLK,
+ DM_GET_DRIVER(rockchip_rk3128_cru), devp);
+}
+
+void *rockchip_get_cru(void)
+{
+ struct rk3128_clk_priv *priv;
+ struct udevice *dev;
+ int ret;
+
+ ret = rockchip_get_clk(&dev);
+ if (ret)
+ return ERR_PTR(ret);
+
+ priv = dev_get_priv(dev);
+
+ return priv->cru;
+}