On Tue, Nov 24, 2020 at 1:55 AM Philippe Mathieu-Daudé <f4...@amsat.org> wrote: > > 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.mayd...@linaro.org> > Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com> Alistair > --- > 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 > >