/* Check if program or erase operation is completed in current operation.  */
static uint32_t check_status(const struct nand_flash_raw *raw)
/* Check if program or erase operation is completed in current operation.  */
static uint32_t check_status(const struct nand_flash_raw *raw)
{
	uint32_t status;
	smc_nfc_send_command(SMC,
			NFCADDR_CMD_NFCCMD          |
			NFCADDR_CMD_NFC_READ        |
			0                           |
			NFCADDR_CMD_CSID(BOARD_NAND_CS)          |
			NFCADDR_CMD_ACYCLE_NONE     |
			(NAND_COMMAND_STATUS << 2),
			0,
			0
			);
	status = READ_DATA8(raw);
	if (((status & NAND_STATUS_READY) != NAND_STATUS_READY) ||
			((status & NAND_STATUS_ERROR) != 0)) {
		return 0;
	}
	return 1;
}