diff --git a/.gitmodules b/.gitmodules index 87453ddb1..4fe0f7539 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "trezor-crypto"] - path = trezor-crypto + path = vendor/trezor-crypto url = https://github.com/trezor/trezor-crypto.git [submodule "trezor-common"] - path = trezor-common + path = vendor/trezor-common url = https://github.com/trezor/trezor-common.git [submodule "trezor-qrenc"] - path = trezor-qrenc + path = vendor/trezor-qrenc url = https://github.com/trezor/trezor-qrenc.git [submodule "libopencm3"] - path = libopencm3 + path = vendor/libopencm3 url = https://github.com/libopencm3/libopencm3.git diff --git a/Makefile.include b/Makefile.include index 97bc3a604..6a83e366c 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1,5 +1,5 @@ TOP_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -TOOLCHAIN_DIR ?= $(TOP_DIR)libopencm3 +TOOLCHAIN_DIR ?= $(TOP_DIR)vendor/libopencm3 PREFIX ?= arm-none-eabi- CC = $(PREFIX)gcc @@ -43,8 +43,8 @@ CFLAGS += $(OPTFLAGS) \ -I$(TOOLCHAIN_DIR)/include \ -I$(TOP_DIR) \ -I$(TOP_DIR)gen \ - -I$(TOP_DIR)trezor-crypto \ - -I$(TOP_DIR)trezor-qrenc + -I$(TOP_DIR)vendor/trezor-crypto \ + -I$(TOP_DIR)vendor/trezor-qrenc ifdef APPVER CFLAGS += -DAPPVER=$(APPVER) diff --git a/bootloader/Makefile b/bootloader/Makefile index 1d87042ca..85b9aa048 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile @@ -4,12 +4,12 @@ OBJS += bootloader.o OBJS += signatures.o OBJS += usb.o -OBJS += ../trezor-crypto/bignum.o -OBJS += ../trezor-crypto/ecdsa.small.o -OBJS += ../trezor-crypto/hmac.o -OBJS += ../trezor-crypto/ripemd160.o -OBJS += ../trezor-crypto/secp256k1.small.o -OBJS += ../trezor-crypto/sha2.o +OBJS += ../vendor/trezor-crypto/bignum.o +OBJS += ../vendor/trezor-crypto/ecdsa.small.o +OBJS += ../vendor/trezor-crypto/hmac.o +OBJS += ../vendor/trezor-crypto/ripemd160.o +OBJS += ../vendor/trezor-crypto/secp256k1.small.o +OBJS += ../vendor/trezor-crypto/sha2.o CFLAGS += -DUSE_PRECOMPUTED_IV=0 CFLAGS += -DUSE_PRECOMPUTED_CP=0 diff --git a/demo/Makefile b/demo/Makefile index 5f16147c7..57dcb068e 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -4,14 +4,14 @@ NAME = demo OBJS += demo.o -OBJS += ../trezor-crypto/bignum.o -OBJS += ../trezor-crypto/bip32.o -OBJS += ../trezor-crypto/ecdsa.o -OBJS += ../trezor-crypto/hmac.o -OBJS += ../trezor-crypto/ripemd160.o -OBJS += ../trezor-crypto/secp256k1.o -OBJS += ../trezor-crypto/sha2.o -OBJS += ../trezor-crypto/bip39.o -OBJS += ../trezor-crypto/pbkdf2.o +OBJS += ../vendor/trezor-crypto/bignum.o +OBJS += ../vendor/trezor-crypto/bip32.o +OBJS += ../vendor/trezor-crypto/ecdsa.o +OBJS += ../vendor/trezor-crypto/hmac.o +OBJS += ../vendor/trezor-crypto/ripemd160.o +OBJS += ../vendor/trezor-crypto/secp256k1.o +OBJS += ../vendor/trezor-crypto/sha2.o +OBJS += ../vendor/trezor-crypto/bip39.o +OBJS += ../vendor/trezor-crypto/pbkdf2.o include ../Makefile.include diff --git a/firmware-docker-build.sh b/firmware-docker-build.sh index 1aaf2c35e..7deeff5f7 100755 --- a/firmware-docker-build.sh +++ b/firmware-docker-build.sh @@ -8,7 +8,7 @@ docker run -t -v $(pwd)/output:/output $IMAGETAG /bin/sh -c "\ cd trezor-mcu && \ git checkout $FIRMWARETAG && \ git submodule update --init && \ - make -C libopencm3 && \ + make -C vendor/libopencm3 && \ make && \ make -C firmware && \ cp firmware/trezor.bin /output/trezor-$FIRMWARETAG.bin" diff --git a/firmware/Makefile b/firmware/Makefile index fa4aa3e16..bd86a79a5 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -19,25 +19,25 @@ OBJS += crypto.o OBJS += debug.o -OBJS += ../trezor-crypto/bignum.o -OBJS += ../trezor-crypto/ecdsa.o -OBJS += ../trezor-crypto/secp256k1.o -OBJS += ../trezor-crypto/nist256p1.o -OBJS += ../trezor-crypto/hmac.o -OBJS += ../trezor-crypto/bip32.o -OBJS += ../trezor-crypto/bip39.o -OBJS += ../trezor-crypto/pbkdf2.o -OBJS += ../trezor-crypto/base58.o +OBJS += ../vendor/trezor-crypto/bignum.o +OBJS += ../vendor/trezor-crypto/ecdsa.o +OBJS += ../vendor/trezor-crypto/secp256k1.o +OBJS += ../vendor/trezor-crypto/nist256p1.o +OBJS += ../vendor/trezor-crypto/hmac.o +OBJS += ../vendor/trezor-crypto/bip32.o +OBJS += ../vendor/trezor-crypto/bip39.o +OBJS += ../vendor/trezor-crypto/pbkdf2.o +OBJS += ../vendor/trezor-crypto/base58.o -OBJS += ../trezor-crypto/ripemd160.o -OBJS += ../trezor-crypto/sha2.o +OBJS += ../vendor/trezor-crypto/ripemd160.o +OBJS += ../vendor/trezor-crypto/sha2.o -OBJS += ../trezor-crypto/aescrypt.o -OBJS += ../trezor-crypto/aeskey.o -OBJS += ../trezor-crypto/aestab.o -OBJS += ../trezor-crypto/aes_modes.o +OBJS += ../vendor/trezor-crypto/aescrypt.o +OBJS += ../vendor/trezor-crypto/aeskey.o +OBJS += ../vendor/trezor-crypto/aestab.o +OBJS += ../vendor/trezor-crypto/aes_modes.o -OBJS += ../trezor-qrenc/qr_encode.o +OBJS += ../vendor/trezor-qrenc/qr_encode.o # OBJS += protob/pb_common.o OBJS += protob/pb_decode.o diff --git a/firmware/protob/messages.proto b/firmware/protob/messages.proto index f788ef73a..4f4140fbd 120000 --- a/firmware/protob/messages.proto +++ b/firmware/protob/messages.proto @@ -1 +1 @@ -../../trezor-common/protob/messages.proto \ No newline at end of file +../../vendor/trezor-common/protob/messages.proto \ No newline at end of file diff --git a/firmware/protob/storage.proto b/firmware/protob/storage.proto index b7b890d7b..7502e62f6 120000 --- a/firmware/protob/storage.proto +++ b/firmware/protob/storage.proto @@ -1 +1 @@ -../../trezor-common/protob/storage.proto \ No newline at end of file +../../vendor/trezor-common/protob/storage.proto \ No newline at end of file diff --git a/firmware/protob/types.proto b/firmware/protob/types.proto index 6f8a7a998..8eed39a0a 120000 --- a/firmware/protob/types.proto +++ b/firmware/protob/types.proto @@ -1 +1 @@ -../../trezor-common/protob/types.proto \ No newline at end of file +../../vendor/trezor-common/protob/types.proto \ No newline at end of file diff --git a/gen/bitmaps/.gitignore b/gen/bitmaps/.gitignore deleted file mode 100644 index 68359a786..000000000 --- a/gen/bitmaps/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.c -*.h diff --git a/libopencm3 b/libopencm3 deleted file mode 160000 index b1049f9a6..000000000 --- a/libopencm3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b1049f9a6f43882968dcf82ca1df3f1eee67e367 diff --git a/setup.c b/setup.c index cb6ad1bf0..c85bd8d0c 100644 --- a/setup.c +++ b/setup.c @@ -25,7 +25,7 @@ void setup(void) { // setup clock - clock_scale_t clock = hse_8mhz_3v3[CLOCK_3V3_120MHZ]; + struct rcc_clock_scale clock = rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]; rcc_clock_setup_hse_3v3(&clock); // enable GPIO clock - A (oled), B(oled), C (buttons) diff --git a/trezor-crypto b/trezor-crypto deleted file mode 160000 index cbbc0bdc7..000000000 --- a/trezor-crypto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cbbc0bdc7197e74d647aedcbfd064c43544318cf diff --git a/vendor/libopencm3 b/vendor/libopencm3 new file mode 160000 index 000000000..e8a4a37b9 --- /dev/null +++ b/vendor/libopencm3 @@ -0,0 +1 @@ +Subproject commit e8a4a37b9c2f1f1cfad4d1f92b8151dac3f113c0 diff --git a/trezor-common b/vendor/trezor-common similarity index 100% rename from trezor-common rename to vendor/trezor-common diff --git a/vendor/trezor-crypto b/vendor/trezor-crypto new file mode 160000 index 000000000..3556c7474 --- /dev/null +++ b/vendor/trezor-crypto @@ -0,0 +1 @@ +Subproject commit 3556c74740b64484eeec4716d57c197828b330a0 diff --git a/trezor-qrenc b/vendor/trezor-qrenc similarity index 100% rename from trezor-qrenc rename to vendor/trezor-qrenc