//  Memory map file to generate linker scripts for programs to run on
//  most targets (that have the OCD option); allows I/O through the host
//  debugger when being debugged using GDB (via the Xtensa OCD daemon).

// Customer ID=13283; Build=0x707fb; Copyright (c) 2006-2015 Cadence Design Systems, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

//  Show extra XTBOARD memory map details.
INCLUDE_XTBOARD_MEMORIES = try


// A memory map is a sequence of memory descriptions and
// optional parameter assignments.
//
// Each memory description has the following format:
//   BEGIN <name>
//     <addr> [,<paddr>] : <mem-type> : <mem-name> : <size> [,<psize>]
//                       : [writable] [,executable] [,device] ;
//     <segment>*
//   END <name>
//
// where each <segment> description has the following format:
//     <seg-name> : F|C : <start-addr> - <end-addr> [ : STACK ] [ : HEAP ]
//                : <section-name>* ;
//
// Each parameter assignment is a keyword/value pair in the following format:
//   <keyword> = <value>                (no spaces in <value>)
// or
//   <keyword> = "<value>"              (spaces allowed in <value>)
//
// The following primitives are also defined:
//   PLACE SECTIONS( <section-name>* ) { WITH_SECTION(<section-name>)
//                                       | IN_SEGMENT(<seg-name>) }
//
//   NOLOAD <section-name1> [ <section-name2> ... ]
//
// Please refer to the Xtensa LSP Reference Manual for more details.
//
BEGIN iram0
0x100000: instRam : iram0 : 0x60000 : executable, writable ;
 iram0_0 : F : 0x100000 - 0x1003ff : .ResetVector.text .ResetHandler.literal .ResetHandler.text;
 iram0_1 : F : 0x100400 - 0x10057b : .WindowVectors.text .Level2InterruptVector.literal;
 iram0_2 : F : 0x10057c - 0x10059b : .Level2InterruptVector.text .DebugExceptionVector.literal;
 iram0_3 : F : 0x10059c - 0x1005bf : .DebugExceptionVector.text .NMIExceptionVector.literal;
 iram0_4 : F : 0x1005c0 - 0x1005fb : .NMIExceptionVector.text .KernelExceptionVector.literal;
 iram0_5 : F : 0x1005fc - 0x10061b : .KernelExceptionVector.text .UserExceptionVector.literal;
 iram0_6 : F : 0x10061c - 0x10063b : .UserExceptionVector.text .DoubleExceptionVector.literal;
 iram0_7 : F : 0x10063c - 0x127fff : .DoubleExceptionVector.text .iram0.literal .iram0.text .literal .text .lib_au_task.literal .lib_au_task.text .lib_foundation.literal .lib_foundation.text .lib_algo.literal .lib_algo.text .lib_patch.literal .lib_patch.text;
 iram0_8 : F : 0x128000 - 0x1280ff : .iram0_overlay_entry.literal;
 iram0_9 : F : 0x128100 - 0x15ffff : .iram0_overlay_entry.text .iram0_overlay.literal .iram0_overlay.text .lib_std_overlay.literal .lib_std_overlay.text;
END iram0

BEGIN irom0
0x180000: instRom : irom0 : 0x30000 : executable ;
 irom0_0 : C : 0x180000 - 0x1affff : .lib_std.literal .lib_std.text .irom0.literal .irom0.text .lib_rom_function.literal .lib_rom_function.text .lib_aacplus_v2_dec.literal .lib_aacplus_v2_dec.text .lib_mp3_dec.literal .lib_mp3_dec.text .lib_msbc_enc.literal .lib_msbc_enc.text .lib_wma_dec.literal .lib_wma_dec.text .lib_msbc_sbc_dec.literal .lib_msbc_sbc_dec.text;
END irom0

