[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.2? 2/4] hw/arm/exynos4210: Add SD bus QOM alias on the SoC
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.2? 2/4] hw/arm/exynos4210: Add SD bus QOM alias on the SoC |
Date: |
Tue, 24 Nov 2020 10:49:39 +0100 |
To be able to select a particular SD bus from the command
line, add a QOM alias on the SoC (using an unique name).
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/exynos4210.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index ced2769b102..a60f08d372a 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -408,6 +408,7 @@ static void exynos4210_realize(DeviceState *socdev, Error
**errp)
/*** SD/MMC host controllers ***/
for (n = 0; n < EXYNOS4210_SDHCI_NUMBER; n++) {
+ g_autofree char *bus_name = NULL;
DeviceState *carddev;
BlockBackend *blk;
DriveInfo *di;
@@ -432,6 +433,10 @@ static void exynos4210_realize(DeviceState *socdev, Error
**errp)
sysbus_mmio_map(busdev, 0, EXYNOS4210_SDHCI_ADDR(n));
sysbus_connect_irq(busdev, 0, s->irq_table[exynos4210_get_irq(29, n)]);
+ /* Alias controller SD bus to the SoC itself */
+ bus_name = g_strdup_printf("sd-bus%d", n);
+ object_property_add_alias(OBJECT(s), bus_name, OBJECT(dev), "sd-bus");
+
di = drive_get(IF_SD, 0, n);
blk = di ? blk_by_legacy_dinfo(di) : NULL;
carddev = qdev_new(TYPE_SD_CARD);
--
2.26.2