1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-27 04:29:03 +00:00

rename bootloader to boardloader

This commit is contained in:
Pavol Rusnak 2017-04-10 19:11:44 +02:00
parent b412ef4b24
commit 0633506166
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
10 changed files with 30 additions and 30 deletions

View File

@ -18,7 +18,7 @@ script:
- make build_cross - make build_cross
- make build_bootloader - make build_boardloader
- make build_loader - make build_loader

View File

@ -3,7 +3,7 @@
JOBS=4 JOBS=4
MAKE=make -j $(JOBS) MAKE=make -j $(JOBS)
BOOTLOADER_BUILD_DIR=micropython/bootloader/build BOARDLOADER_BUILD_DIR=micropython/boardloader/build
LOADER_BUILD_DIR=micropython/loader/build LOADER_BUILD_DIR=micropython/loader/build
FIRMWARE_BUILD_DIR=micropython/firmware/build FIRMWARE_BUILD_DIR=micropython/firmware/build
@ -42,10 +42,10 @@ testpy: ## run selected unit tests from python-trezor
## build commands: ## build commands:
build: build_bootloader build_loader build_firmware build_unix build_cross ## build all build: build_boardloader build_loader build_firmware build_unix build_cross ## build all
build_bootloader: ## build bootloader build_boardloader: ## build boardloader
$(MAKE) -f Makefile.bootloader $(TREZORHAL_PORT_OPTS) $(MAKE) -f Makefile.boardloader $(TREZORHAL_PORT_OPTS)
build_loader: ## build loader build_loader: ## build loader
$(MAKE) -f Makefile.loader $(TREZORHAL_PORT_OPTS) $(MAKE) -f Makefile.loader $(TREZORHAL_PORT_OPTS)
@ -63,10 +63,10 @@ build_cross: ## build mpy-cross port
## clean commands: ## clean commands:
clean: clean_bootloader clean_loader clean_firmware clean_unix clean_cross ## clean all clean: clean_boardloader clean_loader clean_firmware clean_unix clean_cross ## clean all
clean_bootloader: ## clean bootloader build clean_boardloader: ## clean boardloader build
$(MAKE) -f Makefile.bootloader clean $(TREZORHAL_PORT_OPTS) $(MAKE) -f Makefile.boardloader clean $(TREZORHAL_PORT_OPTS)
clean_loader: ## clean loader build clean_loader: ## clean loader build
$(MAKE) -f Makefile.loader clean $(TREZORHAL_PORT_OPTS) $(MAKE) -f Makefile.loader clean $(TREZORHAL_PORT_OPTS)
@ -84,10 +84,10 @@ clean_cross: ## clean mpy-cross build
## flash commands: ## flash commands:
flash: flash_bootloader flash_loader flash_firmware ## flash everything using st-flash flash: flash_boardloader flash_loader flash_firmware ## flash everything using st-flash
flash_bootloader: ## flash bootloader using st-flash flash_boardloader: ## flash boardloader using st-flash
st-flash write $(BOOTLOADER_BUILD_DIR)/bootloader.bin 0x08000000 st-flash write $(BOARDLOADER_BUILD_DIR)/boardloader.bin 0x08000000
flash_loader: ## flash loader using st-flash flash_loader: ## flash loader using st-flash
st-flash write $(LOADER_BUILD_DIR)/loader.bin 0x08010000 st-flash write $(LOADER_BUILD_DIR)/loader.bin 0x08010000

View File

@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython SRCDIR_FW = micropython
# target directory # target directory
BUILD ?= micropython/bootloader/build BUILD ?= micropython/boardloader/build
TARGET ?= bootloader TARGET ?= boardloader
# include py core make definitions # include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk include $(SRCDIR_MP)/py/mkenv.mk
@ -56,7 +56,7 @@ OBJ_HAL += $(addprefix $(BUILD_MP)/,\
# OBJ micropython/ # OBJ micropython/
OBJ_FW += $(addprefix $(BUILD_FW)/, \ OBJ_FW += $(addprefix $(BUILD_FW)/, \
bootloader/main.o \ boardloader/main.o \
extmod/modtrezorui/display.o \ extmod/modtrezorui/display.o \
extmod/modtrezorui/font_bitmap.o \ extmod/modtrezorui/font_bitmap.o \
trezorhal/common.o \ trezorhal/common.o \
@ -95,7 +95,7 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
CROSS_COMPILE = arm-none-eabi- CROSS_COMPILE = arm-none-eabi-
INC += -I. INC += -I.
INC += -I$(SRCDIR_FW)/bootloader INC += -I$(SRCDIR_FW)/boardloader
INC += -I$(SRCDIR_FW)/extmod/modtrezorui INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal INC += -I$(SRCDIR_FW)/trezorhal/hal
@ -121,7 +121,7 @@ CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/bootloader/memory.ld -Map=$@.map --cref LDFLAGS = -nostdlib -T $(SRCDIR_FW)/boardloader/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image # remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections

View File

@ -2,14 +2,14 @@
TREZOR initialization in split into two stages. See [Memory Layout](memory.md) for info about in which sectors each stage is stored. TREZOR initialization in split into two stages. See [Memory Layout](memory.md) for info about in which sectors each stage is stored.
First stage (bootloader) is stored in write-protected area, which means it is non-upgradable. First stage (boardloader) is stored in write-protected area, which means it is non-upgradable.
Only second stage (loader) update is allowed. Only second stage (loader) update is allowed.
## First Stage - Bootloader ## First Stage - Boardloader
First stage checks the integrity and signatures of the second stage and runs it if everything is OK. First stage checks the integrity and signatures of the second stage and runs it if everything is OK.
If first stage bootloader finds a valid second stage loader image on the SD card (in raw format, no filesystem), If first stage boardloader finds a valid second stage loader image on the SD card (in raw format, no filesystem),
it will replace the internal second stage, allowing a second stage update via SD card. it will replace the internal second stage, allowing a second stage update via SD card.
## Second Stage - Loader ## Second Stage - Loader

View File

@ -4,8 +4,8 @@
| sector | range | size | function | sector | range | size | function
|-----------|-------------------------|--------:|---------------------- |-----------|-------------------------|--------:|----------------------
| Sector 0 | 0x08000000 - 0x08003FFF | 16 KiB | bootloader (1st stage) (write-protected) | Sector 0 | 0x08000000 - 0x08003FFF | 16 KiB | boardloader (1st stage) (write-protected)
| Sector 1 | 0x08004000 - 0x08007FFF | 16 KiB | bootloader (1st stage) (write-protected) | Sector 1 | 0x08004000 - 0x08007FFF | 16 KiB | boardloader (1st stage) (write-protected)
| Sector 2 | 0x08008000 - 0x0800BFFF | 16 KiB | storage area | Sector 2 | 0x08008000 - 0x0800BFFF | 16 KiB | storage area
| Sector 3 | 0x0800C000 - 0x0800FFFF | 16 KiB | storage area | Sector 3 | 0x0800C000 - 0x0800FFFF | 16 KiB | storage area
| Sector 4 | 0x08010000 - 0x0801FFFF | 64 KiB | loader (2nd stage) | Sector 4 | 0x08010000 - 0x0801FFFF | 64 KiB | loader (2nd stage)

View File

@ -56,7 +56,7 @@ bool copy_sdcard(void)
DPRINT("erasing flash "); DPRINT("erasing flash ");
// erase flash (except bootloader) // erase flash (except boardloader)
HAL_FLASH_Unlock(); HAL_FLASH_Unlock();
FLASH_EraseInitTypeDef EraseInitStruct; FLASH_EraseInitTypeDef EraseInitStruct;
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |
@ -142,7 +142,7 @@ void check_and_jump(void)
int main(void) int main(void)
{ {
SCB->VTOR = BOOTLOADER_START; SCB->VTOR = BOARDLOADER_START;
periph_init(); periph_init();
if (0 != display_init()) { if (0 != display_init()) {
@ -160,9 +160,9 @@ int main(void)
display_clear(); display_clear();
display_backlight(255); display_backlight(255);
DPRINTLN("TREZOR Bootloader " VERSION_STR); DPRINTLN("TREZOR Boardloader " VERSION_STR);
DPRINTLN("================="); DPRINTLN("==================");
DPRINTLN("starting bootloader"); DPRINTLN("starting boardloader");
if (check_sdcard()) { if (check_sdcard()) {
if (!copy_sdcard()) { if (!copy_sdcard()) {

View File

@ -3,10 +3,10 @@
#include <stdint.h> #include <stdint.h>
#define BOOTLOADER_START 0x08000000 #define BOARDLOADER_START 0x08000000
#define LOADER_START 0x08010000 #define LOADER_START 0x08010000
#define FIRMWARE_START 0x08020000 #define FIRMWARE_START 0x08020000
#define HEADER_SIZE 0x200 #define HEADER_SIZE 0x200
void periph_init(void); void periph_init(void);