[U-Boot] [PATCH 1/2 V2] PXA: Add MMC driver using the generic MMC framework
Igor Grinberg
grinberg at compulab.co.il
Wed Nov 2 09:48:33 CET 2011
On 11/02/11 00:58, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> ---
> arch/arm/include/asm/arch-pxa/regs-mmc.h | 154 +++++++++++
> drivers/mmc/Makefile | 1 +
> drivers/mmc/pxa_mmc_gen.c | 442 ++++++++++++++++++++++++++++++
> 3 files changed, 597 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/include/asm/arch-pxa/regs-mmc.h
> create mode 100644 drivers/mmc/pxa_mmc_gen.c
>
> V2: Squash CMD(x) and use #define[space]
[...]
>
> diff --git a/arch/arm/include/asm/arch-pxa/regs-mmc.h b/arch/arm/include/asm/arch-pxa/regs-mmc.h
> new file mode 100644
> index 0000000..6b7dfd3
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-pxa/regs-mmc.h
[...]
> +
> +/* MMC_STRPCL */
> +#define MMC_STRPCL_STOP_CLK (1 << 0)
> +#define MMC_STRPCL_START_CLK (1 << 1)
> +
> +/* MMC_STAT */
> +#define MMC_STAT_END_CMD_RES (1 << 13)
> +#define MMC_STAT_PRG_DONE (1 << 12)
> +#define MMC_STAT_DATA_TRAN_DONE (1 << 11)
> +#define MMC_STAT_CLK_EN (1 << 8)
> +#define MMC_STAT_RECV_FIFO_FULL (1 << 7)
> +#define MMC_STAT_XMIT_FIFO_EMPTY (1 << 6)
> +#define MMC_STAT_RES_CRC_ERROR (1 << 5)
> +#define MMC_STAT_SPI_READ_ERROR_TOKEN (1 << 4)
You have 3 spaces here while all other lines use tab.
> +#define MMC_STAT_CRC_READ_ERROR (1 << 3)
> +#define MMC_STAT_CRC_WRITE_ERROR (1 << 2)
> +#define MMC_STAT_TIME_OUT_RESPONSE (1 << 1)
> +#define MMC_STAT_READ_TIME_OUT (1 << 0)
> +
> +/* MMC_CLKRT */
> +#define MMC_CLKRT_20MHZ 0
> +#define MMC_CLKRT_10MHZ 1
> +#define MMC_CLKRT_5MHZ 2
> +#define MMC_CLKRT_2_5MHZ 3
> +#define MMC_CLKRT_1_25MHZ 4
> +#define MMC_CLKRT_0_625MHZ 5
> +#define MMC_CLKRT_0_3125MHZ 6
> +
> +/* MMC_SPI */
> +#define MMC_SPI_EN (1 << 0)
> +#define MMC_SPI_CS_EN (1 << 2)
> +#define MMC_SPI_CS_ADDRESS (1 << 3)
> +#define MMC_SPI_CRC_ON (1 << 1)
> +
> +/* MMC_CMDAT */
> +#define MMC_CMDAT_SD_4DAT (1 << 8)
> +#define MMC_CMDAT_MMC_DMA_EN (1 << 7)
> +#define MMC_CMDAT_INIT (1 << 6)
> +#define MMC_CMDAT_BUSY (1 << 5)
> +#define MMC_CMDAT_BCR (MMC_CMDAT_BUSY | MMC_CMDAT_INIT)
> +#define MMC_CMDAT_STREAM (1 << 4)
> +#define MMC_CMDAT_WRITE (1 << 3)
> +#define MMC_CMDAT_DATA_EN (1 << 2)
> +#define MMC_CMDAT_R0 0
> +#define MMC_CMDAT_R1 1
> +#define MMC_CMDAT_R2 2
> +#define MMC_CMDAT_R3 3
> +
> +/* MMC_RESTO */
> +#define MMC_RES_TO_MAX_MASK 0x7f
> +
> +/* MMC_RDTO */
> +#define MMC_READ_TO_MAX_MASK 0xffff
> +
> +/* MMC_BLKLEN */
> +#define MMC_BLK_LEN_MAX_MASK 0x3ff
> +
> +/* MMC_PRTBUF */
> +#define MMC_PRTBUF_BUF_PART_FULL (1 << 0)
> +
> +/* MMC_I_MASK */
> +#define MMC_I_MASK_TXFIFO_WR_REQ (1 << 6)
> +#define MMC_I_MASK_RXFIFO_RD_REQ (1 << 5)
> +#define MMC_I_MASK_CLK_IS_OFF (1 << 4)
> +#define MMC_I_MASK_STOP_CMD (1 << 3)
> +#define MMC_I_MASK_END_CMD_RES (1 << 2)
> +#define MMC_I_MASK_PRG_DONE (1 << 1)
> +#define MMC_I_MASK_DATA_TRAN_DONE (1 << 0)
spaces instead before the parenthesis
[...]
--
Regards,
Igor.
More information about the U-Boot
mailing list