blob: 6d3d46a184474be04b4b50a101fe47b98251cbb6 [file] [log] [blame]
Michal Simek08d0d6f2013-11-21 13:39:02 -08001/*
2 * Copyright (C) 2013 Xilinx, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#include <common.h>
7#include <command.h>
8#include <clk.h>
9
10int __weak soc_clk_dump(void)
11{
12 puts("Not implemented\n");
13 return 1;
14}
15
16static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc,
17 char *const argv[])
18{
19 return soc_clk_dump();
20}
21
22static cmd_tbl_t cmd_clk_sub[] = {
23 U_BOOT_CMD_MKENT(dump, 1, 1, do_clk_dump, "", ""),
24};
25
26static int do_clk(cmd_tbl_t *cmdtp, int flag, int argc,
27 char *const argv[])
28{
29 cmd_tbl_t *c;
30
31 if (argc < 2)
32 return CMD_RET_USAGE;
33
34 /* Strip off leading 'clk' command argument */
35 argc--;
36 argv++;
37
38 c = find_cmd_tbl(argv[0], &cmd_clk_sub[0], ARRAY_SIZE(cmd_clk_sub));
39
40 if (c)
41 return c->cmd(cmdtp, flag, argc, argv);
42 else
43 return CMD_RET_USAGE;
44}
45
46#ifdef CONFIG_SYS_LONGHELP
47static char clk_help_text[] =
48 "dump - Print clock frequencies";
49#endif
50
51U_BOOT_CMD(clk, 2, 1, do_clk, "CLK sub-system", clk_help_text);