Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 #include <asm/vmlinux.lds.h>
0004 #include <asm/page.h>
0005 #include <asm/memory.h>
0006 
0007 OUTPUT_ARCH(csky)
0008 ENTRY(_start)
0009 
0010 #ifndef __cskyBE__
0011 jiffies = jiffies_64;
0012 #else
0013 jiffies = jiffies_64 + 4;
0014 #endif
0015 
0016 #define VBR_BASE \
0017     . = ALIGN(1024); \
0018     vec_base = .; \
0019     . += 512;
0020 
0021 SECTIONS
0022 {
0023     . = PAGE_OFFSET + PHYS_OFFSET_OFFSET;
0024 
0025     _start = .;
0026     HEAD_TEXT_SECTION
0027     . = ALIGN(PAGE_SIZE);
0028 
0029     .text : AT(ADDR(.text) - LOAD_OFFSET) {
0030         _text = .;
0031         _stext = .;
0032         VBR_BASE
0033         IRQENTRY_TEXT
0034         SOFTIRQENTRY_TEXT
0035         TEXT_TEXT
0036         SCHED_TEXT
0037         CPUIDLE_TEXT
0038         LOCK_TEXT
0039         KPROBES_TEXT
0040         *(.fixup)
0041         *(.gnu.warning)
0042     } = 0
0043     _etext = .;
0044 
0045     /* __init_begin __init_end must be page aligned for free_initmem */
0046     . = ALIGN(PAGE_SIZE);
0047     __init_begin = .;
0048     INIT_TEXT_SECTION(PAGE_SIZE)
0049     INIT_DATA_SECTION(PAGE_SIZE)
0050     PERCPU_SECTION(L1_CACHE_BYTES)
0051     . = ALIGN(PAGE_SIZE);
0052     __init_end = .;
0053 
0054     _sdata = .;
0055     RO_DATA(PAGE_SIZE)
0056     RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
0057     _edata = .;
0058 
0059 #ifdef CONFIG_HAVE_TCM
0060     .tcm_start : {
0061         . = ALIGN(PAGE_SIZE);
0062         __tcm_start = .;
0063     }
0064 
0065     .text_data_tcm FIXADDR_TCM : AT(__tcm_start)
0066     {
0067         . = ALIGN(4);
0068         __stcm_text_data = .;
0069         *(.tcm.text)
0070         *(.tcm.rodata)
0071 #ifndef CONFIG_HAVE_DTCM
0072         *(.tcm.data)
0073 #endif
0074         . = ALIGN(4);
0075         __etcm_text_data = .;
0076     }
0077 
0078     . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
0079 
0080 #ifdef CONFIG_HAVE_DTCM
0081     #define ITCM_SIZE   CONFIG_ITCM_NR_PAGES * PAGE_SIZE
0082 
0083     .dtcm_start : {
0084         __dtcm_start = .;
0085     }
0086 
0087     .data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
0088     {
0089         . = ALIGN(4);
0090         __stcm_data = .;
0091         *(.tcm.data)
0092         . = ALIGN(4);
0093         __etcm_data = .;
0094     }
0095 
0096     . = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
0097 
0098     .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
0099 #else
0100     .tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
0101 #endif
0102         . = ALIGN(PAGE_SIZE);
0103         __tcm_end = .;
0104     }
0105 #endif
0106 
0107     EXCEPTION_TABLE(L1_CACHE_BYTES)
0108     BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
0109     _end = . ;
0110 
0111     STABS_DEBUG
0112     DWARF_DEBUG
0113     ELF_DETAILS
0114 
0115     DISCARDS
0116 }