hw/sd: Add QOM bus which SD cards plug in to
commitc759a790b672b0c5bfc50520dcc93565b55732b3
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:16:18 +0000 (18 14:16 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:26:33 +0000 (18 14:26 +0000)
tree16f1c77fc63c8b1d448354fba86bfe7cec99ea43
parentba3ed0fa94ee9473ef8f454512b6ca3e10fcb885
hw/sd: Add QOM bus which SD cards plug in to

Add a QOM bus for SD cards to plug in to.

Note that since sd_enable() is used only by one board and there
only as part of a broken implementation, we do not provide it in
the SDBus API (but instead add a warning comment about the old
function). Whoever converts OMAP and the nseries boards to QOM
will need to either implement the card switch properly or move
the enable hack into the OMAP MMC controller model.

In the SDBus API, the old-style use of sd_set_cb to register some
qemu_irqs for notification of card insertion and write-protect
toggling is replaced with methods in the SDBusClass which the
card calls on status changes and methods in the SDClass which
the controller can call to find out the current status. The
query methods will allow us to remove the abuse of the 'register
irqs' API by controllers in their reset methods to trigger
the card to tell them about the current status again.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 1455646193-13238-5-git-send-email-peter.maydell@linaro.org
hw/sd/Makefile.objs
hw/sd/core.c [new file with mode: 0644]
hw/sd/sd.c
include/hw/sd/sd.h