⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adsp-bf537.ldf

📁 Using the Blackfin Processor SPORT to Emulate a SPI Interface
💻 LDF
📖 第 1 页 / 共 2 页
字号:
/*
** Default LDF for C, C++ and assembly applications targeting ADSP-BF537.
** 
** There are a number of configuration macros that may be specified as a 
** result of use of certain compiler switches or by linker flags directly.
** The options are:
** 
** __WORKAROUNDS_ENABLED
**   Defined by compiler to direct LDF to link with libraries that have 
**   been built with hardware errata workarounds enabled.
** USE_INSTRUCTION_CACHE, USE_DATA_A_CACHE, USE_DATA_B_CACHE, USE_CACHE
**   Avoids use of regions of L1 which will be configured for cache use. 
**   Use implies the presence SDRAM (external) memory.
** USE_SDRAM
**   Makes SDRAM available as standard program and data memory.
** USE_SCRATCHPAD_STACK
**   Use scratchpad for system stack. Note only 4k memory.
** USE_SCRATCHPAD_HEAP
**   Use scratchpad for dynamic heap allocation. Note only 4k memory.
** USE_SDRAM_STACK
**   Use SDRAM for system stack rather than L1 default. Should allow for
**   much larger stack but likely to have a significant performance impact.
** USE_SDRAM_HEAP
**   Use SDRAM for dynamic heap allocation rather than L1 default. Should 
**   result in a much larger heap being available but can have a significant
**   performance impact.
** USER_CRT
**   Specifies a custom or System Builder generated CRT startup object to use.
** USER_CPLBTAB
**   Specifies a custom or System Builder generated CPLB configuration 
**   definition.
** USE_FILEIO
**   Normally defined and causes linking of I/O support libraries.
** IEEEFP
**   Defined by the compiler when switch -ieee-fp is used to direct the
**   use of slower but more IEEE conformant floating-point emulation.
** _DINKUM_IO
**   Defined by the compiler when switch -full-io is used to direct the
**   use of the slower but more conformant Dinkum libc I/O support instead
**   of libio.
** USE_PROFILER0, USE_PROFILER1, and USE_PROFILER2
**   Defined by compiler when switch -p[1|2] is used to direct LDF to link
**   with suitable profiling support.
** __NO_STD_LIB
**   Defined by the compiler when switch -no-std-lib is used and causes
**   the LDF to avoid using the standard VisualDSP++ library search path.
** __MEMINIT__
**   Macro defined by the linker when -meminit is used to enable run
**   initialization.
*/

ARCHITECTURE(ADSP-BF537)

/*
** include standard VisualDSP++ installation libraries in search path
*/
#if !defined(__NO_STD_LIB)
SEARCH_DIR( $ADI_DSP/Blackfin/lib )
#endif

/*
** define macros used to check cache configuration
*/
# if defined(USE_INSTRUCTION_CACHE) || \
     defined(USE_DATA_A_CACHE) || defined(USE_DATA_B_CACHE)
#  define USE_CACHE_PARTS 1
# else
#  define USE_CACHE_PARTS 0
#endif
#define INSTR_CACHE \
    ( defined(USE_CACHE) && \
     ( ( defined(USE_INSTRUCTION_CACHE) || !USE_CACHE_PARTS ) ) )
#define DATAA_CACHE \
    ( defined(USE_CACHE) && \
     ( ( defined(USE_DATA_A_CACHE) || defined(USE_DATA_B_CACHE) || \
         !USE_CACHE_PARTS ) ) )
#define DATAB_CACHE \
    ( defined(USE_CACHE) && \
     ( ( defined(USE_DATA_B_CACHE) || !USE_CACHE_PARTS ) ) )

/*
** define various macros used to reduce complexity of LDF
*/
#if defined(__WORKAROUNDS_ENABLED)
#  define RT_LIB_NAME(x) lib ## x ## y.dlb
#  define RT_OBJ_NAME(x) x ## y.doj
#  if defined(__ADI_LIBEH__)
#    define RT_LIB_NAME_EH(x) lib ## x ## yx.dlb
#  else /* __ADI_LIBEH__ */
#    define RT_LIB_NAME_EH(x) lib ## x ## y.dlb
#  endif
#else /* __WORKAROUNDS_ENABLED */
#  define RT_LIB_NAME(x) lib ## x ## .dlb
#  define RT_OBJ_NAME(x) x ## .doj
#  if defined(__ADI_LIBEH__)
#    define RT_LIB_NAME_EH(x) lib ## x ## x.dlb
#  else /* __ADI_LIBEH__ */
#    define RT_LIB_NAME_EH(x) lib ## x ## .dlb
#  endif
#endif /* __WORKAROUNDS_ENABLED */

#if !defined(USE_L1DATA_STACK)
#  define USE_L1DATA_STACK \
    !defined(USE_SCRATCHPAD_STACK) && !defined(USE_SDRAM_STACK)
#endif

#if !defined(USE_L1DATA_HEAP)
#  define USE_L1DATA_HEAP \
    !defined(USE_SCRATCHPAD_HEAP) && !defined(USE_SDRAM_HEAP)
#endif

/*
** minimum sizes of the stack and heap allocated
*/
#define STACK_SIZE 8K
#define HEAP_SIZE 7K
#define STACKHEAP_SIZE 15K

/*
** decide if to include mappings to SDRAM or not
*/
#if !defined(USE_SDRAM) && \
    ( defined(USE_CACHE) || defined(USE_SDRAM_STACK) || \
      defined(USE_SDRAM_HEAP) )
#  define USE_SDRAM
#endif

/*
** default to USE_FILEIO support
*/
#if !defined(USE_FILEIO)
#  define USE_FILEIO 1
#endif

/*
** determine which CRT to use 
*/
#if defined(USER_CRT)
#  define CRT USER_CRT
#else
#  if defined(USE_PROFILER) 
#    if USE_FILEIO
#      if defined(__cplusplus)
#      define CRT RT_OBJ_NAME(crtsfpc532)
#      else
#      define CRT RT_OBJ_NAME(crtsfp532)
#      endif
#    else
#      if defined(__cplusplus)
#      define CRT RT_OBJ_NAME(crtspc532)
#      else
#      define CRT RT_OBJ_NAME(crtsp532)
#      endif
#    endif
#  else
#    if USE_FILEIO
#      if defined(__cplusplus)
#      define CRT RT_OBJ_NAME(crtsfc532)
#      else
#      define CRT RT_OBJ_NAME(crtsf532)
#      endif
#    else
#      if defined(__cplusplus)
#      define CRT RT_OBJ_NAME(crtsc532)
#      else
#      define CRT RT_OBJ_NAME(crts532)
#      endif
#    endif
#  endif
#endif

/*
** define linked objects list
*/
$OBJECTS = 
   CRT,                       /* C startup object                 */
   $COMMAND_LINE_OBJECTS ,    /* defined by linker */
#if defined(USE_PROFILER0)    /* Profiling initialization funcs.  */
   RT_OBJ_NAME(prfflg0_532),
#elif defined(USE_PROFILER1)
   RT_OBJ_NAME(prfflg1_532),
#elif defined(USE_PROFILER2)
   RT_OBJ_NAME(prfflg2_532),
#endif
   __initsbsz532.doj,         /* meminit support                  */
#if defined(USER_CPLBTAB)
   USER_CPLBTAB ,             /* custom cplb configuration        */
#else
   cplbtab537.doj,            /* default cplb configuration       */
#endif
   RT_OBJ_NAME(crtn532)       /* CRT end object                   */
   ;

/*
** define linked library list
*/
$LIBRARIES = 
   RT_LIB_NAME(small532),     /* Supervisor mode support routines */
#if defined(_DINKUM_IO)
   RT_LIB_NAME(c532),         /* ANSI C (and IO) run-time library */
   RT_LIB_NAME(io532),        /* Fast IO and host IO support      */
#else
   RT_LIB_NAME(io532),        /* Fast IO and host IO support      */
   RT_LIB_NAME(c532),         /* ANSI C (and IO) run-time library */
#endif
#if defined(USE_FILEIO) || defined(USE_PROFGUIDE)
   RT_LIB_NAME(rt_fileio532), /* Run-time Support with File IO    */
#else
   RT_LIB_NAME(rt532),        /* Run-time Support without File IO */
#endif
   RT_LIB_NAME(event532),     /* Interrupt handler support        */
   RT_LIB_NAME_EH(cpp532),    /* ANSI C++ run-time library        */
   RT_LIB_NAME_EH(cpprt532),  /* C++ run-time support library     */
   RT_LIB_NAME(x532),         /* C++ exception handling support   */
#if defined(IEEEFP)
   RT_LIB_NAME(sftflt532),    /* IEEE floating-point emulation    */
#endif
   RT_LIB_NAME(f64ieee532),   /* 64-bit floating-point support    */
   RT_LIB_NAME(dsp532),       /* DSP run-time library             */
#if !defined(IEEEFP)
   RT_LIB_NAME(sftflt532),    /* IEEE floating-point emulation    */
