xref: /openbmc/linux/arch/csky/kernel/vmlinux.lds.S (revision 8938c48f)
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		VBR_BASE
37		IRQENTRY_TEXT
38		SOFTIRQENTRY_TEXT
39		TEXT_TEXT
40		SCHED_TEXT
41		CPUIDLE_TEXT
42		LOCK_TEXT
43		KPROBES_TEXT
44		*(.fixup)
45		*(.gnu.warning)
46	} = 0
47	_etext = .;
48
49	/* __init_begin __init_end must be page aligned for free_initmem */
50	. = ALIGN(PAGE_SIZE);
51
52
53	_sdata = .;
54	RO_DATA(PAGE_SIZE)
55	RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
56	_edata = .;
57
58#ifdef CONFIG_HAVE_TCM
59	.tcm_start : {
60		. = ALIGN(PAGE_SIZE);
61		__tcm_start = .;
62	}
63
64	.text_data_tcm FIXADDR_TCM : AT(__tcm_start)
65	{
66		. = ALIGN(4);
67		__stcm_text_data = .;
68		*(.tcm.text)
69		*(.tcm.rodata)
70#ifndef CONFIG_HAVE_DTCM
71		*(.tcm.data)
72#endif
73		. = ALIGN(4);
74		__etcm_text_data = .;
75	}
76
77	. = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
78
79#ifdef CONFIG_HAVE_DTCM
80	#define ITCM_SIZE	CONFIG_ITCM_NR_PAGES * PAGE_SIZE
81
82	.dtcm_start : {
83		__dtcm_start = .;
84	}
85
86	.data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
87	{
88		. = ALIGN(4);
89		__stcm_data = .;
90		*(.tcm.data)
91		. = ALIGN(4);
92		__etcm_data = .;
93	}
94
95	. = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
96
97	.tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
98#else
99	.tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
100#endif
101		. = ALIGN(PAGE_SIZE);
102		__tcm_end = .;
103	}
104#endif
105
106	EXCEPTION_TABLE(L1_CACHE_BYTES)
107	BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
108	_end = . ;
109
110	STABS_DEBUG
111	DWARF_DEBUG
112	ELF_DETAILS
113
114	DISCARDS
115}
116