Skip to content

Commit

Permalink
Refactor bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
saursin committed Oct 14, 2023
1 parent 2cb7450 commit f177abd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions sw/bootloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ EXEC:= bootloader
RVPREFIX:= riscv64-unknown-elf

CFLAGS:= -mabi=ilp32 -march=rv32i -nostartfiles -ffreestanding -Os
CFLAGS+= -DENABLE_UART
CFLAGS+= -I $(RVATOM_LIB)/include
LFLAGS:= -L $(RVATOM_LIB)/ -T $(RVATOM_LIB)/link/link_bootloader.ld -lcatom -Xlinker -Map $(EXEC).map -Wl,--gc-sections

Expand Down
8 changes: 5 additions & 3 deletions sw/bootloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include "stdio.h"

// Enable Prints through UART
#define ENABLE_UART
// #define ENABLE_UART

// Clear screen at start of bootloader
#define CLS_AT_START
// #define CLS_AT_START

#ifdef ENABLE_UART
#define P(x) x
Expand All @@ -30,7 +30,7 @@ int main() {
#else
P(putchar('\n');)
#endif
P(puts("***** RISC-V Atom Bootloader *****\n");)
P(puts("*** RISC-V Atom Bootloader ***\n");)


// ********** Platform specific initialization **********
Expand All @@ -40,6 +40,8 @@ int main() {
goto panic;
}

P(puts("Jumping to target..\n------------------------------\n");)

// Jump
fnc_ptr app_main = (fnc_ptr) jump_addr;
app_main();
Expand Down

0 comments on commit f177abd

Please sign in to comment.