From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
qemu-arm@nongnu.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine
Date: Tue, 24 Nov 2020 10:49:41 +0100 [thread overview]
Message-ID: <20201124094941.485767-5-f4bug@amsat.org> (raw)
In-Reply-To: <20201124094941.485767-1-f4bug@amsat.org>
To be able to select a particular SD bus from the command
line, add a QOM alias on the machine (using an unique name).
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/xilinx_zynq.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index b72772bc824..6a4a1de88cf 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -286,6 +286,7 @@ static void zynq_init(MachineState *machine)
DriveInfo *di;
BlockBackend *blk;
DeviceState *carddev;
+ g_autofree char *bus_name = NULL;
/* Compatible with:
* - SD Host Controller Specification Version 2.0 Part A2
@@ -299,6 +300,11 @@ static void zynq_init(MachineState *machine)
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, hci_addr);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[hci_irq - IRQ_OFFSET]);
+ /* Alias controller SD bus to the machine itself */
+ bus_name = g_strdup_printf("sd-bus%d", n);
+ object_property_add_alias(OBJECT(machine), bus_name,
+ OBJECT(dev), "sd-bus");
+
di = drive_get_next(IF_SD);
blk = di ? blk_by_legacy_dinfo(di) : NULL;
carddev = qdev_new(TYPE_SD_CARD);
--
2.26.2
next prev parent reply other threads:[~2020-11-24 9:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-24 9:49 [PATCH-for-5.2? 0/4] hw/arm: Add SD bus QOM alias on the machine/soc Philippe Mathieu-Daudé
2020-11-24 9:49 ` [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC Philippe Mathieu-Daudé
2020-12-01 1:56 ` Alistair Francis
2020-11-24 9:49 ` [PATCH-for-5.2? 2/4] hw/arm/exynos4210: " Philippe Mathieu-Daudé
2020-12-01 1:51 ` Alistair Francis
2020-11-24 9:49 ` [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: " Philippe Mathieu-Daudé
2020-12-01 1:55 ` Alistair Francis
2020-11-24 9:49 ` Philippe Mathieu-Daudé [this message]
2020-12-01 1:55 ` [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine Alistair Francis
2020-12-01 13:20 ` [PATCH-for-5.2? 0/4] hw/arm: Add SD bus QOM alias on the machine/soc Peter Maydell
2023-07-09 8:31 ` Bernhard Beschow
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=20201124094941.485767-5-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=i.mitsyanko@gmail.com \
--cc=jcd@tribudubois.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).