linux/drivers/mmc/host/cavium.c

/*
 * Shared part of driver for MMC/SDHC controller on 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.
 * Authors:
 *   David Daney <[email protected]>
 *   Peter Swain <[email protected]>
 *   Steven J. Hill <[email protected]>
 *   Jan Glauber <[email protected]>
 */
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/slot-gpio.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
#include <linux/scatterlist.h>
#include <linux/time.h>

#include "cavium.h"

const char *cvm_mmc_irq_names[] =;

/*
 * The Cavium MMC host hardware assumes that all commands have fixed
 * command and response types.  These are correct if MMC devices are
 * being used.  However, non-MMC devices like SD use command and
 * response types that are unexpected by the host hardware.
 *
 * The command and response types can be overridden by supplying an
 * XOR value that is applied to the type.  We calculate the XOR value
 * from the values in this table and the flags passed from the MMC
 * core.
 */
static struct cvm_mmc_cr_type cvm_mmc_cr_types[] =;

static struct cvm_mmc_cr_mods cvm_mmc_get_cr_mods(struct mmc_command *cmd)
{}

static void check_switch_errors(struct cvm_mmc_host *host)
{}

static void clear_bus_id(u64 *reg)
{}

static void set_bus_id(u64 *reg, int bus_id)
{}

static int get_bus_id(u64 reg)
{}

/*
 * We never set the switch_exe bit since that would interfere
 * with the commands send by the MMC core.
 */
static void do_switch(struct cvm_mmc_host *host, u64 emm_switch)
{}

static bool switch_val_changed(struct cvm_mmc_slot *slot, u64 new_val)
{}

static void set_wdog(struct cvm_mmc_slot *slot, unsigned int ns)
{}

static void cvm_mmc_reset_bus(struct cvm_mmc_slot *slot)
{}

/* Switch to another slot if needed */
static void cvm_mmc_switch_to(struct cvm_mmc_slot *slot)
{}

static void do_read(struct cvm_mmc_host *host, struct mmc_request *req,
		    u64 dbuf)
{}

static void do_write(struct mmc_request *req)
{}

static void set_cmd_response(struct cvm_mmc_host *host, struct mmc_request *req,
			     u64 rsp_sts)
{}

static int get_dma_dir(struct mmc_data *data)
{}

static int finish_dma_single(struct cvm_mmc_host *host, struct mmc_data *data)
{}

static int finish_dma_sg(struct cvm_mmc_host *host, struct mmc_data *data)
{}

static int finish_dma(struct cvm_mmc_host *host, struct mmc_data *data)
{}

static int check_status(u64 rsp_sts)
{}

/* Try to clean up failed DMA. */
static void cleanup_dma(struct cvm_mmc_host *host, u64 rsp_sts)
{}

irqreturn_t cvm_mmc_interrupt(int irq, void *dev_id)
{}

/*
 * Program DMA_CFG and if needed DMA_ADR.
 * Returns 0 on error, DMA address otherwise.
 */
static u64 prepare_dma_single(struct cvm_mmc_host *host, struct mmc_data *data)
{}

/*
 * Queue complete sg list into the FIFO.
 * Returns 0 on error, 1 otherwise.
 */
static u64 prepare_dma_sg(struct cvm_mmc_host *host, struct mmc_data *data)
{}

static u64 prepare_dma(struct cvm_mmc_host *host, struct mmc_data *data)
{}

static u64 prepare_ext_dma(struct mmc_host *mmc, struct mmc_request *mrq)
{}

static void cvm_mmc_dma_request(struct mmc_host *mmc,
				struct mmc_request *mrq)
{}

static void do_read_request(struct cvm_mmc_host *host, struct mmc_request *mrq)
{}

static void do_write_request(struct cvm_mmc_host *host, struct mmc_request *mrq)
{}

static void cvm_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
{}

static void cvm_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{}

static const struct mmc_host_ops cvm_mmc_ops =;

static void cvm_mmc_set_clock(struct cvm_mmc_slot *slot, unsigned int clock)
{}

static int cvm_mmc_init_lowlevel(struct cvm_mmc_slot *slot)
{}

static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)
{}

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)
{}