From a12a73b66476c48dfe5afd2c3711153d09feda6c Mon Sep 17 00:00:00 2001 From: Johan Jonker Date: Mon, 13 Mar 2023 01:32:04 +0100 Subject: drivers: use dev_read_addr_ptr when cast to pointer The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use dev_read_addr_ptr instead of the dev_read_addr function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass --- doc/develop/driver-model/livetree.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/driver-model/livetree.rst b/doc/develop/driver-model/livetree.rst index 579eef5ca9f..20055d559a6 100644 --- a/doc/develop/driver-model/livetree.rst +++ b/doc/develop/driver-model/livetree.rst @@ -103,7 +103,7 @@ The new code is: struct udevice *bus; - i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev); + i2c_bus->regs = dev_read_addr_ptr(dev); plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", 500000); The dev_read\_...() interface is more convenient and works with both the -- cgit v1.2.3 From 55171aedda88d12666e2a1bbc661dea1bec65337 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 May 2023 16:50:45 -0600 Subject: dm: Emit the arch_cpu_init_dm() even only before relocation The original function was only called once, before relocation. The new one is called again after relocation. This was not the intent of the original call. Fix this by renaming and updating the calling logic. With this, chromebook_link64 makes it through SPL. Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events") Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/arm/mach-imx/imx8/cpu.c | 2 +- arch/arm/mach-imx/imx8m/soc.c | 2 +- arch/arm/mach-imx/imx8ulp/soc.c | 2 +- arch/arm/mach-imx/imx9/soc.c | 2 +- arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/hwinit-common.c | 2 +- arch/mips/mach-pic32/cpu.c | 2 +- arch/nios2/cpu/cpu.c | 2 +- arch/riscv/cpu/cpu.c | 2 +- arch/x86/cpu/baytrail/cpu.c | 2 +- arch/x86/cpu/broadwell/cpu.c | 2 +- arch/x86/cpu/ivybridge/cpu.c | 2 +- arch/x86/cpu/quark/quark.c | 2 +- arch/x86/lib/fsp2/fsp_init.c | 2 +- doc/develop/event.rst | 6 +++--- drivers/core/root.c | 4 ++-- drivers/cpu/microblaze_cpu.c | 2 +- include/event.h | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) (limited to 'doc/develop') diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index be1f4edded1..99772f68c32 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -89,7 +89,7 @@ static int imx8_init_mu(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, imx8_init_mu); +EVENT_SPY(EVT_DM_POST_INIT_F, imx8_init_mu); #if defined(CONFIG_ARCH_MISC_INIT) int arch_misc_init(void) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 4705e6c1192..5a4f8358c9f 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -549,7 +549,7 @@ static int imx8m_check_clock(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock); +EVENT_SPY(EVT_DM_POST_INIT_F, imx8m_check_clock); static void imx8m_setup_snvs(void) { diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index 8424332f429..81eae02b6a8 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -808,7 +808,7 @@ static int imx8ulp_evt_dm_post_init(void *ctx, struct event *event) { return imx8ulp_dm_post_init(); } -EVENT_SPY(EVT_DM_POST_INIT, imx8ulp_evt_dm_post_init); +EVENT_SPY(EVT_DM_POST_INIT_F, imx8ulp_evt_dm_post_init); #if defined(CONFIG_SPL_BUILD) __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c index a16e22ea6bb..252663a9eec 100644 --- a/arch/arm/mach-imx/imx9/soc.c +++ b/arch/arm/mach-imx/imx9/soc.c @@ -262,7 +262,7 @@ int imx9_probe_mu(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, imx9_probe_mu); +EVENT_SPY(EVT_DM_POST_INIT_F, imx9_probe_mu); int timer_init(void) { diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index a52d04d85c8..ecc0a592e99 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -535,4 +535,4 @@ static int am33xx_dm_post_init(void *ctx, struct event *event) #endif return 0; } -EVENT_SPY(EVT_DM_POST_INIT, am33xx_dm_post_init); +EVENT_SPY(EVT_DM_POST_INIT_F, am33xx_dm_post_init); diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c index c4a8eabc3eb..771533394bc 100644 --- a/arch/arm/mach-omap2/hwinit-common.c +++ b/arch/arm/mach-omap2/hwinit-common.c @@ -246,7 +246,7 @@ static int omap2_system_init(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, omap2_system_init); +EVENT_SPY(EVT_DM_POST_INIT_F, omap2_system_init); /* * Routine: wait_for_command_complete diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index de449e3c6a2..ec3c2505313 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -102,7 +102,7 @@ static int pic32_flash_prefetch(void *ctx, struct event *event) prefetch_init(); return 0; } -EVENT_SPY(EVT_DM_POST_INIT, pic32_flash_prefetch); +EVENT_SPY(EVT_DM_POST_INIT_F, pic32_flash_prefetch); /* Un-gate DDR2 modules (gated by default) */ static void ddr2_pmd_ungate(void) diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index 85544503a5e..da167f4b29e 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -80,7 +80,7 @@ static int nios_cpu_setup(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, nios_cpu_setup); +EVENT_SPY(EVT_DM_POST_INIT_F, nios_cpu_setup); static int altera_nios2_get_desc(const struct udevice *dev, char *buf, int size) diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index e1ed4ec01d0..ecfb1fb08c4 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -145,7 +145,7 @@ int riscv_cpu_setup(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, riscv_cpu_setup); +EVENT_SPY(EVT_DM_POST_INIT_F, riscv_cpu_setup); int arch_early_init_r(void) { diff --git a/arch/x86/cpu/baytrail/cpu.c b/arch/x86/cpu/baytrail/cpu.c index 4fb6a485542..4a7b4f617f8 100644 --- a/arch/x86/cpu/baytrail/cpu.c +++ b/arch/x86/cpu/baytrail/cpu.c @@ -64,7 +64,7 @@ static int baytrail_uart_init(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, baytrail_uart_init); +EVENT_SPY(EVT_DM_POST_INIT_F, baytrail_uart_init); static void set_max_freq(void) { diff --git a/arch/x86/cpu/broadwell/cpu.c b/arch/x86/cpu/broadwell/cpu.c index 7877961451a..f30aebfe4c6 100644 --- a/arch/x86/cpu/broadwell/cpu.c +++ b/arch/x86/cpu/broadwell/cpu.c @@ -40,7 +40,7 @@ static int broadwell_init_cpu(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, broadwell_init_cpu); +EVENT_SPY(EVT_DM_POST_INIT_F, broadwell_init_cpu); void set_max_freq(void) { diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index cffc5d5b1d8..c988d7ff477 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -86,7 +86,7 @@ static int ivybridge_cpu_init(void *ctx, struct event *ev) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, ivybridge_cpu_init); +EVENT_SPY(EVT_DM_POST_INIT_F, ivybridge_cpu_init); #define PCH_EHCI0_TEMP_BAR0 0xe8000000 #define PCH_EHCI1_TEMP_BAR0 0xe8000400 diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index 0a1fbb34d40..1be8e38cdf4 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -263,7 +263,7 @@ static int quark_init_pcie(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, quark_init_pcie); +EVENT_SPY(EVT_DM_POST_INIT_F, quark_init_pcie); int checkcpu(void) { diff --git a/arch/x86/lib/fsp2/fsp_init.c b/arch/x86/lib/fsp2/fsp_init.c index b15926e8247..afec7d08d67 100644 --- a/arch/x86/lib/fsp2/fsp_init.c +++ b/arch/x86/lib/fsp2/fsp_init.c @@ -42,7 +42,7 @@ int fsp_setup_pinctrl(void *ctx, struct event *event) return ret; } -EVENT_SPY(EVT_DM_POST_INIT, fsp_setup_pinctrl); +EVENT_SPY(EVT_DM_POST_INIT_F, fsp_setup_pinctrl); #if !defined(CONFIG_TPL_BUILD) binman_sym_declare(ulong, intel_fsp_m, image_pos); diff --git a/doc/develop/event.rst b/doc/develop/event.rst index e60cbf65691..1c1c9ef7f1b 100644 --- a/doc/develop/event.rst +++ b/doc/develop/event.rst @@ -11,7 +11,7 @@ block device is probed. 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, +An event consists of a type (e.g. EVT_DM_POST_INIT_F) and some optional data, 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. @@ -26,9 +26,9 @@ To declare a spy, use something like this:: /* do something */ return 0; } - EVENT_SPY(EVT_DM_POST_INIT, snow_setup_cpus); + EVENT_SPY(EVT_DM_POST_INIT_F, snow_setup_cpus); -Your function is called when EVT_DM_POST_INIT is emitted, i.e. after driver +Your function is called when EVT_DM_POST_INIT_F is emitted, i.e. after driver model is inited (in SPL, or in U-Boot proper before and after relocation). diff --git a/drivers/core/root.c b/drivers/core/root.c index c4fb48548bb..6775fb0b657 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -436,8 +436,8 @@ int dm_init_and_scan(bool pre_reloc_only) return ret; } } - if (CONFIG_IS_ENABLED(DM_EVENT)) { - ret = event_notify_null(EVT_DM_POST_INIT); + if (CONFIG_IS_ENABLED(DM_EVENT) && !(gd->flags & GD_FLG_RELOC)) { + ret = event_notify_null(EVT_DM_POST_INIT_F); if (ret) return log_msg_ret("ev", ret); } diff --git a/drivers/cpu/microblaze_cpu.c b/drivers/cpu/microblaze_cpu.c index b9d07928223..c97a89fbd5c 100644 --- a/drivers/cpu/microblaze_cpu.c +++ b/drivers/cpu/microblaze_cpu.c @@ -29,7 +29,7 @@ static int microblaze_cpu_probe_all(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_DM_POST_INIT, microblaze_cpu_probe_all); +EVENT_SPY(EVT_DM_POST_INIT_F, microblaze_cpu_probe_all); static void microblaze_set_cpuinfo_pvr(struct microblaze_cpuinfo *ci) { diff --git a/include/event.h b/include/event.h index e4580b68350..fe41080fa63 100644 --- a/include/event.h +++ b/include/event.h @@ -22,7 +22,7 @@ enum event_t { EVT_TEST, /* Events related to driver model */ - EVT_DM_POST_INIT, + EVT_DM_POST_INIT_F, EVT_DM_PRE_PROBE, EVT_DM_POST_PROBE, EVT_DM_PRE_REMOVE, -- cgit v1.2.3 From 0c97e771d02c15914562df7df775ab7d6cf94682 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Tue, 2 May 2023 13:21:46 +0300 Subject: doc: devicetree: fix u-boot.bin filename typo Signed-off-by: Baruch Siach Reviewed-by: Simon Glass Signed-off-by: Heinrich Schuchardt --- doc/develop/devicetree/control.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/devicetree/control.rst b/doc/develop/devicetree/control.rst index 0b3b32be1bb..cbb65c9b177 100644 --- a/doc/develop/devicetree/control.rst +++ b/doc/develop/devicetree/control.rst @@ -100,7 +100,7 @@ and development only and is not recommended for production devices. If CONFIG_OF_SEPARATE is defined, then it will be built and placed in a u-boot.dtb file alongside u-boot-nodtb.bin with the combined result placed -in u-boot.bin so you can still just flash u-boot,bin onto your board. If you are +in u-boot.bin so you can still just flash u-boot.bin onto your board. If you are using CONFIG_SPL_FRAMEWORK, then u-boot.img will be built to include the device tree binary. -- cgit v1.2.3 From 79f663515a8a55bdcb7496d3db51462b6ff7c0c2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 10 May 2023 16:34:46 -0600 Subject: bootstd: Rename distro and syslinux to extlinux We use the terms 'distro' to mean extlinux but they are not really the same. 'Distro' could refer to any method of booting a distribution, whereas extlinux is a particular method. Also we sometimes use syslinux, but it is better to use the same term in all cases. Rename distro to syslinux and also update bootstd uses of syslinux to use extlinux instead. Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 4 +- boot/Kconfig | 20 ++-- boot/Makefile | 4 +- boot/bootmeth_distro.c | 193 ---------------------------------- boot/bootmeth_extlinux.c | 193 ++++++++++++++++++++++++++++++++++ boot/bootmeth_pxe.c | 50 ++++----- boot/bootmeth_qfw.c | 2 +- boot/bootmeth_sandbox.c | 2 +- doc/develop/bootstd.rst | 24 ++--- doc/device-tree-bindings/bootmeth.txt | 8 +- doc/device-tree-bindings/bootstd.txt | 4 +- doc/usage/cmd/bootflow.rst | 2 +- doc/usage/cmd/bootmeth.rst | 8 +- doc/usage/cmd/dm.rst | 2 +- include/bootmeth.h | 2 +- include/distro.h | 24 ----- include/extlinux.h | 24 +++++ net/eth_bootdev.c | 4 +- test/boot/bootflow.c | 34 +++--- test/boot/bootmeth.c | 24 ++--- 20 files changed, 319 insertions(+), 309 deletions(-) delete mode 100644 boot/bootmeth_distro.c create mode 100644 boot/bootmeth_extlinux.c delete mode 100644 include/distro.h create mode 100644 include/extlinux.h (limited to 'doc/develop') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 453e53db71a..6f9af489a37 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -86,8 +86,8 @@ filename-prefixes = "/", "/boot/"; bootdev-order = "mmc2", "mmc1"; - syslinux { - compatible = "u-boot,distro-syslinux"; + extlinux { + compatible = "u-boot,extlinux"; }; efi { diff --git a/boot/Kconfig b/boot/Kconfig index fad8e530b17..3f8e407be7c 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -462,25 +462,33 @@ config BOOTMETH_GLOBAL EFI bootmgr, since they take full control over which bootdevs are selected to boot. -config BOOTMETH_DISTRO - bool "Bootdev support for distro boot" +config BOOTMETH_EXTLINUX + bool "Bootdev support for extlinux boot" select PXE_UTILS default y help - Enables support for distro boot using bootdevs. This makes the + Enables support for extlinux boot using bootdevs. This makes the bootdevs look for a 'extlinux/extlinux.conf' on each filesystem they scan. + The specification for this filed is here: + + https://uapi-group.org/specifications/specs/boot_loader_specification/ + This provides a way to try out standard boot on an existing boot flow. -config BOOTMETH_DISTRO_PXE - bool "Bootdev support for distro boot over network" +config BOOTMETH_EXTLINUX_PXE + bool "Bootdev support for extlinux boot over network" depends on CMD_PXE && CMD_NET && DM_ETH default y help - Enables support for distro boot using bootdevs. This makes the + Enables support for extlinux boot using bootdevs. This makes the bootdevs look for a 'extlinux/extlinux.conf' on the tftp server. + The specification for this file is here: + + https://uapi-group.org/specifications/specs/boot_loader_specification/ + This provides a way to try out standard boot on an existing boot flow. config BOOTMETH_EFILOADER diff --git a/boot/Makefile b/boot/Makefile index 88193a1b60e..f94c31d922d 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -24,8 +24,8 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO) += bootmeth_distro.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO_PXE) += bootmeth_pxe.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX) += bootmeth_extlinux.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX_PXE) += bootmeth_pxe.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o diff --git a/boot/bootmeth_distro.c b/boot/bootmeth_distro.c deleted file mode 100644 index b4b73ecbf58..00000000000 --- a/boot/bootmeth_distro.c +++ /dev/null @@ -1,193 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Bootmethod for distro boot (syslinux boot from a block device) - * - * Copyright 2021 Google LLC - * Written by Simon Glass - */ - -#define LOG_CATEGORY UCLASS_BOOTSTD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int distro_get_state_desc(struct udevice *dev, char *buf, int maxsize) -{ - if (IS_ENABLED(CONFIG_SANDBOX)) { - int len; - - len = snprintf(buf, maxsize, "OK"); - - return len + 1 < maxsize ? 0 : -ENOSPC; - } - - return 0; -} - -static int distro_getfile(struct pxe_context *ctx, const char *file_path, - char *file_addr, ulong *sizep) -{ - struct distro_info *info = ctx->userdata; - ulong addr; - int ret; - - addr = simple_strtoul(file_addr, NULL, 16); - - /* Allow up to 1GB */ - *sizep = 1 << 30; - ret = bootmeth_read_file(info->dev, info->bflow, file_path, addr, - sizep); - if (ret) - return log_msg_ret("read", ret); - - return 0; -} - -static int distro_check(struct udevice *dev, struct bootflow_iter *iter) -{ - int ret; - - /* This only works on block devices */ - ret = bootflow_iter_check_blk(iter); - if (ret) - return log_msg_ret("blk", ret); - - return 0; -} - -/** - * distro_fill_info() - Decode the extlinux file to find out distro info - * - * @bflow: Bootflow to process - * @return 0 if OK, -ve on error - */ -static int distro_fill_info(struct bootflow *bflow) -{ - struct membuff mb; - char line[200]; - char *data; - int len; - - log_debug("parsing bflow file size %x\n", bflow->size); - membuff_init(&mb, bflow->buf, bflow->size); - membuff_putraw(&mb, bflow->size, true, &data); - while (len = membuff_readline(&mb, line, sizeof(line) - 1, ' '), len) { - char *tok, *p = line; - - tok = strsep(&p, " "); - if (p) { - if (!strcmp("label", tok)) { - bflow->os_name = strdup(p); - if (!bflow->os_name) - return log_msg_ret("os", -ENOMEM); - } - } - } - - return 0; -} - -static int distro_read_bootflow(struct udevice *dev, struct bootflow *bflow) -{ - struct blk_desc *desc; - const char *const *prefixes; - struct udevice *bootstd; - const char *prefix; - loff_t size; - int ret, i; - - ret = uclass_first_device_err(UCLASS_BOOTSTD, &bootstd); - if (ret) - return log_msg_ret("std", ret); - - /* If a block device, we require a partition table */ - if (bflow->blk && !bflow->part) - return -ENOENT; - - prefixes = bootstd_get_prefixes(bootstd); - i = 0; - desc = bflow->blk ? dev_get_uclass_plat(bflow->blk) : NULL; - do { - prefix = prefixes ? prefixes[i] : NULL; - - ret = bootmeth_try_file(bflow, desc, prefix, DISTRO_FNAME); - } while (ret && prefixes && prefixes[++i]); - if (ret) - return log_msg_ret("try", ret); - size = bflow->size; - - ret = bootmeth_alloc_file(bflow, 0x10000, 1); - if (ret) - return log_msg_ret("read", ret); - - ret = distro_fill_info(bflow); - if (ret) - return log_msg_ret("inf", ret); - - return 0; -} - -static int distro_boot(struct udevice *dev, struct bootflow *bflow) -{ - struct cmd_tbl cmdtp = {}; /* dummy */ - struct pxe_context ctx; - struct distro_info info; - ulong addr; - int ret; - - addr = map_to_sysmem(bflow->buf); - info.dev = dev; - info.bflow = bflow; - ret = pxe_setup_ctx(&ctx, &cmdtp, distro_getfile, &info, true, - bflow->subdir, false); - if (ret) - return log_msg_ret("ctx", -EINVAL); - - ret = pxe_process(&ctx, addr, false); - if (ret) - return log_msg_ret("bread", -EINVAL); - - return 0; -} - -static int distro_bootmeth_bind(struct udevice *dev) -{ - struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); - - plat->desc = IS_ENABLED(CONFIG_BOOTSTD_FULL) ? - "Syslinux boot from a block device" : "syslinux"; - - return 0; -} - -static struct bootmeth_ops distro_bootmeth_ops = { - .get_state_desc = distro_get_state_desc, - .check = distro_check, - .read_bootflow = distro_read_bootflow, - .read_file = bootmeth_common_read_file, - .boot = distro_boot, -}; - -static const struct udevice_id distro_bootmeth_ids[] = { - { .compatible = "u-boot,distro-syslinux" }, - { } -}; - -U_BOOT_DRIVER(bootmeth_distro) = { - .name = "bootmeth_distro", - .id = UCLASS_BOOTMETH, - .of_match = distro_bootmeth_ids, - .ops = &distro_bootmeth_ops, - .bind = distro_bootmeth_bind, -}; diff --git a/boot/bootmeth_extlinux.c b/boot/bootmeth_extlinux.c new file mode 100644 index 00000000000..24be0760229 --- /dev/null +++ b/boot/bootmeth_extlinux.c @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Bootmethod for extlinux boot from a block device + * + * Copyright 2021 Google LLC + * Written by Simon Glass + */ + +#define LOG_CATEGORY UCLASS_BOOTSTD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int extlinux_get_state_desc(struct udevice *dev, char *buf, int maxsize) +{ + if (IS_ENABLED(CONFIG_SANDBOX)) { + int len; + + len = snprintf(buf, maxsize, "OK"); + + return len + 1 < maxsize ? 0 : -ENOSPC; + } + + return 0; +} + +static int extlinux_getfile(struct pxe_context *ctx, const char *file_path, + char *file_addr, ulong *sizep) +{ + struct extlinux_info *info = ctx->userdata; + ulong addr; + int ret; + + addr = simple_strtoul(file_addr, NULL, 16); + + /* Allow up to 1GB */ + *sizep = 1 << 30; + ret = bootmeth_read_file(info->dev, info->bflow, file_path, addr, + sizep); + if (ret) + return log_msg_ret("read", ret); + + return 0; +} + +static int extlinux_check(struct udevice *dev, struct bootflow_iter *iter) +{ + int ret; + + /* This only works on block devices */ + ret = bootflow_iter_check_blk(iter); + if (ret) + return log_msg_ret("blk", ret); + + return 0; +} + +/** + * extlinux_fill_info() - Decode the extlinux file to find out its info + * + * @bflow: Bootflow to process + * @return 0 if OK, -ve on error + */ +static int extlinux_fill_info(struct bootflow *bflow) +{ + struct membuff mb; + char line[200]; + char *data; + int len; + + log_debug("parsing bflow file size %x\n", bflow->size); + membuff_init(&mb, bflow->buf, bflow->size); + membuff_putraw(&mb, bflow->size, true, &data); + while (len = membuff_readline(&mb, line, sizeof(line) - 1, ' '), len) { + char *tok, *p = line; + + tok = strsep(&p, " "); + if (p) { + if (!strcmp("label", tok)) { + bflow->os_name = strdup(p); + if (!bflow->os_name) + return log_msg_ret("os", -ENOMEM); + } + } + } + + return 0; +} + +static int extlinux_read_bootflow(struct udevice *dev, struct bootflow *bflow) +{ + struct blk_desc *desc; + const char *const *prefixes; + struct udevice *bootstd; + const char *prefix; + loff_t size; + int ret, i; + + ret = uclass_first_device_err(UCLASS_BOOTSTD, &bootstd); + if (ret) + return log_msg_ret("std", ret); + + /* If a block device, we require a partition table */ + if (bflow->blk && !bflow->part) + return -ENOENT; + + prefixes = bootstd_get_prefixes(bootstd); + i = 0; + desc = bflow->blk ? dev_get_uclass_plat(bflow->blk) : NULL; + do { + prefix = prefixes ? prefixes[i] : NULL; + + ret = bootmeth_try_file(bflow, desc, prefix, EXTLINUX_FNAME); + } while (ret && prefixes && prefixes[++i]); + if (ret) + return log_msg_ret("try", ret); + size = bflow->size; + + ret = bootmeth_alloc_file(bflow, 0x10000, 1); + if (ret) + return log_msg_ret("read", ret); + + ret = extlinux_fill_info(bflow); + if (ret) + return log_msg_ret("inf", ret); + + return 0; +} + +static int extlinux_boot(struct udevice *dev, struct bootflow *bflow) +{ + struct cmd_tbl cmdtp = {}; /* dummy */ + struct pxe_context ctx; + struct extlinux_info info; + ulong addr; + int ret; + + addr = map_to_sysmem(bflow->buf); + info.dev = dev; + info.bflow = bflow; + ret = pxe_setup_ctx(&ctx, &cmdtp, extlinux_getfile, &info, true, + bflow->subdir, false); + if (ret) + return log_msg_ret("ctx", -EINVAL); + + ret = pxe_process(&ctx, addr, false); + if (ret) + return log_msg_ret("bread", -EINVAL); + + return 0; +} + +static int extlinux_bootmeth_bind(struct udevice *dev) +{ + struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); + + plat->desc = IS_ENABLED(CONFIG_BOOTSTD_FULL) ? + "Extlinux boot from a block device" : "extlinux"; + + return 0; +} + +static struct bootmeth_ops extlinux_bootmeth_ops = { + .get_state_desc = extlinux_get_state_desc, + .check = extlinux_check, + .read_bootflow = extlinux_read_bootflow, + .read_file = bootmeth_common_read_file, + .boot = extlinux_boot, +}; + +static const struct udevice_id extlinux_bootmeth_ids[] = { + { .compatible = "u-boot,extlinux" }, + { } +}; + +U_BOOT_DRIVER(bootmeth_extlinux) = { + .name = "bootmeth_extlinux", + .id = UCLASS_BOOTMETH, + .of_match = extlinux_bootmeth_ids, + .ops = &extlinux_bootmeth_ops, + .bind = extlinux_bootmeth_bind, +}; diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c index 5a8af2bbd0b..ce986bd260d 100644 --- a/boot/bootmeth_pxe.c +++ b/boot/bootmeth_pxe.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Bootmethod for distro boot using PXE (network boot) + * Bootmethod for extlinux boot using PXE (network boot) * * Copyright 2021 Google LLC * Written by Simon Glass @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -23,10 +23,10 @@ #include #include -static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, - char *file_addr, ulong *sizep) +static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path, + char *file_addr, ulong *sizep) { - struct distro_info *info = ctx->userdata; + struct extlinux_info *info = ctx->userdata; ulong addr; int ret; @@ -39,7 +39,7 @@ static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, return 0; } -static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) +static int extlinux_pxe_check(struct udevice *dev, struct bootflow_iter *iter) { int ret; @@ -54,7 +54,8 @@ static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) return 0; } -static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_read_bootflow(struct udevice *dev, + struct bootflow *bflow) { const char *addr_str; char fname[200]; @@ -90,7 +91,7 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) } } snprintf(fname, sizeof(fname), "%s%s", - bflow->subdir ? bflow->subdir : "", DISTRO_FNAME); + bflow->subdir ? bflow->subdir : "", EXTLINUX_FNAME); bflow->fname = strdup(fname); if (!bflow->fname) @@ -108,8 +109,9 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep) +static int extlinux_pxe_read_file(struct udevice *dev, struct bootflow *bflow, + const char *file_path, ulong addr, + ulong *sizep) { char *tftp_argv[] = {"tftp", NULL, NULL, NULL}; struct pxe_context *ctx = dev_get_priv(dev); @@ -133,11 +135,11 @@ static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, return 0; } -static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_boot(struct udevice *dev, struct bootflow *bflow) { struct pxe_context *ctx = dev_get_priv(dev); struct cmd_tbl cmdtp = {}; /* dummy */ - struct distro_info info; + struct extlinux_info info; ulong addr; int ret; @@ -145,7 +147,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) info.dev = dev; info.bflow = bflow; info.cmdtp = &cmdtp; - ret = pxe_setup_ctx(ctx, &cmdtp, distro_pxe_getfile, &info, false, + ret = pxe_setup_ctx(ctx, &cmdtp, extlinux_pxe_getfile, &info, false, bflow->subdir, false); if (ret) return log_msg_ret("ctx", -EINVAL); @@ -157,7 +159,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_bootmeth_pxe_bind(struct udevice *dev) +static int extlinux_bootmeth_pxe_bind(struct udevice *dev) { struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); @@ -167,23 +169,23 @@ static int distro_bootmeth_pxe_bind(struct udevice *dev) return 0; } -static struct bootmeth_ops distro_bootmeth_pxe_ops = { - .check = distro_pxe_check, - .read_bootflow = distro_pxe_read_bootflow, - .read_file = distro_pxe_read_file, - .boot = distro_pxe_boot, +static struct bootmeth_ops extlinux_bootmeth_pxe_ops = { + .check = extlinux_pxe_check, + .read_bootflow = extlinux_pxe_read_bootflow, + .read_file = extlinux_pxe_read_file, + .boot = extlinux_pxe_boot, }; -static const struct udevice_id distro_bootmeth_pxe_ids[] = { - { .compatible = "u-boot,distro-pxe" }, +static const struct udevice_id extlinux_bootmeth_pxe_ids[] = { + { .compatible = "u-boot,extlinux-pxe" }, { } }; U_BOOT_DRIVER(bootmeth_pxe) = { .name = "bootmeth_pxe", .id = UCLASS_BOOTMETH, - .of_match = distro_bootmeth_pxe_ids, - .ops = &distro_bootmeth_pxe_ops, - .bind = distro_bootmeth_pxe_bind, + .of_match = extlinux_bootmeth_pxe_ids, + .ops = &extlinux_bootmeth_pxe_ops, + .bind = extlinux_bootmeth_pxe_bind, .priv_auto = sizeof(struct pxe_context), }; diff --git a/boot/bootmeth_qfw.c b/boot/bootmeth_qfw.c index a5f95d4d0c5..ecd4b082fd2 100644 --- a/boot/bootmeth_qfw.c +++ b/boot/bootmeth_qfw.c @@ -89,7 +89,7 @@ static struct bootmeth_ops qfw_bootmeth_ops = { }; static const struct udevice_id qfw_bootmeth_ids[] = { - { .compatible = "u-boot,qfw-syslinux" }, + { .compatible = "u-boot,qfw-extlinux" }, { } }; diff --git a/boot/bootmeth_sandbox.c b/boot/bootmeth_sandbox.c index 13ec5e95e64..aabc57e635a 100644 --- a/boot/bootmeth_sandbox.c +++ b/boot/bootmeth_sandbox.c @@ -56,7 +56,7 @@ static struct bootmeth_ops sandbox_bootmeth_ops = { }; static const struct udevice_id sandbox_bootmeth_ids[] = { - { .compatible = "u-boot,sandbox-syslinux" }, + { .compatible = "u-boot,sandbox-extlinux" }, { } }; diff --git a/doc/develop/bootstd.rst b/doc/develop/bootstd.rst index 5dfa6cfce51..7a2a69fdfce 100644 --- a/doc/develop/bootstd.rst +++ b/doc/develop/bootstd.rst @@ -154,7 +154,7 @@ bootmeths This environment variable can be used to control the list of bootmeths used and their ordering for example:: - setenv bootmeths "syslinux efi" + setenv bootmeths "extlinux efi" Entries may be removed or re-ordered in this list to affect the order the bootmeths are tried on each bootdev. If the variable is empty, the default @@ -389,8 +389,8 @@ Configuration ------------- Standard boot is enabled with `CONFIG_BOOTSTD`. Each bootmeth has its own CONFIG -option also. For example, `CONFIG_BOOTMETH_DISTRO` enables support for distro -boot from a disk. +option also. For example, `CONFIG_BOOTMETH_EXTLINUX` enables support for +booting from a disk using an `extlinux.conf` file. To enable all feature sof standard boot, use `CONFIG_BOOTSTD_FULL`. This includes the full set of commands, more error messages when things go wrong and @@ -406,8 +406,8 @@ Available bootmeth drivers Bootmeth drivers are provided for: - - distro boot from a disk (syslinux) - - distro boot from a network (PXE) + - extlinux / syslinux boot from a disk + - extlinux boot from a network (PXE) - U-Boot scripts from disk, network or SPI flash - EFI boot using bootefi from disk - VBE @@ -683,8 +683,8 @@ This feature can be added as needed. Note that sandbox is a special case, since in that case the host filesystem can be accessed even though the block device is NULL. -If we take the example of the `bootmeth_distro` driver, this call ends up at -`distro_read_bootflow()`. It has the filesystem ready, so tries various +If we take the example of the `bootmeth_extlinux` driver, this call ends up at +`extlinux_read_bootflow()`. It has the filesystem ready, so tries various filenames to try to find the `extlinux.conf` file, reading it if possible. If all goes well the bootflow ends up in the `BOOTFLOWST_READY` state. @@ -697,12 +697,12 @@ the `BOOTFLOWST_READY` state. That is the basic operation of scanning for bootflows. The process of booting a bootflow is handled by the bootmeth driver for that bootflow. In the case of -distro boot, this parses and processes the `extlinux.conf` file that was read. -See `distro_boot()` for how that works. The processing may involve reading +extlinux boot, this parses and processes the `extlinux.conf` file that was read. +See `extlinux_boot()` for how that works. The processing may involve reading additional files, which is handled by the `read_file()` method, which is -`distro_read_file()` in this case. All bootmethds should support reading files, -since the bootflow is typically only the basic instructions and does not include -the operating system itself, ramdisk, device tree, etc. +`extlinux_read_file()` in this case. All bootmethds should support reading +files, since the bootflow is typically only the basic instructions and does not +include the operating system itself, ramdisk, device tree, etc. The vast majority of the bootstd code is concerned with iterating through partitions on bootdevs and using bootmethds to find bootflows. diff --git a/doc/device-tree-bindings/bootmeth.txt b/doc/device-tree-bindings/bootmeth.txt index de6396a7b35..127b09cd1b2 100644 --- a/doc/device-tree-bindings/bootmeth.txt +++ b/doc/device-tree-bindings/bootmeth.txt @@ -7,8 +7,8 @@ device (bootdev). These are normally created as children of the bootstd device. Required properties: compatible: - "u-boot,distro-syslinux" - distro boot from a block device - "u-boot,distro-pxe" - distro boot from a network device + "u-boot,extlinux" - distro boot from a block device + "u-boot,extlinux-pxe" - distro boot from a network device "u-boot,distro-efi" - EFI boot from an .efi file "u-boot,efi-bootmgr" - EFI boot using boot manager (bootmgr) @@ -21,8 +21,8 @@ Example: filename-prefixes = "/", "/boot/"; bootdev-order = "mmc2", "mmc1"; - syslinux { - compatible = "u-boot,distro-syslinux"; + extlinux { + compatible = "u-boot,extlinux"; }; efi { diff --git a/doc/device-tree-bindings/bootstd.txt b/doc/device-tree-bindings/bootstd.txt index 8706c5f4993..1f1b9cba601 100644 --- a/doc/device-tree-bindings/bootstd.txt +++ b/doc/device-tree-bindings/bootstd.txt @@ -26,8 +26,8 @@ Example: filename-prefixes = "/", "/boot/"; bootdev-order = "mmc2", "mmc1"; - syslinux { - compatible = "u-boot,distro-syslinux"; + extlinux { + compatible = "u-boot,extlinux"; }; efi { diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index cad09bbec9a..8590efca218 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -148,7 +148,7 @@ Name mmc\@7e202000.bootdev.part_2 Device mmc\@7e202000.bootdev Block dev mmc\@7e202000.blk Type distro -Method: syslinux +Method: extlinux State ready Partition 2 Subdir (none) diff --git a/doc/usage/cmd/bootmeth.rst b/doc/usage/cmd/bootmeth.rst index 29d8215a0c0..f632d74e1dc 100644 --- a/doc/usage/cmd/bootmeth.rst +++ b/doc/usage/cmd/bootmeth.rst @@ -45,7 +45,7 @@ The format looks like this: ===== === ================== ================================= Order Seq Name Description ===== === ================== ================================= - 0 0 distro Syslinux boot from a block device + 0 0 extlinunx Extlinux boot from a block device 1 1 efi EFI boot from an .efi file 2 2 pxe PXE boot from a network device 3 3 sandbox Sandbox boot for testing @@ -77,7 +77,7 @@ This shows listing bootmeths. All are present and in the normal order:: => bootmeth list Order Seq Name Description ----- --- ------------------ ------------------ - 0 0 distro Syslinux boot from a block device + 0 0 distro Extlinux boot from a block device 1 1 efi EFI boot from an .efi file 2 2 pxe PXE boot from a network device 3 3 sandbox Sandbox boot for testing @@ -92,7 +92,7 @@ Now the order is changed, to include only two of them:: Order Seq Name Description ----- --- ------------------ ------------------ 0 3 sandbox Sandbox boot for testing - 1 0 distro Syslinux boot from a block device + 1 0 distro Extlinux boot from a block device ----- --- ------------------ ------------------ (2 bootmeths) @@ -102,7 +102,7 @@ which are not:: => bootmeth list -a Order Seq Name Description ----- --- ------------------ ------------------ - 1 0 distro Syslinux boot from a block device + 1 0 distro Extlinux boot from a block device - 1 efi EFI boot from an .efi file - 2 pxe PXE boot from a network device 0 3 sandbox Sandbox boot for testing diff --git a/doc/usage/cmd/dm.rst b/doc/usage/cmd/dm.rst index 236cd02bd62..74c6b01e361 100644 --- a/doc/usage/cmd/dm.rst +++ b/doc/usage/cmd/dm.rst @@ -366,7 +366,7 @@ This example shows the abridged sandbox output:: .. sysreset 0 [ ] sysreset_sandbox |-- sysreset_sandbox bootstd 0 [ ] bootstd_drv |-- bootstd - bootmeth 0 [ ] bootmeth_distro | |-- syslinux + bootmeth 0 [ ] bootmeth_extlinux | |-- extlinux bootmeth 1 [ ] bootmeth_efi | `-- efi reboot-mod 0 [ ] reboot-mode-gpio |-- reboot-mode0 reboot-mod 1 [ ] reboot-mode-rtc |-- reboot-mode@14 diff --git a/include/bootmeth.h b/include/bootmeth.h index b12dfd42c90..c3df9702e87 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -255,7 +255,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global); * This selects the ordering to use for bootmeths * * @order_str: String containing the ordering. This is a comma-separate list of - * bootmeth-device names, e.g. "syslinux,efi". If empty then a default ordering + * bootmeth-device names, e.g. "extlinux,efi". If empty then a default ordering * is used, based on the sequence number of devices (i.e. using aliases) * Return: 0 if OK, -ENODEV if an unknown bootmeth is mentioned, -ENOMEM if * out of memory, -ENOENT if there are no bootmeth devices diff --git a/include/distro.h b/include/distro.h deleted file mode 100644 index 2ee145871b2..00000000000 --- a/include/distro.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2021 Google LLC - * Written by Simon Glass - */ - -#ifndef __distro_h -#define __distro_h - -#define DISTRO_FNAME "extlinux/extlinux.conf" - -/** - * struct distro_info - useful information for distro_getfile() - * - * @dev: bootmethod device being used to boot - * @bflow: bootflow being booted - */ -struct distro_info { - struct udevice *dev; - struct bootflow *bflow; - struct cmd_tbl *cmdtp; -}; - -#endif diff --git a/include/extlinux.h b/include/extlinux.h new file mode 100644 index 00000000000..721ba46371c --- /dev/null +++ b/include/extlinux.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 Google LLC + * Written by Simon Glass + */ + +#ifndef __extlinux_h +#define __extlinux_h + +#define EXTLINUX_FNAME "extlinux/extlinux.conf" + +/** + * struct extlinux_info - useful information for extlinux_getfile() + * + * @dev: bootmethod device being used to boot + * @bflow: bootflow being booted + */ +struct extlinux_info { + struct udevice *dev; + struct bootflow *bflow; + struct cmd_tbl *cmdtp; +}; + +#endif diff --git a/net/eth_bootdev.c b/net/eth_bootdev.c index 13e5fcd3bdf..f7b4196f78d 100644 --- a/net/eth_bootdev.c +++ b/net/eth_bootdev.c @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -36,7 +36,7 @@ static int eth_get_bootflow(struct udevice *dev, struct bootflow_iter *iter, return log_msg_ret("check", ret); /* - * Like distro boot, this assumes there is only one Ethernet device. + * Like extlinux boot, this assumes there is only one Ethernet device. * In this case, that means that @eth is ignored */ diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index bb53bab0c0c..2b5f87d7f09 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -57,7 +57,7 @@ static int bootflow_cmd(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':"); ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':"); - ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextline("No more bootdevs"); ut_assert_nextlinen("---"); ut_assert_nextline("(1 bootflow, 1 valid)"); @@ -67,7 +67,7 @@ static int bootflow_cmd(struct unit_test_state *uts) ut_assert_nextline("Showing bootflows for bootdev 'mmc1.bootdev'"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextlinen("---"); ut_assert_nextline("(1 bootflow, 1 valid)"); ut_assert_console_end(); @@ -136,7 +136,7 @@ static int bootflow_cmd_glob(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':"); ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':"); - ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextline("Scanning bootdev 'mmc0.bootdev':"); ut_assert_nextline("No more bootdevs"); ut_assert_nextlinen("---"); @@ -147,7 +147,7 @@ static int bootflow_cmd_glob(struct unit_test_state *uts) ut_assert_nextline("Showing all bootflows"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextlinen("---"); ut_assert_nextline("(1 bootflow, 1 valid)"); ut_assert_console_end(); @@ -167,17 +167,17 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts) ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':"); - ut_assert_nextline(" 0 syslinux media mmc 0 mmc2.bootdev.whole "); + ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported"); ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported"); ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':"); - ut_assert_nextline(" 2 syslinux media mmc 0 mmc1.bootdev.whole "); + ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-2: No such file or directory"); ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-2: No such file or directory"); - ut_assert_nextline(" 4 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_nextline(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextline(" 5 efi fs mmc 1 mmc1.bootdev.part_1 efi/boot/bootsbox.efi"); ut_assert_skip_to_line("Scanning bootdev 'mmc0.bootdev':"); @@ -192,9 +192,9 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts) ut_assert_nextline("Showing all bootflows"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 syslinux media mmc 0 mmc2.bootdev.whole "); + ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); - ut_assert_skip_to_line(" 4 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_skip_to_line(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole "); ut_assert_nextlinen("---"); ut_assert_nextline("(64 bootflows, 1 valid)"); @@ -218,7 +218,7 @@ static int bootflow_cmd_info(struct unit_test_state *uts) ut_assert_nextline("Name: mmc1.bootdev.part_1"); ut_assert_nextline("Device: mmc1.bootdev"); ut_assert_nextline("Block dev: mmc1.blk"); - ut_assert_nextline("Method: syslinux"); + ut_assert_nextline("Method: extlinux"); ut_assert_nextline("State: ready"); ut_assert_nextline("Partition: 1"); ut_assert_nextline("Subdir: (none)"); @@ -251,7 +251,7 @@ static int bootflow_scan_boot(struct unit_test_state *uts) ut_assertok(inject_response(uts)); ut_assertok(run_command("bootflow scan -b", 0)); ut_assert_nextline( - "** Booting bootflow 'mmc1.bootdev.part_1' with syslinux"); + "** Booting bootflow 'mmc1.bootdev.part_1' with extlinux"); ut_assert_nextline("Ignoring unknown command: ui"); /* @@ -282,7 +282,7 @@ static int bootflow_iter(struct unit_test_state *uts) ut_asserteq(0, iter.cur_method); ut_asserteq(0, iter.part); ut_asserteq(0, iter.max_part); - ut_asserteq_str("syslinux", iter.method->name); + ut_asserteq_str("extlinux", iter.method->name); ut_asserteq(0, bflow.err); /* @@ -309,7 +309,7 @@ static int bootflow_iter(struct unit_test_state *uts) ut_asserteq(0, iter.cur_method); ut_asserteq(0, iter.part); ut_asserteq(0x1e, iter.max_part); - ut_asserteq_str("syslinux", iter.method->name); + ut_asserteq_str("extlinux", iter.method->name); ut_asserteq(0, bflow.err); ut_asserteq(BOOTFLOWST_MEDIA, bflow.state); bootflow_free(&bflow); @@ -330,7 +330,7 @@ static int bootflow_iter(struct unit_test_state *uts) ut_asserteq(0, iter.cur_method); ut_asserteq(1, iter.part); ut_asserteq(0x1e, iter.max_part); - ut_asserteq_str("syslinux", iter.method->name); + ut_asserteq_str("extlinux", iter.method->name); ut_asserteq(0, bflow.err); ut_asserteq(BOOTFLOWST_READY, bflow.state); bootflow_free(&bflow); @@ -351,7 +351,7 @@ static int bootflow_iter(struct unit_test_state *uts) ut_asserteq(0, iter.cur_method); ut_asserteq(2, iter.part); ut_asserteq(0x1e, iter.max_part); - ut_asserteq_str("syslinux", iter.method->name); + ut_asserteq_str("extlinux", iter.method->name); ut_asserteq(0, bflow.err); ut_asserteq(BOOTFLOWST_MEDIA, bflow.state); bootflow_free(&bflow); @@ -489,7 +489,7 @@ static int bootflow_cmd_boot(struct unit_test_state *uts) ut_assertok(inject_response(uts)); ut_asserteq(1, run_command("bootflow boot", 0)); ut_assert_nextline( - "** Booting bootflow 'mmc1.bootdev.part_1' with syslinux"); + "** Booting bootflow 'mmc1.bootdev.part_1' with extlinux"); ut_assert_nextline("Ignoring unknown command: ui"); /* @@ -614,7 +614,7 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts) ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':"); ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':"); ut_assert_nextline( - " 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + " 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextline("Scanning bootdev 'mmc0.bootdev':"); ut_assert_skip_to_line("(1 bootflow, 1 valid)"); ut_assert_console_end(); diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c index 0098ef3efd0..e498eee036e 100644 --- a/test/boot/bootmeth.c +++ b/test/boot/bootmeth.c @@ -21,7 +21,7 @@ static int bootmeth_cmd_list(struct unit_test_state *uts) ut_assertok(run_command("bootmeth list", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device"); + ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device"); ut_assert_nextline(" 1 1 efi EFI boot from an .efi file"); if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) ut_assert_nextline(" glob 2 firmware0 VBE simple"); @@ -39,16 +39,16 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) { /* Select just one bootmethod */ console_record_reset_enable(); - ut_assertok(run_command("bootmeth order syslinux", 0)); + ut_assertok(run_command("bootmeth order extlinux", 0)); ut_assert_console_end(); ut_assertnonnull(env_get("bootmeths")); - ut_asserteq_str("syslinux", env_get("bootmeths")); + ut_asserteq_str("extlinux", env_get("bootmeths")); /* Only that one should be listed */ ut_assertok(run_command("bootmeth list", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device"); + ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device"); ut_assert_nextlinen("---"); ut_assert_nextline("(1 bootmeth)"); ut_assert_console_end(); @@ -57,7 +57,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assertok(run_command("bootmeth list -a", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device"); + ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device"); ut_assert_nextline(" - 1 efi EFI boot from an .efi file"); if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) ut_assert_nextline(" glob 2 firmware0 VBE simple"); @@ -67,12 +67,12 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assert_console_end(); /* Check the -a flag with the reverse order */ - ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0)); + ut_assertok(run_command("bootmeth order \"efi extlinux\"", 0)); ut_assert_console_end(); ut_assertok(run_command("bootmeth list -a", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device"); + ut_assert_nextline(" 1 0 extlinux Extlinux boot from a block device"); ut_assert_nextline(" 0 1 efi EFI boot from an .efi file"); if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) ut_assert_nextline(" glob 2 firmware0 VBE simple"); @@ -90,17 +90,17 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) "(3 bootmeths)" : "(2 bootmeths)"); /* Try reverse order */ - ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0)); + ut_assertok(run_command("bootmeth order \"efi extlinux\"", 0)); ut_assert_console_end(); ut_assertok(run_command("bootmeth list", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); ut_assert_nextline(" 0 1 efi EFI boot from an .efi file"); - ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device"); + ut_assert_nextline(" 1 0 extlinux Extlinux boot from a block device"); ut_assert_nextlinen("---"); ut_assert_nextline("(2 bootmeths)"); ut_assertnonnull(env_get("bootmeths")); - ut_asserteq_str("efi syslinux", env_get("bootmeths")); + ut_asserteq_str("efi extlinux", env_get("bootmeths")); ut_assert_console_end(); return 0; @@ -140,7 +140,7 @@ static int bootmeth_env(struct unit_test_state *uts) /* Select just one bootmethod */ console_record_reset_enable(); - ut_assertok(env_set("bootmeths", "syslinux")); + ut_assertok(env_set("bootmeths", "extlinux")); ut_asserteq(1, std->bootmeth_count); /* Select an invalid bootmethod */ @@ -149,7 +149,7 @@ static int bootmeth_env(struct unit_test_state *uts) ut_assert_nextlinen("## Error inserting"); ut_assert_console_end(); - ut_assertok(env_set("bootmeths", "efi syslinux")); + ut_assertok(env_set("bootmeths", "efi extlinux")); ut_asserteq(2, std->bootmeth_count); ut_assert_console_end(); -- cgit v1.2.3 From 020520bbc1ff4a542e014f0873c13b4543aea0ea Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 29 May 2023 10:59:09 -0400 Subject: Prepare v2023.07-rc3 Signed-off-by: Tom Rini --- Makefile | 2 +- doc/develop/release_cycle.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/develop') diff --git a/Makefile b/Makefile index a5ab5e3da9d..10bfaa52adf 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = 2023 PATCHLEVEL = 07 SUBLEVEL = -EXTRAVERSION = -rc2 +EXTRAVERSION = -rc3 NAME = # *DOCUMENTATION* diff --git a/doc/develop/release_cycle.rst b/doc/develop/release_cycle.rst index 41d8edecb88..c00cfaa3315 100644 --- a/doc/develop/release_cycle.rst +++ b/doc/develop/release_cycle.rst @@ -68,7 +68,7 @@ For the next scheduled release, release candidates were made on:: * U-Boot v2023.07-rc2 was released on Mon 08 May 2023. -.. * U-Boot v2023.07-rc3 was released on Mon 22 May 2023. +* U-Boot v2023.07-rc3 was released on Mon 29 May 2023. .. * U-Boot v2023.07-rc4 was released on Mon 05 June 2023. -- cgit v1.2.3 From 19b77d3d23966a0d6dbb3c86187765f11100fb6f Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 12 Jun 2023 13:45:09 -0400 Subject: Prepare v2023.07-rc4 Signed-off-by: Tom Rini --- Makefile | 2 +- doc/develop/release_cycle.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/develop') diff --git a/Makefile b/Makefile index 10bfaa52adf..8b030f31be9 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = 2023 PATCHLEVEL = 07 SUBLEVEL = -EXTRAVERSION = -rc3 +EXTRAVERSION = -rc4 NAME = # *DOCUMENTATION* diff --git a/doc/develop/release_cycle.rst b/doc/develop/release_cycle.rst index c00cfaa3315..2c82783a89e 100644 --- a/doc/develop/release_cycle.rst +++ b/doc/develop/release_cycle.rst @@ -70,7 +70,7 @@ For the next scheduled release, release candidates were made on:: * U-Boot v2023.07-rc3 was released on Mon 29 May 2023. -.. * U-Boot v2023.07-rc4 was released on Mon 05 June 2023. +* U-Boot v2023.07-rc4 was released on Mon 12 June 2023. .. * U-Boot v2023.07-rc5 was released on Mon 19 June 2023. -- cgit v1.2.3