Skip to content

Commit d060b27

Browse files
zbalatonphilmd
authored andcommitted
hw/sd/sdhci: Set reset value of interrupt registers
The interrupt enable registers are not reset to 0 on Freescale eSDHC but some bits are enabled on reset. At least some U-Boot versions seem to expect this and not initialise these registers before expecting interrupts. Use existing vendor property for Freescale eSDHC and set the reset value of the interrupt registers to match Freescale documentation. Signed-off-by: BALATON Zoltan <[email protected]> Message-ID: <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 825b96d commit d060b27

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

hw/ppc/e500.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ void ppce500_init(MachineState *machine)
10431043
dev = qdev_new(TYPE_SYSBUS_SDHCI);
10441044
qdev_prop_set_uint8(dev, "sd-spec-version", 2);
10451045
qdev_prop_set_uint8(dev, "endianness", DEVICE_BIG_ENDIAN);
1046+
qdev_prop_set_uint8(dev, "vendor", SDHCI_VENDOR_FSL);
10461047
s = SYS_BUS_DEVICE(dev);
10471048
sysbus_realize_and_unref(s, &error_fatal);
10481049
sysbus_connect_irq(s, 0, qdev_get_gpio_in(mpicdev, MPC85XX_ESDHC_IRQ));

hw/sd/sdhci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ static void sdhci_reset(SDHCIState *s)
307307
s->data_count = 0;
308308
s->stopped_state = sdhc_not_stopped;
309309
s->pending_insert_state = false;
310+
if (s->vendor == SDHCI_VENDOR_FSL) {
311+
s->norintstsen = 0x013f;
312+
s->errintstsen = 0x117f;
313+
}
310314
}
311315

312316
static void sdhci_poweron_reset(DeviceState *dev)

include/hw/sd/sdhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ typedef struct SDHCIState SDHCIState;
110110

111111
#define SDHCI_VENDOR_NONE 0
112112
#define SDHCI_VENDOR_IMX 1
113+
#define SDHCI_VENDOR_FSL 2
113114

114115
/*
115116
* Controller does not provide transfer-complete interrupt when not

0 commit comments

Comments
 (0)