2018-05-07 05:58:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-02-27 06:59:22 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013 Google, Inc
|
|
|
|
*
|
|
|
|
* (C) Copyright 2012
|
|
|
|
* Marek Vasut <marex@denx.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2015-12-07 21:23:29 +08:00
|
|
|
#include <command.h>
|
2015-06-24 05:38:35 +08:00
|
|
|
#include <dm/util.h>
|
2014-11-29 16:01:56 +08:00
|
|
|
|
2020-05-11 01:40:03 +08:00
|
|
|
static int do_dm_dump_all(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2014-11-29 16:01:56 +08:00
|
|
|
{
|
2015-06-24 05:38:35 +08:00
|
|
|
dm_dump_all();
|
2014-11-29 16:01:56 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-05-11 01:40:03 +08:00
|
|
|
static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2014-02-27 06:59:22 +08:00
|
|
|
{
|
2015-06-24 05:38:35 +08:00
|
|
|
dm_dump_uclass();
|
2014-02-27 06:59:22 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-05-11 01:40:03 +08:00
|
|
|
static int do_dm_dump_devres(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2015-07-25 20:52:38 +08:00
|
|
|
{
|
|
|
|
dm_dump_devres();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-05-11 01:40:03 +08:00
|
|
|
static int do_dm_dump_drivers(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2020-01-18 03:48:09 +08:00
|
|
|
{
|
|
|
|
dm_dump_drivers();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-24 23:17:05 +08:00
|
|
|
static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char * const argv[])
|
|
|
|
{
|
|
|
|
dm_dump_driver_compat();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char * const argv[])
|
|
|
|
{
|
|
|
|
dm_dump_static_driver_info();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-05-08 18:01:42 +08:00
|
|
|
#if CONFIG_IS_ENABLED(SYS_LONGHELP)
|
|
|
|
static char dm_help_text[] =
|
2018-09-07 19:31:21 +08:00
|
|
|
"tree Dump driver model tree ('*' = activated)\n"
|
2015-07-25 20:52:38 +08:00
|
|
|
"dm uclass Dump list of instances for each uclass\n"
|
2020-01-18 03:48:09 +08:00
|
|
|
"dm devres Dump list of device resources for each device\n"
|
2020-03-24 23:17:05 +08:00
|
|
|
"dm drivers Dump list of drivers with uclass and instances\n"
|
|
|
|
"dm compat Dump list of drivers with compatibility strings\n"
|
|
|
|
"dm static Dump list of drivers with static platform data"
|
2022-05-08 18:01:42 +08:00
|
|
|
;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
U_BOOT_CMD_WITH_SUBCMDS(dm, "Driver model low level access", dm_help_text,
|
|
|
|
U_BOOT_SUBCMD_MKENT(tree, 1, 1, do_dm_dump_all),
|
|
|
|
U_BOOT_SUBCMD_MKENT(uclass, 1, 1, do_dm_dump_uclass),
|
|
|
|
U_BOOT_SUBCMD_MKENT(devres, 1, 1, do_dm_dump_devres),
|
|
|
|
U_BOOT_SUBCMD_MKENT(drivers, 1, 1, do_dm_dump_drivers),
|
|
|
|
U_BOOT_SUBCMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat),
|
|
|
|
U_BOOT_SUBCMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info));
|