Skip to content
Snippets Groups Projects
pxa_mmc.h 4.26 KiB
/*
 *  linux/drivers/mmc/mmc_pxa.h
 *
 *  Author: Vladimir Shebordaev, Igor Oblakov
 *  Copyright:  MontaVista Software Inc.
 *
 *  $Id: mmc_pxa.h,v 0.3.1.6 2002/09/25 19:25:48 ted Exp ted $
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 */
#ifndef __MMC_PXA_P_H__
#define __MMC_PXA_P_H__

/* PXA-250 MMC controller registers */

/* MMC_STRPCL */
#define MMC_STRPCL_STOP_CLK		(0x0001UL)
#define MMC_STRPCL_START_CLK		(0x0002UL)

/* MMC_STAT */
#define MMC_STAT_END_CMD_RES		(0x0001UL << 13)
#define MMC_STAT_PRG_DONE		(0x0001UL << 12)
#define MMC_STAT_DATA_TRAN_DONE		(0x0001UL << 11)
#define MMC_STAT_CLK_EN			(0x0001UL << 8)
#define MMC_STAT_RECV_FIFO_FULL		(0x0001UL << 7)
#define MMC_STAT_XMIT_FIFO_EMPTY	(0x0001UL << 6)
#define MMC_STAT_RES_CRC_ERROR		(0x0001UL << 5)
#define MMC_STAT_SPI_READ_ERROR_TOKEN   (0x0001UL << 4)
#define MMC_STAT_CRC_READ_ERROR		(0x0001UL << 3)
#define MMC_STAT_CRC_WRITE_ERROR	(0x0001UL << 2)
#define MMC_STAT_TIME_OUT_RESPONSE	(0x0001UL << 1)
#define MMC_STAT_READ_TIME_OUT		(0x0001UL)

#define MMC_STAT_ERRORS (MMC_STAT_RES_CRC_ERROR|MMC_STAT_SPI_READ_ERROR_TOKEN\
	|MMC_STAT_CRC_READ_ERROR|MMC_STAT_TIME_OUT_RESPONSE\
	|MMC_STAT_READ_TIME_OUT|MMC_STAT_CRC_WRITE_ERROR)

/* MMC_CLKRT */
#define MMC_CLKRT_20MHZ			(0x0000UL)
#define MMC_CLKRT_10MHZ			(0x0001UL)
#define MMC_CLKRT_5MHZ			(0x0002UL)
#define MMC_CLKRT_2_5MHZ		(0x0003UL)
#define MMC_CLKRT_1_25MHZ		(0x0004UL)
#define MMC_CLKRT_0_625MHZ		(0x0005UL)
#define MMC_CLKRT_0_3125MHZ		(0x0006UL)

/* MMC_SPI */
#define MMC_SPI_DISABLE			(0x00UL)
#define MMC_SPI_EN			(0x01UL)
#define MMC_SPI_CS_EN			(0x01UL << 2)
#define MMC_SPI_CS_ADDRESS		(0x01UL << 3)
#define MMC_SPI_CRC_ON			(0x01UL << 1)

/* MMC_CMDAT */
#define MMC_CMDAT_SD_4DAT		(0x0001UL << 8)
#define MMC_CMDAT_MMC_DMA_EN		(0x0001UL << 7)
#define MMC_CMDAT_INIT			(0x0001UL << 6)
#define MMC_CMDAT_BUSY			(0x0001UL << 5)
#define MMC_CMDAT_BCR			(0x0003UL << 5)
#define MMC_CMDAT_STREAM		(0x0001UL << 4)
#define MMC_CMDAT_BLOCK			(0x0000UL << 4)
#define MMC_CMDAT_WRITE			(0x0001UL << 3)
#define MMC_CMDAT_READ			(0x0000UL << 3)
#define MMC_CMDAT_DATA_EN		(0x0001UL << 2)
#define MMC_CMDAT_R0			(0)
#define MMC_CMDAT_R1			(0x0001UL)
#define MMC_CMDAT_R2			(0x0002UL)
#define MMC_CMDAT_R3			(0x0003UL)