linux/drivers/mmc/host/cavium.h

/*
 * Driver for MMC and SSD cards for Cavium OCTEON and ThunderX SOCs.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2012-2017 Cavium Inc.
 */

#ifndef _CAVIUM_MMC_H_
#define _CAVIUM_MMC_H_

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/mmc/host.h>
#include <linux/of.h>
#include <linux/scatterlist.h>
#include <linux/semaphore.h>

#define CAVIUM_MAX_MMC

/* DMA register addresses */
#define MIO_EMM_DMA_FIFO_CFG(x)
#define MIO_EMM_DMA_FIFO_ADR(x)
#define MIO_EMM_DMA_FIFO_CMD(x)
#define MIO_EMM_DMA_CFG(x)
#define MIO_EMM_DMA_ADR(x)
#define MIO_EMM_DMA_INT(x)
#define MIO_EMM_DMA_INT_W1S(x)
#define MIO_EMM_DMA_INT_ENA_W1S(x)
#define MIO_EMM_DMA_INT_ENA_W1C(x)

/* register addresses */
#define MIO_EMM_CFG(x)
#define MIO_EMM_SWITCH(x)
#define MIO_EMM_DMA(x)
#define MIO_EMM_CMD(x)
#define MIO_EMM_RSP_STS(x)
#define MIO_EMM_RSP_LO(x)
#define MIO_EMM_RSP_HI(x)
#define MIO_EMM_INT(x)
#define MIO_EMM_INT_EN(x)
#define MIO_EMM_WDOG(x)
#define MIO_EMM_SAMPLE(x)
#define MIO_EMM_STS_MASK(x)
#define MIO_EMM_RCA(x)
#define MIO_EMM_INT_EN_SET(x)
#define MIO_EMM_INT_EN_CLR(x)
#define MIO_EMM_BUF_IDX(x)
#define MIO_EMM_BUF_DAT(x)

struct cvm_mmc_host {};

struct cvm_mmc_slot {};

struct cvm_mmc_cr_type {};

struct cvm_mmc_cr_mods {};

/* Bitfield definitions */
#define MIO_EMM_DMA_FIFO_CFG_CLR
#define MIO_EMM_DMA_FIFO_CFG_INT_LVL
#define MIO_EMM_DMA_FIFO_CFG_COUNT

#define MIO_EMM_DMA_FIFO_CMD_RW
#define MIO_EMM_DMA_FIFO_CMD_INTDIS
#define MIO_EMM_DMA_FIFO_CMD_SWAP32
#define MIO_EMM_DMA_FIFO_CMD_SWAP16
#define MIO_EMM_DMA_FIFO_CMD_SWAP8
#define MIO_EMM_DMA_FIFO_CMD_ENDIAN
#define MIO_EMM_DMA_FIFO_CMD_SIZE

#define MIO_EMM_CMD_SKIP_BUSY
#define MIO_EMM_CMD_BUS_ID
#define MIO_EMM_CMD_VAL
#define MIO_EMM_CMD_DBUF
#define MIO_EMM_CMD_OFFSET
#define MIO_EMM_CMD_CTYPE_XOR
#define MIO_EMM_CMD_RTYPE_XOR
#define MIO_EMM_CMD_IDX
#define MIO_EMM_CMD_ARG

#define MIO_EMM_DMA_SKIP_BUSY
#define MIO_EMM_DMA_BUS_ID
#define MIO_EMM_DMA_VAL
#define MIO_EMM_DMA_SECTOR
#define MIO_EMM_DMA_DAT_NULL
#define MIO_EMM_DMA_THRES
#define MIO_EMM_DMA_REL_WR
#define MIO_EMM_DMA_RW
#define MIO_EMM_DMA_MULTI
#define MIO_EMM_DMA_BLOCK_CNT
#define MIO_EMM_DMA_CARD_ADDR

#define MIO_EMM_DMA_CFG_EN
#define MIO_EMM_DMA_CFG_RW
#define MIO_EMM_DMA_CFG_CLR
#define MIO_EMM_DMA_CFG_SWAP32
#define MIO_EMM_DMA_CFG_SWAP16
#define MIO_EMM_DMA_CFG_SWAP8
#define MIO_EMM_DMA_CFG_ENDIAN
#define MIO_EMM_DMA_CFG_SIZE
#define MIO_EMM_DMA_CFG_ADR

#define MIO_EMM_INT_SWITCH_ERR
#define MIO_EMM_INT_SWITCH_DONE
#define MIO_EMM_INT_DMA_ERR
#define MIO_EMM_INT_CMD_ERR
#define MIO_EMM_INT_DMA_DONE
#define MIO_EMM_INT_CMD_DONE
#define MIO_EMM_INT_BUF_DONE

#define MIO_EMM_RSP_STS_BUS_ID
#define MIO_EMM_RSP_STS_CMD_VAL
#define MIO_EMM_RSP_STS_SWITCH_VAL
#define MIO_EMM_RSP_STS_DMA_VAL
#define MIO_EMM_RSP_STS_DMA_PEND
#define MIO_EMM_RSP_STS_DBUF_ERR
#define MIO_EMM_RSP_STS_DBUF
#define MIO_EMM_RSP_STS_BLK_TIMEOUT
#define MIO_EMM_RSP_STS_BLK_CRC_ERR
#define MIO_EMM_RSP_STS_RSP_BUSYBIT
#define MIO_EMM_RSP_STS_STP_TIMEOUT
#define MIO_EMM_RSP_STS_STP_CRC_ERR
#define MIO_EMM_RSP_STS_STP_BAD_STS
#define MIO_EMM_RSP_STS_STP_VAL
#define MIO_EMM_RSP_STS_RSP_TIMEOUT
#define MIO_EMM_RSP_STS_RSP_CRC_ERR
#define MIO_EMM_RSP_STS_RSP_BAD_STS
#define MIO_EMM_RSP_STS_RSP_VAL
#define MIO_EMM_RSP_STS_RSP_TYPE
#define MIO_EMM_RSP_STS_CMD_TYPE
#define MIO_EMM_RSP_STS_CMD_IDX
#define MIO_EMM_RSP_STS_CMD_DONE

#define MIO_EMM_SAMPLE_CMD_CNT
#define MIO_EMM_SAMPLE_DAT_CNT

#define MIO_EMM_SWITCH_BUS_ID
#define MIO_EMM_SWITCH_EXE
#define MIO_EMM_SWITCH_ERR0
#define MIO_EMM_SWITCH_ERR1
#define MIO_EMM_SWITCH_ERR2
#define MIO_EMM_SWITCH_HS_TIMING
#define MIO_EMM_SWITCH_BUS_WIDTH
#define MIO_EMM_SWITCH_POWER_CLASS
#define MIO_EMM_SWITCH_CLK_HI
#define MIO_EMM_SWITCH_CLK_LO

/* Protoypes */
irqreturn_t cvm_mmc_interrupt(int irq, void *dev_id);
int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host);
int cvm_mmc_of_slot_remove(struct cvm_mmc_slot *slot);
extern const char *cvm_mmc_irq_names[];

#endif