Remove K210 support.
This commit is contained in:
parent
a279615610
commit
82aff1d510
5 changed files with 6 additions and 95 deletions
36
os/Makefile
36
os/Makefile
|
@ -6,10 +6,9 @@ KERNEL_BIN := $(KERNEL_ELF).bin
|
|||
DISASM_TMP := target/$(TARGET)/$(MODE)/asm
|
||||
|
||||
# BOARD
|
||||
BOARD ?= qemu
|
||||
BOARD := qemu
|
||||
SBI ?= rustsbi
|
||||
BOOTLOADER := ../bootloader/$(SBI)-$(BOARD).bin
|
||||
K210_BOOTLOADER_SIZE := 131072
|
||||
|
||||
# Building mode argument
|
||||
ifeq ($(MODE), release)
|
||||
|
@ -17,15 +16,7 @@ ifeq ($(MODE), release)
|
|||
endif
|
||||
|
||||
# KERNEL ENTRY
|
||||
ifeq ($(BOARD), qemu)
|
||||
KERNEL_ENTRY_PA := 0x80200000
|
||||
else ifeq ($(BOARD), k210)
|
||||
KERNEL_ENTRY_PA := 0x80020000
|
||||
endif
|
||||
|
||||
# Run K210
|
||||
K210-SERIALPORT = /dev/ttyUSB0
|
||||
K210-BURNER = ../tools/kflash.py
|
||||
KERNEL_ENTRY_PA := 0x80200000
|
||||
|
||||
# Binutils
|
||||
OBJDUMP := rust-objdump --arch-name=riscv64
|
||||
|
@ -34,14 +25,7 @@ OBJCOPY := rust-objcopy --binary-architecture=riscv64
|
|||
# Disassembly
|
||||
DISASM ?= -x
|
||||
|
||||
build: env switch-check $(KERNEL_BIN)
|
||||
|
||||
switch-check:
|
||||
ifeq ($(BOARD), qemu)
|
||||
(which last-qemu) || (rm -f last-k210 && touch last-qemu && make clean)
|
||||
else ifeq ($(BOARD), k210)
|
||||
(which last-k210) || (rm -f last-qemu && touch last-k210 && make clean)
|
||||
endif
|
||||
build: env $(KERNEL_BIN)
|
||||
|
||||
env:
|
||||
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
|
||||
|
@ -56,7 +40,7 @@ kernel:
|
|||
@cd ../user && make build
|
||||
@echo Platform: $(BOARD)
|
||||
@cp src/linker-$(BOARD).ld src/linker.ld
|
||||
@cargo build $(MODE_ARG) --features "board_$(BOARD)"
|
||||
@cargo build $(MODE_ARG)
|
||||
@rm src/linker.ld
|
||||
|
||||
clean:
|
||||
|
@ -75,21 +59,11 @@ run: run-inner
|
|||
|
||||
|
||||
run-inner: build
|
||||
ifeq ($(BOARD),qemu)
|
||||
@qemu-system-riscv64 \
|
||||
-machine virt \
|
||||
-nographic \
|
||||
-bios $(BOOTLOADER) \
|
||||
-device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA)
|
||||
else
|
||||
(which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools)
|
||||
@cp $(BOOTLOADER) $(BOOTLOADER).copy
|
||||
@dd if=$(KERNEL_BIN) of=$(BOOTLOADER).copy bs=$(K210_BOOTLOADER_SIZE) seek=1
|
||||
@mv $(BOOTLOADER).copy $(KERNEL_BIN)
|
||||
@sudo chmod 777 $(K210-SERIALPORT)
|
||||
python3 $(K210-BURNER) -p $(K210-SERIALPORT) -b 1500000 $(KERNEL_BIN)
|
||||
python3 -m serial.tools.miniterm --eol LF --dtr 0 --rts 0 --filter direct $(K210-SERIALPORT) 115200
|
||||
endif
|
||||
|
||||
debug: build
|
||||
@tmux new-session -d \
|
||||
|
@ -103,4 +77,4 @@ gdbserver: build
|
|||
gdbclient:
|
||||
@riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'
|
||||
|
||||
.PHONY: build env kernel clean disasm disasm-vim run-inner switch-check gdbserver gdbclient
|
||||
.PHONY: build env kernel clean disasm disasm-vim run-inner gdbserver gdbclient
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue