Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sw/device/bootrom/bootrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <stdint.h>

#define MAJOR "00"
#define MINOR "01"
#define MINOR "02"
#define PATCH "00"

const uintptr_t boot_slots[] = { 0x10000000, 0x80000000 };
Expand Down Expand Up @@ -45,6 +45,7 @@ static void clear_slots();
// TODO: Add support to cheri mode
int boot_main(void)
{
uint32_t boot_addr;
struct boot_context boot_ctx = (struct boot_context){
.console = mocha_system_uart(),
.timer = mocha_system_timer(),
Expand All @@ -56,14 +57,13 @@ int boot_main(void)

timer_init(boot_ctx.timer);
timer_enable_write(boot_ctx.timer, true);
if (bootstrap_requested(&boot_ctx)) {
if (bootstrap_requested(&boot_ctx) || !get_boot_addr(&boot_addr)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break the opensbi flow in simulation because it doesn't have the magic number. We need to figure out a better solution.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we flash the LEDs inside the exception handler?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree that is a better solution!

uprintf(boot_ctx.console, "Entering SPI bootstrap\n");
clear_slots(); // Cleaning slots from previeous boot.
// Spin polling the spi_dev and processing incoming data until a reset command is received.
spi_boot_strap(&boot_ctx);
}

uint32_t boot_addr;
if (!get_boot_addr(&boot_addr)) {
uprintf(boot_ctx.console, "No valid slot found, default to DRAM\n");
boot_addr = dram_base;
Expand Down