Exemplo n.º 1
0
int movi_init(void)
{
	hsmmc_set_base();
	hsmmc_set_gpio();
	hsmmc_reset();
	if (hsmmc_init()) {
		printf("\nCard Initialization failed.\n");
		return -1;
	}
	return 1;
}
Exemplo n.º 2
0
static void s3c_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
	struct s3c_hsmmc_host *host = mmc_priv(mmc);

	unsigned long iflags;

	spin_lock_irqsave(&host->lock, iflags);

	/*
	 * Reset the chip on each power off.
	 * Should clear out any weird states.
	 */
	if (ios->power_mode == MMC_POWER_OFF) {
		s3c_hsmmc_writew(0, S3C_HSMMC_NORINTSIGEN);
		s3c_hsmmc_ios_init(host);
	}

        if (host->plat_data->enabled)
                hsmmc_set_gpio(host->plat_data->hwport, host->plat_data->bus_width);

	DBG("\nios->clock: %d Hz\n", ios->clock);
	s3c_hsmmc_set_clock(host, ios->clock);

	DBG("\nios->bus_width: %d\n", ios->bus_width);
	s3c_set_bus_width(host, ios->bus_width);

	DBG("S3C_HSMMC_CONTROL2(0x80) = 0x%08x\n", s3c_hsmmc_readl(S3C_HSMMC_CONTROL2));
	DBG("S3C_HSMMC_CONTROL3(0x84) = 0x%08x\n", s3c_hsmmc_readl(S3C_HSMMC_CONTROL3));
	DBG("S3C_HSMMC_CLKCON  (0x2c) = 0x%04x\n", s3c_hsmmc_readw(S3C_HSMMC_CLKCON));

	if (ios->power_mode == MMC_POWER_OFF)
		s3c_hsmmc_writeb(S3C_HSMMC_POWER_OFF, S3C_HSMMC_PWRCON);
	else
		s3c_hsmmc_writeb(S3C_HSMMC_POWER_ON_ALL, S3C_HSMMC_PWRCON);

	udelay(1000);
	spin_unlock_irqrestore(&host->lock, iflags);
}