diff options
author | Tom Rini <trini@konsulko.com> | 2023-05-04 11:49:30 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-05-04 11:49:30 -0400 |
commit | 7f30eec1779b8f641b9563a1dab6a6865916ec01 (patch) | |
tree | 9d0b296416d6820d45cfa24bdebe1ef81ef44b1c | |
parent | bfce695104d59a8570ce0a7cbd75d3728117eb5d (diff) | |
parent | 0d734df4a459f01fdf1e62512fb28b28022cb6a9 (diff) |
Merge branch '2023-05-03-assorted-updates-and-fixes'
- Various typo fixes, pass -Werror to host tools builds, bdi cleanups,
fix hush and local variables, a FSL PCI fix and correct some python in
one of the tests.
-rw-r--r-- | boot/Kconfig | 2 | ||||
-rw-r--r-- | cmd/bdinfo.c | 33 | ||||
-rw-r--r-- | common/Kconfig | 2 | ||||
-rw-r--r-- | common/cli_hush.c | 8 | ||||
-rw-r--r-- | configs/bk4r1_defconfig | 1 | ||||
-rw-r--r-- | doc/develop/event.rst | 2 | ||||
-rw-r--r-- | drivers/pci/pcie_fsl.c | 14 | ||||
-rw-r--r-- | test/py/tests/test_hush_if_test.py | 13 | ||||
-rw-r--r-- | tools/buildman/builderthread.py | 1 |
9 files changed, 59 insertions, 17 deletions
diff --git a/boot/Kconfig b/boot/Kconfig index d95a2a702665..8c27f52ec3ed 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -231,7 +231,7 @@ config SPL_LOAD_FIT_APPLY_OVERLAY depends on SPL_LOAD_FIT select OF_LIBFDT_OVERLAY help - The device tree is loaded from the FIT image. Allow the SPL is to + The device tree is loaded from the FIT image. Allow the SPL to also load device-tree overlays from the FIT image an apply them over the device tree. diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index f709904c5167..365357ca545f 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -11,6 +11,7 @@ #include <dm.h> #include <env.h> #include <lmb.h> +#include <mapmem.h> #include <net.h> #include <video.h> #include <vsprintf.h> @@ -41,17 +42,26 @@ void bdinfo_print_num_ll(const char *name, unsigned long long value) printf("%-12s= 0x%.*llx\n", name, 2 * (int)sizeof(ulong), value); } -static void print_eth(int idx) +static void print_eth(void) { - char name[10], *val; + const int idx = eth_get_dev_index(); + uchar enetaddr[6]; + char name[10]; + int ret; + if (idx) sprintf(name, "eth%iaddr", idx); else strcpy(name, "ethaddr"); - val = env_get(name); - if (!val) - val = "(not set)"; - printf("%-12s= %s\n", name, val); + + ret = eth_env_get_enetaddr_by_index("eth", idx, enetaddr); + + printf("current eth = %s\n", eth_get_name()); + if (!ret) + printf("%-12s= (not set)\n", name); + else + printf("%-12s= %pM\n", name, enetaddr); + printf("IP addr = %s\n", env_get("ipaddr")); } void bdinfo_print_mhz(const char *name, unsigned long hz) @@ -123,13 +133,10 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) bdinfo_print_num_l("relocaddr", gd->relocaddr); bdinfo_print_num_l("reloc off", gd->reloc_off); printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8); - if (IS_ENABLED(CONFIG_CMD_NET)) { - printf("current eth = %s\n", eth_get_name()); - print_eth(0); - printf("IP addr = %s\n", env_get("ipaddr")); - } - bdinfo_print_num_l("fdt_blob", (ulong)gd->fdt_blob); - bdinfo_print_num_l("new_fdt", (ulong)gd->new_fdt); + if (IS_ENABLED(CONFIG_CMD_NET)) + print_eth(); + bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob)); + bdinfo_print_num_l("new_fdt", (ulong)map_to_sysmem(gd->new_fdt)); bdinfo_print_num_l("fdt_size", (ulong)gd->fdt_size); if (IS_ENABLED(CONFIG_VIDEO)) show_video_info(); diff --git a/common/Kconfig b/common/Kconfig index 6345d5c4bae2..a19d82f8d92c 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -626,7 +626,7 @@ config EVENT_DEBUG bool "Enable event debugging assistance" default y if SANDBOX help - Enable this get usefui features for seeing what is happening with + Enable this to get useful features for seeing what is happening with events, such as event-type names. This adds to the code size of U-Boot so can be turned off for production builds. diff --git a/common/cli_hush.c b/common/cli_hush.c index 1ad7a509dfa8..171069f5f49b 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -2171,12 +2171,18 @@ int set_local_var(const char *s, int flg_export) * NAME=VALUE format. So the first order of business is to * split 's' on the '=' into 'name' and 'value' */ value = strchr(name, '='); - if (value == NULL || *(value + 1) == 0) { + if (!value) { free(name); return -1; } *value++ = 0; + if (!*value) { + unset_local_var(name); + free(name); + return 0; + } + for(cur = top_vars; cur; cur = cur->next) { if(strcmp(cur->name, name)==0) break; diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig index 66adeac725ce..95f0c30cde63 100644 --- a/configs/bk4r1_defconfig +++ b/configs/bk4r1_defconfig @@ -18,6 +18,7 @@ CONFIG_TARGET_BK4R1=y CONFIG_SYS_LOAD_ADDR=0x82000000 CONFIG_SYS_MEMTEST_START=0x80010000 CONFIG_SYS_MEMTEST_END=0x87c00000 +CONFIG_LTO=y CONFIG_HAS_BOARD_SIZE_LIMIT=y CONFIG_BOARD_SIZE_LIMIT=520192 CONFIG_FIT=y diff --git a/doc/develop/event.rst b/doc/develop/event.rst index 4ff593483715..e60cbf65691e 100644 --- a/doc/develop/event.rst +++ b/doc/develop/event.rst @@ -12,7 +12,7 @@ Rather than using weak functions and direct calls across subsystemss, it is often easier to use an event. An event consists of a type (e.g. EVT_DM_POST_INIT) and some optional data, -in `union event_data`. An event spy can be creasted to watch for events of a +in `union event_data`. An event spy can be created to watch for events of a particular type. When the event is created, it is sent to each spy in turn. diff --git a/drivers/pci/pcie_fsl.c b/drivers/pci/pcie_fsl.c index 4600652f2b1b..8d89a1e5919c 100644 --- a/drivers/pci/pcie_fsl.c +++ b/drivers/pci/pcie_fsl.c @@ -58,6 +58,14 @@ static int fsl_pcie_read_config(const struct udevice *bus, pci_dev_t bdf, return 0; } + /* Skip Freescale PCIe controller's PEXCSRBAR register */ + if (PCI_BUS(bdf) - dev_seq(bus) == 0 && + PCI_DEV(bdf) == 0 && PCI_FUNC(bdf) == 0 && + (offset & ~3) == PCI_BASE_ADDRESS_0) { + *valuep = 0; + return 0; + } + val = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf) - dev_seq(bus), PCI_DEV(bdf), PCI_FUNC(bdf), offset); @@ -95,6 +103,12 @@ static int fsl_pcie_write_config(struct udevice *bus, pci_dev_t bdf, if (fsl_pcie_addr_valid(pcie, bdf)) return 0; + /* Skip Freescale PCIe controller's PEXCSRBAR register */ + if (PCI_BUS(bdf) - dev_seq(bus) == 0 && + PCI_DEV(bdf) == 0 && PCI_FUNC(bdf) == 0 && + (offset & ~3) == PCI_BASE_ADDRESS_0) + return 0; + val = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf) - dev_seq(bus), PCI_DEV(bdf), PCI_FUNC(bdf), offset); diff --git a/test/py/tests/test_hush_if_test.py b/test/py/tests/test_hush_if_test.py index 37c1608bb229..3b4b6fcaf405 100644 --- a/test/py/tests/test_hush_if_test.py +++ b/test/py/tests/test_hush_if_test.py @@ -182,3 +182,16 @@ def test_hush_if_test_host_file_exists(u_boot_console): expr = 'test -e hostfs - ' + test_file exec_hush_if(u_boot_console, expr, False) + +def test_hush_var(u_boot_console): + """Test the set and unset of variables""" + u_boot_console.run_command('ut_var_nonexistent=') + u_boot_console.run_command('ut_var_exists=1') + u_boot_console.run_command('ut_var_unset=1') + exec_hush_if(u_boot_console, 'test -z "$ut_var_nonexistent"', True) + exec_hush_if(u_boot_console, 'test -z "$ut_var_exists"', False) + exec_hush_if(u_boot_console, 'test -z "$ut_var_unset"', False) + exec_hush_if(u_boot_console, 'ut_var_unset=', True) + exec_hush_if(u_boot_console, 'test -z "$ut_var_unset"', True) + u_boot_console.run_command('ut_var_exists=') + u_boot_console.run_command('ut_var_unset=') diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 879ff138ad75..635865c21c85 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -253,6 +253,7 @@ class BuilderThread(threading.Thread): args.extend(['-j', str(self.builder.num_jobs)]) if self.builder.warnings_as_errors: args.append('KCFLAGS=-Werror') + args.append('HOSTCFLAGS=-Werror') if self.builder.allow_missing: args.append('BINMAN_ALLOW_MISSING=1') if self.builder.no_lto: |