diff --git a/kernel/crt0.S b/kernel/crt0.S index e003faf..5e71de9 100644 --- a/kernel/crt0.S +++ b/kernel/crt0.S @@ -33,6 +33,14 @@ pos_init_entry: csrr a0, 0xF14 andi a1, a0, 0x1f srli a0, a0, 5 +#ifdef ARCHI_CL_BOOT + + li a2, ARCHI_FC_CID + beq a0, a2, do_cl_boot + bnez a1, pe_start + +#else + #ifdef ARCHI_FC_CID li a2, ARCHI_FC_CID bne a0, a2, pe_start @@ -41,6 +49,8 @@ pos_init_entry: #endif #endif +#endif + # Clear the bss segment @@ -155,4 +165,17 @@ pe_start: mul x1, x3, a1 add x2, x2, x1 j cluster_entry_stub -#endif \ No newline at end of file +#endif + +do_cl_boot: + li x2, 0x10200000 + li x3, 0x1 + la x4, _start + sw x4, 0x40(x2) + sw x3, 8(x2) + +loop: + li x2, 0x1a109800 + sw x0, 0(x2) + wfi + j loop \ No newline at end of file diff --git a/rules/pulpos/default_rules.mk b/rules/pulpos/default_rules.mk index b3e60bc..b1328cf 100644 --- a/rules/pulpos/default_rules.mk +++ b/rules/pulpos/default_rules.mk @@ -75,6 +75,10 @@ ifdef CONFIG_NO_FC PULP_CFLAGS += -DARCHI_NO_FC=1 endif +ifdef CONFIG_CL_BOOT +PULP_CFLAGS += -DARCHI_CL_BOOT=1 +endif + ifdef CONFIG_IO_UART PULP_CFLAGS += -DCONFIG_IO_UART=$(CONFIG_IO_UART) endif