/* Print out which flash was booted from and if booting from the 2nd flash, swap flash chip selects to maintain consistent flash numbering/addresses.  */
static void flash_cs_fixup(void)
/* Print out which flash was booted from and if booting from the 2nd flash, swap flash chip selects to maintain consistent flash numbering/addresses.  */
static void flash_cs_fixup(void)
{
	immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
	ccsr_lbc_t *lbc = &immap->im_lbc;
	int flash_sel;
	flash_sel = !((pca953x_get_val(CONFIG_SYS_I2C_PCA953X_ADDR0) &
			CONFIG_SYS_PCA953X_C0_FLASH_PASS_CS));
	printf("FLASH: Executed from FLASH%d\n", flash_sel ? 2 : 1);
	if (flash_sel) {
		out_be32(&lbc->br0, CONFIG_SYS_BR1_PRELIM);
		out_be32(&lbc->or0, CONFIG_SYS_OR1_PRELIM);
		out_be32(&lbc->br1, CONFIG_SYS_BR0_PRELIM);
		out_be32(&lbc->or1, CONFIG_SYS_OR0_PRELIM);
	}
}