diff options
| author | Tom Rini <[email protected]> | 2022-10-22 11:19:31 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-10-22 11:19:31 -0400 |
| commit | 1e892ef0b59a4a04971ac23619b95917020b3e18 (patch) | |
| tree | bf93c61d6d3e0877206589ce8b423a6df0b1cfeb /cmd | |
| parent | 7723828c97bc107d2fba976fc50403ac8747f1bc (diff) | |
| parent | 4344c113c4fc1e48be58dbd55ac8922edb0d5c79 (diff) | |
Merge branch '2022-10-21-assorted-fixes-and-updates'
- NC-SI handling support and enable on evb-ast2[56]00, gpio driver for
ADP5585, improve qfw support, print more sysresets info, gw_ventana
and gcc-12 bugfix, improve BCB support, fix a few typos and remove an
unused keymile CONFIG symbol.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/Kconfig | 8 | ||||
| -rw-r--r-- | cmd/bcb.c | 11 | ||||
| -rw-r--r-- | cmd/net.c | 22 | ||||
| -rw-r--r-- | cmd/qfw.c | 6 |
4 files changed, 45 insertions, 2 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 16030e34a12..41cf1d46fb1 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1842,6 +1842,14 @@ config CMD_LINK_LOCAL help Acquire a network IP address using the link-local protocol +config CMD_NCSI + bool "ncsi" + depends on PHY_NCSI + help + Manually configure the attached NIC via NC-SI. + Normally this happens automatically before other network + operations. + endif config CMD_ETHSW diff --git a/cmd/bcb.c b/cmd/bcb.c index 1622a90c97f..02d0c70d87e 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -14,6 +14,7 @@ #include <part.h> #include <malloc.h> #include <memalign.h> +#include <linux/err.h> enum bcb_cmd { BCB_CMD_LOAD, @@ -128,6 +129,16 @@ static int __bcb_load(int devnum, const char *partp) goto err_read_fail; } + /* + * always select the USER mmc hwpart in case another + * blk operation selected a different hwpart + */ + ret = blk_dselect_hwpart(desc, 0); + if (IS_ERR_VALUE(ret)) { + ret = -ENODEV; + goto err_read_fail; + } + part = simple_strtoul(partp, &endp, 0); if (*endp == '\0') { ret = part_get_info(desc, part, &info); diff --git a/cmd/net.c b/cmd/net.c index 46f8c87b692..addcad3ac14 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -16,6 +16,7 @@ #include <net.h> #include <net/udp.h> #include <net/sntp.h> +#include <net/ncsi.h> static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []); @@ -566,3 +567,24 @@ U_BOOT_CMD( "list - list available devices\n" ); #endif // CONFIG_DM_ETH + +#if defined(CONFIG_CMD_NCSI) +static int do_ncsi(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) +{ + if (!phy_interface_is_ncsi() || !ncsi_active()) { + printf("Device not configured for NC-SI\n"); + return CMD_RET_FAILURE; + } + + if (net_loop(NCSI) < 0) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD( + ncsi, 1, 1, do_ncsi, + "Configure attached NIC via NC-SI", + "" +); +#endif /* CONFIG_CMD_NCSI */ diff --git a/cmd/qfw.c b/cmd/qfw.c index ccbc967ca9f..95ddc4b79ec 100644 --- a/cmd/qfw.c +++ b/cmd/qfw.c @@ -26,8 +26,8 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr) qfw_read_entry(qfw_dev, FW_CFG_KERNEL_SIZE, 4, &kernel_size); if (kernel_size == 0) { - printf("warning: no kernel available\n"); - return -1; + printf("fatal: no kernel available\n"); + return CMD_RET_FAILURE; } data_addr = load_addr; @@ -40,6 +40,7 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr) qfw_read_entry(qfw_dev, FW_CFG_KERNEL_DATA, le32_to_cpu(kernel_size), data_addr); data_addr += le32_to_cpu(kernel_size); + env_set_hex("filesize", le32_to_cpu(kernel_size)); data_addr = initrd_addr; qfw_read_entry(qfw_dev, FW_CFG_INITRD_SIZE, 4, &initrd_size); @@ -49,6 +50,7 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr) qfw_read_entry(qfw_dev, FW_CFG_INITRD_DATA, le32_to_cpu(initrd_size), data_addr); data_addr += le32_to_cpu(initrd_size); + env_set_hex("filesize", le32_to_cpu(initrd_size)); } qfw_read_entry(qfw_dev, FW_CFG_CMDLINE_SIZE, 4, &cmdline_size); |