#endif
   RT_LIB_NAME(etsi532),      /* ETSI run-time support library    */
   RT_LIB_NAME(ssl537),       /* system services library          */
   RT_LIB_NAME(drv537),       /* device drivers                   */
   RT_LIB_NAME(profile532)    /* Profile support routines         */
   ;

/*
** List of objects and libraries which prefer internal memory as
** specified by prefersMem attribute.
*/
$OBJS_LIBS_INTERNAL =
   $OBJECTS{prefersMem("internal")},
   $LIBRARIES{prefersMem("internal")}
   ;

/*
** List of objects and libraries which don't have a preference for
** external memory as specified by prefersMem attribute.
*/
$OBJS_LIBS_NOT_EXTERNAL =
   $OBJECTS{!prefersMem("external")},
   $LIBRARIES{!prefersMem("external")}
   ;

/*
** Memory map.
**
** 0xFFE00000 - 0xFFFFFFFF  Core MMR registers (2MB)
** 0xFFC00000 - 0xFFDFFFFF  System MMR registers (2MB)
** 0xFFB01000 - 0xFFBFFFFF  Reserved
** 0xFFB00000 - 0xFFB00FFF  Scratch SRAM (4K)
** 0xFFA14000 - 0xFFAFFFFF  Reserved
** 0xFFA10000 - 0XFFA13FFF  Code SRAM/CACHE (16K)
** 0xFFA0C000 - 0xFFA0FFFF  Reserved
** 0xFFA08000 - 0xFFA0BFFF  Instruction Bank B SRAM (16K)
** 0xFFA00000 - 0xFFA07FFF  Instruction Bank A SRAM (32K)
** 0xFF908000 - 0xFF9FFFFF  Reserved
** 0xFF904000 - 0xFF907FFF  Data Bank B SRAM/CACHE (16k)
** 0xFF900000 - 0XFF903FFF  Data Bank B SRAM (16k)
** 0xFF808000 - 0xFF8FFFFF  Reserved
** 0xFF804000 - 0xFF807FFF  Data Bank A SRAM/CACHE (16k)
** 0xFF800000 - 0XFF803FFF  Data Bank A SRAM (16k)
** 0xEF000800 - 0xFF800000  Reserved
** 0xEF000000 - 0xFF8007FF  Boot ROM (2K)
** 0x20400000 - 0xEEFFFFFF  Reserved
** 0x20300000 - 0x203FFFFF  ASYNC MEMORY BANK 3 (1MB)
** 0x20200000 - 0x202FFFFF  ASYNC MEMORY BANK 2 (1MB)
** 0x20100000 - 0x201FFFFF  ASYNC MEMORY BANK 1 (1MB)
** 0x20000000 - 0x200FFFFF  ASYNC MEMORY BANK 0 (1MB)
** 0x00000000 - 0x03FFFFFF  EZ-Kit SDRAM MEMORY (64MB)
** 0x00000000 - 0x1FFFFFFF  SDRAM MEMORY (16MB - 512MB)
** 
** Notes:
** 0xFF807FEF-0xFF807FFF Required by boot-loader. 
*/

MEMORY
{

   MEM_L1_SCRATCH       { START(0xFFB00000) END(0xFFB00FFF) TYPE(RAM) WIDTH(8) }
   MEM_L1_CODE_CACHE    { START(0xFFA10000) END(0xFFA13FFF) TYPE(RAM) WIDTH(8) }
   MEM_L1_CODE          { START(0xFFA00000) END(0xFFA0BFFF) TYPE(RAM) WIDTH(8) }

#if DATAB_CACHE /* { */
   MEM_L1_DATA_B_CACHE  { START(0xFF904000) END(0xFF907FFF) TYPE(RAM) WIDTH(8) }
   MEM_L1_DATA_B        { START(0xFF900000) END(0xFF903FFF) TYPE(RAM) WIDTH(8) }
#else
   MEM_L1_DATA_B        { START(0xFF900000) END(0xFF907FFF) TYPE(RAM) WIDTH(8) }
#endif /* DATAB_CACHE } */

#if DATAA_CACHE
   MEM_L1_DATA_A_CACHE  { START(0xFF804000) END(0xFF807FFF) TYPE(RAM) WIDTH(8) }
   MEM_L1_DATA_A        { START(0xFF800000) END(0xFF803FFF) TYPE(RAM) WIDTH(8) }
#else
#if defined(IDDE_ARGS) && !defined(USE_SDRAM)
#define ARGV_START 0xFF800000
   MEM_ARGV             { START(0xFF800000) END(0xFF8000FF) TYPE(RAM) WIDTH(8) }
   MEM_L1_DATA_A        { START(0xFF800100) END(0xFF807FFF) TYPE(RAM) WIDTH(8) }
#else
   MEM_L1_DATA_A        { START(0xFF800000) END(0xFF807FFF) TYPE(RAM) WIDTH(8) }
#endif
#endif

   MEM_ASYNC3           { START(0x20300000) END(0x203FFFFF) TYPE(RAM) WIDTH(8) }
   MEM_ASYNC2           { START(0x20200000) END(0x202FFFFF) TYPE(RAM) WIDTH(8) }
   MEM_ASYNC1           { START(0x20100000) END(0x201FFFFF) TYPE(RAM) WIDTH(8) }
   MEM_ASYNC0           { START(0x20000000) END(0x200FFFFF) TYPE(RAM) WIDTH(8) }
	/* The ADSP-BF537 EZ-KIT is supplied with 64 MB SDRAM.
	** The ADSP-BF537 EBIU allows for 4 sub-banks to be accessed simultaneously
	** The LDF partitions the available SDRAM into 4 16MB banks which makes
	** the best use of the EBIU and minimizes memory access stall cycles.
	** bank0-heap, bank1-data, bank2-data/bsz, bank3-program
	** See ADSP-BF537 Hardware Reference Manual, SDRAM controller section
	** for further information.
	*/
#if defined(IDDE_ARGS) && defined(USE_SDRAM)
#define ARGV_START 0x00000004
   MEM_ARGV             { START(0x00000004) END(0x00000103) TYPE(RAM) WIDTH(8) }
   MEM_SDRAM0_BANK0     { START(0x00000104) END(0x00FFFFFF) TYPE(RAM) WIDTH(8) }
#else
   MEM_SDRAM0_BANK0     { START(0x00000004) END(0x00FFFFFF) TYPE(RAM) WIDTH(8) }
#endif
   MEM_SDRAM0_BANK1     { START(0x01000000) END(0x01FFFFFF) TYPE(RAM) WIDTH(8) }
   MEM_SDRAM0_BANK2     { START(0x02000000) END(0x02FFFFFF) TYPE(RAM) WIDTH(8) }
   MEM_SDRAM0_BANK3     { START(0x03000000) END(0x03FFFC5F) TYPE(RAM) WIDTH(8) }
   MEM_RESERVE_SSL      { START(0x03FFFC60) END(0x03FFFFFF) TYPE(RAM) WIDTH(8) }
} /* MEMORY */

PROCESSOR p0
{
  OUTPUT( $COMMAND_LINE_OUTPUT_FILE )

  /* Following address must match the reset PC address */
  RESOLVE(start,0xFFA00000)

#if defined(IDDE_ARGS)
  RESOLVE(___argv_string, ARGV_START)
#endif

  KEEP(start,_main)

  SECTIONS
  {

#if defined(__WORKAROUND_AVOID_LDF_BLOCK_BOUNDARIES) /* { */
    /* Workaround for hardware errata 05-00-0189 -
    ** "Speculative (and fetches made at boundary of reserved memory
    ** space) for instruction or data fetches may cause false
    ** protection exceptions".
    **
    ** Done by avoiding use of 76 bytes from at the end of blocks
    ** that are adjacent to reserved memory. Workaround is enabled
    ** for appropriate silicon revisions (-si-revision switch).
    */
    RESERVE(___wab0=0xFFB00FFF - 75,___l0=76) /* scratchpad */
#  if !INSTR_CACHE
    RESERVE(___wab1=0xFFA13FFF - 75,___l1=76) /* l1 instr sram/cache */
#  endif
    RESERVE(___wab2=0xFFA0BFFF - 75,___l2=76) /* l1 B instr sram */
#  if DATAB_CACHE
    RESERVE(___wab3=0xFF903FFF - 75,___l3=76) /* data B sram */
#  else
    RESERVE(___wab4=0xFF907FFF - 75,___l4=76) /* data B sram/cache */
#  endif
#  if DATAA_CACHE
    RESERVE(___wab5=0xFF803FFF - 75,___l5=76) /* data A sram */
#  else
    RESERVE(___wab6=0xFF807FFF - 75,___l6=76) /* data A sram/cache */
#  endif
    RESERVE(___wab7=0x203FFFFF - 75,___l7=76) /* async bank 3 */
#  if defined(USE_SDRAM) || defined(USE_CACHE)
    RESERVE(___wab8=0x03FFFFFF - 75,___l8=76)  /* EZ-Kit sdram */
#  endif
#endif /*} __WORKAROUND_AVOID_LDF_BLOCK_BOUNDARIES */

/* 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -