drivers/mmc/host/mvsdio.h

Source file repositories/reference/linux-study-clean/drivers/mmc/host/mvsdio.h

File Facts

System
Linux kernel
Corpus path
drivers/mmc/host/mvsdio.h
Extension
.h
Size
4913 bytes
Lines
188
Domain
Driver Families
Bucket
drivers/mmc
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __MVSDIO_H
#define __MVSDIO_H

/*
 * Clock rates
 */

#define MVSD_CLOCKRATE_MAX			50000000
#define MVSD_BASE_DIV_MAX			0x7ff


/*
 * Register offsets
 */

#define MVSD_SYS_ADDR_LOW			0x000
#define MVSD_SYS_ADDR_HI			0x004
#define MVSD_BLK_SIZE				0x008
#define MVSD_BLK_COUNT				0x00c
#define MVSD_ARG_LOW				0x010
#define MVSD_ARG_HI				0x014
#define MVSD_XFER_MODE				0x018
#define MVSD_CMD				0x01c
#define MVSD_RSP(i)				(0x020 + ((i)<<2))
#define MVSD_RSP0				0x020
#define MVSD_RSP1				0x024
#define MVSD_RSP2				0x028
#define MVSD_RSP3				0x02c
#define MVSD_RSP4				0x030
#define MVSD_RSP5				0x034
#define MVSD_RSP6				0x038
#define MVSD_RSP7				0x03c
#define MVSD_FIFO				0x040
#define MVSD_RSP_CRC7				0x044
#define MVSD_HW_STATE				0x048
#define MVSD_HOST_CTRL				0x050
#define MVSD_BLK_GAP_CTRL			0x054
#define MVSD_CLK_CTRL				0x058
#define MVSD_SW_RESET				0x05c
#define MVSD_NOR_INTR_STATUS			0x060
#define MVSD_ERR_INTR_STATUS			0x064
#define MVSD_NOR_STATUS_EN			0x068
#define MVSD_ERR_STATUS_EN			0x06c
#define MVSD_NOR_INTR_EN			0x070
#define MVSD_ERR_INTR_EN			0x074
#define MVSD_AUTOCMD12_ERR_STATUS		0x078
#define MVSD_CURR_BYTE_LEFT			0x07c
#define MVSD_CURR_BLK_LEFT			0x080
#define MVSD_AUTOCMD12_ARG_LOW			0x084
#define MVSD_AUTOCMD12_ARG_HI			0x088
#define MVSD_AUTOCMD12_CMD			0x08c
#define MVSD_AUTO_RSP(i)			(0x090 + ((i)<<2))
#define MVSD_AUTO_RSP0				0x090
#define MVSD_AUTO_RSP1				0x094
#define MVSD_AUTO_RSP2				0x098
#define MVSD_CLK_DIV				0x128

#define MVSD_WINDOW_CTRL(i)			(0x108 + ((i) << 3))
#define MVSD_WINDOW_BASE(i)			(0x10c + ((i) << 3))


/*
 * MVSD_CMD
 */

#define MVSD_CMD_RSP_NONE			(0 << 0)
#define MVSD_CMD_RSP_136			(1 << 0)
#define MVSD_CMD_RSP_48				(2 << 0)
#define MVSD_CMD_RSP_48BUSY			(3 << 0)

#define MVSD_CMD_CHECK_DATACRC16		(1 << 2)
#define MVSD_CMD_CHECK_CMDCRC			(1 << 3)
#define MVSD_CMD_INDX_CHECK			(1 << 4)
#define MVSD_CMD_DATA_PRESENT			(1 << 5)
#define MVSD_UNEXPECTED_RESP			(1 << 7)
#define MVSD_CMD_INDEX(x)			((x) << 8)


/*
 * MVSD_AUTOCMD12_CMD
 */

#define MVSD_AUTOCMD12_BUSY			(1 << 0)
#define MVSD_AUTOCMD12_INDX_CHECK		(1 << 1)
#define MVSD_AUTOCMD12_INDEX(x)			((x) << 8)

/*
 * MVSD_XFER_MODE
 */

Annotation

Implementation Notes