
#include  "windef.h"
#include  "mbdr_dsp_sw_version.h"
#include  "mbdr_dsp_core_type_const.h"

#ifndef  _MBDR_DSP_COMMON_BOOT_LOADER_APP_H
#define  _MBDR_DSP_COMMON_BOOT_LOADER_APP_H

/* offset of dsp status report */
#define MBDR_DSP_COMMON_STATUS_BYTE_OFFSET 0x000ffE80



/* BOOT LOADER SW version */
#define MBDR_DSP_BOOT_LOADER_SW_VERSION MBDR_DSP_VERSION_NUMBER_TO_32BIT_M(0,0, 0, 4)

/* Location of config in DSP internal memory */
#define MBDR_DSP_CPU_DSP_CONFIG_ADDRESS (MBDR_DSP_COMMON_L2_BASE+MBDR_DSP_CPU_DSP_CONFIG_BYTE_OFFSET)

/* Location of MBDR_DSP_CPU_DSP_BOOT_LOADER_APPLICATION_MEMORY_BASE */
/* in DSP internal memory                                           */
#define MBDR_DSP_CPU_DSP_BOOT_LOADER_APPLICATION_MEMORY_BASE 0x20000

typedef struct
{

  /* boot loader and application common routines */
  /* if location is change, boot loader & application are not compatible */
  void  (*mbdr_dsp_debug_signal_app_proc_p)(ULONG  pi_sw_main_module_code,        /* report code                  */
                                          LONG  *pio_physical_layer_buffer_2dw_p);
  void  (*mbdr_dsp_application_emif_init_proc_p)(void);
  void  (*mbdr_dsp_boot_loader_application_copy_program_proc_p)(void);

}mbdr_dsp_boot_application_common_proc_p_t ;


typedef struct
{
  void   (*c_int00_proc_p)(void);
  mbdr_dsp_boot_application_common_proc_p_t boot_application_common_proc_p;

}mbdr_dsp_boot_loader_header_t;
extern mbdr_dsp_boot_loader_header_t mbdr_dsp_boot_loader_header[1];

/* since boot loader is not in main flow, calling these routine */
/* enforces linker to include boot loader object code           */
extern void mbdr_dsp_boot_loader_never_reach(void);
extern void mbdr_dsp_boot_loader_never_reach_2(void);
extern void mbdr_dsp_boot_loader_never_reach_3(void);


extern const mbdr_dsp_boot_loader_header_t mbdr_dsp_boot_loader_header_init;

/* application emif initialization */
extern void mbdr_dsp_application_emif_init(void);

/* application routine that copy program into DSP memory */
extern void  mbdr_dsp_boot_loader_application_copy_program(void);


#define  MBDR_DSP_BOOT_LOADER_FLASH_BASE 0x64000000
extern void mbdr_dsp_boot_loader_flash_read_memcpy(void);




#endif
