qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-5.2? 0/4] hw/arm: Add SD bus QOM alias on the machine/soc
@ 2020-11-24  9:49 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é
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-24  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois, qemu-arm, Edgar E. Iglesias

Easy fix for LP#1895895 suggested by Peter.

As TYPE_ASPEED_SDHCI creates SDHCI inside a controller
(not a SoC/machine) we don't bother modifying it yet.

Philippe Mathieu-Daudé (4):
  hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
  hw/arm/exynos4210: Add SD bus QOM alias on the SoC
  hw/arm/xlnx-versal: Add SD bus QOM alias on the SoC
  hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine

 hw/arm/exynos4210.c  | 5 +++++
 hw/arm/fsl-imx25.c   | 6 ++++++
 hw/arm/fsl-imx6.c    | 6 ++++++
 hw/arm/xilinx_zynq.c | 6 ++++++
 hw/arm/xlnx-versal.c | 5 +++++
 5 files changed, 28 insertions(+)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
  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 ` 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é
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-24  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois, David Aghaian, qemu-arm,
	Edgar E. Iglesias

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>
---
 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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH-for-5.2? 2/4] hw/arm/exynos4210: Add SD bus QOM alias on the SoC
  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-11-24  9:49 ` 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é
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-24  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois, qemu-arm, Edgar E. Iglesias

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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: Add SD bus QOM alias on the SoC
  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-11-24  9:49 ` [PATCH-for-5.2? 2/4] hw/arm/exynos4210: " Philippe Mathieu-Daudé
@ 2020-11-24  9:49 ` Philippe Mathieu-Daudé
  2020-12-01  1:55   ` Alistair Francis
  2020-11-24  9:49 ` [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-24  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois, qemu-arm, Edgar E. Iglesias

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/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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine
  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é
                   ` (2 preceding siblings ...)
  2020-11-24  9:49 ` [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: " Philippe Mathieu-Daudé
@ 2020-11-24  9:49 ` Philippe Mathieu-Daudé
  2020-12-01  1:55   ` 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
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-24  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois, qemu-arm, Edgar E. Iglesias

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



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 2/4] hw/arm/exynos4210: Add SD bus QOM alias on the SoC
  2020-11-24  9:49 ` [PATCH-for-5.2? 2/4] hw/arm/exynos4210: " Philippe Mathieu-Daudé
@ 2020-12-01  1:51   ` Alistair Francis
  0 siblings, 0 replies; 11+ messages in thread
From: Alistair Francis @ 2020-12-01  1:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	qemu-devel@nongnu.org Developers, Jean-Christophe Dubois,
	qemu-arm, Edgar E. Iglesias

On Tue, Nov 24, 2020 at 1:55 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/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
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 3/4] hw/arm/xlnx-versal: Add SD bus QOM alias on the SoC
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Alistair Francis @ 2020-12-01  1:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	qemu-devel@nongnu.org Developers, Jean-Christophe Dubois,
	qemu-arm, Edgar E. Iglesias

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
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine
  2020-11-24  9:49 ` [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine Philippe Mathieu-Daudé
@ 2020-12-01  1:55   ` Alistair Francis
  0 siblings, 0 replies; 11+ messages in thread
From: Alistair Francis @ 2020-12-01  1:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	qemu-devel@nongnu.org Developers, Jean-Christophe Dubois,
	qemu-arm, Edgar E. Iglesias

On Tue, Nov 24, 2020 at 1:50 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 machine (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/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
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Alistair Francis @ 2020-12-01  1:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Igor Mitsyanko, Alistair Francis,
	qemu-devel@nongnu.org Developers, Jean-Christophe Dubois,
	David Aghaian, qemu-arm, Edgar E. Iglesias

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
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 0/4] hw/arm: Add SD bus QOM alias on the machine/soc
  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é
                   ` (3 preceding siblings ...)
  2020-11-24  9:49 ` [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine Philippe Mathieu-Daudé
@ 2020-12-01 13:20 ` Peter Maydell
  2023-07-09  8:31 ` Bernhard Beschow
  5 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2020-12-01 13:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Igor Mitsyanko, Alistair Francis, QEMU Developers,
	Jean-Christophe Dubois, qemu-arm, Edgar E. Iglesias

On Tue, 24 Nov 2020 at 09:49, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Easy fix for LP#1895895 suggested by Peter.
>
> As TYPE_ASPEED_SDHCI creates SDHCI inside a controller
> (not a SoC/machine) we don't bother modifying it yet.

So how on the command line do you specify plugging the SD
card into one of the new aliases?

I tried (with the sabrelite machine):
-drive file=/tmp/sdcard.img,format=raw,id=mysdcard -device
sd-card,drive=mysdcard,bus=sd-bus0

but QEMU gives the error:
qemu-system-arm: -device sd-card,drive=mysdcard,bus=sd-bus0: Bus
'sd-bus0' not found

Maybe my idea about the aliases turns out to be wrong ? :-(

thanks
-- PMM


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH-for-5.2? 0/4] hw/arm: Add SD bus QOM alias on the machine/soc
  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é
                   ` (4 preceding siblings ...)
  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
  5 siblings, 0 replies; 11+ messages in thread
From: Bernhard Beschow @ 2023-07-09  8:31 UTC (permalink / raw)
  To: f4bug
  Cc: alistair, edgar.iglesias, i.mitsyanko, jcd, peter.maydell,
	qemu-arm, qemu-devel

> Easy fix for LP#1895895 suggested by Peter.
>
> As TYPE_ASPEED_SDHCI creates SDHCI inside a controller
> (not a SoC/machine) we don't bother modifying it yet.
>
> Philippe Mathieu-Daudé (4):
>   hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
>   hw/arm/exynos4210: Add SD bus QOM alias on the SoC
>   hw/arm/xlnx-versal: Add SD bus QOM alias on the SoC
>   hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine
>
>  hw/arm/exynos4210.c  | 5 +++++
>  hw/arm/fsl-imx25.c   | 6 ++++++
>  hw/arm/fsl-imx6.c    | 6 ++++++
>  hw/arm/xilinx_zynq.c | 6 ++++++
>  hw/arm/xlnx-versal.c | 5 +++++
>  5 files changed, 28 insertions(+)

Ping


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-09  8:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH-for-5.2? 4/4] hw/arm/xilinx_zynq: Add SD bus QOM alias on the machine Philippe Mathieu-Daudé
2020-12-01  1:55   ` 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

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).