summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-07-19 08:53:23 -0600
committerTom Rini <[email protected]>2024-07-19 08:53:23 -0600
commitcb0b7ab607aa71ae4b77a2b4d30d3d604c8324af (patch)
treedc3702be4e5ca6bdcf2ca66d4948bc44cf72a36a /boot
parent459560000736ac7c9c8b04522789c20fb45ff95a (diff)
parent38b000881ebc0a48b0a814fce9f52dfe62ac644b (diff)
Merge tag 'efi-2024-10-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-10-rc1-3 Documentation: * Move out-of-tree building info to HTML * Enable ReadTheDocs addon management * Remove FIT documentation that is elsewhere * Update table of contents for FIT images * Add description for more boot methods UEFI: * Correct finding distro device-path for media devices * Fix typo in EFI_RT_VOLATILE_STORE description Other: * MAINTAINERS: Rename BOOTDEVICE
Diffstat (limited to 'boot')
-rw-r--r--boot/bootmeth_efi.c3
-rw-r--r--boot/bootmeth_extlinux.c2
-rw-r--r--boot/bootmeth_qfw.c2
-rw-r--r--boot/bootmeth_sandbox.c2
-rw-r--r--boot/bootmeth_script.c53
5 files changed, 37 insertions, 25 deletions
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 5a4c125835a..39232eb2e25 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -265,7 +265,7 @@ static int distro_efi_read_bootflow_net(struct bootflow *bflow)
return log_msg_ret("sz", -EINVAL);
bflow->size = size;
- /* bootfile should be setup by dhcp*/
+ /* bootfile should be setup by dhcp */
bootfile_name = env_get("bootfile");
if (!bootfile_name)
return log_msg_ret("bootfile_name", ret);
@@ -394,6 +394,7 @@ static const struct udevice_id distro_efi_bootmeth_ids[] = {
{ }
};
+/* Put a number before 'efi' to provide a default ordering */
U_BOOT_DRIVER(bootmeth_4efi) = {
.name = "bootmeth_efi",
.id = UCLASS_BOOTMETH,
diff --git a/boot/bootmeth_extlinux.c b/boot/bootmeth_extlinux.c
index 9b55686948f..fbb05ef928e 100644
--- a/boot/bootmeth_extlinux.c
+++ b/boot/bootmeth_extlinux.c
@@ -183,7 +183,7 @@ static const struct udevice_id extlinux_bootmeth_ids[] = {
{ }
};
-/* Put an number before 'extlinux' to provide a default ordering */
+/* Put a number before 'extlinux' to provide a default ordering */
U_BOOT_DRIVER(bootmeth_1extlinux) = {
.name = "bootmeth_extlinux",
.id = UCLASS_BOOTMETH,
diff --git a/boot/bootmeth_qfw.c b/boot/bootmeth_qfw.c
index dfaa944594e..2f8e00cf350 100644
--- a/boot/bootmeth_qfw.c
+++ b/boot/bootmeth_qfw.c
@@ -88,7 +88,7 @@ static struct bootmeth_ops qfw_bootmeth_ops = {
};
static const struct udevice_id qfw_bootmeth_ids[] = {
- { .compatible = "u-boot,qfw-extlinux" },
+ { .compatible = "u-boot,qfw-bootmeth" },
{ }
};
diff --git a/boot/bootmeth_sandbox.c b/boot/bootmeth_sandbox.c
index 0bc8f688e30..26c713bb5f3 100644
--- a/boot/bootmeth_sandbox.c
+++ b/boot/bootmeth_sandbox.c
@@ -55,7 +55,7 @@ static struct bootmeth_ops sandbox_bootmeth_ops = {
};
static const struct udevice_id sandbox_bootmeth_ids[] = {
- { .compatible = "u-boot,sandbox-extlinux" },
+ { .compatible = "u-boot,sandbox-bootmeth" },
{ }
};
diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c
index 0e05d28d4d9..c5cbf18c2e6 100644
--- a/boot/bootmeth_script.c
+++ b/boot/bootmeth_script.c
@@ -185,31 +185,42 @@ static int script_set_bootflow(struct udevice *dev, struct bootflow *bflow,
static int script_boot(struct udevice *dev, struct bootflow *bflow)
{
- struct blk_desc *desc = dev_get_uclass_plat(bflow->blk);
+ struct blk_desc *desc;
ulong addr;
int ret = 0;
- if (desc->uclass_id == UCLASS_USB) {
- ret = env_set("devtype", "usb");
+ if (bflow->blk) {
+ desc = dev_get_uclass_plat(bflow->blk);
+ if (desc->uclass_id == UCLASS_USB) {
+ ret = env_set("devtype", "usb");
+ } else {
+ /*
+ * If the uclass is AHCI, but the driver is ATA
+ * (not scsi), set devtype to sata
+ */
+ if (IS_ENABLED(CONFIG_SATA) &&
+ desc->uclass_id == UCLASS_AHCI)
+ ret = env_set("devtype", "sata");
+ else
+ ret = env_set("devtype", blk_get_devtype(bflow->blk));
+ }
+ if (!ret)
+ ret = env_set_hex("devnum", desc->devnum);
+ if (!ret)
+ ret = env_set_hex("distro_bootpart", bflow->part);
+ if (!ret)
+ ret = env_set("prefix", bflow->subdir);
+ if (!ret && IS_ENABLED(CONFIG_ARCH_SUNXI) &&
+ !strcmp("mmc", blk_get_devtype(bflow->blk)))
+ ret = env_set_hex("mmc_bootdev", desc->devnum);
} else {
- /* If the uclass is AHCI, but the driver is ATA
- * (not scsi), set devtype to sata
- */
- if (IS_ENABLED(CONFIG_SATA) &&
- desc->uclass_id == UCLASS_AHCI)
- ret = env_set("devtype", "sata");
- else
- ret = env_set("devtype", blk_get_devtype(bflow->blk));
+ const struct udevice *media = dev_get_parent(bflow->dev);
+
+ ret = env_set("devtype",
+ uclass_get_name(device_get_uclass_id(media)));
+ if (!ret)
+ ret = env_set_hex("devnum", dev_seq(media));
}
- if (!ret)
- ret = env_set_hex("devnum", desc->devnum);
- if (!ret)
- ret = env_set_hex("distro_bootpart", bflow->part);
- if (!ret)
- ret = env_set("prefix", bflow->subdir);
- if (!ret && IS_ENABLED(CONFIG_ARCH_SUNXI) &&
- !strcmp("mmc", blk_get_devtype(bflow->blk)))
- ret = env_set_hex("mmc_bootdev", desc->devnum);
if (ret)
return log_msg_ret("env", ret);
@@ -250,7 +261,7 @@ static const struct udevice_id script_bootmeth_ids[] = {
{ }
};
-/* Put an number before 'script' to provide a default ordering */
+/* Put a number before 'script' to provide a default ordering */
U_BOOT_DRIVER(bootmeth_2script) = {
.name = "bootmeth_script",
.id = UCLASS_BOOTMETH,