arm_boot: Pass ARMCPU to arm_load_kernel()
In particular this simplifies the &s->mpu->cpu->env expression again. first_cpu and ->next_cpu are expected to be QOM'ified later. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos) Acked-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
17c2f0bf37
commit
3aaa8dfae9
@ -59,7 +59,7 @@ struct arm_boot_info {
|
|||||||
target_phys_addr_t initrd_size;
|
target_phys_addr_t initrd_size;
|
||||||
target_phys_addr_t entry;
|
target_phys_addr_t entry;
|
||||||
};
|
};
|
||||||
void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info);
|
void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
|
||||||
|
|
||||||
/* Multiplication factor to convert from system clock ticks to qemu timer
|
/* Multiplication factor to convert from system clock ticks to qemu timer
|
||||||
ticks. */
|
ticks. */
|
||||||
|
@ -303,9 +303,9 @@ static void do_cpu_reset(void *opaque)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info)
|
void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
|
||||||
{
|
{
|
||||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
CPUARMState *env = &cpu->env;
|
||||||
int kernel_size;
|
int kernel_size;
|
||||||
int initrd_size;
|
int initrd_size;
|
||||||
int n;
|
int n;
|
||||||
|
@ -54,7 +54,7 @@ static void collie_init(ram_addr_t ram_size,
|
|||||||
collie_binfo.kernel_cmdline = kernel_cmdline;
|
collie_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
collie_binfo.initrd_filename = initrd_filename;
|
collie_binfo.initrd_filename = initrd_filename;
|
||||||
collie_binfo.board_id = 0x208;
|
collie_binfo.board_id = 0x208;
|
||||||
arm_load_kernel(&s->cpu->env, &collie_binfo);
|
arm_load_kernel(s->cpu, &collie_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine collie_machine = {
|
static QEMUMachine collie_machine = {
|
||||||
|
@ -138,7 +138,7 @@ static void nuri_init(ram_addr_t ram_size,
|
|||||||
exynos4_boards_init_common(kernel_filename, kernel_cmdline,
|
exynos4_boards_init_common(kernel_filename, kernel_cmdline,
|
||||||
initrd_filename, EXYNOS4_BOARD_NURI);
|
initrd_filename, EXYNOS4_BOARD_NURI);
|
||||||
|
|
||||||
arm_load_kernel(first_cpu, &exynos4_board_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &exynos4_board_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void smdkc210_init(ram_addr_t ram_size,
|
static void smdkc210_init(ram_addr_t ram_size,
|
||||||
@ -151,7 +151,7 @@ static void smdkc210_init(ram_addr_t ram_size,
|
|||||||
|
|
||||||
lan9215_init(SMDK_LAN9118_BASE_ADDR,
|
lan9215_init(SMDK_LAN9118_BASE_ADDR,
|
||||||
qemu_irq_invert(s->irq_table[exynos4210_get_irq(37, 1)]));
|
qemu_irq_invert(s->irq_table[exynos4210_get_irq(37, 1)]));
|
||||||
arm_load_kernel(first_cpu, &exynos4_board_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &exynos4_board_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine exynos4_machines[EXYNOS4_NUM_OF_BOARDS] = {
|
static QEMUMachine exynos4_machines[EXYNOS4_NUM_OF_BOARDS] = {
|
||||||
|
@ -318,7 +318,7 @@ static void highbank_init(ram_addr_t ram_size,
|
|||||||
highbank_binfo.loader_start = 0;
|
highbank_binfo.loader_start = 0;
|
||||||
highbank_binfo.write_secondary_boot = hb_write_secondary;
|
highbank_binfo.write_secondary_boot = hb_write_secondary;
|
||||||
highbank_binfo.secondary_cpu_reset_hook = hb_reset_secondary;
|
highbank_binfo.secondary_cpu_reset_hook = hb_reset_secondary;
|
||||||
arm_load_kernel(first_cpu, &highbank_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &highbank_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine highbank_machine = {
|
static QEMUMachine highbank_machine = {
|
||||||
|
@ -502,7 +502,7 @@ static void integratorcp_init(ram_addr_t ram_size,
|
|||||||
integrator_binfo.kernel_filename = kernel_filename;
|
integrator_binfo.kernel_filename = kernel_filename;
|
||||||
integrator_binfo.kernel_cmdline = kernel_cmdline;
|
integrator_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
integrator_binfo.initrd_filename = initrd_filename;
|
integrator_binfo.initrd_filename = initrd_filename;
|
||||||
arm_load_kernel(&cpu->env, &integrator_binfo);
|
arm_load_kernel(cpu, &integrator_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine integratorcp_machine = {
|
static QEMUMachine integratorcp_machine = {
|
||||||
|
@ -168,7 +168,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
|
|||||||
mainstone_binfo.kernel_cmdline = kernel_cmdline;
|
mainstone_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
mainstone_binfo.initrd_filename = initrd_filename;
|
mainstone_binfo.initrd_filename = initrd_filename;
|
||||||
mainstone_binfo.board_id = arm_id;
|
mainstone_binfo.board_id = arm_id;
|
||||||
arm_load_kernel(&mpu->cpu->env, &mainstone_binfo);
|
arm_load_kernel(mpu->cpu, &mainstone_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mainstone_init(ram_addr_t ram_size,
|
static void mainstone_init(ram_addr_t ram_size,
|
||||||
|
@ -1651,7 +1651,7 @@ static void musicpal_init(ram_addr_t ram_size,
|
|||||||
musicpal_binfo.kernel_filename = kernel_filename;
|
musicpal_binfo.kernel_filename = kernel_filename;
|
||||||
musicpal_binfo.kernel_cmdline = kernel_cmdline;
|
musicpal_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
musicpal_binfo.initrd_filename = initrd_filename;
|
musicpal_binfo.initrd_filename = initrd_filename;
|
||||||
arm_load_kernel(&cpu->env, &musicpal_binfo);
|
arm_load_kernel(cpu, &musicpal_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine musicpal_machine = {
|
static QEMUMachine musicpal_machine = {
|
||||||
|
@ -1329,7 +1329,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
|
|||||||
binfo->kernel_filename = kernel_filename;
|
binfo->kernel_filename = kernel_filename;
|
||||||
binfo->kernel_cmdline = kernel_cmdline;
|
binfo->kernel_cmdline = kernel_cmdline;
|
||||||
binfo->initrd_filename = initrd_filename;
|
binfo->initrd_filename = initrd_filename;
|
||||||
arm_load_kernel(&s->mpu->cpu->env, binfo);
|
arm_load_kernel(s->mpu->cpu, binfo);
|
||||||
|
|
||||||
qemu_register_reset(n8x0_boot_init, s);
|
qemu_register_reset(n8x0_boot_init, s);
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ static void sx1_init(ram_addr_t ram_size,
|
|||||||
sx1_binfo.kernel_filename = kernel_filename;
|
sx1_binfo.kernel_filename = kernel_filename;
|
||||||
sx1_binfo.kernel_cmdline = kernel_cmdline;
|
sx1_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
sx1_binfo.initrd_filename = initrd_filename;
|
sx1_binfo.initrd_filename = initrd_filename;
|
||||||
arm_load_kernel(&mpu->cpu->env, &sx1_binfo);
|
arm_load_kernel(mpu->cpu, &sx1_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: fix next line */
|
/* TODO: fix next line */
|
||||||
|
@ -265,7 +265,7 @@ static void palmte_init(ram_addr_t ram_size,
|
|||||||
palmte_binfo.kernel_filename = kernel_filename;
|
palmte_binfo.kernel_filename = kernel_filename;
|
||||||
palmte_binfo.kernel_cmdline = kernel_cmdline;
|
palmte_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
palmte_binfo.initrd_filename = initrd_filename;
|
palmte_binfo.initrd_filename = initrd_filename;
|
||||||
arm_load_kernel(&mpu->cpu->env, &palmte_binfo);
|
arm_load_kernel(mpu->cpu, &palmte_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: We shouldn't really be doing this here. The LCD controller
|
/* FIXME: We shouldn't really be doing this here. The LCD controller
|
||||||
|
@ -327,7 +327,7 @@ static void realview_init(ram_addr_t ram_size,
|
|||||||
realview_binfo.nb_cpus = smp_cpus;
|
realview_binfo.nb_cpus = smp_cpus;
|
||||||
realview_binfo.board_id = realview_board_id[board_type];
|
realview_binfo.board_id = realview_board_id[board_type];
|
||||||
realview_binfo.loader_start = (board_type == BOARD_PB_A8 ? 0x70000000 : 0);
|
realview_binfo.loader_start = (board_type == BOARD_PB_A8 ? 0x70000000 : 0);
|
||||||
arm_load_kernel(first_cpu, &realview_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &realview_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void realview_eb_init(ram_addr_t ram_size,
|
static void realview_eb_init(ram_addr_t ram_size,
|
||||||
|
@ -932,7 +932,7 @@ static void spitz_common_init(ram_addr_t ram_size,
|
|||||||
spitz_binfo.kernel_cmdline = kernel_cmdline;
|
spitz_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
spitz_binfo.initrd_filename = initrd_filename;
|
spitz_binfo.initrd_filename = initrd_filename;
|
||||||
spitz_binfo.board_id = arm_id;
|
spitz_binfo.board_id = arm_id;
|
||||||
arm_load_kernel(&mpu->cpu->env, &spitz_binfo);
|
arm_load_kernel(mpu->cpu, &spitz_binfo);
|
||||||
sl_bootparam_write(SL_PXA_PARAM_BASE);
|
sl_bootparam_write(SL_PXA_PARAM_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ static void tosa_init(ram_addr_t ram_size,
|
|||||||
tosa_binfo.kernel_cmdline = kernel_cmdline;
|
tosa_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
tosa_binfo.initrd_filename = initrd_filename;
|
tosa_binfo.initrd_filename = initrd_filename;
|
||||||
tosa_binfo.board_id = 0x208;
|
tosa_binfo.board_id = 0x208;
|
||||||
arm_load_kernel(&mpu->cpu->env, &tosa_binfo);
|
arm_load_kernel(mpu->cpu, &tosa_binfo);
|
||||||
sl_bootparam_write(SL_PXA_PARAM_BASE);
|
sl_bootparam_write(SL_PXA_PARAM_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ static void versatile_init(ram_addr_t ram_size,
|
|||||||
versatile_binfo.kernel_cmdline = kernel_cmdline;
|
versatile_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
versatile_binfo.initrd_filename = initrd_filename;
|
versatile_binfo.initrd_filename = initrd_filename;
|
||||||
versatile_binfo.board_id = board_id;
|
versatile_binfo.board_id = board_id;
|
||||||
arm_load_kernel(&cpu->env, &versatile_binfo);
|
arm_load_kernel(cpu, &versatile_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vpb_init(ram_addr_t ram_size,
|
static void vpb_init(ram_addr_t ram_size,
|
||||||
|
@ -438,7 +438,7 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard,
|
|||||||
vexpress_binfo.smp_loader_start = map[VE_SRAM];
|
vexpress_binfo.smp_loader_start = map[VE_SRAM];
|
||||||
vexpress_binfo.smp_bootreg_addr = map[VE_SYSREGS] + 0x30;
|
vexpress_binfo.smp_bootreg_addr = map[VE_SYSREGS] + 0x30;
|
||||||
vexpress_binfo.gic_cpu_if_addr = daughterboard->gic_cpu_if_addr;
|
vexpress_binfo.gic_cpu_if_addr = daughterboard->gic_cpu_if_addr;
|
||||||
arm_load_kernel(first_cpu, &vexpress_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &vexpress_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vexpress_a9_init(ram_addr_t ram_size,
|
static void vexpress_a9_init(ram_addr_t ram_size,
|
||||||
|
@ -137,7 +137,7 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device,
|
|||||||
zynq_binfo.nb_cpus = 1;
|
zynq_binfo.nb_cpus = 1;
|
||||||
zynq_binfo.board_id = 0xd32;
|
zynq_binfo.board_id = 0xd32;
|
||||||
zynq_binfo.loader_start = 0;
|
zynq_binfo.loader_start = 0;
|
||||||
arm_load_kernel(first_cpu, &zynq_binfo);
|
arm_load_kernel(arm_env_get_cpu(first_cpu), &zynq_binfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QEMUMachine zynq_machine = {
|
static QEMUMachine zynq_machine = {
|
||||||
|
2
hw/z2.c
2
hw/z2.c
@ -363,7 +363,7 @@ static void z2_init(ram_addr_t ram_size,
|
|||||||
z2_binfo.kernel_cmdline = kernel_cmdline;
|
z2_binfo.kernel_cmdline = kernel_cmdline;
|
||||||
z2_binfo.initrd_filename = initrd_filename;
|
z2_binfo.initrd_filename = initrd_filename;
|
||||||
z2_binfo.board_id = 0x6dd;
|
z2_binfo.board_id = 0x6dd;
|
||||||
arm_load_kernel(&mpu->cpu->env, &z2_binfo);
|
arm_load_kernel(mpu->cpu, &z2_binfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user