/* Read the flash id present at bank #banknum  */
static unsigned int smi_read_id(flash_info_t *info, int banknum)
/* Read the flash id present at bank #banknum  */
static unsigned int smi_read_id(flash_info_t *info, int banknum)
{
	unsigned int value;
	writel(readl(&smicntl->smi_cr1) | SW_MODE, &smicntl->smi_cr1);
	writel(READ_ID, &smicntl->smi_tr);
	writel((banknum << BANKSEL_SHIFT) | SEND | TX_LEN_1 | RX_LEN_3,
	       &smicntl->smi_cr2);
	smi_wait_xfer_finish(XFER_FINISH_TOUT);
	value = (readl(&smicntl->smi_rr) & 0x00FFFFFF);
	writel(readl(&smicntl->smi_sr) & ~TFF, &smicntl->smi_sr);
	writel(readl(&smicntl->smi_cr1) & ~SW_MODE, &smicntl->smi_cr1);
	return value;
}