9#define SMHC_GCTRL_SOFT_RESET (1 << 0)
10#define SMHC_GCTRL_FIFO_RESET (1 << 1)
11#define SMHC_GCTRL_DMA_RESET (1 << 2)
12#define SMHC_GCTRL_INTERRUPT_ENABLE (1 << 4)
13#define SMHC_GCTRL_DMA_ENABLE (1 << 5)
14#define SMHC_GCTRL_DEBOUNCE_ENABLE (1 << 8)
15#define SMHC_GCTRL_POSEDGE_LATCH_DATA (1 << 9)
16#define SMHC_GCTRL_DDR_MODE (1 << 10)
17#define SMHC_GCTRL_MEMORY_ACCESS_DONE (1 << 29)
18#define SMHC_GCTRL_ACCESS_DONE_DIRECT (1 << 30)
19#define SMHC_GCTRL_ACCESS_BY_AHB (1 << 31)
20#define SMHC_GCTRL_ACCESS_BY_DMA (0 << 31)
21#define SMHC_GCTRL_HARDWARE_RESET (SMHC_GCTRL_SOFT_RESET | SMHC_GCTRL_FIFO_RESET | SMHC_GCTRL_DMA_RESET)
26#define SMHC_CLKCR_MASK_D0 (1 << 31)
27#define SMHC_CLKCR_CARD_CLOCK_ON (1 << 16)
28#define SMHC_CLKCR_LOW_POWER_ON (1 << 17)
29#define SMHC_CLKCR_CLOCK_DIV(n) ((n - 1) & 0xff)
34#define SMHC_WIDTH_1BIT (0)
35#define SMHC_WIDTH_4BIT (1)
36#define SMHC_WIDTH_8BIT (2)
41#define SMHC_CMD_RESP_EXPIRE (1 << 6)
42#define SMHC_CMD_LONG_RESPONSE (1 << 7)
43#define SMHC_CMD_CHECK_RESPONSE_CRC (1 << 8)
44#define SMHC_CMD_DATA_EXPIRE (1 << 9)
45#define SMHC_CMD_WRITE (1 << 10)
46#define SMHC_CMD_SEQUENCE_MODE (1 << 11)
47#define SMHC_CMD_SEND_AUTO_STOP (1 << 12)
48#define SMHC_CMD_WAIT_PRE_OVER (1 << 13)
49#define SMHC_CMD_STOP_ABORT_CMD (1 << 14)
50#define SMHC_CMD_SEND_INIT_SEQUENCE (1 << 15)
51#define SMHC_CMD_UPCLK_ONLY (1 << 21)
52#define SMHC_CMD_READ_CEATA_DEV (1 << 22)
53#define SMHC_CMD_CCS_EXPIRE (1 << 23)
54#define SMHC_CMD_ENABLE_BIT_BOOT (1 << 24)
55#define SMHC_CMD_ALT_BOOT_OPTIONS (1 << 25)
56#define SMHC_CMD_BOOT_ACK_EXPIRE (1 << 26)
57#define SMHC_CMD_BOOT_ABORT (1 << 27)
58#define SMHC_CMD_VOLTAGE_SWITCH (1 << 28)
59#define SMHC_CMD_USE_HOLD_REGISTER (1 << 29)
60#define SMHC_CMD_START (1 << 31)
65#define SMHC_RINT_RESP_ERROR (0x1 << 1)
66#define SMHC_RINT_COMMAND_DONE (0x1 << 2)
67#define SMHC_RINT_DATA_OVER (0x1 << 3)
68#define SMHC_RINT_TX_DATA_REQUEST (0x1 << 4)
69#define SMHC_RINT_RX_DATA_REQUEST (0x1 << 5)
70#define SMHC_RINT_RESP_CRC_ERROR (0x1 << 6)
71#define SMHC_RINT_DATA_CRC_ERROR (0x1 << 7)
72#define SMHC_RINT_RESP_TIMEOUT (0x1 << 8)
73#define SMHC_RINT_DATA_TIMEOUT (0x1 << 9)
74#define SMHC_RINT_VOLTAGE_CHANGE_DONE (0x1 << 10)
75#define SMHC_RINT_FIFO_RUN_ERROR (0x1 << 11)
76#define SMHC_RINT_HARD_WARE_LOCKED (0x1 << 12)
77#define SMHC_RINT_START_BIT_ERROR (0x1 << 13)
78#define SMHC_RINT_AUTO_COMMAND_DONE (0x1 << 14)
79#define SMHC_RINT_END_BIT_ERROR (0x1 << 15)
80#define SMHC_RINT_SDIO_INTERRUPT (0x1 << 16)
81#define SMHC_RINT_R1B_BUSY_CLEAR (0x1 << 17)
82#define SMHC_RINT_CARD_INSERT (0x1 << 30)
83#define SMHC_RINT_CARD_REMOVE (0x1 << 31)
84#define SMHC_RINT_INTERRUPT_ERROR_BIT \
85 (SMHC_RINT_RESP_ERROR | SMHC_RINT_RESP_CRC_ERROR | SMHC_RINT_DATA_CRC_ERROR | SMHC_RINT_RESP_TIMEOUT | SMHC_RINT_DATA_TIMEOUT | SMHC_RINT_FIFO_RUN_ERROR | \
86 SMHC_RINT_HARD_WARE_LOCKED | SMHC_RINT_START_BIT_ERROR | SMHC_RINT_END_BIT_ERROR)
87#define SMHC_RINT_INTERRUPT_DONE_BIT (SMHC_RINT_AUTO_COMMAND_DONE | SMHC_RINT_DATA_OVER | SMHC_RINT_COMMAND_DONE | SMHC_RINT_VOLTAGE_CHANGE_DONE)
92#define SMHC_STATUS_RXWL_FLAG (1 << 0)
93#define SMHC_STATUS_TXWL_FLAG (1 << 1)
94#define SMHC_STATUS_FIFO_EMPTY (1 << 2)
95#define SMHC_STATUS_FIFO_FULL (1 << 3)
96#define SMHC_STATUS_CARD_PRESENT (1 << 8)
97#define SMHC_STATUS_CARD_DATA_BUSY (1 << 9)
98#define SMHC_STATUS_DATA_FSM_BUSY (1 << 10)
99#define SMHC_STATUS_DMA_REQUEST (1 << 31)
100#define SMHC_STATUS_FIFO_SIZE (16)
101#define SMHC_STATUS_FIFO_LEVEL(x) (((x) >> 17) & 0x3fff)
104#define SMHC_IDMAC_SOFT_RESET BIT(0)
105#define SMHC_IDMAC_FIX_BURST BIT(1)
106#define SMHC_IDMAC_IDMA_ON BIT(7)
107#define SMHC_IDMAC_REFETCH_DES BIT(31)
110#define SMHC_IDMAC_TRANSMIT_INTERRUPT BIT(0)
111#define SMHC_IDMAC_RECEIVE_INTERRUPT BIT(1)
112#define SMHC_IDMAC_FATAL_BUS_ERROR BIT(2)
113#define SMHC_IDMAC_DESTINATION_INVALID BIT(4)
114#define SMHC_IDMAC_CARD_ERROR_SUM BIT(5)
115#define SMHC_IDMAC_NORMAL_INTERRUPT_SUM BIT(8)
116#define SMHC_IDMAC_ABNORMAL_INTERRUPT_SUM BIT(9)
117#define SMHC_IDMAC_HOST_ABORT_INTERRUPT BIT(10)
118#define SMHC_IDMAC_IDLE (0 << 13)
119#define SMHC_IDMAC_SUSPEND (1 << 13)
120#define SMHC_IDMAC_DESC_READ (2 << 13)
121#define SMHC_IDMAC_DESC_CHECK (3 << 13)
122#define SMHC_IDMAC_READ_REQUEST_WAIT (4 << 13)
123#define SMHC_IDMAC_WRITE_REQUEST_WAIT (5 << 13)
124#define SMHC_IDMAC_READ (6 << 13)
125#define SMHC_IDMAC_WRITE (7 << 13)
126#define SMHC_IDMAC_DESC_CLOSE (8 << 13)
135#define SMHC_IDMAC_DES0_DIC BIT(1)
136#define SMHC_IDMAC_DES0_LD BIT(2)
137#define SMHC_IDMAC_DES0_FD BIT(3)
138#define SMHC_IDMAC_DES0_CH BIT(4)
139#define SMHC_IDMAC_DES0_ER BIT(5)
140#define SMHC_IDMAC_DES0_CES BIT(30)
141#define SMHC_IDMAC_DES0_OWN BIT(31)
153#define SUNXI_MMC_TIMING_MODE_0 0U
154#define SUNXI_MMC_TIMING_MODE_1 1U
155#define SUNXI_MMC_TIMING_MODE_2 2U
156#define SUNXI_MMC_TIMING_MODE_3 3U
157#define SUNXI_MMC_TIMING_MODE_4 4U
158#define SUNXI_MMC_TIMING_MODE_5 5U
160#define MMC_CLK_SAMPLE_POINIT_MODE_0 8U
161#define MMC_CLK_SAMPLE_POINIT_MODE_1 3U
162#define MMC_CLK_SAMPLE_POINIT_MODE_2 2U
163#define MMC_CLK_SAMPLE_POINIT_MODE_2_HS400 64U
164#define MMC_CLK_SAMPLE_POINIT_MODE_3 64U
165#define MMC_CLK_SAMPLE_POINIT_MODE_4 64U
166#define MMC_CLK_SAMPLE_POINIT_MODE_5 64U
168#define TM5_OUT_PH90 (0)
169#define TM5_OUT_PH180 (1)
170#define TM5_IN_PH90 (0)
171#define TM5_IN_PH180 (1)
172#define TM5_IN_PH270 (2)
173#define TM5_IN_PH0 (3)
176#define SDXC_NTDC_START_CAL (1 << 15)
177#define SDXC_NTDC_CAL_DONE (1 << 14)
178#define SDXC_NTDC_CAL_DLY (0x3F << 8)
179#define SDXC_NTDC_ENABLE_DLY (1 << 7)
180#define SDXC_NTDC_CFG_DLY (0x3F << 0)
181#define SDXC_NTDC_CFG_NEW_DLY (0xF << 0)
184#define SUNXI_MMC_NTSR_MODE_SEL_NEW (0x1 << 31)
u32_t uint32_t
Definition stdint.h:13
Definition reg-smhc.h:186
volatile uint32_t ntdc
Definition reg-smhc.h:229
volatile uint32_t dbgc
Definition reg-smhc.h:207
volatile uint32_t cmd
Definition reg-smhc.h:193
volatile uint32_t mint
Definition reg-smhc.h:200
volatile uint32_t skew_dat3_dl
Definition reg-smhc.h:234
volatile uint32_t arg
Definition reg-smhc.h:194
volatile uint32_t cbda
Definition reg-smhc.h:219
volatile uint32_t bytecnt
Definition reg-smhc.h:192
volatile uint32_t resp0
Definition reg-smhc.h:195
volatile uint32_t skew_dat0_dl
Definition reg-smhc.h:231
volatile uint32_t fifo
Definition reg-smhc.h:242
volatile uint32_t rint
Definition reg-smhc.h:201
volatile uint32_t ds_dl
Definition reg-smhc.h:228
volatile uint32_t hwrst
Definition reg-smhc.h:212
volatile uint32_t cbcr
Definition reg-smhc.h:205
volatile uint32_t resp2
Definition reg-smhc.h:197
volatile uint32_t status
Definition reg-smhc.h:202
volatile uint32_t timeout
Definition reg-smhc.h:189
volatile uint32_t dlba
Definition reg-smhc.h:215
volatile uint32_t vers
Definition reg-smhc.h:244
volatile uint32_t samp_dl
Definition reg-smhc.h:227
volatile uint32_t drv_dl
Definition reg-smhc.h:226
volatile uint32_t chda
Definition reg-smhc.h:218
volatile uint32_t bbcr
Definition reg-smhc.h:206
volatile uint32_t skew_ds_dl
Definition reg-smhc.h:239
volatile uint32_t resp1
Definition reg-smhc.h:196
volatile uint32_t skew_dat7_dl
Definition reg-smhc.h:238
volatile uint32_t ftrglevel
Definition reg-smhc.h:203
volatile uint32_t imask
Definition reg-smhc.h:199
volatile uint32_t skew_dat6_dl
Definition reg-smhc.h:237
volatile uint32_t width
Definition reg-smhc.h:190
volatile uint32_t funcsel
Definition reg-smhc.h:204
volatile uint32_t blksz
Definition reg-smhc.h:191
volatile uint32_t resp3
Definition reg-smhc.h:198
volatile uint32_t skew_dat5_dl
Definition reg-smhc.h:236
volatile uint32_t clkcr
Definition reg-smhc.h:188
volatile uint32_t a12a
Definition reg-smhc.h:209
volatile uint32_t idie
Definition reg-smhc.h:217
volatile uint32_t skew_dat1_dl
Definition reg-smhc.h:232
volatile uint32_t ntsr
Definition reg-smhc.h:210
volatile uint32_t res2
Definition reg-smhc.h:213
volatile uint32_t dsbd
Definition reg-smhc.h:224
volatile uint32_t gctrl
Definition reg-smhc.h:187
volatile uint32_t skew_ctrl
Definition reg-smhc.h:240
volatile uint32_t thldc
Definition reg-smhc.h:221
volatile uint32_t idst
Definition reg-smhc.h:216
volatile uint32_t csdc
Definition reg-smhc.h:208
volatile uint32_t skew_dat2_dl
Definition reg-smhc.h:233
volatile uint32_t dmac
Definition reg-smhc.h:214
volatile uint32_t skew_dat4_dl
Definition reg-smhc.h:235
volatile uint32_t sfc
Definition reg-smhc.h:222