MEMORY
{
   BEGIN            : origin = 0x080000, length = 0x000002  // Update the codestart location as needed

   BOOT_RSVD        : origin = 0x000002, length = 0x0001AF     /* Part of M0, BOOT rom will use this for stack */
   RAMM0            : origin = 0x0001B1, length = 0x00024F
   RAMM1            : origin = 0x000400, length = 0x000400

 //  RAMD0            : origin = 0x00C000, length = 0x002000
 //  RAMD1            : origin = 0x00E000, length = 0x002000
   RAMD0_1			: origin = 0x00C000, length = 0x004000


   RAMD2            : origin = 0x01A000, length = 0x002000  // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0x8000. User should comment/uncomment based on core selection
   RAMD3            : origin = 0x01C000, length = 0x002000  // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xA000. User should comment/uncomment based on core selection
   RAMD4            : origin = 0x01E000, length = 0x002000  // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xC000. User should comment/uncomment based on core selection
   RAMD5            : origin = 0x020000, length = 0x002000  // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xE000. User should comment/uncomment based on core selection

   /*RAMLS0           : origin = 0x008000, length = 0x000800
   RAMLS1           : origin = 0x008800, length = 0x000800
   RAMLS2           : origin = 0x009000, length = 0x000800
   RAMLS3           : origin = 0x009800, length = 0x000800
   RAMLS4           : origin = 0x00A000, length = 0x000800
   RAMLS5           : origin = 0x00A800, length = 0x000800
   RAMLS6           : origin = 0x00B000, length = 0x000800
   RAMLS7           : origin = 0x00B800, length = 0x000800*/
   BOOTRAM          : origin = 0x008000, length = 0x001000  //bootloader RAM
   RAMLS2_7			: origin = 0x009000, length = 0x003000

   //RAMLS8           : origin = 0x022000, length = 0x002000  // When configured as CLA program use the address 0x4000
   //RAMLS9           : origin = 0x024000, length = 0x002000  // When configured as CLA program use the address 0x6000
   RAMLS8_9			: origin = 0x022000, length = 0x004000

   // RAMLS8_CLA    : origin = 0x004000, length = 0x002000  // Use only if configured as CLA program memory
   // RAMLS9_CLA    : origin = 0x006000, length = 0x002000  // Use only if configured as CLA program memory

   /*RAMGS0           : origin = 0x010000, length = 0x002000
   RAMGS1           : origin = 0x012000, length = 0x002000
   RAMGS2           : origin = 0x014000, length = 0x002000
   RAMGS3           : origin = 0x016000, length = 0x002000
   RAMGS4           : origin = 0x018000, length = 0x002000*/
   RAMGS0_4			: origin = 0x010000, length = 0x00A000

   /* Flash Banks (128 sectors each) */
   //FLASH_BANK0     : origin = 0x080002, length = 0x1FFFE  // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection
   //FLASH_BANK1     : origin = 0x0A0000, length = 0x20000  // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection
   //FLASH_BANK2     : origin = 0x0C0000, length = 0x20000  // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection
   // FLASH_BANK3     : origin = 0x0E0000, length = 0x20000  // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection
   // FLASH_BANK4     : origin = 0x100000, length = 0x20000  // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection

	TYPE_BANK		: origin = 0x080010, length = 0x40
	BOOTCONST_BANK  : origin = 0x080050, length = 0x3B0   //bootloader静态变量存放

	BOOTMARK_BANK	: origin = 0x080400, length = 0x400   //bootloader MarkPtr标志位

	BOOTLOADER_BANK	: origin = 0x080800, length = 0x2000  //bootloader程序
	CINT00_BANK		: origin = 0x082800, length = 0x80    //C_init00
	USERAPP_BANK    : origin = 0x082880, length = 0x5D780 //user_APP



    CPU1TOCPU2RAM    : origin = 0x03A000, length = 0x000300
   	STOCOMMDTOCPU2   : origin = 0x03A300, length = 0x000100
	
	
   	CPU2TOCPU1RAM    : origin = 0x03B000, length = 0x000300
   	STOSTATETOCPU1   : origin = 0x03B300, length = 0x000100

   	CLATOCPURAM      : origin = 0x001480,   length = 0x000080
   	CPUTOCLARAM      : origin = 0x001500,   length = 0x000080
   	CLATODMARAM      : origin = 0x001680,   length = 0x000080
   	DMATOCLARAM      : origin = 0x001700,   length = 0x000080

   	CANA_MSG_RAM     : origin = 0x049000, length = 0x000800
   	CANB_MSG_RAM     : origin = 0x04B000, length = 0x000800
   	RESET            : origin = 0x3FFFC0, length = 0x000002
}


