/* Set the boot bank to the alternate bank  */
void cpld_set_altbank(void)
/* Set the boot bank to the alternate bank  */
void cpld_set_altbank(void)
{
	u8 val, curbank, altbank, override;
	val = CPLD_READ(vbank);
	curbank = val & CPLD_BANK_SEL_MASK;
	switch (curbank) {
	case CPLD_SELECT_BANK0:
	case CPLD_SELECT_BANK4:
		altbank = CPLD_SELECT_BANK4;
		CPLD_WRITE(vbank, altbank);
		override = CPLD_READ(software_on);
		CPLD_WRITE(software_on, override | CPLD_BANK_SEL_EN);
		CPLD_WRITE(sys_reset, CPLD_SYSTEM_RESET);
		break;
	default:
		printf("CPLD Altbank Fail: Invalid value!\n");
		return;
	}
}