mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
sdhci: Add i.MX specific subtype of SDHCI
IP block found on several generations of i.MX family does not use vanilla SDHCI implementation and it comes with a number of quirks. Introduce i.MX SDHCI subtype of SDHCI block to add code necessary to support unmodified Linux guest driver. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Jason Wang <jasowang@redhat.com> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Cc: Marcel Apfelbaum <marcel.apfelbaum@zoho.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> [PMM: define and use ESDHC_UNDOCUMENTED_REG27] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
955f56d44a
commit
fd1e5c8179
3 changed files with 265 additions and 1 deletions
|
@ -44,6 +44,7 @@ typedef struct SDHCIState {
|
|||
AddressSpace sysbus_dma_as;
|
||||
AddressSpace *dma_as;
|
||||
MemoryRegion *dma_mr;
|
||||
const MemoryRegionOps *io_ops;
|
||||
|
||||
QEMUTimer *insert_timer; /* timer for 'changing' sd card. */
|
||||
QEMUTimer *transfer_timer;
|
||||
|
@ -91,8 +92,18 @@ typedef struct SDHCIState {
|
|||
|
||||
/* Configurable properties */
|
||||
bool pending_insert_quirk; /* Quirk for Raspberry Pi card insert int */
|
||||
uint32_t quirks;
|
||||
} SDHCIState;
|
||||
|
||||
/*
|
||||
* Controller does not provide transfer-complete interrupt when not
|
||||
* busy.
|
||||
*
|
||||
* NOTE: This definition is taken out of Linux kernel and so the
|
||||
* original bit number is preserved
|
||||
*/
|
||||
#define SDHCI_QUIRK_NO_BUSY_IRQ BIT(14)
|
||||
|
||||
#define TYPE_PCI_SDHCI "sdhci-pci"
|
||||
#define PCI_SDHCI(obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI)
|
||||
|
||||
|
@ -100,4 +111,6 @@ typedef struct SDHCIState {
|
|||
#define SYSBUS_SDHCI(obj) \
|
||||
OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI)
|
||||
|
||||
#define TYPE_IMX_USDHC "imx-usdhc"
|
||||
|
||||
#endif /* SDHCI_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue