1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-31 18:40:56 +00:00

Disable fastflash.

It doesn't make sense any more and doesn't work with newer bootloaders.
This commit is contained in:
Jochen Hoenicke 2018-03-23 13:10:04 +01:00 committed by Pavol Rusnak
parent 4ebbe8c274
commit 2587e49843
10 changed files with 2 additions and 153 deletions

View File

@ -16,10 +16,8 @@ env:
- PYTHON=python3
- PROTOBUF_VERSION=3.4.0
matrix:
- DEBUG_LINK=0 FASTFLASH=0
- DEBUG_LINK=1 FASTFLASH=0
- DEBUG_LINK=0 FASTFLASH=1
- DEBUG_LINK=1 FASTFLASH=1
- DEBUG_LINK=0
- DEBUG_LINK=1
matrix:
include:

View File

@ -1,22 +0,0 @@
APPVER = fastflash
NAME = bootloader
OBJS += bootloader.o
OBJS += signatures.o
OBJS += usb.o
OBJS += ../vendor/trezor-crypto/bignum.small.o
OBJS += ../vendor/trezor-crypto/ecdsa.small.o
OBJS += ../vendor/trezor-crypto/secp256k1.small.o
OBJS += ../vendor/trezor-crypto/sha2.small.o
OBJS += ../vendor/trezor-crypto/memzero.small.o
CFLAGS += -DUSE_PRECOMPUTED_IV=0
CFLAGS += -DUSE_PRECOMPUTED_CP=0
OPTFLAGS ?= -Os
include ../Makefile.include
CFLAGS += -I../bootloader

View File

@ -1 +0,0 @@
../bootloader/bootloader.c

View File

@ -1,28 +0,0 @@
/*
* This file is part of the TREZOR project, https://trezor.io/
*
* Copyright (C) 2017 Saleem Rashid <trezor@saleemrashid.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
int signatures_ok(uint8_t *store_hash)
{
(void) store_hash;
return false;
}

View File

@ -1 +0,0 @@
../bootloader/usb.c

View File

@ -1,10 +1,5 @@
APPVER = 1.0.0
ifeq ($(FASTFLASH),1)
OBJS += fastflash.o
OBJS += bootloader.o
endif
NAME = trezor
ifeq ($(EMULATOR),1)
@ -87,12 +82,6 @@ OBJS += protob/types.pb.o
include ../Makefile.include
ifeq ($(FASTFLASH),1)
CFLAGS += -DFASTFLASH=1
else
CFLAGS += -DFASTFLASH=0
endif
DEBUG_LINK ?= 0
DEBUG_LOG ?= 0
@ -105,13 +94,6 @@ CFLAGS += -DSCM_REVISION='"$(shell git rev-parse HEAD | sed 's:\(..\):\\x\1:g')"
CFLAGS += -DUSE_ETHEREUM=1
CFLAGS += -DUSE_NEM=1
bootloader.o: ../fastflash/bootloader.bin
$(OBJCOPY) -I binary -O elf32-littlearm -B arm \
--redefine-sym _binary_$(shell echo -n "$<" | tr -c "[:alnum:]" "_")_start=__bootloader_start__ \
--redefine-sym _binary_$(shell echo -n "$<" | tr -c "[:alnum:]" "_")_size=__bootloader_size__ \
--rename-section .data=.rodata \
$< $@
coins_count.h: coins-gen.py coins.json
$(PYTHON) $< count > $@

View File

@ -1,41 +0,0 @@
/*
* This file is part of the TREZOR project, https://trezor.io/
*
* Copyright (C) 2017 Saleem Rashid <trezor@saleemrashid.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "fastflash.h"
#include "util.h"
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#define bootloader_vec ((vector_table_t *) 0x20000000)
void __attribute__((noreturn)) run_bootloader(void)
{
extern uint8_t __bootloader_start__[];
extern uint8_t __bootloader_size__[];
// zero out SRAM
memset_reg(_ram_start, _ram_end, 0);
// copy bootloader
memcpy(bootloader_vec, __bootloader_start__, (size_t) __bootloader_size__);
jump_to_firmware(bootloader_vec, FW_TRUSTED);
}

View File

@ -1,25 +0,0 @@
/*
* This file is part of the TREZOR project, https://trezor.io/
*
* Copyright (C) 2017 Saleem Rashid <trezor@saleemrashid.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FASTFLASH_H__
#define __FASTFLASH_H__
void __attribute__((noreturn)) run_bootloader(void);
#endif

View File

@ -31,7 +31,6 @@
#include "buttons.h"
#include "gettext.h"
#include "bl_check.h"
#include "fastflash.h"
/* Screen timeout */
uint32_t system_millis_lock_start;
@ -97,13 +96,6 @@ int main(void)
__stack_chk_guard = random32(); // this supports compiler provided unpredictable stack protection checks
#endif
#if FASTFLASH
uint16_t state = gpio_port_read(BTN_PORT);
if ((state & BTN_PIN_NO) == 0) {
run_bootloader();
}
#endif
timer_init();
#ifdef APPVER

View File

@ -14,11 +14,6 @@ else
fi
make
if [ "$FASTFLASH" = 1 ]; then
make -C fastflash
fi
make -C bootloader
make -C vendor/nanopb/generator/proto
make -C firmware/protob