SECTIONS
{
   boot				: > BOOTLOADER_BANK   PAGE = 0
   {
   		-l rts2800_fpu64_eabi.lib<fs_div28.asm.obj>(.text)
   		-l rts2800_fpu64_eabi.lib<memcpy.c.obj>(.text)

   }

   codestart        : > BEGIN,	      ALIGN(8)
   .text            : > USERAPP_BANK, ALIGN(8)
   .cinit           : > USERAPP_BANK, ALIGN(8)
   .switch          : > USERAPP_BANK, ALIGN(8)
   .reset           : > RESET, TYPE = DSECT /* not used, */

   .stack           : > RAMLS2_7//RAMM1
#if defined(__TI_EABI__)
   .bss             : > RAMGS0_4
   .bss:output      : > RAMGS0_4
   .init_array      : > USERAPP_BANK, ALIGN(8)
   .const           : > USERAPP_BANK, ALIGN(8)
   .data            : > RAMGS0_4
   .sysmem          : > RAMGS0_4
#else
   .pinit           : > USERAPP_BANK, ALIGN(8)
   .ebss            : > RAMGS0_4
   .econst          : > USERAPP_BANK, ALIGN(8)
   .esysmem         : > RAMGS0_4
#endif

   BOOTBANK			: > BOOTLOADER_BANK
   TYPEBANK		    : > TYPE_BANK
   CONSTBANK	    : > BOOTCONST_BANK
   MARKBANK		    : >	BOOTMARK_BANK
   CINT00ROM		: > CINT00_BANK



   MSGRAM_CPU1_TO_CPU2 > CPU1TOCPU2RAM, type=NOINIT
   MSGRAM_CPU2_TO_CPU1 > CPU2TOCPU1RAM, type=NOINIT
   MSGSTO_CPU1_TO_CPU2 > STOCOMMDTOCPU2, type=NOINIT
   MSGSTO_CPU2_TO_CPU1 > STOSTATETOCPU1, type=NOINIT
   MSGRAM_SCOPE_BUF    > RAMD0_1, type=NOINIT

   #if defined(__TI_EABI__)
       .TI.ramfunc : {}
       					LOAD = USERAPP_BANK,
                        RUN = RAMLS2_7,
                        LOAD_START(RamfuncsLoadStart),
                        LOAD_SIZE(RamfuncsLoadSize),
                        LOAD_END(RamfuncsLoadEnd),
                        RUN_START(RamfuncsRunStart),
                        RUN_SIZE(RamfuncsRunSize),
                        RUN_END(RamfuncsRunEnd),
                        ALIGN(8)

                        GROUP
                        {
                        	.BOOT.ramfunc
                        	{-l FAPI_F28P65x_EABI_v3.00.00.lib}

                        }
 						LOAD = BOOTLOADER_BANK,
                        RUN = BOOTRAM,
                        LOAD_START(BootRamfuncsLoadStart),
                        LOAD_SIZE(BootRamfuncsLoadSize),
                        LOAD_END(BootRamfuncsLoadEnd),
                        RUN_START(BootRamfuncsRunStart),
                        RUN_SIZE(BootRamfuncsRunSize),
                        RUN_END(BootRamfuncsRunEnd),
                        ALIGN(8)



   #else       //coff格式
       .TI.ramfunc :{}
       				    LOAD = FLASH_BANK0,
                        RUN = RAMLS2_7,
                        LOAD_START(_RamfuncsLoadStart),
                        LOAD_SIZE(_RamfuncsLoadSize),
                        LOAD_END(_RamfuncsLoadEnd),
                        RUN_START(_RamfuncsRunStart),
                        RUN_SIZE(_RamfuncsRunSize),
                        RUN_END(_RamfuncsRunEnd),
                        ALIGN(8)


                        GROUP
                        {
                        	.BOOT.ramfunc
                        	{-l FAPI_F28P65x_COFF_v3.00.00.lib}
                        }
 						LOAD = BOOTLOADER_BANK,
                        RUN = BOOTRAM,
                        LOAD_START(_BootRamfuncsLoadStart),
                        LOAD_SIZE(_BootRamfuncsLoadSize),
                        LOAD_END(_BootRamfuncsLoadEnd),
                        RUN_START(_BootRamfuncsRunStart),
                        RUN_SIZE(_BootRamfuncsRunSize),
                        RUN_END(_BootRamfuncsRunEnd),
                        ALIGN(8)

   #endif


}

/*
//===========================================================================
// End of file.
//===========================================================================
*/
