forked from sycuricon/starship
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using maskrom as first stage bootloader
- Loading branch information
1 parent
bf9b5f8
commit a58482a
Showing
27 changed files
with
91 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
fsbl/sdboot/linker/memory.lds → firmware/fsbl/linker/memory.lds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
MEMORY | ||
{ | ||
bootrom_mem (rx) : ORIGIN = 0x10000, LENGTH = 0x2000 | ||
bootrom_mem (rx) : ORIGIN = 0x20000, LENGTH = 0x2000 | ||
memory_mem (rwx) : ORIGIN = 0x80000000, LENGTH = 0x40000000 | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ROOT_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
BUILD_DIR := $(ROOT_DIR)/build/firmware/zsbl | ||
|
||
GCC = riscv64-unknown-elf-gcc | ||
OBJCOPY = riscv64-unknown-elf-objcopy | ||
|
||
elf := $(BUILD_DIR)/bootrom.elf | ||
bin := $(BUILD_DIR)/bootrom.bin | ||
img := $(BUILD_DIR)/bootrom.img | ||
|
||
all: $(img) | ||
|
||
elf: $(elf) | ||
$(elf): bootrom.S linker.ld | ||
mkdir -p $(BUILD_DIR) | ||
$(GCC) -Tlinker.ld $< -nostdlib -static -Wl,--no-gc-sections -o $@ | ||
|
||
bin:$(bin) | ||
$(bin): $(elf) | ||
mkdir -p $(BUILD_DIR) | ||
$(OBJCOPY) -O binary $< $@ | ||
|
||
img:$(img) | ||
$(img): $(bin) | ||
mkdir -p $(BUILD_DIR) | ||
dd if=$< of=$@ bs=128 count=1 | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#define ROM_BASE 0x20000 | ||
|
||
.section .text.start, "ax", @progbits | ||
.globl _start | ||
_start: | ||
csrwi 0x7c1, 0 // disable chicken bits | ||
li s0, ROM_BASE | ||
csrr a0, mhartid | ||
li a1, 0 | ||
jr s0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SECTIONS | ||
{ | ||
START_ADDRESS = 0x10000; /* ... but actually position independent */ | ||
|
||
. = START_ADDRESS; | ||
.text.start : { *(.text.start) } | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters