aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-09-24 12:43:00 -0400
committerTom Rini <trini@konsulko.com>2023-09-24 12:43:00 -0400
commit90c81f407dd4a7747385b10f9b8f732202c45cde (patch)
treee7200b32d45c2754df3f9445a48b6d113d968a33
parent1e94b46f73cedcebbff73799203f3266c5b28d90 (diff)
parentae84514feee209091d331a8baaa344ed8d8e905b (diff)
downloadu-boot-90c81f407dd4a7747385b10f9b8f732202c45cde.zip
u-boot-90c81f407dd4a7747385b10f9b8f732202c45cde.tar.gz
u-boot-90c81f407dd4a7747385b10f9b8f732202c45cde.tar.bz2
Merge tag 'dm-next-23sep23' of https://source.denx.de/u-boot/custodians/u-boot-dm into nextWIP/24Sep2023
buildman file-keeping and build-progress improvements dm tree enhancement adjust meaning of bootph-pre-ram/sram
-rw-r--r--arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi2
-rw-r--r--cmd/dm.c48
-rw-r--r--doc/board/kontron/sl28.rst4
-rw-r--r--doc/usage/cmd/dm.rst30
-rw-r--r--drivers/core/dump.c116
-rw-r--r--drivers/core/ofnode.c2
-rw-r--r--include/dm/ofnode.h8
-rw-r--r--include/dm/util.h15
-rw-r--r--tools/buildman/boards.py15
-rw-r--r--tools/buildman/builder.py3
-rw-r--r--tools/buildman/builderthread.py12
-rw-r--r--tools/buildman/control.py3
12 files changed, 197 insertions, 61 deletions
diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
index 83750ab..aacf181 100644
--- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
+++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
@@ -64,7 +64,7 @@
&binman {
u-boot-update {
- filename = "u-boot.update";
+ filename = "u-boot-update.bin";
fit {
description = "FIT update image";
diff --git a/cmd/dm.c b/cmd/dm.c
index 3263547..1aa86aa 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -59,11 +59,26 @@ static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag,
static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- bool sort;
-
- sort = argc > 1 && !strcmp(argv[1], "-s");
-
- dm_dump_tree(sort);
+ bool extended = false, sort = false;
+ char *device = NULL;
+
+ for (; argc > 1; argc--, argv++) {
+ if (argv[1][0] != '-')
+ break;
+
+ if (!strcmp(argv[1], "-e")) {
+ extended = true;
+ } else if (!strcmp(argv[1], "-s")) {
+ sort = true;
+ } else {
+ printf("Unknown parameter: %s\n", argv[1]);
+ return 0;
+ }
+ }
+ if (argc > 1)
+ device = argv[1];
+
+ dm_dump_tree(device, extended, sort);
return 0;
}
@@ -71,7 +86,20 @@ static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc,
static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- dm_dump_uclass();
+ bool extended = false;
+ char *uclass = NULL;
+
+ if (argc > 1) {
+ if (!strcmp(argv[1], "-e")) {
+ extended = true;
+ argc--;
+ argv++;
+ }
+ if (argc > 1)
+ uclass = argv[1];
+ }
+
+ dm_dump_uclass(uclass, extended);
return 0;
}
@@ -91,8 +119,8 @@ static char dm_help_text[] =
"dm drivers Dump list of drivers with uclass and instances\n"
DM_MEM_HELP
"dm static Dump list of drivers with static platform data\n"
- "dm tree [-s] Dump tree of driver model devices (-s=sort)\n"
- "dm uclass Dump list of instances for each uclass"
+ "dm tree [-s][-e][name] Dump tree of driver model devices (-s=sort)\n"
+ "dm uclass [-e][name] Dump list of instances for each uclass"
;
#endif
@@ -102,5 +130,5 @@ U_BOOT_CMD_WITH_SUBCMDS(dm, "Driver model low level access", dm_help_text,
U_BOOT_SUBCMD_MKENT(drivers, 1, 1, do_dm_dump_drivers),
DM_MEM
U_BOOT_SUBCMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info),
- U_BOOT_SUBCMD_MKENT(tree, 2, 1, do_dm_dump_tree),
- U_BOOT_SUBCMD_MKENT(uclass, 1, 1, do_dm_dump_uclass));
+ U_BOOT_SUBCMD_MKENT(tree, 4, 1, do_dm_dump_tree),
+ U_BOOT_SUBCMD_MKENT(uclass, 3, 1, do_dm_dump_uclass));
diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst
index 44435d9..2cb8ec6 100644
--- a/doc/board/kontron/sl28.rst
+++ b/doc/board/kontron/sl28.rst
@@ -39,12 +39,12 @@ Update image
------------
After the build finished, there will be an update image called
-u-boot.update. This can either be used in the DFU mode (which isn't
+u-boot-update.bin. This can either be used in the DFU mode (which isn't
supported yet) or encapsulated in an EFI UpdateCapsule.
To build the capsule use the following command
- $ tools/mkeficapsule -f u-boot.update -i 1 UpdateUboot
+ $ tools/mkeficapsule -f u-boot-update.bin -i 1 UpdateUboot
Afterward you can copy this file to your ESP into the /EFI/UpdateCapsule/
folder. On the next EFI boot this will automatically update your
diff --git a/doc/usage/cmd/dm.rst b/doc/usage/cmd/dm.rst
index 74c6b01..12b7ede 100644
--- a/doc/usage/cmd/dm.rst
+++ b/doc/usage/cmd/dm.rst
@@ -12,8 +12,8 @@ Synopis
dm devres
dm drivers
dm static
- dm tree [-s]
- dm uclass
+ dm tree [-s][-e] [uclass name]
+ dm uclass [-e] [udevice name]
Description
-----------
@@ -127,6 +127,12 @@ If -s is given, the top-level devices (those which are children of the root
device) are shown sorted in order of uclass ID, so it is easier to find a
particular device type.
+If -e is given, forward-matching against existing devices is
+made and only the matched devices are shown.
+
+If a device name is given, forward-matching against existing devices is
+made and only the matched devices are shown.
+
dm uclass
~~~~~~~~~
@@ -140,6 +146,11 @@ For each device, the format is::
where `n` is the index within the uclass, `a` is the address of the device in
memory and `s` is the sequence number of the device.
+If -e is given, forward-matching against existing uclasses is
+made and only the matched uclasses are shown.
+
+If no uclass name is given, all the uclasses are shown.
+
Examples
--------
@@ -409,6 +420,15 @@ This example shows the abridged sandbox output::
nop 8 [ ] scmi_voltage_domain `-- regulators
regulator 5 [ ] scmi_regulator |-- reg@0
regulator 6 [ ] scmi_regulator `-- reg@1
+ => dm tree pinc
+ pinctrl 0 [ + ] sandbox_pinctrl_gpio pinctrl-gpio
+ gpio 1 [ + ] sandbox_gpio |-- base-gpios
+ nop 0 [ + ] gpio_hog | |-- hog_input_active_low
+ nop 1 [ + ] gpio_hog | |-- hog_input_active_high
+ nop 2 [ + ] gpio_hog | |-- hog_output_low
+ nop 3 [ + ] gpio_hog | `-- hog_output_high
+ gpio 2 [ ] sandbox_gpio |-- extra-gpios
+ gpio 3 [ ] sandbox_gpio `-- pinmux-gpios
=>
@@ -487,4 +507,10 @@ This example shows the abridged sandbox output::
0 * gpio-wdt @ 0301c070, seq 0
1 * wdt@0 @ 03021710, seq 1
+ => dm uclass blk
+ uclass 22: blk
+ 0 mmc2.blk @ 0301ca00, seq 0
+ 1 mmc1.blk @ 0301cee0, seq 1
+ 2 mmc0.blk @ 0301d380, seq 2
+
=>
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index 3e77832..4023b39 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -85,29 +85,65 @@ static void show_devices(struct udevice *dev, int depth, int last_flag,
}
}
-void dm_dump_tree(bool sort)
+static void dm_dump_tree_single(struct udevice *dev, bool sort)
{
- struct udevice *root;
+ int dev_count, uclasses;
+ struct udevice **devs = NULL;
- root = dm_root();
- if (root) {
- int dev_count, uclasses;
- struct udevice **devs = NULL;
-
- dm_get_stats(&dev_count, &uclasses);
-
- printf(" Class Index Probed Driver Name\n");
- printf("-----------------------------------------------------------\n");
- if (sort) {
- devs = calloc(dev_count, sizeof(struct udevice *));
- if (!devs) {
- printf("(out of memory)\n");
- return;
+ dm_get_stats(&dev_count, &uclasses);
+
+ if (sort) {
+ devs = calloc(dev_count, sizeof(struct udevice *));
+ if (!devs) {
+ printf("(out of memory)\n");
+ return;
+ }
+ }
+ show_devices(dev, -1, 0, devs);
+ free(devs);
+}
+
+static void dm_dump_tree_recursive(struct udevice *dev, char *dev_name,
+ bool extended, bool sort)
+{
+ struct udevice *child;
+ size_t len;
+
+ len = strlen(dev_name);
+
+ device_foreach_child(child, dev) {
+ if (extended) {
+ if (!strncmp(child->name, dev_name, len)) {
+ dm_dump_tree_single(child, sort);
+ continue;
+ }
+ } else {
+ if (!strcmp(child->name, dev_name)) {
+ dm_dump_tree_single(child, sort);
+ continue;
}
}
- show_devices(root, -1, 0, devs);
- free(devs);
+ dm_dump_tree_recursive(child, dev_name, extended, sort);
+ }
+}
+
+void dm_dump_tree(char *dev_name, bool extended, bool sort)
+{
+ struct udevice *root;
+
+ printf(" Class Index Probed Driver Name\n");
+ printf("-----------------------------------------------------------\n");
+
+ root = dm_root();
+ if (!root)
+ return;
+
+ if (!dev_name || !strcmp(dev_name, "root")) {
+ dm_dump_tree_single(root, sort);
+ return;
}
+
+ dm_dump_tree_recursive(root, dev_name, extended, sort);
}
/**
@@ -127,26 +163,50 @@ static void dm_display_line(struct udevice *dev, int index)
puts("\n");
}
-void dm_dump_uclass(void)
+static void dm_dump_uclass_single(enum uclass_id id)
{
struct uclass *uc;
+ struct udevice *dev;
+ int i = 0, ret;
+
+ ret = uclass_get(id, &uc);
+ if (ret)
+ return;
+
+ printf("uclass %d: %s\n", id, uc->uc_drv->name);
+ uclass_foreach_dev(dev, uc) {
+ dm_display_line(dev, i);
+ i++;
+ }
+ puts("\n");
+}
+
+void dm_dump_uclass(char *uclass, bool extended)
+{
+ struct uclass *uc;
+ enum uclass_id id;
+ bool matching;
int ret;
- int id;
- for (id = 0; id < UCLASS_COUNT; id++) {
- struct udevice *dev;
- int i = 0;
+ matching = !!(uclass && strcmp(uclass, "root"));
+ for (id = 0; id < UCLASS_COUNT; id++) {
ret = uclass_get(id, &uc);
if (ret)
continue;
- printf("uclass %d: %s\n", id, uc->uc_drv->name);
- uclass_foreach_dev(dev, uc) {
- dm_display_line(dev, i);
- i++;
+ if (matching) {
+ if (extended) {
+ if (!strncmp(uc->uc_drv->name, uclass,
+ strlen(uclass)))
+ dm_dump_uclass_single(id);
+ } else {
+ if (!strcmp(uc->uc_drv->name, uclass))
+ dm_dump_uclass_single(id);
+ }
+ } else {
+ dm_dump_uclass_single(id);
}
- puts("\n");
}
}
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index ff0a5b5..2cafa7b 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -1383,7 +1383,7 @@ bool ofnode_pre_reloc(ofnode node)
*/
if (ofnode_read_bool(node, "bootph-pre-ram") ||
ofnode_read_bool(node, "bootph-pre-sram"))
- return true;
+ return gd->flags & GD_FLG_RELOC;
if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) {
/* detect and handle old tags */
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 06ea68e..06c969c 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -1211,15 +1211,15 @@ int ofnode_read_simple_size_cells(ofnode node);
* determine if a node was bound in one of SPL/TPL stages.
*
* There are 4 settings currently in use
- * - bootph-some-ram: U-Boot proper pre-relocation only
+ * - bootph-some-ram: U-Boot proper pre-relocation phase
* - bootph-all: all phases
* Existing platforms only use it to indicate nodes needed in
* SPL. Should probably be replaced by bootph-pre-ram for new platforms.
- * - bootph-pre-ram: SPL and U-Boot pre-relocation
- * - bootph-pre-sram: TPL and U-Boot pre-relocation
+ * - bootph-pre-ram: SPL phase
+ * - bootph-pre-sram: TPL phase
*
* @node: node to check
- * Return: true if node is needed in SPL/TL, false otherwise
+ * Return: true if node should be or was bound, false otherwise
*/
bool ofnode_pre_reloc(ofnode node);
diff --git a/include/dm/util.h b/include/dm/util.h
index 4bb49e9..89206cc 100644
--- a/include/dm/util.h
+++ b/include/dm/util.h
@@ -27,14 +27,21 @@ struct list_head;
int list_count_items(struct list_head *head);
/**
- * Dump out a tree of all devices
+ * Dump out a tree of all devices starting @uclass
*
+ * @dev_name: udevice name
+ * @extended: true if forword-matching expected
* @sort: Sort by uclass name
*/
-void dm_dump_tree(bool sort);
+void dm_dump_tree(char *dev_name, bool extended, bool sort);
-/* Dump out a list of uclasses and their devices */
-void dm_dump_uclass(void);
+/*
+ * Dump out a list of uclasses and their devices
+ *
+ * @uclass: uclass name
+ * @extended: true if forword-matching expected
+ */
+void dm_dump_uclass(char *uclass, bool extended);
#ifdef CONFIG_DEBUG_DEVRES
/* Dump out a list of device resources */
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index eef3f19..341a505 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -19,6 +19,7 @@ import time
from buildman import board
from buildman import kconfiglib
+from u_boot_pylib.terminal import print_clear, tprint
### constant variables ###
OUTPUT_FILE = 'boards.cfg'
@@ -863,11 +864,19 @@ class Boards:
Returns:
bool: True if all is well, False if there were warnings
"""
- if not force and output_is_new(output, CONFIG_DIR, '.'):
+ if not force:
if not quiet:
- print(f'{output} is up to date. Nothing to do.')
- return True
+ tprint('\rChecking for Kconfig changes...', newline=False)
+ is_new = output_is_new(output, CONFIG_DIR, '.')
+ print_clear()
+ if is_new:
+ if not quiet:
+ print(f'{output} is up to date. Nothing to do.')
+ return True
+ if not quiet:
+ tprint('\rGenerating board list...', newline=False)
params_list, warnings = self.build_board_list(CONFIG_DIR, '.', jobs)
+ print_clear()
for warn in warnings:
print(warn, file=sys.stderr)
self.format_and_output(params_list, output)
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index ecbd368..5305477 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -328,7 +328,7 @@ class Builder:
self._build_period_us = None
self._complete_delay = None
self._next_delay_update = datetime.now()
- self._start_time = datetime.now()
+ self._start_time = None
self._step = step
self._error_lines = 0
self.no_subdirs = no_subdirs
@@ -1778,6 +1778,7 @@ class Builder:
self._prepare_output_space()
if not self._ide:
tprint('\rStarting build...', newline=False)
+ self._start_time = datetime.now()
self.setup_build(board_selected, commits)
self.process_result(None)
self.thread_exceptions = []
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 25f460c..6a61f64 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -23,6 +23,9 @@ from u_boot_pylib import command
RETURN_CODE_RETRY = -1
BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl']
+# Common extensions for images
+COMMON_EXTS = ['.bin', '.rom', '.itb', '.img']
+
def mkdir(dirname, parents=False):
"""Make a directory if it doesn't already exist.
@@ -636,10 +639,11 @@ class BuilderThread(threading.Thread):
# Now write the actual build output
if keep_outputs:
- copy_files(
- result.out_dir, build_dir, '',
- ['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL',
- 'include/autoconf.mk', 'spl/u-boot-spl*'])
+ to_copy = ['u-boot*', '*.map', 'MLO', 'SPL',
+ 'include/autoconf.mk', 'spl/u-boot-spl*',
+ 'tpl/u-boot-tpl*', 'vpl/u-boot-vpl*']
+ to_copy += [f'*{ext}' for ext in COMMON_EXTS]
+ copy_files(result.out_dir, build_dir, '', to_copy)
def _send_result(self, result):
"""Send a result to the builder for processing
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index f2ffb7f..8f6850c 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -621,7 +621,8 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None,
if not brds:
brds = get_boards_obj(output_dir, args.regen_board_list,
args.maintainer_check, args.full_check,
- args.threads, args.verbose)
+ args.threads, args.verbose and
+ not args.print_arch and not args.print_prefix)
if isinstance(brds, int):
return brds