BEGIN dram0
0x200000: dataRam : dram0 : 0x80000 : writable ;
 dram0_0 : C : 0x200000 - 0x20005F :  .dram0_version_date .dram0_version_time .dram0_hook_fp.data .lib_std.data .lib_rom_function.data .lib_rom_function.bss .lib_std.bss;
 dram0_1 : C : 0x200060 - 0x201FFF :  .rodata .data .dram0_global_var.data .lib_au_task.rodata .lib_au_task.data .lib_foundation.rodata .lib_foundation.data .lib_algo.data .lib_patch.rodata .lib_patch.data .dram0_global_var_3.bss;
 dram0_2 : C : 0x202000 - 0x20FFFF :  .dram0_b0_buffers;
 dram0_3 : C : 0x210000 - 0x247FFF :  .dram0_overlay_info.data .dram0_overlay.data .dram0_overlay.rodata .lib_std_overlay.rodata .lib_std_overlay.data .lib_std_overlay.bss .dram0_overlay.bss;
 dram0_4 : C : 0x248000 - 0x26FAAF :  .dram0_b1_buffers;
 dram0_5 : C : 0x26FAB0 - 0x2720AF :  STACK :;
 dram0_6 : C : 0x2720B0 - 0x27FFFF :  .lib_algo.rodata .dram0.literal .dram0.data .dram0.rodata .dram0_global_var_2.data .bss .dram0_global_var.bss .dram0_global_var_2.bss .lib_au_task.bss .lib_foundation.bss .lib_algo.bss .lib_patch.bss .dram0.bss;

END dram0

BEGIN drom0
0x280000: dataRom : drom0 : 0x20000 : ;
 drom0_0 : C : 0x280000 - 0x29ffff : .drom0.rodata .drom0.literal
 .lib_rom_function.rodata .cvsd.rodata .g711.rodata .msbc_plcbec_tables.rodata .wav_decoder.rodata .aac_plc_tables.rodata .aac_plc_windows.rodata .sbc_plc_configs.rodata .sbc_plc_tables.rodata
 .lib_std.rodata .lib_aacplus_v2_dec.rodata .lib_mp3_dec.rodata .lib_msbc_enc.rodata .lib_wma_dec.rodata .lib_msbc_sbc_dec.rodata;
END drom0

BEGIN dram1
0x300000: dataRam : dram1 : 0x1000 : writable ;
 dram1_0 : C : 0x300000 - 0x300fff : .dram1.rodata .dram1.literal .dram1.data .dram1.bss;
END dram1

BEGIN srom
0x800000: sysrom : srom : 0x40000 : executable ;
 srom0 : C : 0x800000 - 0x83ffff : .srom.rodata .srom.literal .srom.text .rom.store;
END srom

BEGIN sram
0xa00000: sysram : sram : 0x40000 : executable, writable ;
 sram0 : C : 0xa00000 - 0xa3ffff : .sram.rodata .sram.literal .sram.text .sram.data .sram.bss;
END sram

BEGIN iocached
0x70000000: io : iocached : 0xda00000 : executable, writable ;
END iocached

NOLOAD .log_data
BEGIN LOG_DATA_AREA
0x80000020: sysrom : LOG_DATA_AREA : 0x100000 :  ;
 LOG_DATA_AREA : C : 0x80000020 - 0x8010001F : .log_data;
END LOG_DATA_AREA

BEGIN iobypass
0x90000000: io : iobypass : 0xda00000 : device, executable, writable ;
END iobypass

//NOLOAD .drom0.rodata .drom0.literal .lib_rom_function.rodata .lib_std.rodata .lib_aacplus_v2_dec.rodata .lib_mp3_dec.rodata .lib_msbc_enc.rodata .lib_wma_dec.rodata .lib_msbc_sbc_dec.rodata .literal .text .lib_aacplus_v2_dec.literal .lib_aacplus_v2_dec.text .lib_wma_dec.literal .lib_wma_dec.text .lib_msbc_sbc_dec.literal .lib_msbc_sbc_dec.text .irom0.literal .irom0.text .lib_mp3_dec.literal .lib_mp3_dec.text .lib_msbc_enc.literal .lib_msbc_enc.text .lib_std.literal .lib_std.text .lib_rom_function.literal .lib_rom_function.text
