[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
From: |
Alistair Francis |
Subject: |
Re: [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC |
Date: |
Mon, 30 Nov 2020 17:56:56 -0800 |
On Tue, Nov 24, 2020 at 1:54 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).
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1895895
> Reported-by: David Aghaian <David.Aghaian@panasonic.aero>
> 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/fsl-imx25.c | 6 ++++++
> hw/arm/fsl-imx6.c | 6 ++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
> index 08a98f828fc..6e66ae742af 100644
> --- a/hw/arm/fsl-imx25.c
> +++ b/hw/arm/fsl-imx25.c
> @@ -239,6 +239,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error
> **errp)
> { FSL_IMX25_ESDHC1_ADDR, FSL_IMX25_ESDHC1_IRQ },
> { FSL_IMX25_ESDHC2_ADDR, FSL_IMX25_ESDHC2_IRQ },
> };
> + g_autofree char *bus_name = NULL;
>
> object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 2,
> &error_abort);
> @@ -253,6 +254,11 @@ static void fsl_imx25_realize(DeviceState *dev, Error
> **errp)
> sysbus_connect_irq(SYS_BUS_DEVICE(&s->esdhc[i]), 0,
> qdev_get_gpio_in(DEVICE(&s->avic),
> esdhc_table[i].irq));
> +
> + /* 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(&s->esdhc[i]), "sd-bus");
> }
>
> /* USB */
> diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
> index 00dafe3f62d..144bcdcaf6c 100644
> --- a/hw/arm/fsl-imx6.c
> +++ b/hw/arm/fsl-imx6.c
> @@ -314,6 +314,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error
> **errp)
> { FSL_IMX6_uSDHC3_ADDR, FSL_IMX6_uSDHC3_IRQ },
> { FSL_IMX6_uSDHC4_ADDR, FSL_IMX6_uSDHC4_IRQ },
> };
> + g_autofree char *bus_name = NULL;
>
> /* UHS-I SDIO3.0 SDR104 1.8V ADMA */
> object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 3,
> @@ -329,6 +330,11 @@ static void fsl_imx6_realize(DeviceState *dev, Error
> **errp)
> sysbus_connect_irq(SYS_BUS_DEVICE(&s->esdhc[i]), 0,
> qdev_get_gpio_in(DEVICE(&s->a9mpcore),
> esdhc_table[i].irq));
> +
> + /* 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(&s->esdhc[i]), "sd-bus");
> }
>
> /* USB */
> --
> 2.26.2
>
>