[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: Add SD bus QOM alias on the
From: |
Alistair Francis |
Subject: |
Re: [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: Add SD bus QOM alias on the SoC |
Date: |
Mon, 30 Nov 2020 17:55:13 -0800 |
On Tue, Nov 24, 2020 at 1:51 AM Philippe Mathieu-Daudé <f4bug@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.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/arm/xlnx-versal.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
> index 12ba6c4ebae..da3ee24a5b9 100644
> --- a/hw/arm/xlnx-versal.c
> +++ b/hw/arm/xlnx-versal.c
> @@ -210,6 +210,7 @@ static void versal_create_sds(Versal *s, qemu_irq *pic)
> int i;
>
> for (i = 0; i < ARRAY_SIZE(s->pmc.iou.sd); i++) {
> + g_autofree char *bus_name = NULL;
> DeviceState *dev;
> MemoryRegion *mr;
>
> @@ -224,6 +225,10 @@ static void versal_create_sds(Versal *s, qemu_irq *pic)
> object_property_set_uint(OBJECT(dev), "uhs", UHS_I, &error_fatal);
> sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
>
> + /* Alias controller SD bus to the SoC itself */
> + bus_name = g_strdup_printf("sd-bus%d", i);
> + object_property_add_alias(OBJECT(s), bus_name, OBJECT(dev),
> "sd-bus");
> +
> mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> memory_region_add_subregion(&s->mr_ps,
> MM_PMC_SD0 + i * MM_PMC_SD0_SIZE, mr);
> --
> 2.26.2
>
>