Skip to content

Commit

Permalink
Merge pull request #89 from P-Miranda/boot-flash
Browse files Browse the repository at this point in the history
feat(Flash): boot from flash
  • Loading branch information
jjts authored May 31, 2024
2 parents c6f1ec6 + ef9feb0 commit 617d141
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
- name: test baremetal
run: make fpga-run RUN_LINUX=0 BOARD=AES-KU040-DB-G
- name: test linux
run: make test-linux-fpga-connect BOARD=AES-KU040-DB-G
run: make test-linux-fpga-connect BOARD=AES-KU040-DB-G BOOT_FLOW=FLASH_TO_EXTMEM

## doc:
## runs-on: self-hosted
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include $(LIB_DIR)/setup.mk
INIT_MEM ?= 0
RUN_LINUX ?= 1
USE_EXTMEM := 1
BOOT_FLOW ?= CONSOLE_TO_EXTMEM

ifeq ($(INIT_MEM),1)
SETUP_ARGS += INIT_MEM
Expand Down Expand Up @@ -39,12 +40,12 @@ sim-test-spi:
fpga-run:
nix-shell --run 'make clean setup INIT_MEM=$(INIT_MEM) USE_EXTMEM=$(USE_EXTMEM)'
nix-shell --run 'make -C ../$(CORE)_V*/ fpga-fw-build BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX)'
make -C ../$(CORE)_V*/ fpga-run BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX)
make -C ../$(CORE)_V*/ fpga-run BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX) BOOT_FLOW=$(BOOT_FLOW)

fpga-connect:
nix-shell --run 'make -C ../$(CORE)_V*/ fpga-fw-build BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX)'
# Should run under 'bash', running with 'fish' as a shell gives an error
make -C ../$(CORE)_V*/ fpga-run BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX)
make -C ../$(CORE)_V*/ fpga-run BOARD=$(BOARD) RUN_LINUX=$(RUN_LINUX) BOOT_FLOW=$(BOOT_FLOW)

fpga-test:
make clean setup fpga-run INIT_MEM=0
Expand All @@ -58,6 +59,6 @@ test-all:
test-linux-fpga-connect: build_dir_name
-rm $(BUILD_DIR)/hardware/fpga/test.log
-ln -s minicom_test1.txt $(BUILD_DIR)/hardware/fpga/minicom_linux_script.txt
make fpga-connect RUN_LINUX=1
make fpga-connect RUN_LINUX=1 BOOT_FLOW=$(BOOT_FLOW)

.PHONY: sim-test fpga-test test-all test-linux-fpga-connect
3 changes: 3 additions & 0 deletions hardware/simulation/sim_build.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Add iob_soc_opencryptolinux software as a build dependency
HEX+=iob_soc_opencryptolinux_boot.hex iob_soc_opencryptolinux_firmware.hex
HEX+=boot_flow

ROOT_DIR :=../..
include $(ROOT_DIR)/software/sw_build.mk
Expand All @@ -23,3 +24,5 @@ GRAB_TIMEOUT ?= 7200
TEST_LIST+=test1
test1:
make -C ../../ fw-clean SIMULATOR=$(SIMULATOR) && make -C ../../ sim-clean SIMULATOR=$(SIMULATOR) && make run SIMULATOR=$(SIMULATOR)

.PHONY: boot_flow
2 changes: 2 additions & 0 deletions iob_soc_opencryptolinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ def _post_setup(cls):
# Set custom ethernet CONSOLE_CMD
contents.append(
f"""
RUN_DEPS+=boot_flow
GRAB_TIMEOUT = 600
### Launch minicom if running Linux
# pass CI variable over ssh commands
UFLAGS+=CI=$(CI)
UFLAGS+=BOOT_FLOW=$(BOOT_FLOW)
ifeq ($(shell grep -o rootfs.cpio.gz ../{cls.name}_mem.config),rootfs.cpio.gz)
ifneq ($(wildcard minicom_linux_script.txt),)
SCRIPT_STR:=-S minicom_linux_script.txt
Expand Down
Loading

0 comments on commit 617d141

Please sign in to comment.