mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
sdhci: check the Spec v1 capabilities correctness
Incorrect value will throw an error. Note than Spec v2 is supported by default. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Message-Id: <20180208164818.7961-11-f4bug@amsat.org>
This commit is contained in:
parent
09b738ff65
commit
6ff37c3dfa
3 changed files with 116 additions and 2 deletions
|
@ -87,6 +87,8 @@
|
|||
/* R/W Host control Register 0x0 */
|
||||
#define SDHC_HOSTCTL 0x28
|
||||
#define SDHC_CTRL_LED 0x01
|
||||
#define SDHC_CTRL_DATATRANSFERWIDTH 0x02 /* SD mode only */
|
||||
#define SDHC_CTRL_HIGH_SPEED 0x04
|
||||
#define SDHC_CTRL_DMA_CHECK_MASK 0x18
|
||||
#define SDHC_CTRL_SDMA 0x00
|
||||
#define SDHC_CTRL_ADMA1_32 0x08
|
||||
|
@ -102,6 +104,7 @@
|
|||
/* R/W Power Control Register 0x0 */
|
||||
#define SDHC_PWRCON 0x29
|
||||
#define SDHC_POWER_ON (1 << 0)
|
||||
FIELD(SDHC_PWRCON, BUS_VOLTAGE, 1, 3);
|
||||
|
||||
/* R/W Block Gap Control Register 0x0 */
|
||||
#define SDHC_BLKGAP 0x2A
|
||||
|
@ -124,6 +127,7 @@
|
|||
|
||||
/* R/W Timeout Control Register 0x0 */
|
||||
#define SDHC_TIMEOUTCON 0x2E
|
||||
FIELD(SDHC_TIMEOUTCON, COUNTER, 0, 4);
|
||||
|
||||
/* R/W Software Reset Register 0x0 */
|
||||
#define SDHC_SWRST 0x2F
|
||||
|
@ -180,17 +184,31 @@
|
|||
|
||||
/* ROC Auto CMD12 error status register 0x0 */
|
||||
#define SDHC_ACMD12ERRSTS 0x3C
|
||||
FIELD(SDHC_ACMD12ERRSTS, TIMEOUT_ERR, 1, 1);
|
||||
FIELD(SDHC_ACMD12ERRSTS, CRC_ERR, 2, 1);
|
||||
FIELD(SDHC_ACMD12ERRSTS, INDEX_ERR, 4, 1);
|
||||
|
||||
/* HWInit Capabilities Register 0x05E80080 */
|
||||
#define SDHC_CAPAB 0x40
|
||||
#define SDHC_CAN_DO_DMA 0x00400000
|
||||
#define SDHC_CAN_DO_ADMA2 0x00080000
|
||||
#define SDHC_CAN_DO_ADMA1 0x00100000
|
||||
#define SDHC_64_BIT_BUS_SUPPORT (1 << 28)
|
||||
FIELD(SDHC_CAPAB, TOCLKFREQ, 0, 6);
|
||||
FIELD(SDHC_CAPAB, TOUNIT, 7, 1);
|
||||
FIELD(SDHC_CAPAB, BASECLKFREQ, 8, 8);
|
||||
FIELD(SDHC_CAPAB, MAXBLOCKLENGTH, 16, 2);
|
||||
FIELD(SDHC_CAPAB, HIGHSPEED, 21, 1);
|
||||
FIELD(SDHC_CAPAB, SDMA, 22, 1);
|
||||
FIELD(SDHC_CAPAB, SUSPRESUME, 23, 1);
|
||||
FIELD(SDHC_CAPAB, V33, 24, 1);
|
||||
FIELD(SDHC_CAPAB, V30, 25, 1);
|
||||
FIELD(SDHC_CAPAB, V18, 26, 1);
|
||||
|
||||
/* HWInit Maximum Current Capabilities Register 0x0 */
|
||||
#define SDHC_MAXCURR 0x48
|
||||
FIELD(SDHC_MAXCURR, V33_VDD1, 0, 8);
|
||||
FIELD(SDHC_MAXCURR, V30_VDD1, 8, 8);
|
||||
FIELD(SDHC_MAXCURR, V18_VDD1, 16, 8);
|
||||
|
||||
/* W Force Event Auto CMD12 Error Interrupt Register 0x0000 */
|
||||
#define SDHC_FEAER 0x50
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue