Skip to content

Commit 6d697de

Browse files
authored
Merge pull request #237 from RossBrunton/linkerfile
[refsi] Update Refsi memory specifications
2 parents 1fde0b3 + e7f5744 commit 6d697de

File tree

4 files changed

+20
-29
lines changed

4 files changed

+20
-29
lines changed

examples/refsi/hal_refsi/external/refsidrv/source/refsidrv/refsi_device_g.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
// does not have dedicated (TCIM) memory for storing kernel exeutables, a memory
2929
// window is set up to map this memory area to a reserved area in DMA.
3030
constexpr const uint64_t REFSI_ELF_BASE = 0x10000ull;
31-
// The upper region can be up to the tdcm start point at 0x10000000
32-
// We will make it approx 128MB to give some latitude
33-
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 27) - REFSI_ELF_BASE;
31+
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 20) - REFSI_ELF_BASE;
3432

3533
// Memory area for per-hart storage.
3634
constexpr const uint64_t G_HART_LOCAL_BASE = 0x20800000;

examples/refsi/hal_refsi/include/device/program.lds

+17-20
Original file line numberDiff line numberDiff line change
@@ -17,57 +17,57 @@
1717

1818
OUTPUT_ARCH( "riscv" )
1919

20+
MEMORY
21+
{
22+
mainmem : ORIGIN = 0x10000, LENGTH = (1 << 20)
23+
localmem : ORIGIN = 0x10000000, LENGTH = 0x200000
24+
}
25+
2026
SECTIONS
2127
{
2228

2329
/*--------------------------------------------------------------------*/
2430
/* Code and read-only segment */
2531
/*--------------------------------------------------------------------*/
2632

27-
/* Begining of code and text segment */
28-
. = 0x00010000;
29-
30-
.text :
31-
{
33+
.text : {
3234
*(.text.init)
33-
}
35+
} >mainmem
3436

3537
/* text: Program code section */
36-
.text :
38+
.text :
3739
{
3840
*(.text)
3941
*(.text.*)
4042
*(.gnu.linkonce.t.*)
41-
}
43+
} >mainmem
4244

4345
/* rodata: Read-only data */
44-
.rodata :
46+
.rodata :
4547
{
4648
*(.rdata)
4749
*(.rodata)
4850
*(.rodata.*)
4951
*(.gnu.linkonce.r.*)
50-
}
52+
} >mainmem
5153

5254
/* End of code and read-only segment */
53-
. = ALIGN(0x1000);
5455

5556
/*--------------------------------------------------------------------*/
5657
/* Initialized data segment */
5758
/*--------------------------------------------------------------------*/
5859

5960
/* data: Writable data */
60-
.data :
61+
.data ALIGN(0x1000) :
6162
{
6263
*(.data)
6364
*(.data.*)
6465
*(.srodata*)
6566
*(.gnu.linkonce.d.*)
6667
*(.comment)
67-
}
68+
} >mainmem
6869

6970
/* End of initialized data segment */
70-
. = ALIGN(16);
7171

7272
/*--------------------------------------------------------------------*/
7373
/* Uninitialized data segment */
@@ -81,26 +81,23 @@ SECTIONS
8181

8282
/* bss: Uninitialized writeable data section */
8383
. = .;
84-
.bss :
84+
.bss ALIGN(16) :
8585
{
8686
*(.bss)
8787
*(.bss.*)
8888
*(.sbss*)
8989
*(.gnu.linkonce.b.*)
9090
*(COMMON)
91-
}
91+
} >mainmem
9292

9393

9494
/*--------------------------------------------------------------------*/
9595
/* Local memory */
9696
/*--------------------------------------------------------------------*/
97-
98-
. = 0x10000000;
99-
10097
.local :
10198
{
10299
*(.local)
103-
}
100+
} >localmem
104101

105102
/DISCARD/ : { *(.note.gnu.build-id) }
106103
}

examples/refsi/hal_refsi/source/refsi_hal_g1.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
// does not have dedicated (TCIM) memory for storing kernel exeutables, a memory
3131
// window is set up to map this memory area to a reserved area in DMA.
3232
constexpr const uint64_t REFSI_ELF_BASE = 0x10000ull;
33-
// The upper region can be up to the tdcm start point at 0x10000000
34-
// We will make it approx 128MB to give some latitude
35-
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 27) - REFSI_ELF_BASE;
33+
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 20) - REFSI_ELF_BASE;
3634

3735
constexpr const uint64_t REFSI_MAX_HARTS = 64;
3836

examples/refsi/hal_refsi/source/refsi_hal_m1.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
// does not have dedicated (TCIM) memory for storing kernel exeutables, a memory
3030
// window is set up to map this memory area to a reserved area in DMA.
3131
constexpr const uint64_t REFSI_ELF_BASE = 0x10000ull;
32-
// The upper region can be up to the tdcm start point at 0x10000000
33-
// We will make it approx 128MB to give some latitude
34-
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 27) - REFSI_ELF_BASE;
32+
constexpr const uint64_t REFSI_ELF_SIZE = (1 << 20) - REFSI_ELF_BASE;
3533

3634
refsi_m1_hal_device::refsi_m1_hal_device(refsi_device_t device,
3735
riscv::hal_device_info_riscv_t *info,

0 commit comments

Comments
 (0)