@ -83,7 +83,7 @@ error:
}
void
uart_boot ( uint32_t * jump_entry_point )
uart_boot ( uint32_t * jump_entry_point , int need_nwp_nand )
{
# if defined(FLASH_TYPE_NAND)
int wrote_copies = 0 ;
@ -131,6 +131,7 @@ uart_boot(uint32_t *jump_entry_point)
NOR_WriteBytes ( nor_get_flashbase ( ) , uart_ack_header . size ,
( uint32_t ) uart_ack_header . recv_buffer ) ;
# elif defined(FLASH_TYPE_NAND)
nand_remove_nwp ( need_nwp_nand ) ;
wrote_copies = 0 ;
for ( block_num = START_UBL_BLOCK_NUM ; block_num < = END_UBL_BLOCK_NUM ; block_num + + ) {
im_desc . magic = uart_ack_header . magic ;
@ -199,6 +200,7 @@ uart_boot(uint32_t *jump_entry_point)
goto uartboot_error ;
# elif defined(FLASH_TYPE_NAND)
/* Write multiple copy of U-Boot (depending on the defines in NAND.h) */
nand_remove_nwp ( need_nwp_nand ) ;
prog_ok = 0 ;
wrote_copies = 0 ;
for ( block_num = START_UBOOT_BLOCK_NUM ; ( block_num + MAX_BLOCK_PER_UBOOT - 1 ) < = END_UBOOT_BLOCK_NUM ; block_num + = MAX_BLOCK_PER_UBOOT ) {
@ -256,6 +258,7 @@ uart_boot(uint32_t *jump_entry_point)
goto uartboot_error ;
}
# elif defined(FLASH_TYPE_NAND)
nand_remove_nwp ( need_nwp_nand ) ;
if ( nand_erase_all ( ) ! = E_PASS ) {
log_info ( " Erase failed " ) ;
goto uartboot_error ;