162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#define MMC_STRPCL	0x0000
362306a36Sopenharmony_ci#define STOP_CLOCK		(1 << 0)
462306a36Sopenharmony_ci#define START_CLOCK		(2 << 0)
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#define MMC_STAT	0x0004
762306a36Sopenharmony_ci#define STAT_END_CMD_RES		(1 << 13)
862306a36Sopenharmony_ci#define STAT_PRG_DONE			(1 << 12)
962306a36Sopenharmony_ci#define STAT_DATA_TRAN_DONE		(1 << 11)
1062306a36Sopenharmony_ci#define STAT_CLK_EN			(1 << 8)
1162306a36Sopenharmony_ci#define STAT_RECV_FIFO_FULL		(1 << 7)
1262306a36Sopenharmony_ci#define STAT_XMIT_FIFO_EMPTY		(1 << 6)
1362306a36Sopenharmony_ci#define STAT_RES_CRC_ERR		(1 << 5)
1462306a36Sopenharmony_ci#define STAT_SPI_READ_ERROR_TOKEN	(1 << 4)
1562306a36Sopenharmony_ci#define STAT_CRC_READ_ERROR		(1 << 3)
1662306a36Sopenharmony_ci#define STAT_CRC_WRITE_ERROR		(1 << 2)
1762306a36Sopenharmony_ci#define STAT_TIME_OUT_RESPONSE		(1 << 1)
1862306a36Sopenharmony_ci#define STAT_READ_TIME_OUT		(1 << 0)
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci#define MMC_CLKRT	0x0008		/* 3 bit */
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci#define MMC_SPI		0x000c
2362306a36Sopenharmony_ci#define SPI_CS_ADDRESS		(1 << 3)
2462306a36Sopenharmony_ci#define SPI_CS_EN		(1 << 2)
2562306a36Sopenharmony_ci#define CRC_ON			(1 << 1)
2662306a36Sopenharmony_ci#define SPI_EN			(1 << 0)
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define MMC_CMDAT	0x0010
2962306a36Sopenharmony_ci#define CMDAT_SDIO_INT_EN	(1 << 11)
3062306a36Sopenharmony_ci#define CMDAT_SD_4DAT		(1 << 8)
3162306a36Sopenharmony_ci#define CMDAT_DMAEN		(1 << 7)
3262306a36Sopenharmony_ci#define CMDAT_INIT		(1 << 6)
3362306a36Sopenharmony_ci#define CMDAT_BUSY		(1 << 5)
3462306a36Sopenharmony_ci#define CMDAT_STREAM		(1 << 4)	/* 1 = stream */
3562306a36Sopenharmony_ci#define CMDAT_WRITE		(1 << 3)	/* 1 = write */
3662306a36Sopenharmony_ci#define CMDAT_DATAEN		(1 << 2)
3762306a36Sopenharmony_ci#define CMDAT_RESP_NONE		(0 << 0)
3862306a36Sopenharmony_ci#define CMDAT_RESP_SHORT	(1 << 0)
3962306a36Sopenharmony_ci#define CMDAT_RESP_R2		(2 << 0)
4062306a36Sopenharmony_ci#define CMDAT_RESP_R3		(3 << 0)
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define MMC_RESTO	0x0014	/* 7 bit */
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define MMC_RDTO	0x0018	/* 16 bit */
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define MMC_BLKLEN	0x001c	/* 10 bit */
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci#define MMC_NOB		0x0020	/* 16 bit */
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#define MMC_PRTBUF	0x0024
5162306a36Sopenharmony_ci#define BUF_PART_FULL		(1 << 0)
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define MMC_I_MASK	0x0028
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/*PXA27x MMC interrupts*/
5662306a36Sopenharmony_ci#define SDIO_SUSPEND_ACK  	(1 << 12)
5762306a36Sopenharmony_ci#define SDIO_INT          	(1 << 11)
5862306a36Sopenharmony_ci#define RD_STALLED        	(1 << 10)
5962306a36Sopenharmony_ci#define RES_ERR           	(1 << 9)
6062306a36Sopenharmony_ci#define DAT_ERR           	(1 << 8)
6162306a36Sopenharmony_ci#define TINT              	(1 << 7)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci/*PXA2xx MMC interrupts*/
6462306a36Sopenharmony_ci#define TXFIFO_WR_REQ		(1 << 6)
6562306a36Sopenharmony_ci#define RXFIFO_RD_REQ		(1 << 5)
6662306a36Sopenharmony_ci#define CLK_IS_OFF		(1 << 4)
6762306a36Sopenharmony_ci#define STOP_CMD		(1 << 3)
6862306a36Sopenharmony_ci#define END_CMD_RES		(1 << 2)
6962306a36Sopenharmony_ci#define PRG_DONE		(1 << 1)
7062306a36Sopenharmony_ci#define DATA_TRAN_DONE		(1 << 0)
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
7362306a36Sopenharmony_ci#define MMC_I_MASK_ALL          0x00001fff
7462306a36Sopenharmony_ci#else
7562306a36Sopenharmony_ci#define MMC_I_MASK_ALL          0x0000007f
7662306a36Sopenharmony_ci#endif
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define MMC_I_REG	0x002c
7962306a36Sopenharmony_ci/* same as MMC_I_MASK */
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#define MMC_CMD		0x0030
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci#define MMC_ARGH	0x0034	/* 16 bit */
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define MMC_ARGL	0x0038	/* 16 bit */
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci#define MMC_RES		0x003c	/* 16 bit */
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci#define MMC_RXFIFO	0x0040	/* 8 bit */
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#define MMC_TXFIFO	0x0044	/* 8 bit */
92