diff --git a/sw/bootrom/build.sh b/sw/bootrom/build.sh index 248cd38..1d2094e 100755 --- a/sw/bootrom/build.sh +++ b/sw/bootrom/build.sh @@ -5,4 +5,4 @@ riscv64-elf-gcc -mabi=ilp32 -march=rv32i -nostdlib -nostartfiles -ffreestanding #riscv64-elf-objdump -D bootrom.elf riscv64-elf-objcopy -O binary bootrom.elf bootrom.bin od --endian=little -vtx4 -An -w4 bootrom.bin | tr -d ' ' > bootrom.vhex -r2 -A -c 'pdf @ sym._start' -q bootrom.elf +r2 -A -c 'pdf @ entry0' -q bootrom.elf diff --git a/sw/bootrom/main.c b/sw/bootrom/main.c index 00706e3..1b7fff1 100644 --- a/sw/bootrom/main.c +++ b/sw/bootrom/main.c @@ -7,16 +7,20 @@ #define UART0_SR_RX_DATA_EMPTY (1 << 0) #define UART0_SR_TX_FULL (1 << 1) -/* +//#define ENABLE_STACK + +#ifdef ENABLE_STACK // Set up stack pointer asm("_start:\ xor sp, sp, sp;\ lui sp, 0x40100;\ j main;\ "); -*/ +#else + #define main() _start() +#endif /* ifdef ENABLE_STACK */ -__attribute__((noreturn)) void _start() { +__attribute__((noreturn)) void main() { uint8_t state = 0; uint8_t c; uint8_t opcode;