Skip to content

Commit 0d9185b

Browse files
authored
[bsp][cvitek]fix milkv-duos-sd cann't startup big-core kernel (#9633)
fix milkv-duos-sd cann't startup big-core kernel milkv-duos-sd use cv1813h folder store ld file Signed-off-by: flyingcys <flyingcys@163.com>
1 parent 83a250f commit 0d9185b

File tree

5 files changed

+262
-5
lines changed

5 files changed

+262
-5
lines changed

bsp/cvitek/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ cvitek_bootloader
22
fip.bin
33
boot.sd
44
output
5-
c906_little/board/script
65
Image.lzma

bsp/cvitek/c906_little/SConstruct

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu = False)
3434
# include libraries
3535
objs.extend(SConscript(drivers_path_prefix + '/SConscript', variant_dir='build/drivers', duplicate=0))
3636

37-
if GetDepend('BOARD_TYPE_MILKV_DUO256M') or GetDepend('BOARD_TYPE_MILKV_DUOS'):
37+
if GetDepend('BOARD_TYPE_MILKV_DUO256M'):
3838
env['LINKFLAGS'] = env['LINKFLAGS'].replace('cv180x_lscript.ld', 'cv181x_lscript.ld')
3939
env['LINKFLAGS'] = env['LINKFLAGS'].replace('-L board/script/cv180x', '-L board/script/cv181x')
40+
elif GetDepend('BOARD_TYPE_MILKV_DUOS'):
41+
env['LINKFLAGS'] = env['LINKFLAGS'].replace('cv180x_lscript.ld', 'cv1813h_lscript.ld')
42+
env['LINKFLAGS'] = env['LINKFLAGS'].replace('-L board/script/cv180x', '-L board/script/cv1813h')
4043

