/**********************************************************
	File : ldscript 
	Author : Alain Greiner
	Date : January 2014
**********************************************************/

/* definition of the base address for all segments 
The peripherals base addresses are referenced by the
software drivers and must be defined, even if the 
peripherals are not present in the architecture */

seg_reset_base   = 0x00000000;       /* boot code                   */

seg_kcode_base   = 0x00010000;       /* kernel code                 */
seg_kdata_base   = 0x00020000;       /* kernel cacheable data       */
seg_kunc_base    = 0x00030000;       /* kernel uncacheable data     */

seg_code_base    = 0x00040000;       /* application code            */ 
seg_data_base    = 0x00050000;       /* application data            */

seg_heap_base    = 0x00100000;       /* heaps for applications      */
seg_stack_base   = 0x00300000;       /* stacks ifor applications    */

seg_ramdisk_base = 0x00800000;       /* virtual disk                */

seg_xcu_base     = 0xF0000000;       /* controler XCU               */
seg_tty_base     = 0xF4000000;       /* controler TTY               */
seg_fbf_base     = 0xF3000000;       /* controler FBF               */
seg_ioc_base     = 0xF2000000;       /* controler IOC               */
seg_nic_base     = 0xF7000000;       /* controler NIC               */
seg_cma_base     = 0xF8000000;       /* controler CMA               */
seg_pic_base     = 0xF9000000;       /* controler PIC               */
seg_mmc_base     = 0xE0000000;       /* config    MMC               */


/* Grouping sections into segments */

SECTIONS
{
   . = seg_kcode_base;
   seg_kcode : {
      *(.giet)
      *(.switch)
      *(.drivers)
      *(.isr)
   } 
   . = seg_kdata_base;
   seg_kdata : {
      *(.kdata)
   } 
   . = seg_kunc_base;
   seg_kunc : {
      *(.unckdata)
   } 
   . = seg_kdata_base;
   seg_kdata : {
      *(.ksave)
   } 
   . = seg_code_base;
   seg_code : {
      *(.text)
   } 
   . = seg_reset_base;
   seg_reset : {
      *(.reset)
   } 
   . = seg_data_base;
   seg_data : {
      *(.rodata)
      . = ALIGN(4);
      *(.rodata.*)
      . = ALIGN(4);
      *(.data)
      . = ALIGN(4);
      *(.sdata)
      . = ALIGN(4);
      *(.bss)
      *(COMMON)
      *(.sbss)
   } 
}

