mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 06:46:59 +00:00
- Fix broken multi-core boot for QEMU x86 - Add zboot support to boot x86 Linux kernel image in the PXE sysboot utility
This commit is contained in:
commit
67472aa059
3 changed files with 64 additions and 54 deletions
|
@ -17,10 +17,16 @@ int qemu_cpu_fixup(void)
|
|||
int ret;
|
||||
int cpu_num;
|
||||
int cpu_online;
|
||||
struct uclass *uc;
|
||||
struct udevice *dev, *pdev;
|
||||
struct cpu_plat *plat;
|
||||
char *cpu;
|
||||
|
||||
/* This will cause the CPUs devices to be bound */
|
||||
ret = uclass_get(UCLASS_CPU, &uc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* first we need to find '/cpus' */
|
||||
for (device_find_first_child(dm_root(), &pdev);
|
||||
pdev;
|
||||
|
|
|
@ -492,16 +492,16 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
|||
env_get("gatewayip"), env_get("netmask"));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CMD_NET
|
||||
if (label->ipappend & 0x2) {
|
||||
int err;
|
||||
if (IS_ENABLED(CONFIG_CMD_NET)) {
|
||||
if (label->ipappend & 0x2) {
|
||||
int err;
|
||||
|
||||
strcpy(mac_str, " BOOTIF=");
|
||||
err = format_mac_pxe(mac_str + 8, sizeof(mac_str) - 8);
|
||||
if (err < 0)
|
||||
mac_str[0] = '\0';
|
||||
strcpy(mac_str, " BOOTIF=");
|
||||
err = format_mac_pxe(mac_str + 8, sizeof(mac_str) - 8);
|
||||
if (err < 0)
|
||||
mac_str[0] = '\0';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((label->ipappend & 0x3) || label->append) {
|
||||
char bootargs[CONFIG_SYS_CBSIZE] = "";
|
||||
|
@ -649,15 +649,16 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
|||
/* Try bootm for legacy and FIT format image */
|
||||
if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID)
|
||||
do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
|
||||
#ifdef CONFIG_CMD_BOOTI
|
||||
/* Try booting an AArch64 Linux kernel image */
|
||||
else
|
||||
else if (IS_ENABLED(CONFIG_CMD_BOOTI))
|
||||
do_booti(cmdtp, 0, bootm_argc, bootm_argv);
|
||||
#elif defined(CONFIG_CMD_BOOTZ)
|
||||
/* Try booting a Image */
|
||||
else
|
||||
else if (IS_ENABLED(CONFIG_CMD_BOOTZ))
|
||||
do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
|
||||
#endif
|
||||
/* Try booting an x86_64 Linux kernel image */
|
||||
else if (IS_ENABLED(CONFIG_CMD_ZBOOT))
|
||||
do_zboot_parent(cmdtp, 0, bootm_argc, bootm_argv, NULL);
|
||||
|
||||
unmap_sysmem(buf);
|
||||
|
||||
cleanup:
|
||||
|
@ -1424,20 +1425,20 @@ void handle_pxe_menu(struct cmd_tbl *cmdtp, struct pxe_menu *cfg)
|
|||
struct menu *m;
|
||||
int err;
|
||||
|
||||
#ifdef CONFIG_CMD_BMP
|
||||
/* display BMP if available */
|
||||
if (cfg->bmp) {
|
||||
if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {
|
||||
if (CONFIG_IS_ENABLED(CMD_CLS))
|
||||
run_command("cls", 0);
|
||||
bmp_display(image_load_addr,
|
||||
BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
|
||||
} else {
|
||||
printf("Skipping background bmp %s for failure\n",
|
||||
cfg->bmp);
|
||||
if (IS_ENABLED(CONFIG_CMD_BMP)) {
|
||||
/* display BMP if available */
|
||||
if (cfg->bmp) {
|
||||
if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {
|
||||
if (CONFIG_IS_ENABLED(CMD_CLS))
|
||||
run_command("cls", 0);
|
||||
bmp_display(image_load_addr,
|
||||
BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
|
||||
} else {
|
||||
printf("Skipping background bmp %s for failure\n",
|
||||
cfg->bmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m = pxe_menu_to_menu(cfg);
|
||||
if (!m)
|
||||
|
|
|
@ -55,8 +55,8 @@ struct cmd_tbl {
|
|||
};
|
||||
|
||||
#if defined(CONFIG_CMD_RUN)
|
||||
extern int do_run(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_run(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
#endif
|
||||
|
||||
/* common/command.c */
|
||||
|
@ -69,7 +69,7 @@ int complete_subcmdv(struct cmd_tbl *cmdtp, int count, int argc,
|
|||
char *const argv[], char last_char, int maxv,
|
||||
char *cmdv[]);
|
||||
|
||||
extern int cmd_usage(const struct cmd_tbl *cmdtp);
|
||||
int cmd_usage(const struct cmd_tbl *cmdtp);
|
||||
|
||||
/* Dummy ->cmd and ->cmd_rep wrappers. */
|
||||
int cmd_always_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
@ -85,10 +85,10 @@ static inline bool cmd_is_repeatable(struct cmd_tbl *cmdtp)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_AUTO_COMPLETE
|
||||
extern int var_complete(int argc, char *const argv[], char last_char, int maxv,
|
||||
char *cmdv[]);
|
||||
extern int cmd_auto_complete(const char *const prompt, char *buf, int *np,
|
||||
int *colp);
|
||||
int var_complete(int argc, char *const argv[], char last_char, int maxv,
|
||||
char *cmdv[]);
|
||||
int cmd_auto_complete(const char *const prompt, char *buf, int *np,
|
||||
int *colp);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -145,13 +145,13 @@ int cmd_get_data_size(char *arg, int default_size);
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_BOOTD
|
||||
extern int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
#endif
|
||||
#ifdef CONFIG_CMD_BOOTM
|
||||
extern int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
extern int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd);
|
||||
int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd);
|
||||
#else
|
||||
static inline int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd)
|
||||
{
|
||||
|
@ -159,28 +159,31 @@ static inline int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd)
|
|||
}
|
||||
#endif
|
||||
|
||||
extern int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int do_booti(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int do_zboot_parent(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[], int *repeatable);
|
||||
|
||||
int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
extern int do_booti(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
extern int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
extern int do_reset(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
extern int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
extern unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
|
||||
char *const argv[]);
|
||||
unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
|
||||
char *const argv[]);
|
||||
|
||||
#if defined(CONFIG_CMD_NVEDIT_EFI)
|
||||
extern int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
extern int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[]);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue