/* Copy the data in a page of the NAND Flash device to an other page on that same chip.  */
uint32_t nand_flash_raw_copy_page(const struct nand_flash_raw *raw, uint16_t source_block, uint16_t source_page, uint16_t dest_block, uint16_t dest_page)
/* Copy the data in a page of the NAND Flash device to an other page on that same chip.  */
uint32_t nand_flash_raw_copy_page(const struct nand_flash_raw *raw, uint16_t source_block, uint16_t source_page, uint16_t dest_block, uint16_t dest_page)
{
	uint32_t num_try = CONF_NF_COPY_NUM_TRY;
	while (num_try) {
		if (!copy_page(raw, source_block, source_page, dest_block,
				dest_page)) {
			return 0;
		}
		num_try--;
	}
	return NAND_COMMON_ERROR_BADBLOCK;
}