/* Write a proper sized command to the correct address  */
static void flash_write_cmd(flash_info_t *info, int sect, uchar offset, uchar cmd)
/* Write a proper sized command to the correct address  */
static void flash_write_cmd(flash_info_t *info, int sect, uchar offset, uchar cmd)
{
	volatile cfiptr_t addr;
	cfiword_t cword;
	addr.cp = flash_make_addr(info, sect, offset);
	flash_make_cmd(info, cmd, &cword);
	switch (info->portwidth) {
	case FLASH_CFI_8BIT:
		*addr.cp = cword.c;
		break;
	case FLASH_CFI_16BIT:
		*addr.wp = cword.w;
		break;
	case FLASH_CFI_32BIT:
		*addr.lp = cword.l;
		break;
	}
}