mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
sdhci: implement UHS-I voltage switch
[based on a patch from Alistair Francis <alistair.francis@xilinx.com> from qemu/xilinx tag xilinx-v2015.2] Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Message-Id: <20180208164818.7961-22-f4bug@amsat.org>
This commit is contained in:
parent
238cd93567
commit
0034ebe6ee
6 changed files with 55 additions and 1 deletions
|
@ -1255,7 +1255,16 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
|
|||
sdhci_update_irq(s);
|
||||
break;
|
||||
case SDHC_ACMD12ERRSTS:
|
||||
MASKED_WRITE(s->acmd12errsts, mask, value);
|
||||
MASKED_WRITE(s->acmd12errsts, mask, value & UINT16_MAX);
|
||||
if (s->uhs_mode >= UHS_I) {
|
||||
MASKED_WRITE(s->hostctl2, mask >> 16, value >> 16);
|
||||
|
||||
if (FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, V18_ENA)) {
|
||||
sdbus_set_voltage(&s->sdbus, SD_VOLTAGE_1_8V);
|
||||
} else {
|
||||
sdbus_set_voltage(&s->sdbus, SD_VOLTAGE_3_3V);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SDHC_CAPAB:
|
||||
|
@ -1310,6 +1319,7 @@ static void sdhci_init_readonly_registers(SDHCIState *s, Error **errp)
|
|||
|
||||
#define DEFINE_SDHCI_COMMON_PROPERTIES(_state) \
|
||||
DEFINE_PROP_UINT8("sd-spec-version", _state, sd_spec_version, 2), \
|
||||
DEFINE_PROP_UINT8("uhs", _state, uhs_mode, UHS_NOT_SUPPORTED), \
|
||||
\
|
||||
/* Capabilities registers provide information on supported
|
||||
* features of this specific host controller implementation */ \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue