mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-06 06:27:41 -07:00
hw/sd/pl181: Do not create SD card within the SD host controller
SD/MMC host controllers provide a SD Bus to plug SD cards, but don't come with SD card plugged in :) Let the machine/board model create and plug the SD cards when required. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200705204630.4133-8-f4bug@amsat.org>
This commit is contained in:
parent
2762eed1f5
commit
26c607b86b
5 changed files with 61 additions and 20 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include "hw/char/pl011.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/sd/sd.h"
|
||||
|
||||
#define TYPE_INTEGRATOR_CM "integrator_core"
|
||||
#define INTEGRATOR_CM(obj) \
|
||||
|
|
@ -595,6 +596,7 @@ static void integratorcp_init(MachineState *machine)
|
|||
MemoryRegion *ram_alias = g_new(MemoryRegion, 1);
|
||||
qemu_irq pic[32];
|
||||
DeviceState *dev, *sic, *icp;
|
||||
DriveInfo *dinfo;
|
||||
int i;
|
||||
|
||||
cpuobj = object_new(machine->cpu_type);
|
||||
|
|
@ -649,6 +651,17 @@ static void integratorcp_init(MachineState *machine)
|
|||
qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_WPROT, 0));
|
||||
qdev_connect_gpio_out_named(dev, "card-inserted", 0,
|
||||
qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_CARDIN, 0));
|
||||
dinfo = drive_get_next(IF_SD);
|
||||
if (dinfo) {
|
||||
DeviceState *card;
|
||||
|
||||
card = qdev_new(TYPE_SD_CARD);
|
||||
qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
|
||||
&error_fatal);
|
||||
qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"),
|
||||
&error_fatal);
|
||||
}
|
||||
|
||||
sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL);
|
||||
|
||||
if (nd_table[0].used)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue