Ejemplo n.º 1
0
int board_mmc_init(bd_t *bis)
{
	int err, ret = 0, index, bus_width;
	u32 base;

	err = exynos_pinmux_config(PERIPH_ID_SDMMC0, PINMUX_FLAG_8BIT_MODE);
	if (err)
		debug("SDMMC0 not configured\n");
	ret |= err;

	/*EMMC: dwmmc Channel-0 with 8 bit bus width */
	index = 0;
	base =  samsung_get_base_mmc() + (0x10000 * index);
	bus_width = 8;
	err = exynos_dwmci_add_port(index, base, bus_width, (u32)NULL);
	if (err)
		debug("dwmmc Channel-0 init failed\n");
	ret |= err;

	err = exynos_pinmux_config(PERIPH_ID_SDMMC2, PINMUX_FLAG_NONE);
	if (err)
		debug("SDMMC2 not configured\n");
	ret |= err;

	/*SD: dwmmc Channel-2 with 4 bit bus width */
	index = 2;
	base = samsung_get_base_mmc() + (0x10000 * index);
	bus_width = 4;
	err = exynos_dwmci_add_port(index, base, bus_width, (u32)NULL);
	if (err)
		debug("dwmmc Channel-2 init failed\n");
	ret |= err;

	return ret;
}
Ejemplo n.º 2
0
static inline struct s5p_mmc *s5p_get_base_mmc(int dev_index)
{
	unsigned long offset = dev_index * sizeof(struct s5p_mmc);
	return (struct s5p_mmc *)(samsung_get_base_mmc() + offset);
}