mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-11-28 11:21:45 -05:00
build: Create and use a complete filesystem image
- Create a flash image in flash_image.bin, useful for both a real TKey and QEMU. - Use flash_image.bin directly in prog_flash for a real TKey, which also flashes the bitstream. - Remove building of tools/default_partition.bin. - Update documentation about the tool use. - We keep the load_preloaded_app.sh for development purposes, but it's no longer used in the build.
This commit is contained in:
parent
65ff0a5d61
commit
90a91ba1ba
3 changed files with 20 additions and 20 deletions
|
|
@ -126,8 +126,7 @@ PICORV32_SRCS = \
|
||||||
|
|
||||||
FIRMWARE_DEPS = \
|
FIRMWARE_DEPS = \
|
||||||
$(P)/fw/tk1/proto.h \
|
$(P)/fw/tk1/proto.h \
|
||||||
$(P)/fw/tk1/mgmt_app_digest.h \
|
$(P)/fw/tk1/mgmt_app_digest.h
|
||||||
tools/default_partition.bin
|
|
||||||
|
|
||||||
FIRMWARE_OBJS = \
|
FIRMWARE_OBJS = \
|
||||||
$(P)/fw/tk1/main.o \
|
$(P)/fw/tk1/main.o \
|
||||||
|
|
@ -220,15 +219,15 @@ tkey-libs:
|
||||||
$(DEFAULT_APP):
|
$(DEFAULT_APP):
|
||||||
make -C apps
|
make -C apps
|
||||||
|
|
||||||
# Partititon table for the firmware's filesystem
|
# Build a complete filesystem image
|
||||||
tools/default_partition.bin: tools/tkeyimage/tkeyimage $(DEFAULT_APP)
|
flash_image.bin: tools/tkeyimage/tkeyimage $(DEFAULT_APP)
|
||||||
./tools/tkeyimage/tkeyimage -app0 $(DEFAULT_APP) -o $@
|
./tools/tkeyimage/tkeyimage -f -app0 $(DEFAULT_APP) -o $@
|
||||||
|
|
||||||
$(FIRMWARE_OBJS): $(FIRMWARE_DEPS)
|
$(FIRMWARE_OBJS): $(FIRMWARE_DEPS)
|
||||||
$(TESTFW_OBJS): $(FIRMWARE_DEPS)
|
$(TESTFW_OBJS): $(FIRMWARE_DEPS)
|
||||||
|
|
||||||
#firmware.elf: CFLAGS += -DTKEY_DEBUG
|
#firmware.elf: CFLAGS += -DTKEY_DEBUG
|
||||||
firmware.elf: tkey-libs $(FIRMWARE_OBJS) $(P)/fw/tk1/firmware.lds
|
firmware.elf: tkey-libs $(FIRMWARE_OBJS) $(P)/fw/tk1/firmware.lds flash_image.bin
|
||||||
$(CC) $(CFLAGS) $(FIRMWARE_OBJS) $(LDFLAGS) -o $@ > $(basename $@).map
|
$(CC) $(CFLAGS) $(FIRMWARE_OBJS) $(LDFLAGS) -o $@ > $(basename $@).map
|
||||||
|
|
||||||
simfirmware.elf: CFLAGS += -DSIMULATION
|
simfirmware.elf: CFLAGS += -DSIMULATION
|
||||||
|
|
@ -239,7 +238,7 @@ qemu_firmware.elf: CFLAGS += -DQEMU_DEBUG
|
||||||
qemu_firmware.elf: ASFLAGS += -DQEMU_DEBUG
|
qemu_firmware.elf: ASFLAGS += -DQEMU_DEBUG
|
||||||
qemu_firmware.elf: CFLAGS += -DQEMU_SYSCALL
|
qemu_firmware.elf: CFLAGS += -DQEMU_SYSCALL
|
||||||
qemu_firmware.elf: ASFLAGS += -DQEMU_SYSCALL
|
qemu_firmware.elf: ASFLAGS += -DQEMU_SYSCALL
|
||||||
qemu_firmware.elf: tkey-libs $(FIRMWARE_OBJS) $(P)/fw/tk1/qemu_firmware.lds
|
qemu_firmware.elf: tkey-libs $(FIRMWARE_OBJS) $(P)/fw/tk1/qemu_firmware.lds flash_image.bin
|
||||||
$(CC) $(CFLAGS) $(FIRMWARE_OBJS) $(QEMU_LDFLAGS) -o $@ > $(basename $@).map
|
$(CC) $(CFLAGS) $(FIRMWARE_OBJS) $(QEMU_LDFLAGS) -o $@ > $(basename $@).map
|
||||||
|
|
||||||
# Generate the file containing the digest for the obligatory default
|
# Generate the file containing the digest for the obligatory default
|
||||||
|
|
@ -504,9 +503,9 @@ tb_application_fpga: $(SIM_VERILOG_SRCS) \
|
||||||
# FPGA device programming.
|
# FPGA device programming.
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
prog_flash: check-hardware application_fpga.bin tools/default_partition.bin
|
prog_flash: check-hardware application_fpga.bin flash_image.bin
|
||||||
|
tillitis-iceprog flash_image.bin
|
||||||
tillitis-iceprog application_fpga.bin
|
tillitis-iceprog application_fpga.bin
|
||||||
(cd tools && ./load_preloaded_app.sh 0 $(DEFAULT_APP))
|
|
||||||
.PHONY: prog_flash
|
.PHONY: prog_flash
|
||||||
|
|
||||||
prog_flash_bs: check-hardware application_fpga.bin
|
prog_flash_bs: check-hardware application_fpga.bin
|
||||||
|
|
@ -546,7 +545,7 @@ clean: clean_sim clean_fw clean_tb
|
||||||
rm -rf tools/tpt/__pycache__
|
rm -rf tools/tpt/__pycache__
|
||||||
make -C apps clean
|
make -C apps clean
|
||||||
rm -f fw/tk1/mgmt_app_digest.h
|
rm -f fw/tk1/mgmt_app_digest.h
|
||||||
rm -f tools/default_partition.bin
|
rm -f flash_image.bin
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -784,10 +784,7 @@ There are a couple of test apps, see `../apps`.
|
||||||
The TKey supports a simple filesystem.
|
The TKey supports a simple filesystem.
|
||||||
|
|
||||||
The `tkeyimage` tool is used to parse or generate partition table or
|
The `tkeyimage` tool is used to parse or generate partition table or
|
||||||
entire filesystems for the TKey.
|
entire filesystem images for the TKey.
|
||||||
|
|
||||||
The table and the pre-loaded app can loaded on flash with the
|
|
||||||
`load_preloaded_app.sh` tool.
|
|
||||||
|
|
||||||
The fileystem layout looks like this:
|
The fileystem layout looks like this:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,15 @@ We have developed some tools necessary for the build.
|
||||||
- `b2s`: Compute and print a BLAKE2s digest over a file. Used for the
|
- `b2s`: Compute and print a BLAKE2s digest over a file. Used for the
|
||||||
digest of the app in app slot 0 included in the firmware.
|
digest of the app in app slot 0 included in the firmware.
|
||||||
|
|
||||||
- `default_partition.bin`: Default partition table for the flash.
|
|
||||||
|
|
||||||
- `load_preloaded_app.sh`: Script to load two copies of the partition
|
- `load_preloaded_app.sh`: Script to load two copies of the partition
|
||||||
table to flash and a pre-loaded to app slot 0 or 1. Needs
|
table to flash and a pre-loaded to app slot 0 or 1. Needs
|
||||||
`default_partition.bin`, generated with `tkeyimage` and the binary
|
`default_partition.bin`, generated with `tkeyimage` and the binary
|
||||||
of the device app to load. Call like: `./load_preloaded_app 0
|
of the device app to load. Call like:
|
||||||
path/to/binary`.
|
|
||||||
|
```
|
||||||
|
./tkeyimage/tkeyimage -app0 path/to/binary -o default_partition.bin
|
||||||
|
./load_preloaded_app 0 path/to/binary
|
||||||
|
```
|
||||||
|
|
||||||
- `makehex.py`: Used to build hex version of firmware ROM for FPGA
|
- `makehex.py`: Used to build hex version of firmware ROM for FPGA
|
||||||
bitstream build.
|
bitstream build.
|
||||||
|
|
@ -26,8 +28,10 @@ We have developed some tools necessary for the build.
|
||||||
- `run_pnr.sh`: Script to run place and route with `nextpnr` in order
|
- `run_pnr.sh`: Script to run place and route with `nextpnr` in order
|
||||||
to find a routing seed that will meet desired timing.
|
to find a routing seed that will meet desired timing.
|
||||||
|
|
||||||
- `tkeyimage`: Utility to create and parse flash images with a TKey
|
- `tkeyimage`: Utility to create and parse a partition table or entire
|
||||||
filesystem or the partition table
|
flash images with a TKey filesystem. You can flash the image with
|
||||||
|
the [iceprog tool](https://github.com/tillitis/icestorm/). Remember
|
||||||
|
to flash the flash image first and the FPGA bitstream afterwards.
|
||||||
|
|
||||||
- `tpt/tpt.py`: Utility to create the Unique Device Secret (UDS) and
|
- `tpt/tpt.py`: Utility to create the Unique Device Secret (UDS) and
|
||||||
Unique Device Identity (UDI) interactively.
|
Unique Device Identity (UDI) interactively.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue