From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH 2/8] aspeed: Load eMMC first boot area as a boot rom
Date: Thu, 4 Jul 2024 07:36:45 +0200 [thread overview]
Message-ID: <20240704053651.1100732-3-clg@redhat.com> (raw)
In-Reply-To: <20240704053651.1100732-1-clg@redhat.com>
From: Cédric Le Goater <clg@kaod.org>
The first boot area partition (64K) of the eMMC device should contain
an initial boot loader (u-boot SPL). Load it as a ROM only if an eMMC
device is available to boot from but no flash device is.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 105b990233fa..756deb91efd1 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -364,6 +364,7 @@ static void aspeed_machine_init(MachineState *machine)
AspeedMachineClass *amc = ASPEED_MACHINE_GET_CLASS(machine);
AspeedSoCClass *sc;
int i;
+ DriveInfo *emmc0 = NULL;
bmc->soc = ASPEED_SOC(object_new(amc->soc_name));
object_property_add_child(OBJECT(machine), "soc", OBJECT(bmc->soc));
@@ -440,9 +441,8 @@ static void aspeed_machine_init(MachineState *machine)
}
if (bmc->soc->emmc.num_slots) {
- sdhci_attach_drive(&bmc->soc->emmc.slots[0],
- drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots),
- true);
+ emmc0 = drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots);
+ sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true);
}
if (!bmc->mmio_exec) {
@@ -452,6 +452,8 @@ static void aspeed_machine_init(MachineState *machine)
if (fmc0) {
uint64_t 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);
}
}
--
2.45.2
next prev parent reply other threads:[~2024-07-04 5:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 5:36 [PATCH 0/8] aspeed: Add boot from eMMC support (AST2600) Cédric Le Goater
2024-07-04 5:36 ` [PATCH 1/8] aspeed: Change type of eMMC device Cédric Le Goater
2024-07-05 3:30 ` Andrew Jeffery
2024-07-16 21:36 ` Philippe Mathieu-Daudé
2024-07-04 5:36 ` Cédric Le Goater [this message]
2024-07-05 3:33 ` [PATCH 2/8] aspeed: Load eMMC first boot area as a boot rom Andrew Jeffery
2024-07-04 5:36 ` [PATCH 3/8] aspeed/scu: Add boot-from-eMMC HW strapping bit for AST2600 SoC Cédric Le Goater
2024-07-05 3:36 ` Andrew Jeffery
2024-07-05 5:36 ` Cédric Le Goater
2024-07-04 5:36 ` [PATCH 4/8] aspeed: Introduce a AspeedSoCClass 'boot_from_emmc' handler Cédric Le Goater
2024-07-05 3:39 ` Andrew Jeffery
2024-07-04 5:36 ` [PATCH 5/8] aspeed: Set eMMC 'boot-config' property to reflect HW strapping Cédric Le Goater
2024-07-05 3:41 ` Andrew Jeffery
2024-07-05 5:38 ` Cédric Le Goater
2024-07-05 13:28 ` Philippe Mathieu-Daudé
2024-07-05 15:52 ` Philippe Mathieu-Daudé
2024-07-09 21:32 ` Philippe Mathieu-Daudé
2024-07-10 5:14 ` Cédric Le Goater
2024-07-10 7:07 ` Philippe Mathieu-Daudé
2024-07-10 7:54 ` Cédric Le Goater
2024-07-04 5:36 ` [PATCH 6/8] aspeed: Add boot-from-eMMC HW strapping bit to rainier-bmc machine Cédric Le Goater
2024-07-05 3:42 ` Andrew Jeffery
2024-07-04 5:36 ` [PATCH 7/8] aspeed: Introduce a 'hw_strap1' machine attribute Cédric Le Goater
2024-07-05 3:45 ` Andrew Jeffery
2024-07-04 5:36 ` [PATCH 8/8] aspeed: Introduce a 'boot-emmc' machine option Cédric Le Goater
2024-07-05 3:45 ` Andrew Jeffery
2024-07-05 3:46 ` [PATCH 0/8] aspeed: Add boot from eMMC support (AST2600) Andrew Jeffery
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=20240704053651.1100732-3-clg@redhat.com \
--to=clg@redhat.com \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=jamin_lin@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=leetroy@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_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).