diff mbox series

[1/3] hw/arm/bcm2835: remove gpio/sd-bus

Message ID 20191220144616.911466-2-damien.hedde@greensocs.com (mailing list archive)
State New, archived
Headers show
Series Raspi sd-bus cleanup and multiphase reset | expand

Commit Message

Damien Hedde Dec. 20, 2019, 2:46 p.m. UTC
Remove gpio/sdbus which is only used to host the sd card before reset.

Instead directly we exhibit the sdhci bus to the soc and machine. Thus
the sd card is created on the sdhci bus and do not need to be moved
during first reset.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
 include/hw/gpio/bcm2835_gpio.h | 1 -
 hw/arm/bcm2835_peripherals.c   | 2 +-
 hw/gpio/bcm2835_gpio.c         | 6 ------
 3 files changed, 1 insertion(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h
index b0de0a3c74..f8416d43d3 100644
--- a/include/hw/gpio/bcm2835_gpio.h
+++ b/include/hw/gpio/bcm2835_gpio.h
@@ -23,7 +23,6 @@  typedef struct BCM2835GpioState {
     MemoryRegion iomem;
 
     /* SDBus selector */
-    SDBus sdbus;
     SDBus *sdbus_sdhci;
     SDBus *sdbus_sdhost;
 
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 17207ae07e..93477c5b2f 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -360,7 +360,7 @@  static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
     memory_region_add_subregion(&s->peri_mr, GPIO_OFFSET,
                 sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gpio), 0));
 
-    object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->gpio), "sd-bus",
+    object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->sdhci), "sd-bus",
                               &err);
     if (err) {
         error_propagate(errp, err);
diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c
index 91ce3d10cc..25c180423f 100644
--- a/hw/gpio/bcm2835_gpio.c
+++ b/hw/gpio/bcm2835_gpio.c
@@ -267,9 +267,6 @@  static void bcm2835_gpio_reset(DeviceState *dev)
 
     s->sd_fsel = 0;
 
-    /* SDHCI is selected by default */
-    sdbus_reparent_card(&s->sdbus, s->sdbus_sdhci);
-
     s->lev0 = 0;
     s->lev1 = 0;
 }
@@ -299,9 +296,6 @@  static void bcm2835_gpio_init(Object *obj)
     DeviceState *dev = DEVICE(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
-    qbus_create_inplace(&s->sdbus, sizeof(s->sdbus),
-                        TYPE_SD_BUS, DEVICE(s), "sd-bus");
-
     memory_region_init_io(&s->iomem, obj,
             &bcm2835_gpio_ops, s, "bcm2835_gpio", 0x1000);
     sysbus_init_mmio(sbd, &s->iomem);