Skip to content

Commit 62a6dbb

Browse files
committed
wip no stack issue
1 parent 027949c commit 62a6dbb

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

arch/riscv/Kconfig.socs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ config SOC_SPACEMIT_K1
2020
depends on ARCH_RV64I
2121
select HAS_DEBUG_LL
2222
select DEBUG_SPACEMIT_K1
23-
select RISCV_M_MODE
23+
select RISCV_S_MODE
24+
select RISCV_ICACHE
2425
select RISCV_TIMER
2526

2627
config BOARD_SPACEMIT_K1

arch/riscv/boards/spacemit_k1/lowlevel.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ ENTRY_FUNCTION(start_spacemit_k1, a0, a1, a2)
1212

1313
debug_ll_init();
1414

15-
if (a1 != 0xffffffff) {
15+
if (a1 && fdt_check_header((void *)a1) == 0) {
1616
fdt = (void *)a1;
1717
} else {
1818
fdt = __dtb_z_spacemit_k1_start + get_runtime_offset();
1919
}
2020

21-
barebox_riscv_supervisor_entry(0x80000000, SZ_128M, a0, fdt);
21+
22+
puthex_ll((unsigned long)fdt);
23+
putc_ll('\n');
24+
25+
barebox_riscv_supervisor_entry(0xC0020000, SZ_1G, a0, fdt);
2226
}

arch/riscv/boot/uncompress.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize,
3838
struct elf_image elf;
3939
int ret;
4040

41+
putc_ll('>');
4142
irq_init_vector(riscv_mode());
43+
putc_ll('<');
4244

4345
/* piggy data is not relocated, so determine the bounds now */
4446
pg_start = runtime_address(input_data);
@@ -51,10 +53,15 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize,
5153
* to the current address. Otherwise it may be a readonly location.
5254
* Copy and relocate to the start of the memory in this case.
5355
*/
54-
if (pc > membase && pc - membase < memsize)
56+
putc_ll('>');
57+
if (pc > membase && pc - membase < memsize) {
58+
putc_ll('1');
5559
relocate_to_current_adr();
56-
else
60+
}
61+
else {
62+
putc_ll('2');
5763
relocate_to_adr(membase);
64+
}
5865

5966
barebox_base = riscv_mem_barebox_image(membase, endmem,
6067
uncompressed_len + MAX_BSS_SIZE);

images/barebox-standalone.its

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
os = "barebox";
1313
arch = "riscv";
1414
compression = "none";
15-
load = <0x0 0x00200000>;
15+
load = <0x0 0x20000>;
1616
data = /incbin/("./barebox-spacemit-k1.img");
1717
hash-1 {
1818
algo = "crc32";

0 commit comments

Comments
 (0)