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.
This commit is contained in:
Tom Rini 2023-05-04 11:49:30 -04:00
commit 7f30eec177
9 changed files with 59 additions and 17 deletions

View file

@ -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.

View file

@ -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();

View file

@ -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.

View file

@ -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;

View file

@ -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

View file

@ -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.

View file

@ -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);

View file

@ -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=')

View file

@ -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: