qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"David Aghaian" <David.Aghaian@panasonic.aero>,
	qemu-arm@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC
Date: Tue, 24 Nov 2020 10:49:38 +0100	[thread overview]
Message-ID: <20201124094941.485767-2-f4bug@amsat.org> (raw)
In-Reply-To: <20201124094941.485767-1-f4bug@amsat.org>

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



  reply	other threads:[~2020-11-24  9:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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é [this message]
2020-12-01  1:56   ` [PATCH-for-5.2? 1/4] hw/arm/fsl-imx: Add SD bus QOM alias on the SoC 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201124094941.485767-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=David.Aghaian@panasonic.aero \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).