diff options
author | Tom Rini <trini@konsulko.com> | 2015-09-03 18:57:09 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-09-03 18:57:09 (GMT) |
commit | c9feb427aba860ebc79f9851a1bb49cc456a2d48 (patch) | |
tree | 6a80def1806386e2854d57f740264c6744d96e1d /arch/arm/mach-rockchip/common.c | |
parent | da9d8580ff9ce17452ef931072e5799a9df8807f (diff) | |
parent | f2acc55e3d28e96a6fcc060a7081eb4e2ad96350 (diff) | |
download | u-boot-fsl-qoriq-c9feb427aba860ebc79f9851a1bb49cc456a2d48.tar.xz |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'arch/arm/mach-rockchip/common.c')
-rw-r--r-- | arch/arm/mach-rockchip/common.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/common.c b/arch/arm/mach-rockchip/common.c new file mode 100644 index 0000000..fc7ac72 --- /dev/null +++ b/arch/arm/mach-rockchip/common.c @@ -0,0 +1,28 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> +#include <linux/err.h> + +void *rockchip_get_cru(void) +{ + struct udevice *dev; + fdt_addr_t addr; + int ret; + + ret = uclass_get_device(UCLASS_CLK, 0, &dev); + if (ret) + return ERR_PTR(ret); + + addr = dev_get_addr(dev); + if (addr == FDT_ADDR_T_NONE) + return ERR_PTR(-EINVAL); + + return (void *)addr; +} |