linux/drivers/mmc/host/sdhci-iproc.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright (C) 2014 Broadcom Corporation

/*
 * iProc SDHCI platform driver
 */

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/mmc/host.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include "sdhci-pltfm.h"

struct sdhci_iproc_data {};

struct sdhci_iproc_host {};

#define REG_OFFSET_IN_BITS(reg)

static inline u32 sdhci_iproc_readl(struct sdhci_host *host, int reg)
{}

static u16 sdhci_iproc_readw(struct sdhci_host *host, int reg)
{}

static u8 sdhci_iproc_readb(struct sdhci_host *host, int reg)
{}

static inline void sdhci_iproc_writel(struct sdhci_host *host, u32 val, int reg)
{}

/*
 * The Arasan has a bugette whereby it may lose the content of successive
 * writes to the same register that are within two SD-card clock cycles of
 * each other (a clock domain crossing problem). The data
 * register does not have this problem, which is just as well - otherwise we'd
 * have to nobble the DMA engine too.
 *
 * This wouldn't be a problem with the code except that we can only write the
 * controller with 32-bit writes.  So two different 16-bit registers are
 * written back to back creates the problem.
 *
 * In reality, this only happens when SDHCI_BLOCK_SIZE and SDHCI_BLOCK_COUNT
 * are written followed by SDHCI_TRANSFER_MODE and SDHCI_COMMAND.
 * The BLOCK_SIZE and BLOCK_COUNT are meaningless until a command issued so
 * the work around can be further optimized. We can keep shadow values of
 * BLOCK_SIZE, BLOCK_COUNT, and TRANSFER_MODE until a COMMAND is issued.
 * Then, write the BLOCK_SIZE+BLOCK_COUNT in a single 32-bit write followed
 * by the TRANSFER+COMMAND in another 32-bit write.
 */
static void sdhci_iproc_writew(struct sdhci_host *host, u16 val, int reg)
{}

static void sdhci_iproc_writeb(struct sdhci_host *host, u8 val, int reg)
{}

static unsigned int sdhci_iproc_get_max_clock(struct sdhci_host *host)
{}

/*
 * There is a known bug on BCM2711's SDHCI core integration where the
 * controller will hang when the difference between the core clock and the bus
 * clock is too great. Specifically this can be reproduced under the following
 * conditions:
 *
 *  - No SD card plugged in, polling thread is running, probing cards at
 *    100 kHz.
 *  - BCM2711's core clock configured at 500MHz or more
 *
 * So we set 200kHz as the minimum clock frequency available for that SoC.
 */
static unsigned int sdhci_iproc_bcm2711_get_min_clock(struct sdhci_host *host)
{}

static const struct sdhci_ops sdhci_iproc_ops =;

static const struct sdhci_ops sdhci_iproc_32only_ops =;

static const struct sdhci_pltfm_data sdhci_iproc_cygnus_pltfm_data =;

static const struct sdhci_iproc_data iproc_cygnus_data =;

static const struct sdhci_pltfm_data sdhci_iproc_pltfm_data =;

static const struct sdhci_iproc_data iproc_data =;

static const struct sdhci_pltfm_data sdhci_bcm2835_pltfm_data =;

static const struct sdhci_iproc_data bcm2835_data =;

static const struct sdhci_ops sdhci_iproc_bcm2711_ops =;

static const struct sdhci_pltfm_data sdhci_bcm2711_pltfm_data =;

static const struct sdhci_iproc_data bcm2711_data =;

static const struct sdhci_pltfm_data sdhci_bcm7211a0_pltfm_data =;

#define BCM7211A0_BASE_CLK_MHZ
static const struct sdhci_iproc_data bcm7211a0_data =;

static const struct of_device_id sdhci_iproc_of_match[] =;
MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);

#ifdef CONFIG_ACPI
/*
 * This is a duplicate of bcm2835_(pltfrm_)data without caps quirks
 * which are provided by the ACPI table.
 */
static const struct sdhci_pltfm_data sdhci_bcm_arasan_data =;

static const struct sdhci_iproc_data bcm_arasan_data =;

static const struct acpi_device_id sdhci_iproc_acpi_ids[] =;
MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
#endif

static int sdhci_iproc_probe(struct platform_device *pdev)
{}

static void sdhci_iproc_shutdown(struct platform_device *pdev)
{}

static struct platform_driver sdhci_iproc_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();