[PATCH 0/4] Enable U-Boot at Virtualbox to boot images

From: mtt2hi thomas.mittelstaedt@bosch.com
The changes are needed to get U-Boot to be started at VirtualBox images supporting distro boot capability. Atm the patch "pci: coreboot: Don't read regions when booting" from Simon Glass is not integrated yet. So AHCI and IDE devices are not handled correctly without this patch. (https://patchwork.ozlabs.org/project/uboot/patch/20230220194927.476708-8-sjg...)
mtt2hi (4): X86: Add support for SCSI devices X86: Change command prompt X86: Add support for distro boot X86: pxeboot: bugfix: Set variable for size of initrd
boot/pxe_utils.c | 2 +- configs/efi-x86_payload64_defconfig | 12 ++++++++++-- include/configs/efi-x86_payload.h | 11 +++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-)

From: mtt2hi thomas.mittelstaedt@de.bosch.com
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com --- configs/efi-x86_payload64_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 5cde04a5ac..f3423091ae 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -22,7 +22,7 @@ CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_USB=y -# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_SETEXPR=y CONFIG_CMD_DHCP=y CONFIG_BOOTP_BOOTFILESIZE=y # CONFIG_CMD_NFS is not set @@ -32,6 +32,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y +CONFIG_CMD_SCSI=y CONFIG_CMD_FS_GENERIC=y CONFIG_MAC_PARTITION=y CONFIG_ISO_PARTITION=y @@ -58,3 +59,9 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_STUB_64BIT=y +CONFIG_FAT_WRITE=y +CONFIG_ENV_FAT_INTERFACE="scsi" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_FAT_FILE="uboot.env" +CONFIG_ENV_IS_IN_FAT=y +CONFIG_LEGACY_IMAGE_FORMAT=y

On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
configs/efi-x86_payload64_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 5cde04a5ac..f3423091ae 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -22,7 +22,7 @@ CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_USB=y -# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_SETEXPR=y
This looks like an unrelated change.
CONFIG_CMD_DHCP=y CONFIG_BOOTP_BOOTFILESIZE=y # CONFIG_CMD_NFS is not set @@ -32,6 +32,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y +CONFIG_CMD_SCSI=y CONFIG_CMD_FS_GENERIC=y CONFIG_MAC_PARTITION=y CONFIG_ISO_PARTITION=y @@ -58,3 +59,9 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_STUB_64BIT=y +CONFIG_FAT_WRITE=y +CONFIG_ENV_FAT_INTERFACE="scsi" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_FAT_FILE="uboot.env" +CONFIG_ENV_IS_IN_FAT=y
When changing the defconfig, please, use
make savedefconfig cp defconfig configs/efi-x86_payload64_defconfig git commit -s configs/efi-x86_payload64_defconfig
Best regards
Heinrich
+CONFIG_LEGACY_IMAGE_FORMAT=y

From: mtt2hi thomas.mittelstaedt@de.bosch.com
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com --- configs/efi-x86_payload64_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index f3423091ae..12b5e58374 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -65,3 +65,4 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_ENV_FAT_FILE="uboot.env" CONFIG_ENV_IS_IN_FAT=y CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SYS_PROMPT="U-Boot> "

On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
The commit message should provide a justification for the cahnge.
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
configs/efi-x86_payload64_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index f3423091ae..12b5e58374 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -65,3 +65,4 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_ENV_FAT_FILE="uboot.env" CONFIG_ENV_IS_IN_FAT=y CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SYS_PROMPT="U-Boot> "
Please, keep the default prompt.
Best regards
Heinrich

From: mtt2hi thomas.mittelstaedt@de.bosch.com
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com --- configs/efi-x86_payload64_defconfig | 2 +- include/configs/efi-x86_payload.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 12b5e58374..e6047e5fb4 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -11,7 +11,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -59,6 +58,7 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_STUB_64BIT=y +CONFIG_DISTRO_DEFAULTS=y CONFIG_FAT_WRITE=y CONFIG_ENV_FAT_INTERFACE="scsi" CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h index c72b067c36..e1cd8eb316 100644 --- a/include/configs/efi-x86_payload.h +++ b/include/configs/efi-x86_payload.h @@ -6,6 +6,17 @@ /* * board/config.h - configuration options, board specific */ +#ifndef CONFIG_SPL_BUILD + +#define BOOT_TARGET_SCSI(func) \ + func(SCSI, scsi, 0) + +#define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_SCSI(func) + +#include <config_distro_bootcmd.h> + +#endif
#ifndef __CONFIG_H #define __CONFIG_H

