Exemplo n.º 1
0
/*
 * Early hardware init.
 */
int board_init(void)
{
	int rv;

	rv = fmc_fsmc_setup_gpio();
	if (rv)
		return rv;

#if !defined(CONFIG_SYS_NO_FLASH)

	if ((rv = fsmc_nor_psram_init(CONFIG_SYS_FLASH_CS,
			CONFIG_SYS_FSMC_FLASH_BCR,
			CONFIG_SYS_FSMC_FLASH_BTR,
			CONFIG_SYS_FSMC_FLASH_BWTR))) {
		goto Done;
	}

#endif

#ifdef CONFIG_VIDEO_STM32F4_LTDC
	rv = ltdc_setup_iomux();
	if (rv)
		return rv;
#endif /* CONFIG_VIDEO_STM32F4_LTDC */

Done:
	return 0;
}
Exemplo n.º 2
0
/*
 * Early hardware init.
 */
int board_init(void)
{
	int rv;

#if defined(CONFIG_SYS_BOARD_UCL_BSB)
	rv = pwr_setup_gpio();
	if (rv)
		printf("WARN: pwr_setup_gpio() error %d\n", rv);
#endif

	rv = fmc_fsmc_setup_gpio();
	if (rv)
		return rv;

#if !defined(CONFIG_SYS_NO_FLASH)
# if defined(CONFIG_ENV_IS_IN_FLASH)
	/*
	 * We may sometimes got fixed garbage from NOR flash if access it after
	 * a sw reset and before external SDRAM initializion complete.
	 * Erratas say nothing about this, so we just initialize SDRAM earlier
	 * if want to access NOR to get environment.
	 */
	dram_init();
# endif /* CONFIG_ENV_IS_IN_FLASH */

	if ((rv = fsmc_nor_psram_init(CONFIG_SYS_FLASH_CS,
			CONFIG_SYS_FSMC_FLASH_BCR,
			CONFIG_SYS_FSMC_FLASH_BTR,
			CONFIG_SYS_FSMC_FLASH_BWTR))) {
		goto Done;
	}
#endif

#if defined(CONFIG_VIDEO_STM32F4_LTDC) && !defined(CONFIG_SYS_STM32F769I_DISCO)
	rv = ltdc_setup_iomux();
	if (rv)
		return rv;
#endif /* CONFIG_VIDEO_STM32F4_LTDC */

	rv = qspi_setup_iomux();
	if (rv)
		return rv;

Done:
	return 0;
}