From: Simon Glass Date: Fri, 22 Jan 2016 02:45:07 +0000 (-0700) Subject: rockchip: Add a simple 'clock' command X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=74e53e0e9b7cf78a7e896cf6626f0ca607da5872;p=u-boot.git rockchip: Add a simple 'clock' command Add a command that displays the PLLs and their current rate. Signed-off-by: Simon Glass --- diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index 380aa91a28..133d66341b 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -49,3 +50,26 @@ void enable_caches(void) void lowlevel_init(void) { } + +static int do_clock(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + struct udevice *dev; + + for (uclass_first_device(UCLASS_CLK, &dev); + dev; + uclass_next_device(&dev)) { + ulong rate; + + rate = clk_get_rate(dev); + printf("%s: %lu\n", dev->name, rate); + } + + return 0; +} + +U_BOOT_CMD( + clock, 2, 1, do_clock, + "display information about clocks", + "" +);