diff --git a/CHANGELOG.md b/CHANGELOG.md index cd17117b4..4d5d97c67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,6 +152,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately. ### v1.0.7 - Update manufacturer HID descriptor to bitbox.swiss +- Remove qtouch code from production bootloader ### v1.0.6 - Replace root pubkeys diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe9b634d6..825de7993 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,12 +125,16 @@ set(DBB-BOOTLOADER-SOURCES ${DBB-BOOTLOADER-SOURCES} PARENT_SCOPE) set(DRIVER-SOURCES ${CMAKE_SOURCE_DIR}/src/platform/platform_init.c ${CMAKE_SOURCE_DIR}/src/platform/driver_init.c - ${CMAKE_SOURCE_DIR}/src/qtouch/qtouch.c ${CMAKE_SOURCE_DIR}/src/ui/oled/oled.c ${CMAKE_SOURCE_DIR}/src/ui/oled/oled_writer.c ) set(DRIVER-SOURCES ${DRIVER-SOURCES} PARENT_SCOPE) +set(QTOUCH-SOURCES + ${CMAKE_SOURCE_DIR}/src/qtouch/qtouch.c +) +set(QTOUCH-SOURCES ${DRIVER-SOURCES} PARENT_SCOPE) + set(PLATFORM-BITBOX02-SOURCES ${CMAKE_SOURCE_DIR}/src/sd_mmc/sd_mmc_start.c ${CMAKE_SOURCE_DIR}/src/usb/class/hid/hid.c @@ -180,6 +184,7 @@ set(FIRMWARE-SOURCES ${DBB-FIRMWARE-UI-SOURCES} ${FIRMWARE-DRIVER-SOURCES} ${DRIVER-SOURCES} + ${QTOUCH-SOURCES} ${SECURECHIP-SOURCES} ${CMAKE_SOURCE_DIR}/src/common_main.c ) @@ -337,6 +342,12 @@ set(BOOTLOADERS ) set(BOOTLOADERS ${BOOTLOADERS} PARENT_SCOPE) +set(DEVDEVICE-BOOTLOADERS + bootloader-development + bootloader-development-locked + bootloader-btc-development +) + set(FIRMWARES firmware # Firmware MULTI firmware-btc # Firmware BTC-ONLY @@ -416,7 +427,6 @@ if(CMAKE_CROSSCOMPILING) target_include_directories(${elf} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/bootloader) target_link_libraries(${elf} PRIVATE "-Wl,-Map=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${bootloader}.map\" -T\"${CMAKE_SOURCE_DIR}/bootloader.ld\"") target_link_libraries(${elf} PRIVATE -Wl,--defsym=STACK_SIZE=${STACK_SIZE} -Wl,-defsym=HEAP_SIZE=${HEAP_SIZE}) - target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T}) target_link_libraries(${elf} PRIVATE ${bootloader}_rust_c) @@ -427,6 +437,12 @@ if(CMAKE_CROSSCOMPILING) target_link_libraries(${elf} PRIVATE --specs=nosys.specs) endforeach(bootloader) + foreach(bootloader ${DEVDEVICE-BOOTLOADERS}) + set(elf ${bootloader}.elf) + target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T}) + target_sources(${elf} PRIVATE ${QTOUCH-SOURCES}) + endforeach(bootloader) + foreach(bootloader ${BOOTLOADERS-BITBOX02}) target_sources(${bootloader}.elf PRIVATE ${PLATFORM-BITBOX02-SOURCES}) endforeach(bootloader) diff --git a/src/bootloader/startup.c b/src/bootloader/startup.c index 37b0bbf53..918510b6c 100644 --- a/src/bootloader/startup.c +++ b/src/bootloader/startup.c @@ -19,7 +19,9 @@ #include #include +#ifdef BOOTLOADER_DEVDEVICE #include +#endif #include #include #include @@ -49,7 +51,9 @@ int main(void) platform_init(); __stack_chk_guard = rand_sync_read32(&RAND_0); screen_init(); +#ifdef BOOTLOADER_DEVDEVICE qtouch_init(); +#endif bootloader_jump(); // If did not jump to firmware code, begin USB processing diff --git a/src/platform/driver_init.c b/src/platform/driver_init.c index 286b5752e..92f2bc123 100644 --- a/src/platform/driver_init.c +++ b/src/platform/driver_init.c @@ -307,7 +307,10 @@ void bootloader_init(void) _oled_set_pins(); _ptc_clock_init(); +#ifdef BOOTLOADER_DEVDEVICE + // Only needed for qtouch, which is only needed in the devdevice bootloader. _timer_peripheral_init(); +#endif _delay_driver_init(); // OLED