From 5c006e7cb345d2e9c44de143a88c2cd37d5a9cc9 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 17 Jan 2023 11:44:45 +0100 Subject: cmd: event: Remove additional event description The first name is taken from command name that's why shouldn't be listed in help. The similar change was also done by commit a84d3b6c5634 ("cmd: pwm: Remove additional pwm description"). Also remove additional spaces in help message. Before: event event list - list event spies After: event list - list event spies Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- cmd/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/event.c b/cmd/event.c index 9cac2023530..b4b779ffac0 100644 --- a/cmd/event.c +++ b/cmd/event.c @@ -20,7 +20,7 @@ static int do_event_list(struct cmd_tbl *cmdtp, int flag, int argc, #ifdef CONFIG_SYS_LONGHELP static char event_help_text[] = - "event list - list event spies"; + "list - list event spies"; #endif U_BOOT_CMD_WITH_SUBCMDS(event, "Events", event_help_text, -- cgit v1.2.3 From 448e2b6327d0498d58506d6f4e4b2a325ab7cca0 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 16 Jan 2023 15:46:49 -0500 Subject: event: Correct dependencies on the EVENT framework The event framework is just that, a framework. Enabling it by itself does nothing, so we shouldn't ask the user about it. Reword (and correct typos) around this the option and help text. This also applies to DM_EVENT and EVENT_DYNAMIC. Only EVENT_DEBUG and CMD_EVENT should be visible to the user to select, when EVENT is selected. With this, it's time to address the larger problems. When functionality uses events, typically via EVENT_SPY, the appropriate framework then must be select'd and NOT imply'd. As the functionality will cease to work (and so, platforms will fail to boot) this is non-optional and where select is appropriate. Audit the current users of EVENT_SPY to have a more fine-grained approach to select'ing the framework where used. Also ensure the current users of event_register and also select EVENT_DYNAMIC. Cc: AKASHI Takahiro Cc: Heinrich Schuchardt Reported-by: Oliver Graute Reported-by: Francesco Dolcini Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events") Fixes: 42fdcebf859f ("event: Convert misc_init_f() to use events") Fixes: c5ef2025579e ("dm: fix DM_EVENT dependencies") Signed-off-by: Tom Rini Tested-by: Simon Glass Reviewed-by: Simon Glass Reviewed-by: Fabio Estevam --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd') diff --git a/cmd/Kconfig b/cmd/Kconfig index b2aefae9cb7..4fe2c75de25 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2622,6 +2622,7 @@ config CMD_DIAG config CMD_EVENT bool "event - Show information about events" + depends on EVENT default y if EVENT_DEBUG help This enables the 'event' command which provides information about -- cgit v1.2.3 From 22e7f1d108410cc81a0ec5a6481338e4d6e9586e Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Tue, 10 Jan 2023 17:19:34 +0100 Subject: cmd: part: Add partition-related type command This implements the following command: part type mmc 0:1 -> print partition type UUID part type mmc 0:1 uuid -> set environment variable to partition type UUID "part type" can be useful when writing a bootcmd which searches for a specific partition type to enable automatic discovery of partitions and their intended usage or mount point. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Simon Glass [trini: Fix when CONFIG_PARTITION_TYPE_GUID is disabled and have the command check for "types" before "type"] Signed-off-by: Tom Rini --- cmd/part.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'cmd') diff --git a/cmd/part.c b/cmd/part.c index 9d419c967cb..28f2b7ff9bb 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -182,6 +182,31 @@ static int do_part_number(int argc, char *const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); } +#ifdef CONFIG_PARTITION_TYPE_GUID +static int do_part_type(int argc, char *const argv[]) +{ + int part; + struct blk_desc *dev_desc; + struct disk_partition info; + + if (argc < 2) + return CMD_RET_USAGE; + if (argc > 3) + return CMD_RET_USAGE; + + part = blk_get_device_part_str(argv[0], argv[1], &dev_desc, &info, 0); + if (part < 0) + return 1; + + if (argc > 2) + env_set(argv[2], info.type_guid); + else + printf("%s\n", info.type_guid); + + return 0; +} +#endif + static int do_part_types(int argc, char * const argv[]) { struct part_driver *drv = ll_entry_start(struct part_driver, @@ -220,6 +245,10 @@ static int do_part(struct cmd_tbl *cmdtp, int flag, int argc, return do_part_number(argc - 2, argv + 2); else if (!strcmp(argv[1], "types")) return do_part_types(argc - 2, argv + 2); +#ifdef CONFIG_PARTITION_TYPE_GUID + else if (!strcmp(argv[1], "type")) + return do_part_type(argc - 2, argv + 2); +#endif return CMD_RET_USAGE; } @@ -244,6 +273,12 @@ U_BOOT_CMD( "part number \n" " - set environment variable to the partition number using the partition name\n" " part must be specified as partition name\n" +#ifdef CONFIG_PARTITION_TYPE_GUID + "part type :\n" + " - print partition type\n" +#endif + "part type : \n" + " - set environment variable to partition type\n" "part types\n" " - list supported partition table types" ); -- cgit v1.2.3