/* Write the data and/or the spare areas of a page into a NAND Flash.  */
uint32_t nand_flash_raw_write_page(const struct nand_flash_raw *raw, uint16_t block, uint16_t page, uint8_t *data, uint8_t *spare)
/* Write the data and/or the spare areas of a page into a NAND Flash.  */
uint32_t nand_flash_raw_write_page(const struct nand_flash_raw *raw, uint16_t block, uint16_t page, uint8_t *data, uint8_t *spare)
{
	uint32_t num_try = CONF_NF_WRITE_NUM_TRY;
	while (num_try > 0) {
		if (!write_page(raw, block, page, data, spare)) {
			return 0;
		}
		num_try--;
	}
	return NAND_COMMON_ERROR_BADBLOCK;
}