Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfb committed Mar 13, 2024
1 parent b2eb76a commit 3c26441
Show file tree
Hide file tree
Showing 10 changed files with 1,686 additions and 10 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ BINS := \
$(OUT)/os_sifive_u32 \
$(OUT)/os_hifive1_revb \
$(OUT)/os_ox64 \
$(OUT)/os_star64 \
$(OUT)/os_d1 \
$(OUT)/os_virt

Expand Down Expand Up @@ -113,6 +114,8 @@ OS_VIRT_DEPS = $(BASE_DEPS) \
src/vm.c
OS_OX64_DEPS = $(BASE_DEPS) \
src/machine/ox64/timer.c src/drivers/uart/uart-ox64.c
OS_STAR64_DEPS = $(BASE_DEPS) \
src/machine/star64/timer.c src/drivers/uart/uart-star64.c
OS_D1_DEPS = $(BASE_DEPS) \
src/machine/d1/timer.c src/drivers/uart/uart-d1.c

Expand Down Expand Up @@ -206,6 +209,18 @@ $(OUT)/os_ox64.bin: $(OUT)/os_ox64
$(OUT)/os_ox64.s: $(OUT)/os_ox64
$(RISCV64_OBJDUMP) --source --all-headers --demangle --line-numbers --wide -D $< > $@

$(OUT)/os_star64: ${OS_STAR64_DEPS}
$(RISCV64_GCC) -march=rv64g -mabi=lp64 $(GCC_FLAGS) \
-Wl,--defsym,RAM_START=0x80200000 -g \
-include include/machine/star64.h \
${OS_STAR64_DEPS} -o $@

$(OUT)/os_star64.bin: $(OUT)/os_star64
$(RISCV64_OBJCOPY) -O binary $< $@

$(OUT)/os_star64.s: $(OUT)/os_star64
$(RISCV64_OBJDUMP) --source --all-headers --demangle --line-numbers --wide -D $< > $@

$(OUT)/os_d1: ${OS_D1_DEPS}
$(RISCV64_GCC) -march=rv64g -mabi=lp64 $(GCC_FLAGS) \
-Wl,--defsym,RAM_START=0x40200000 -g \
Expand Down
25 changes: 25 additions & 0 deletions docs/star64-boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Booting Pine64 Star64

### Connecting

TODO

### Regular boot

1. Run picocom with gkermit (`scripts/star64-term.sh` does that)
1. Interrupt U-Boot into its shell
* i.e. hit any key when it does the countdown: `Hit any key to stop autoboot: 2`
1. Run `loadb <address> <baud>` in U-Boot shell:
* `loadb 80200000 115200`
1. When it says `Ready for binary (kermit) download to 0x80200000 at 115200 bps...`,
hit Ctrl-A, Ctrl-S to get it to prompt for a file, then type out the file name:
* `*** file: out/os_d1.bin`
1. When done loading, it will get back to U-Boot prompt, it’s time to boot:
* `booti 0x80200000 - fffc6aa0

Commands repeated here for more convenient copy-pasting:
```
loadb 80200000 115200
out/os_star64.bin
booti 0x80200000 - fffc6aa0
```
Loading

0 comments on commit 3c26441

Please sign in to comment.