4144
# make a building
4245
DoBuilding(TARGET, objs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
/*
2+
* Copyright (c) 2006-2024, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2024/01/11 flyingcys The first version
9+
*/
10+
INCLUDE ./cvi_board_memmap.ld
11+
12+
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x20000;
13+
/* _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x1000000; */
14+
/*_HEAP_SIZE = 0x20000;*/
15+
16+
_EL0_STACK_SIZE = DEFINED(_EL0_STACK_SIZE) ? _EL0_STACK_SIZE : 1024;
17+
_EL1_STACK_SIZE = DEFINED(_EL1_STACK_SIZE) ? _EL1_STACK_SIZE : 2048;
18+
_EL2_STACK_SIZE = DEFINED(_EL2_STACK_SIZE) ? _EL2_STACK_SIZE : 1024;
19+
20+
/* Define Memories in the system */
21+
22+
MEMORY
23+
{
24+
psu_ddr_0_MEM_0 : ORIGIN = CVIMMAP_FREERTOS_ADDR , LENGTH = CVIMMAP_FREERTOS_SIZE
25+
}
26+
27+
/* Specify the default entry point to the program */
28+
29+
/*ENTRY(_vector_table)*/
30+
ENTRY(_start)
31+
32+
/* Define the sections, and where they are mapped in memory */
33+
34+
SECTIONS
35+
{
36+
.text : {
37+
KEEP (*(.vectors))
38+
*(.boot)
39+
*(.text)
40+
*(.text.*)
41+
*(.gnu.linkonce.t.*)
42+
*(.plt)
43+
*(.gnu_warning)
44+
*(.gcc_execpt_table)
45+
*(.glue_7)
46+
*(.glue_7t)
47+
*(.ARM.extab)
48+
*(.gnu.linkonce.armextab.*)
49+
50+
/* section information for finsh shell */
51+
. = ALIGN(8);
52+
__fsymtab_start = .;
53+
KEEP(*(FSymTab))
54+
__fsymtab_end = .;
55+
. = ALIGN(8);
56+
__vsymtab_start = .;
57+
KEEP(*(VSymTab))
58+
__vsymtab_end = .;
59+
. = ALIGN(8);
60+
61+
/* section information for initial. */
62+
. = ALIGN(8);
63+
__rt_init_start = .;
64+
KEEP(*(SORT(.rti_fn*)))
65+
__rt_init_end = .;
66+
. = ALIGN(8);
67+
68+
__rt_utest_tc_tab_start = .;
69+
KEEP(*(UtestTcTab))
70+
__rt_utest_tc_tab_end = .;
71+
} > psu_ddr_0_MEM_0
72+
73+
.init (ALIGN(64)) : {
74+
KEEP (*(.init))
75+
} > psu_ddr_0_MEM_0
76+
77+
.fini (ALIGN(64)) : {
78+
KEEP (*(.fini))
79+
} > psu_ddr_0_MEM_0
80+
81+
.interp : {
82+
KEEP (*(.interp))
83+
} > psu_ddr_0_MEM_0
84+
85+
.note-ABI-tag : {
86+
KEEP (*(.note-ABI-tag))
87+
} > psu_ddr_0_MEM_0
88+
89+
.rodata : {
90+
. = ALIGN(64);
91+
__rodata_start = .;
92+
*(.rodata)
93+
*(.rodata.*)
94+
*(.srodata*)
95+
*(.gnu.linkonce.r.*)
96+
__rodata_end = .;
97+
} > psu_ddr_0_MEM_0
98+
99+
.rodata1 : {
100+
. = ALIGN(64);
101+
__rodata1_start = .;
102+
*(.rodata1)
103+
*(.rodata1.*)
104+
__rodata1_end = .;
105+
} > psu_ddr_0_MEM_0
106+
107+
.data : {
108+
. = ALIGN(64);
109+
_data = .;
110+
*(.data)
111+
*(.data.*)
112+
*(.sdata)
113+
*(.sdata.*)
114+
*(.gnu.linkonce.d.*)
115+
*(.jcr)
116+
*(.got)
117+
*(.got.plt)
118+
_edata = .;
119+
} > psu_ddr_0_MEM_0
120+
121+
.data1 : {
122+
. = ALIGN(64);
123+
__data1_start = .;
124+
*(.data1)
125+
*(.data1.*)
126+
__data1_end = .;
127+
} > psu_ddr_0_MEM_0
128+
129+
.got : {
130+
*(.got)
131+
} > psu_ddr_0_MEM_0
132+
133+
.got1 : {
134+
*(.got1)
135+
} > psu_ddr_0_MEM_0
136+
137+
.got2 : {
138+
*(.got2)
139+
} > psu_ddr_0_MEM_0
140+
141+
.ctors : {
142+
. = ALIGN(64);
143+
__CTOR_LIST__ = .;
144+
___CTORS_LIST___ = .;
145+
KEEP (*crtbegin.o(.ctors))
146+
KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
147+
KEEP (*(SORT(.ctors.*)))
148+
KEEP (*(.ctors))
149+
__CTOR_END__ = .;
150+
___CTORS_END___ = .;
151+
} > psu_ddr_0_MEM_0
152+
153+
.dtors : {
154+
. = ALIGN(64);
155+
__DTOR_LIST__ = .;
156+
___DTORS_LIST___ = .;
157+
KEEP (*crtbegin.o(.dtors))
158+
KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
159+
KEEP (*(SORT(.dtors.*)))
160+
KEEP (*(.dtors))
161+
__DTOR_END__ = .;
162+
___DTORS_END___ = .;
163+
} > psu_ddr_0_MEM_0
164+
165+
.fixup : {
166+
__fixup_start = .;
167+
*(.fixup)
168+
__fixup_end = .;
169+
} > psu_ddr_0_MEM_0
170+
171+
.eh_frame : {
172+
*(.eh_frame)
173+
} > psu_ddr_0_MEM_0
174+
175+
.eh_framehdr : {
176+
__eh_framehdr_start = .;
177+
*(.eh_framehdr)
178+
__eh_framehdr_end = .;
179+
} > psu_ddr_0_MEM_0
180+
181+
.gcc_except_table : {
182+
*(.gcc_except_table)
183+
} > psu_ddr_0_MEM_0
184+
185+
.bss (NOLOAD) : {
186+
. = ALIGN(64);
187+
_bss = .;
188+
*(.bss)
189+
*(.bss.*)
190+
*(.sbss)
191+
*(.sbss.*)
192+
*(.gnu.linkonce.b.*)
193+
*(COMMON)
194+
. = ALIGN(64);
195+
_ebss = .;
196+
} > psu_ddr_0_MEM_0
197+
198+
/*_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );*/
199+
_data_lma = LOADADDR(.data);
200+
201+
/* Generate Stack and Heap definitions */
202+
.stack (NOLOAD) : {
203+
. = ALIGN(64);
204+
_stack_end_end = .;
205+
. += _STACK_SIZE;
206+
_stack_top = .;
207+
__rt_rvstack = .;
208+
} > psu_ddr_0_MEM_0
209+
210+
.heap (NOLOAD) : {
211+
. = ALIGN(64);
212+
_heap = .;
213+
HeapBase = .;
214+
_heap_start = .;
215+
*(.heap*)
216+
/*. += _HEAP_SIZE;*/
217+
/*_heap_size = _HEAP_SIZE; */
218+
_heap_end = .;
219+
HeapLimit = .;
220+
} > psu_ddr_0_MEM_0
221+
222+
HeapLimit = ORIGIN(psu_ddr_0_MEM_0) + LENGTH(psu_ddr_0_MEM_0);
223+
_end = .;
224+
}
225+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CONFIG_SYS_TEXT_BASE = 0x80200000;
2+
CVIMMAP_ATF_SIZE = 0x80000;
3+
CVIMMAP_BOOTLOGO_ADDR = 0x9523e000;
4+
CVIMMAP_BOOTLOGO_SIZE = 0x1c2000;
5+
CVIMMAP_CONFIG_SYS_INIT_SP_ADDR = 0x82800000;
6+
CVIMMAP_CVI_UPDATE_HEADER_ADDR = 0x817ffc00;
7+
CVIMMAP_CVI_UPDATE_HEADER_SIZE = 0x400;
8+
CVIMMAP_DRAM_BASE = 0x80000000;
9+
CVIMMAP_DRAM_SIZE = 0x20000000;
10+
CVIMMAP_FRAMEBUFFER_ADDR = 0x9523e000;
11+
CVIMMAP_FRAMEBUFFER_SIZE = 0x1c2000;
12+
CVIMMAP_FREERTOS_ADDR = 0x9fe00000;
13+
CVIMMAP_FREERTOS_RESERVED_ION_SIZE = 0x1600000;
14+
CVIMMAP_FREERTOS_SIZE = 0x200000;
15+
CVIMMAP_FSBL_C906L_START_ADDR = 0x9fe00000;
16+
CVIMMAP_FSBL_UNZIP_ADDR = 0x81800000;
17+
CVIMMAP_FSBL_UNZIP_SIZE = 0x1000000;
18+
CVIMMAP_H26X_BITSTREAM_ADDR = 0x95400000;
19+
CVIMMAP_H26X_BITSTREAM_SIZE = 0x200000;
20+
CVIMMAP_H26X_ENC_BUFF_ADDR = 0x95600000;
21+
CVIMMAP_H26X_ENC_BUFF_SIZE = 0x0;
22+
CVIMMAP_ION_ADDR = 0x95400000;
23+
CVIMMAP_ION_SIZE = 0xaa00000;
24+
CVIMMAP_ISP_MEM_BASE_ADDR = 0x95600000;
25+
CVIMMAP_ISP_MEM_BASE_SIZE = 0x1400000;
26+
CVIMMAP_KERNEL_MEMORY_ADDR = 0x80000000;
27+
CVIMMAP_KERNEL_MEMORY_SIZE = 0x1fe00000;
28+
CVIMMAP_MONITOR_ADDR = 0x80000000;
29+
CVIMMAP_OPENSBI_FDT_ADDR = 0x80080000;
30+
CVIMMAP_OPENSBI_SIZE = 0x80000;
31+
CVIMMAP_UIMAG_ADDR = 0x81800000;
32+
CVIMMAP_UIMAG_SIZE = 0x1000000;

bsp/cvitek/combine-fip.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ echo "board: ${MV_BOARD_LINK}"
3030

3131
if [ ! -d opensbi/build/platform/generic ] || [ ! -d fsbl/build/${MV_BOARD_LINK} ] || [ ! -d u-boot-2021.10/build/${MV_BOARD_LINK} ]; then
3232
do_build
33-
34-
CHIP_ARCH_L=$(echo $CHIP_ARCH | tr '[:upper:]' '[:lower:]')
35-
cp -rf build/output/${MV_BOARD_LINK}/cvi_board_memmap.ld ${ROOT_PATH}/c906_little/board/script/${CHIP_ARCH_L}
33+
3634
else
3735
echo "Build already done, skip build"
3836

0 commit comments

Comments
 (0)