Пример #1
0
int __init ambarella_init_fio(void)
{
#ifndef CONFIG_AMBARELLA_QUICK_INIT
	/* Following should be handled by the bootloader... */
#if (HOST_MAX_AHB_CLK_EN_BITS == 10)
	amba_clrbitsl(HOST_AHB_CLK_ENABLE_REG,
		(HOST_AHB_BOOT_SEL | HOST_AHB_FDMA_BURST_DIS));
#endif
	rct_reset_fio();
	fio_amb_exit_random_mode();
	enable_fio_dma();
	amba_writel(FLASH_INT_REG, 0x0);
	amba_writel(XD_INT_REG, 0x0);
	amba_writel(CF_STA_REG, CF_STA_CW | CF_STA_DW);
#endif

	//SMIO_38 ~ SMIO_43
	amba_setbitsl(GPIO2_MASK_REG, 0x000007e0);
	amba_clrbitsl(GPIO2_DIR_REG, 0x00000780);
	amba_setbitsl(GPIO2_DIR_REG, 0x00000060);
	amba_setbitsl(GPIO2_DATA_REG, 0x00000040);
	amba_clrbitsl(GPIO2_DATA_REG, 0x00000020);

	return 0;
}
Пример #2
0
int __init ambarella_init_fio(void)
{

	fio_amb_exit_random_mode();
	enable_fio_dma();
	amba_writel(FLASH_INT_REG, 0x0);
	amba_writel(XD_INT_REG, 0x0);
	amba_writel(CF_STA_REG, CF_STA_CW | CF_STA_DW);
//#if defined(CONFIG_AMBARELLA_FIO_FORCE_SDIO_GPIO)
	unsigned long				flags;

	//SMIO_38 ~ SMIO_43
	ambarella_gpio_raw_lock(2, &flags);
	amba_clrbitsl(GPIO2_AFSEL_REG, 0x000007e0);
	amba_clrbitsl(GPIO2_DIR_REG, 0x00000780);
	amba_setbitsl(GPIO2_DIR_REG, 0x00000060);
	amba_writel(GPIO2_MASK_REG, 0x00000060);
	amba_writel(GPIO2_DATA_REG, 0x00000040);
	ambarella_gpio_raw_unlock(2, &flags);
//#endif

	return 0;
}