mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
Merge branch 'master' of git://git.denx.de/u-boot-mmc
This commit is contained in:
commit
5877d8f398
14 changed files with 119 additions and 8 deletions
|
@ -48,6 +48,7 @@ CONFIG_REGMAP=y
|
|||
CONFIG_SYSCON=y
|
||||
CONFIG_CPU=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -50,6 +50,7 @@ CONFIG_DM_I2C=y
|
|||
CONFIG_SYS_I2C_INTEL=y
|
||||
CONFIG_WINBOND_W83627=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -49,6 +49,7 @@ CONFIG_DM_I2C=y
|
|||
CONFIG_SYS_I2C_INTEL=y
|
||||
CONFIG_WINBOND_W83627=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -37,6 +37,7 @@ CONFIG_REGMAP=y
|
|||
CONFIG_SYSCON=y
|
||||
CONFIG_CPU=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -47,6 +47,7 @@ CONFIG_CPU=y
|
|||
CONFIG_DM_I2C=y
|
||||
CONFIG_NUVOTON_NCT6102D=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -42,6 +42,7 @@ CONFIG_REGMAP=y
|
|||
CONFIG_SYSCON=y
|
||||
CONFIG_CPU=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -47,6 +47,7 @@ CONFIG_REGMAP=y
|
|||
CONFIG_SYSCON=y
|
||||
CONFIG_CPU=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -47,6 +47,7 @@ CONFIG_CPU=y
|
|||
CONFIG_DM_I2C=y
|
||||
CONFIG_NUVOTON_NCT6102D=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_PCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
|
|
|
@ -122,6 +122,14 @@ config MMC_MXS
|
|||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_PCI
|
||||
bool "Support for MMC controllers on PCI"
|
||||
help
|
||||
This selects PCI-based MMC controllers.
|
||||
If you have an MMC controller on a PCI bus, say Y here.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_OMAP_HS
|
||||
bool "TI OMAP High Speed Multimedia Card Interface support"
|
||||
help
|
||||
|
@ -317,6 +325,20 @@ config MMC_SDHCI_XENON
|
|||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_SDHCI_TANGIER
|
||||
bool "Tangier SDHCI controller support"
|
||||
depends on DM_MMC && BLK
|
||||
depends on MMC_SDHCI
|
||||
help
|
||||
This selects support for SDHCI controller on Tanginer
|
||||
SoC. Note that this controller does not sit on PCI bus and,
|
||||
hence, cannot be enumerated by standard PCI means.
|
||||
|
||||
If you're using an Intel Tangier SoC (available on Intel
|
||||
Edison board), say Y here.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_SDHCI_TEGRA
|
||||
bool "SDHCI platform support for the Tegra SD/MMC Controller"
|
||||
depends on TEGRA
|
||||
|
|
|
@ -34,7 +34,7 @@ obj-$(CONFIG_MVEBU_MMC) += mvebu_mmc.o
|
|||
obj-$(CONFIG_MMC_OMAP_HS) += omap_hsmmc.o
|
||||
obj-$(CONFIG_MMC_MXC) += mxcmmc.o
|
||||
obj-$(CONFIG_MMC_MXS) += mxsmmc.o
|
||||
obj-$(CONFIG_X86) += pci_mmc.o
|
||||
obj-$(CONFIG_MMC_PCI) += pci_mmc.o
|
||||
obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
|
||||
obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
|
||||
obj-$(CONFIG_S3C_SDI) += s3c_sdi.o
|
||||
|
@ -62,6 +62,7 @@ obj-$(CONFIG_MMC_SDHCI_ROCKCHIP) += rockchip_sdhci.o
|
|||
obj-$(CONFIG_MMC_SDHCI_S5P) += s5p_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_SPEAR) += spear_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_STI) += sti_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_TANGIER) += tangier_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_TEGRA) += tegra_mmc.o
|
||||
obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o
|
||||
|
|
|
@ -1111,7 +1111,6 @@ static int mmc_startup(struct mmc *mmc)
|
|||
struct mmc_cmd cmd;
|
||||
ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
|
||||
ALLOC_CACHE_ALIGN_BUFFER(u8, test_csd, MMC_MAX_BLOCK_LEN);
|
||||
int timeout = 1000;
|
||||
bool has_parts = false;
|
||||
bool part_completed;
|
||||
struct blk_desc *bdesc;
|
||||
|
@ -1167,9 +1166,6 @@ static int mmc_startup(struct mmc *mmc)
|
|||
|
||||
err = mmc_send_cmd(mmc, &cmd, NULL);
|
||||
|
||||
/* Waiting for the ready status */
|
||||
mmc_send_status(mmc, timeout);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
|
@ -242,8 +242,10 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
|
|||
|
||||
sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
|
||||
#ifdef CONFIG_MMC_SDHCI_SDMA
|
||||
trans_bytes = ALIGN(trans_bytes, CONFIG_SYS_CACHELINE_SIZE);
|
||||
flush_cache(start_addr, trans_bytes);
|
||||
if (data != 0) {
|
||||
trans_bytes = ALIGN(trans_bytes, CONFIG_SYS_CACHELINE_SIZE);
|
||||
flush_cache(start_addr, trans_bytes);
|
||||
}
|
||||
#endif
|
||||
sdhci_writew(host, SDHCI_MAKE_CMD(cmd->cmdidx, flags), SDHCI_COMMAND);
|
||||
start = get_timer(0);
|
||||
|
|
81
drivers/mmc/tangier_sdhci.c
Normal file
81
drivers/mmc/tangier_sdhci.c
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <dm/device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <malloc.h>
|
||||
#include <mmc.h>
|
||||
#include <sdhci.h>
|
||||
|
||||
#define SDHCI_TANGIER_FMAX 200000000
|
||||
#define SDHCI_TANGIER_FMIN 400000
|
||||
|
||||
struct sdhci_tangier_plat {
|
||||
struct mmc_config cfg;
|
||||
struct mmc mmc;
|
||||
void __iomem *ioaddr;
|
||||
};
|
||||
|
||||
static int sdhci_tangier_bind(struct udevice *dev)
|
||||
{
|
||||
struct sdhci_tangier_plat *plat = dev_get_platdata(dev);
|
||||
|
||||
return sdhci_bind(dev, &plat->mmc, &plat->cfg);
|
||||
}
|
||||
|
||||
static int sdhci_tangier_probe(struct udevice *dev)
|
||||
{
|
||||
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
|
||||
struct sdhci_tangier_plat *plat = dev_get_platdata(dev);
|
||||
struct sdhci_host *host = dev_get_priv(dev);
|
||||
fdt_addr_t base;
|
||||
int ret;
|
||||
|
||||
base = dev_get_addr(dev);
|
||||
if (base == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
plat->ioaddr = devm_ioremap(dev, base, SZ_1K);
|
||||
if (!plat->ioaddr)
|
||||
return -ENOMEM;
|
||||
|
||||
host->name = dev->name;
|
||||
host->ioaddr = plat->ioaddr;
|
||||
host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
|
||||
SDHCI_QUIRK_32BIT_DMA_ADDR | SDHCI_QUIRK_WAIT_SEND_CMD;
|
||||
|
||||
/* MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195 */
|
||||
host->voltages = MMC_VDD_165_195;
|
||||
|
||||
ret = sdhci_setup_cfg(&plat->cfg, host, SDHCI_TANGIER_FMAX,
|
||||
SDHCI_TANGIER_FMIN);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
upriv->mmc = &plat->mmc;
|
||||
host->mmc = &plat->mmc;
|
||||
host->mmc->priv = host;
|
||||
|
||||
return sdhci_probe(dev);
|
||||
}
|
||||
|
||||
static const struct udevice_id sdhci_tangier_match[] = {
|
||||
{ .compatible = "intel,sdhci-tangier" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(sdhci_tangier) = {
|
||||
.name = "sdhci-tangier",
|
||||
.id = UCLASS_MMC,
|
||||
.of_match = sdhci_tangier_match,
|
||||
.bind = sdhci_tangier_bind,
|
||||
.probe = sdhci_tangier_probe,
|
||||
.ops = &sdhci_ops,
|
||||
.priv_auto_alloc_size = sizeof(struct sdhci_host),
|
||||
.platdata_auto_alloc_size = sizeof(struct sdhci_tangier_plat),
|
||||
};
|
|
@ -422,7 +422,8 @@ static int xenon_sdhci_probe(struct udevice *dev)
|
|||
|
||||
host->ops = &xenon_sdhci_ops;
|
||||
|
||||
ret = sdhci_setup_cfg(&plat->cfg, host, XENON_MMC_MAX_CLK, 0);
|
||||
host->max_clk = XENON_MMC_MAX_CLK;
|
||||
ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue