Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#include <asm/vmlinux.lds.h>
4#include <asm/page.h>
5#include <asm/memory.h>
6
7OUTPUT_ARCH(csky)
8ENTRY(_start)
9
10#ifndef __cskyBE__
11jiffies = jiffies_64;
12#else
13jiffies = jiffies_64 + 4;
14#endif
15
16#define VBR_BASE \
17 . = ALIGN(1024); \
18 vec_base = .; \
19 . += 512;
20
21SECTIONS
22{
23 . = PAGE_OFFSET + PHYS_OFFSET_OFFSET;
24
25 _start = .;
26 HEAD_TEXT_SECTION
27 . = ALIGN(PAGE_SIZE);
28
29 .text : AT(ADDR(.text) - LOAD_OFFSET) {
30 _text = .;
31 _stext = .;
32 VBR_BASE
33 IRQENTRY_TEXT
34 SOFTIRQENTRY_TEXT
35 TEXT_TEXT
36 SCHED_TEXT
37 CPUIDLE_TEXT
38 LOCK_TEXT
39 KPROBES_TEXT
40 *(.fixup)
41 *(.gnu.warning)
42 } = 0
43 _etext = .;
44
45 /* __init_begin __init_end must be page aligned for free_initmem */
46 . = ALIGN(PAGE_SIZE);
47 __init_begin = .;
48 INIT_TEXT_SECTION(PAGE_SIZE)
49 INIT_DATA_SECTION(PAGE_SIZE)
50 PERCPU_SECTION(L1_CACHE_BYTES)
51 . = ALIGN(PAGE_SIZE);
52 __init_end = .;
53
54 _sdata = .;
55 RO_DATA(PAGE_SIZE)
56 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
57 _edata = .;
58
59#ifdef CONFIG_HAVE_TCM
60 .tcm_start : {
61 . = ALIGN(PAGE_SIZE);
62 __tcm_start = .;
63 }
64
65 .text_data_tcm FIXADDR_TCM : AT(__tcm_start)
66 {
67 . = ALIGN(4);
68 __stcm_text_data = .;
69 *(.tcm.text)
70 *(.tcm.rodata)
71#ifndef CONFIG_HAVE_DTCM
72 *(.tcm.data)
73#endif
74 . = ALIGN(4);
75 __etcm_text_data = .;
76 }
77
78 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
79
80#ifdef CONFIG_HAVE_DTCM
81 #define ITCM_SIZE CONFIG_ITCM_NR_PAGES * PAGE_SIZE
82
83 .dtcm_start : {
84 __dtcm_start = .;
85 }
86
87 .data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
88 {
89 . = ALIGN(4);
90 __stcm_data = .;
91 *(.tcm.data)
92 . = ALIGN(4);
93 __etcm_data = .;
94 }
95
96 . = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
97
98 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
99#else
100 .tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
101#endif
102 . = ALIGN(PAGE_SIZE);
103 __tcm_end = .;
104 }
105#endif
106
107 EXCEPTION_TABLE(L1_CACHE_BYTES)
108 BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
109 _end = . ;
110
111 STABS_DEBUG
112 DWARF_DEBUG
113 ELF_DETAILS
114
115 DISCARDS
116}
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#include <asm/vmlinux.lds.h>
4#include <asm/page.h>
5#include <asm/memory.h>
6
7OUTPUT_ARCH(csky)
8ENTRY(_start)
9
10#ifndef __cskyBE__
11jiffies = jiffies_64;
12#else
13jiffies = jiffies_64 + 4;
14#endif
15
16#define VBR_BASE \
17 . = ALIGN(1024); \
18 vec_base = .; \
19 . += 512;
20
21SECTIONS
22{
23 . = PAGE_OFFSET + PHYS_OFFSET_OFFSET;
24
25 _stext = .;
26 __init_begin = .;
27 HEAD_TEXT_SECTION
28 INIT_TEXT_SECTION(PAGE_SIZE)
29 INIT_DATA_SECTION(PAGE_SIZE)
30 PERCPU_SECTION(L1_CACHE_BYTES)
31 . = ALIGN(PAGE_SIZE);
32 __init_end = .;
33
34 .text : AT(ADDR(.text) - LOAD_OFFSET) {
35 _text = .;
36 IRQENTRY_TEXT
37 SOFTIRQENTRY_TEXT
38 TEXT_TEXT
39 SCHED_TEXT
40 CPUIDLE_TEXT
41 LOCK_TEXT
42 KPROBES_TEXT
43 *(.fixup)
44 *(.gnu.warning)
45 } = 0
46 _etext = .;
47
48 /* __init_begin __init_end must be page aligned for free_initmem */
49 . = ALIGN(PAGE_SIZE);
50
51
52 _sdata = .;
53 RO_DATA(PAGE_SIZE)
54 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
55 _edata = .;
56
57#ifdef CONFIG_HAVE_TCM
58 .tcm_start : {
59 . = ALIGN(PAGE_SIZE);
60 __tcm_start = .;
61 }
62
63 .text_data_tcm FIXADDR_TCM : AT(__tcm_start)
64 {
65 . = ALIGN(4);
66 __stcm_text_data = .;
67 *(.tcm.text)
68 *(.tcm.rodata)
69#ifndef CONFIG_HAVE_DTCM
70 *(.tcm.data)
71#endif
72 . = ALIGN(4);
73 __etcm_text_data = .;
74 }
75
76 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
77
78#ifdef CONFIG_HAVE_DTCM
79 #define ITCM_SIZE CONFIG_ITCM_NR_PAGES * PAGE_SIZE
80
81 .dtcm_start : {
82 __dtcm_start = .;
83 }
84
85 .data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
86 {
87 . = ALIGN(4);
88 __stcm_data = .;
89 *(.tcm.data)
90 . = ALIGN(4);
91 __etcm_data = .;
92 }
93
94 . = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
95
96 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
97#else
98 .tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
99#endif
100 . = ALIGN(PAGE_SIZE);
101 __tcm_end = .;
102 }
103#endif
104
105 EXCEPTION_TABLE(L1_CACHE_BYTES)
106 BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
107 VBR_BASE
108 _end = . ;
109
110 STABS_DEBUG
111 DWARF_DEBUG
112
113 DISCARDS
114}