/*                                                                          */
/* File Name   : mbdr_dsp_sdc_boot_loader_application_copy_program.c         */
/*                                                                          */
/* Written By  : 79556                                                      */
/*                                                                          */
/* versions    :                                                            */
/*+--------+-----------+---------------------------------------------------+*/
/*| Version| Date      | Change content                                    |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |19/Jan/2009|- boot_loader_application_copy_program             |*/
/*+--------+-----------+---------------------------------------------------+*/
/*| 0.03.51|27/Jul/2010|- boot from PCI rather dezctivare read from flash  |*/
/*+--------+-----------+---------------------------------------------------+*/
/*| 0.05.08|25/Dec/2011|- replace programmer name by code                  |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |20/JUl/2014|- For 6657 it clears the boot memory used by chip  |*/
/*+--------+-----------+---------------------------------------------------+*/
/*                                                                          */
/* function:                                                                */
/*                                                                          */
/*  copy program from flash                                                 */
/*                                                                          */

#include "windef.h"
#include "mbdr_dsp_common_boot_loader_app.h"
#include "mbdr_dsp_boot_loader_flash_read_memcpy.h"

#define DSP_6657_BOOT_SEQUENCE_START_ADDRESS_BYTE_OFFSET 0x0072DC0
#define DSP_6657_BOOT_SEQUENCE_END_ADDRESS_BYTE_OFFSET   0x007ffff
#define DSP_6657_BOOT_SEQUENCE_DWORD_SIZE\
	              (( DSP_6657_BOOT_SEQUENCE_END_ADDRESS_BYTE_OFFSET\
	                -DSP_6657_BOOT_SEQUENCE_START_ADDRESS_BYTE_OFFSET\
	                +1)/sizeof(LONG))
extern void mbdr_dsp_boot_loader_clean_boot_sequence_area(void);



#pragma DATA_MEM_BANK   (dsp_6657_boot_sequence_memory, 0);
#pragma DATA_SECTION    (dsp_6657_boot_sequence_memory, ".dsp_6657_boot_sequence_memory_sect");
LONG     dsp_6657_boot_sequence_memory[DSP_6657_BOOT_SEQUENCE_DWORD_SIZE];


#pragma CODE_SECTION  (mbdr_dsp_boot_loader_application_copy_program,".mbdr_dsp_boot_loader_routines_sect");
void mbdr_dsp_boot_loader_application_copy_program(void)
{/* mbdr_dsp_boot_loader_application_copy_program */

	/* cleans boot sequence area */
	mbdr_dsp_boot_loader_clean_boot_sequence_area();

   /* No need to read program all code already loaded by PCI */

}/* mbdr_dsp_boot_loader_application_copy_program */

#pragma CODE_SECTION  (mbdr_dsp_boot_loader_clean_boot_sequence_area,".mbdr_dsp_boot_loader_routines_sect");
void mbdr_dsp_boot_loader_clean_boot_sequence_area(void)
{/* mbdr_dsp_boot_loader_clean_boot_sequence_area */

	LONG i;

	for(i=0; i<DSP_6657_BOOT_SEQUENCE_DWORD_SIZE; i++)
		dsp_6657_boot_sequence_memory[i] = 0;

}/* mbdr_dsp_boot_loader_clean_boot_sequence_area */
