예제 #1
0
static int s5p_sdhci_core_init(struct sdhci_host *host)
{
	host->name = S5P_NAME;

	host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
		SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_USE_WIDE8;
	host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);

	host->set_control_reg = &s5p_sdhci_set_control_reg;
	host->set_clock = set_mmc_clk;

	if (host->bus_width == 8)
		host->host_caps |= MMC_MODE_8BIT;

	return add_sdhci(host, 52000000, 400000);
}
예제 #2
0
int ftsdc021_sdhci_init(u32 regbase)
{
	struct sdhci_host *host = NULL;
	uint32_t freq = CONFIG_FTSDC021_CLOCK;

	host = calloc(1, sizeof(struct sdhci_host));
	if (!host) {
		puts("sdh_host malloc fail!\n");
		return -ENOMEM;
	}

	host->name = "FTSDC021";
	host->ioaddr = (void __iomem *)regbase;
	host->quirks = 0;
	host->max_clk = freq;
	add_sdhci(host, 0, 0);

	return 0;
}
예제 #3
0
int zynq_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk)
{
	struct sdhci_host *host = NULL;

	host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
	if (!host) {
		printf("zynq_sdhci_init: sdhci_host malloc fail\n");
		return 1;
	}

	host->name = "zynq_sdhci";
	host->ioaddr = (void *) regbase;
	host->quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD;
	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);

	host->host_caps = MMC_MODE_HC;

	add_sdhci(host, max_clk, min_clk);
	return 0;
}
예제 #4
0
static int s5p_sdhci_core_init(struct sdhci_host *host)
{
	host->name = S5P_NAME;

	host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
		SDHCI_QUIRK_32BIT_DMA_ADDR |
		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_USE_WIDE8;
	host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;

	host->set_control_reg = &s5p_sdhci_set_control_reg;
	host->set_clock = set_mmc_clk;

	if (host->bus_width == 8)
		host->host_caps |= MMC_MODE_8BIT;

#ifndef CONFIG_BLK
	return add_sdhci(host, 52000000, 400000);
#else
	return 0;
#endif
}
예제 #5
0
static int arasan_sdhci_probe(struct udevice *dev)
{
	struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
	struct sdhci_host *host = dev_get_priv(dev);

	host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD |
		       SDHCI_QUIRK_BROKEN_R1B;

#ifdef CONFIG_ZYNQ_HISPD_BROKEN
	host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
#endif

	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);

	add_sdhci(host, CONFIG_ZYNQ_SDHCI_MAX_FREQ,
		  CONFIG_ZYNQ_SDHCI_MIN_FREQ);

	upriv->mmc = host->mmc;

	return 0;
}
예제 #6
0
/* Initialize an SDHCI port with memory address */
SdhciHost *new_mem_sdhci_host(void *ioaddr, int platform_info,
			      int clock_min, int clock_max, int clock_base)
{
	SdhciHost *host;
	int removable = platform_info & SDHCI_PLATFORM_REMOVABLE;

	host = xzalloc(sizeof(*host));

	host->quirks = SDHCI_QUIRK_NO_HISPD_BIT |
		SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER;

	if (platform_info & SDHCI_PLATFORM_NO_EMMC_HS200)
		host->quirks |= SDHCI_QUIRK_NO_EMMC_HS200;

	if (platform_info & SDHCI_PLATFORM_EMMC_1V8_POWER)
		host->quirks |= SDHCI_QUIRK_EMMC_1V8_POWER;

	if (platform_info & SDHCI_PLATFORM_NO_CLK_BASE) {
		host->quirks |= SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
		host->clock_base = clock_base;
	}

	host->clock_f_min = clock_min;
	host->clock_f_max = clock_max;
	host->removable = removable;
	host->ioaddr = ioaddr;

	if (!removable)
		/*
		 * The value translates to 'block access mode, supporting
		 * 1.7..1.95 and 2.7..3.6 voltage ranges, which is typical for
		 * eMMC devices.
		 */
		host->mmc_ctrlr.hardcoded_voltage = 0x40ff8080;

	add_sdhci(host);

	return host;
}
예제 #7
0
/*
 * This driver has only been tested with eMMC devices; SD devices may
 * not work.
 */
int bcmstb_sdhci_init(phys_addr_t regbase)
{
	struct sdhci_host *host = NULL;

	host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
	if (!host) {
		printf("%s: Failed to allocate memory\n", __func__);
		return 1;
	}
	memset(host, 0, sizeof(*host));

	host->name = BCMSTB_SDHCI_NAME;
	host->ioaddr = (void *)regbase;
	host->quirks = 0;

	host->cfg.part_type = PART_TYPE_DOS;

	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);

	return add_sdhci(host,
			 BCMSTB_SDHCI_MAXIMUM_CLOCK_FREQUENCY,
			 BCMSTB_SDHCI_MINIMUM_CLOCK_FREQUENCY);
}
예제 #8
0
int ultisdc_init(u32 regbase, int index)
{
	struct sdhci_host *host = NULL;
	host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
	if (!host) {
		printf("sdh_host malloc fail!\n");
		return 1;
	}

	host->name = CORE_NAME;
	host->ioaddr = (void *)regbase;
	host->quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
		  SDHCI_QUIRK_NO_HISPD_BIT ;
//		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
//		  SDHCI_QUIRK_BROKEN_DMA |   
//		  SDHCI_QUIRK_DELAY_AFTER_POWER |
//		  SDHCI_QUIRK_NO_MULTIBLOCK | 
//		  SDHCI_QUIRK_BROKEN_ADMA;

	host->ops = &sdhci_ultimmc_ops;
	host->index = index;
	add_sdhci(host, 50000000, 400000);
	return 0;
}