qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Jamin Lin <jamin_lin@aspeedtech.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Steven Lee <steven_lee@aspeedtech.com>,
	Troy Lee <leetroy@gmail.com>,
	Andrew Jeffery <andrew@codeconstruct.com.au>,
	Joel Stanley <joel@jms.id.au>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>
Cc: Troy Lee <troy_lee@aspeedtech.com>,
	"nabihestefan@google.com" <nabihestefan@google.com>
Subject: Re: [PATCH v4 06/10] hw/arm/aspeed: Add support for loading vbootrom image via "-bios"
Date: Tue, 22 Apr 2025 18:51:46 +0200	[thread overview]
Message-ID: <a4c178b6-7048-42d1-9e90-58ed87baf9b5@kaod.org> (raw)
In-Reply-To: <SI2PR06MB5041D4AD25381C7D1D6A5C1CFCBB2@SI2PR06MB5041.apcprd06.prod.outlook.com>

Hello Jamin,

> Based on the design of aspeed_install_boot_rom, users can place
> their ROM code at the top of the image-bmc, and this function will
> install image-bmc which included the user's ROM IMAGE at the
> ASPEED_DEV_SPI_BOOT address.  For AST2600, users typically set the
> boot address to 0x0 and boot directly from there.
>
> For AST2700, we introduced a vbootrom to simulate the ROM code and
> the BOOTMCU SPL (RISC-V).

Side question, is anyone working on the BOOTMCU SPL (RISC-V) models ?
heterogeneous machines should be supported one day.

> We use aspeed_install_boot_rom to load the image-bmc at the FMC CS0
> memory-mapped I/O address, so we set ASPEED_DEV_SPI_BOOT to
> 0x100000000.
>
> We load the vbootrom image into the vbootrom memory region at
> address 0x0 and start execution from there.
>
> The guest OS first enters the vbootrom. From there, it can easily
> access the flash data (image-bmc) at 0x100000000, since vbootrom
> itself doesn’t require SPI/flash/emmc host drivers.
>
> To support future eMMC booting, we also plan to install the eMMC
> image at the ASPEED_DEV_SPI_BOOT address.
> https://github.com/qemu/qemu/blob/master/hw/arm/aspeed.c#L477

ok.

> It is fully supported to have both options. If users want to include
> their own ROM code within image-bmc, they can set the program
> counter (PC) to 0x100000000, just like how a manual loader set it to
> 0x43000000 (e.g., to jump directly to BL31).  This allows users to
> bypass the vbootrom if desired.

ok.

> However, I believe this use case will be rare, as the vbootrom
> design should be able to satisfy most, if not all, user
> requirements.

We need to be careful about what we offer the user in terms of boot
method. It's difficult to maintain on the long term. Let's recap.

For the AST2[456]00 machines, we have :

   1. kernel boot
   2. flash device boot with or without "execute-in-place" machine
      option

and this could work for AST2700 machines with some loader magic.
It would be good to decide to or not to support it. If not supported,
let's inform the user asap.

For the AST2600 ast2600evb and rainier machines only, we have :

   3. emmc device boot

and we plan to extend it for AST2700 machines.

For the AST2700 machines, we have :

   4. manual loader boot (this could work for the other SoCs, although
      we have never tried)
   5. firmware boot

We need to define a priority between these methods too (the list
above is more or less ordered, apart from 4.) and handle conflicts.

All of which is to say that the piece of code below will require
some care:

     if (!bmc->mmio_exec) {
         DeviceState *dev = ssi_get_cs(bmc->soc->fmc.spi, 0);
         BlockBackend *fmc0 = dev ? m25p80_get_blk(dev) : NULL;

         if (fmc0 && !boot_emmc) {
             rom_size = memory_region_size(&bmc->soc->spi_boot);
             aspeed_install_boot_rom(bmc, fmc0, rom_size);
         } else if (emmc0) {
             aspeed_install_boot_rom(bmc, blk_by_legacy_dinfo(emmc0), 64 * KiB);
         }
     }

     if (amc->vbootrom) {
         rom_size = memory_region_size(&bmc->soc->vbootrom);
         aspeed_load_vbootrom(machine, rom_size, &error_abort);
     }

Thanks,

C.




  reply	other threads:[~2025-04-22 16:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  3:11 [PATCH v4 00/10] Support vbootrom for AST2700 Jamin Lin via
2025-04-17  3:11 ` [PATCH v4 01/10] hw/arm/aspeed_ast27x0: Rename variable sram_name to name in ast2700 realize Jamin Lin via
2025-04-17  3:11 ` [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region Jamin Lin via
2025-04-21 16:47   ` Cédric Le Goater
2025-04-22  1:59     ` Jamin Lin
2025-04-22  5:50       ` Cédric Le Goater
2025-04-21 21:03   ` Cédric Le Goater
2025-04-22  1:39     ` Jamin Lin
2025-04-17  3:12 ` [PATCH v4 03/10] hw/arm/aspeed: Add vbootrom support on AST2700 EVB machines Jamin Lin via
2025-04-17  3:12 ` [PATCH v4 04/10] hw/arm/aspeed: Reuse rom_size variable for vbootrom setup Jamin Lin via
2025-04-17  3:12 ` [PATCH v4 05/10] pc-bios: Add AST27x0 vBootrom Jamin Lin via
2025-04-17  3:12 ` [PATCH v4 06/10] hw/arm/aspeed: Add support for loading vbootrom image via "-bios" Jamin Lin via
2025-04-21 21:00   ` Cédric Le Goater
2025-04-22  3:30     ` Jamin Lin
2025-04-22 16:51       ` Cédric Le Goater [this message]
2025-04-23  7:02         ` Jamin Lin
2025-04-28  7:45           ` Cédric Le Goater
2025-04-28  7:54             ` Jamin Lin
2025-04-28  9:45               ` Philippe Mathieu-Daudé
2025-04-29  7:59                 ` Jamin Lin
2025-04-17  3:12 ` [PATCH v4 07/10] tests/functional/aspeed: Move I2C test into shared helper for AST2700 reuse Jamin Lin via
2025-04-21 15:12   ` Nabih Estefan
2025-04-21 21:03   ` Cédric Le Goater
2025-04-17  3:12 ` [PATCH v4 08/10] tests/functional/aspeed: Update test ASPEED SDK v09.06 Jamin Lin via
2025-04-21 21:03   ` Cédric Le Goater
2025-04-22  7:05   ` Cédric Le Goater
2025-04-22  7:08     ` Jamin Lin
2025-04-17  3:12 ` [PATCH v4 09/10] tests/functional/aspeed: Add to test vbootrom for AST2700 Jamin Lin via
2025-04-21 15:12   ` Nabih Estefan
2025-04-21 21:07   ` Cédric Le Goater
2025-04-22  6:11     ` Jamin Lin
2025-04-17  3:12 ` [PATCH v4 10/10] docs/system/arm/aspeed: Support " Jamin Lin via
2025-04-22  7:29   ` Cédric Le Goater
2025-04-22  7:36     ` Jamin Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4c178b6-7048-42d1-9e90-58ed87baf9b5@kaod.org \
    --to=clg@kaod.org \
    --cc=andrew@codeconstruct.com.au \
    --cc=jamin_lin@aspeedtech.com \
    --cc=joel@jms.id.au \
    --cc=leetroy@gmail.com \
    --cc=nabihestefan@google.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.com \
    --cc=troy_lee@aspeedtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).