On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
Patches without commit messages cannot be accepted.
Best regards
Heinrich
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
configs/efi-x86_payload64_defconfig | 2 +- include/configs/efi-x86_payload.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 12b5e58374..e6047e5fb4 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -11,7 +11,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -59,6 +58,7 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_STUB_64BIT=y +CONFIG_DISTRO_DEFAULTS=y CONFIG_FAT_WRITE=y CONFIG_ENV_FAT_INTERFACE="scsi" CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h index c72b067c36..e1cd8eb316 100644 --- a/include/configs/efi-x86_payload.h +++ b/include/configs/efi-x86_payload.h @@ -6,6 +6,17 @@ /*
- board/config.h - configuration options, board specific
*/ +#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_SCSI(func) \
func(SCSI, scsi, 0)
+#define BOOT_TARGET_DEVICES(func) \
- BOOT_TARGET_SCSI(func)
+#include <config_distro_bootcmd.h>
+#endif
#ifndef __CONFIG_H #define __CONFIG_H

Hi,
On Tue, 2 May 2023 at 04:19, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
Patches without commit messages cannot be accepted.
Best regards
Heinrich
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
configs/efi-x86_payload64_defconfig | 2 +- include/configs/efi-x86_payload.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 12b5e58374..e6047e5fb4 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -11,7 +11,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -59,6 +58,7 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_STUB_64BIT=y +CONFIG_DISTRO_DEFAULTS=y CONFIG_FAT_WRITE=y CONFIG_ENV_FAT_INTERFACE="scsi" CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h index c72b067c36..e1cd8eb316 100644 --- a/include/configs/efi-x86_payload.h +++ b/include/configs/efi-x86_payload.h @@ -6,6 +6,17 @@ /*
- board/config.h - configuration options, board specific
*/ +#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_SCSI(func) \
func(SCSI, scsi, 0)
+#define BOOT_TARGET_DEVICES(func) \
BOOT_TARGET_SCSI(func)
+#include <config_distro_bootcmd.h>
+#endif
#ifndef __CONFIG_H #define __CONFIG_H
Can you use bootstd instead?
Regards, Simon

From: mtt2hi thomas.mittelstaedt@de.bosch.com
The problem was, that zboot() didn't work because of missing ramdisc size.
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com --- boot/pxe_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 3a1e50f2b1..87c32b6e62 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -554,7 +554,7 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) label->name); goto cleanup; } - + strcpy(initrd_filesize, simple_xtoa(size)); initrd_addr_str = env_get("ramdisk_addr_r"); size = snprintf(initrd_str, sizeof(initrd_str), "%s:%lx", initrd_addr_str, size);

On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
The problem was, that zboot() didn't work because of missing ramdisc size.
Can we create a test for this?
Best regards
Heirnich
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
boot/pxe_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 3a1e50f2b1..87c32b6e62 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -554,7 +554,7 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) label->name); goto cleanup; }
initrd_addr_str = env_get("ramdisk_addr_r"); size = snprintf(initrd_str, sizeof(initrd_str), "%s:%lx", initrd_addr_str, size);strcpy(initrd_filesize, simple_xtoa(size));

-----Ursprüngliche Nachricht----- Von: Heinrich Schuchardt xypron.glpk@gmx.de Gesendet: Dienstag, 2. Mai 2023 12:15 An: Mittelstaedt Thomas (XC-CT/EBV3) thomas.mittelstaedt@bosch.com; u- boot@lists.denx.de Cc: Simon Glass sjg@chromium.org; Niel Armstrong neil.armstrong@linaro.org; Patrick Delaunay patrick.delaunay@foss.st.com; Ramon Fried rfried.dev@gmail.com; Marek Vasut marex@denx.de; Manuel Traut manuel.traut@mt.com; Bin Meng bmeng.cn@gmail.com Betreff: Re: [PATCH 4/4] X86: pxeboot: bugfix: Set variable for size of initrd
On 5/2/23 11:49, thomas.mittelstaedt@bosch.com wrote:
From: mtt2hi thomas.mittelstaedt@de.bosch.com
The problem was, that zboot() didn't work because of missing ramdisc size.
Can we create a test for this?
We could test it, if all would be fine. Atm this function seems only to be called by distroboot implementation. And this is not activated yet.
But for the first time a code walk trough seems to be more appropriate.
At line 551/552 the initrd is loaded to memory and the size is saved to variable size. My correction at 557 stores a string representing the size to variable initrd_filesize At line 725 initrd_filesize is set to parameters of function zboot(). So it must fail without the correction.
Best regards
Heirnich
Signed-off-by: mtt2hi thomas.mittelstaedt@de.bosch.com
boot/pxe_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 3a1e50f2b1..87c32b6e62 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -554,7 +554,7 @@ static int label_boot(struct pxe_context *ctx, struct
pxe_label *label)
label->name); goto cleanup; }
initrd_addr_str = env_get("ramdisk_addr_r"); size = snprintf(initrd_str, sizeof(initrd_str), "%s:%lx", initrd_addr_str, size);strcpy(initrd_filesize, simple_xtoa(size));
participants (4)
-
Heinrich Schuchardt
-
Mittelstaedt Thomas (XC-CT/EBV3)
-
Simon Glass
-
thomas.mittelstaedt@bosch.com