Add "-uboot" option
cover Add "-uboot" option
These patches add "-uboot" option to ARM boards. To let user load u-boot, board should initialize .uboot_start in arm_boot_info struct.
Added utilisation of "-uboot" for exynos4 and integratorcp.
Evgeny Voevodin (2):
ARM: Add "-uboot" option.
ARM: exynos, integratorcp: Specify U-Boot start address.
hw/arm-misc.h | 1 + hw/arm_boot.c | 51 ++++++++++++++++++++++++++++++++++++++------------- hw/exynos4210.h | 1 + hw/exynos4_boards.c | 1 + hw/integratorcp.c | 1 + qemu-options.hx | 8 ++++++++ sysemu.h | 1 + vl.c | 4 ++++ 8 files changed, 55 insertions(+), 13 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/2 ARM: Add "-uboot" option.
With this option board can load U-Boot into address specified through arm_boot_info.uboot_start.
--- hw/arm-misc.h | 1 + hw/arm_boot.c | 51 ++++++++++++++++++++++++++++++++++++++------------- qemu-options.hx | 8 ++++++++ sysemu.h | 1 + vl.c | 4 ++++ 5 files changed, 52 insertions(+), 13 deletions(-)
hw/arm-misc.h +1 -0
@@ -29,6 +29,7 @@ struct arm_boot_info {const char *kernel_filename;const char *kernel_cmdline;const char *initrd_filename; +target_phys_addr_t uboot_start;target_phys_addr_t loader_start;/* multicore boards that use the default secondary core boot functions * need to put the address of the secondary boot code, the boot reg,
hw/arm_boot.c +38 -13
70 lines not on this page · raw message
qemu-options.hx +8 -0
@@ -2336,6 +2336,14 @@ STEXI Set the filename for the BIOS. ETEXI +DEF("uboot", HAS_ARG, QEMU_OPTION_uboot, \ + "-uboot file set the filename for the U-Boot\n", QEMU_ARCH_ARM) +STEXI +@item -uboot @var{file} +@findex -uboot +Set the filename for the U-Boot. +ETEXI + DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL) STEXI
sysemu.h +1 -0
@@ -13,6 +13,7 @@/* vl.c */ extern const char *bios_name; +extern const char *uboot_name;extern const char *qemu_name;extern uint8_t qemu_uuid[];
vl.c +4 -0
@@ -176,6 +176,7 @@ int main(int argc, char **argv)static const char *data_dir;const char *bios_name =NULL ; +const char *uboot_name =NULL ;enum vga_retrace_method vga_retrace_method =VGA_RETRACE_DUMB ;DisplayType display_type =DT_DEFAULT ;int display_remote =0 ;
@@ -2617,6 +2618,9 @@ int main(int argc, char **argv, char **envp)case QEMU_OPTION_bios: bios_name = optarg;break ; +case QEMU_OPTION_uboot: + uboot_name = optarg; +break ;case QEMU_OPTION_singlestep: singlestep =1 ;break ;
Signature · 1 line
1.7.5.4
PATCH 2/2 ARM: exynos, integratorcp: Specify U-Boot start address.
In reply to Evgeny Voevodin--- hw/exynos4210.h | 1 + hw/exynos4_boards.c | 1 + hw/integratorcp.c | 1 + 3 files changed, 3 insertions(+), 0 deletions(-)
hw/exynos4210.h +1 -0
@@ -43,6 +43,7 @@#define EXYNOS4210_IRAM_BASE_ADDR 0x02020000#define EXYNOS4210_IRAM_SIZE 0x00020000/* 128 KB */ +#define EXYNOS4210_UBOOT_ADDR 0x44800000/* Secondary CPU startup code is in IROM memory */ #define EXYNOS4210_SMP_BOOT_ADDR EXYNOS4210_IROM_BASE_ADDR#define EXYNOS4210_SMP_BOOT_SIZE 0x1000
hw/exynos4_boards.c +1 -0
@@ -67,6 +67,7 @@ static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { };static struct arm_boot_info exynos4_board_binfo = { + .uboot_start =EXYNOS4210_UBOOT_ADDR , .loader_start =EXYNOS4210_BASE_BOOT_ADDR , .smp_loader_start =EXYNOS4210_SMP_BOOT_ADDR , .nb_cpus =EXYNOS4210_NCPUS ,
hw/integratorcp.c +1 -0
@@ -434,6 +434,7 @@ static void icp_control_init(target_phys_addr_t base)/* Board init. */ static struct arm_boot_info integrator_binfo = { + .uboot_start =0x01000000 , .loader_start =0x0 , .board_id =0x113 , };
Signature · 1 line
1.7.5.4
Quoted 4 lines · Evgeny Voevodin
These patches add "-uboot" option to ARM boards. To let user load u-boot, board should initialize .uboot_start in
arm_boot_infostruct.
Added utilisation of "-uboot" for exynos4 and integratorcp.
Nack. This kind of thing should be done by making QEMU load an ELF file which has u-boot in it (which at the moment you can do with -kernel). Loading Linux kernels is a special case in arm_boot because of the complicated boot protocol they have and because people want to load lots of different kernels.
-- PMM
Quoted 5 lines · Peter Maydell
Quoted 4 lines · Evgeny Voevodin
These patches add "-uboot" option to ARM boards. To let user load u-boot, board should initialize .uboot_start in
arm_boot_infostruct.
Added utilisation of "-uboot" for exynos4 and integratorcp.
Quoted 9 lines
Nack. This kind of thing should be done by making QEMU load an ELF file which has u-boot in it (which at the moment you can do with -kernel). Loading Linux kernels is a special case in
arm_bootbecause of the complicated boot protocol they have and because people want to load lots of different kernels.-- PMM
As I understood, you mean that -kernel is for people who want to quickly compile and try different kernel.
As for me, -uboot is the same ) No need to generate a file, where u-boot and kernel are placed. Just use -uboot ./u-boot -kernel ./uImage, change kernel, or change u-boot, or both, as you wish.
Signature · 5 lines
Kind regards, Evgeny Voevodin, Leading Software Engineer, ASWG, Moscow R&D center, Samsung Electronics e-mail: [email protected]
Quoted 8 lines · Evgeny Voevodin
Quoted 6 lines · Peter Maydell
Nack. This kind of thing should be done by making QEMU load an ELF file which has u-boot in it (which at the moment you can do with -kernel). Loading Linux kernels is a special case in
arm_bootbecause of the complicated boot protocol they have and because people want to load lots of different kernels.
Quoted 5 lines
As I understood, you mean that -kernel is for people who want to quickly compile and try different kernel.
As for me, -uboot is the same ) No need to generate a file, where u-boot and kernel are placed. Just use -uboot ./u-boot -kernel ./uImage, change kernel, or change u-boot, or both, as you wish.
If you're using -kernel you don't need to provide a u-boot because qemu is being the bootloader. If you're making qemu execute a bootloader than you should just put the kernel where u-boot would load it normally.
We really can't add random options to qemu to support loading every single thing you might possibly want to load, which is why I'm drawing a line in the sand here.
-- PMM