qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] aspeed: Add boot stub for smp booting


From: Joel Stanley
Subject: Re: [PATCH] aspeed: Add boot stub for smp booting
Date: Thu, 9 Apr 2020 06:25:17 +0000

On Tue, 7 Apr 2020 at 08:26, Cédric Le Goater <address@hidden> wrote:
>
> On 4/7/20 10:19 AM, Philippe Mathieu-Daudé wrote:
> >
> >
> > On 4/7/20 9:38 AM, Joel Stanley wrote:
> >> On Tue, 7 Apr 2020 at 07:25, Joel Stanley <address@hidden> wrote:

> >>>   static void write_boot_rom(DriveInfo *dinfo, hwaddr addr, size_t 
> >>> rom_size,
> >>> @@ -270,6 +322,19 @@ static void aspeed_machine_init(MachineState 
> >>> *machine)
> >>>           }
> >>>       }
> >>>
> >>> +    if (machine->kernel_filename) {
> >>
> >> I just realised this shouldn't be executed on non-ast2600 platforms.
> >> We could test for the number of CPUs like this:
> >>
> >> if (machine->kernel_filename && aspeed_board_binfo.nb_cpus > 1) {
> >
> >   if (!strcmp(amc->soc_name, "ast2600")) { ?
>
> or a 'bool' under AspeedMachineClass ?

I considered both, but I went with the number of configured CPUs as
this means we only set it up when configured for SMP, which is the
only time it's worth doing.

Thanks for taking a look.

> A part from that,
>
> Reviewed-by: Cédric Le Goater <address@hidden>
> Tested-by: Cédric Le Goater <address@hidden>
>
> C.
>
>
> >
> >>
> >>> +        /* With no u-boot we must set up a boot stub for the secondary 
> >>> CPU */
> >>> +        MemoryRegion *smpboot = g_new(MemoryRegion, 1);
> >>> +        memory_region_init_ram(smpboot, OBJECT(bmc), "aspeed.smpboot",
> >>> +                               0x80, &error_abort);
> >>> +        memory_region_add_subregion(get_system_memory(),
> >>> +                                    AST_SMP_MAILBOX_BASE, smpboot);
> >>> +
> >>> +        aspeed_board_binfo.write_secondary_boot = aspeed_write_smpboot;
> >>> +        aspeed_board_binfo.secondary_cpu_reset_hook = 
> >>> aspeed_reset_secondary;
> >>> +        aspeed_board_binfo.smp_loader_start = AST_SMP_MBOX_CODE;
> >>> +    }
> >>> +
> >>>       aspeed_board_binfo.ram_size = ram_size;
> >>>       aspeed_board_binfo.loader_start = sc->memmap[ASPEED_SDRAM];
> >>>       aspeed_board_binfo.nb_cpus = bmc->soc.num_cpus;
> >>> --
> >>> 2.25.1
> >>>
> >>
> >
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]