Skip to content

Commit

Permalink
bootloader: qtouch only in devdevice
Browse files Browse the repository at this point in the history
We don't make use of touch in the production bootloader.
  • Loading branch information
benma committed Dec 9, 2024
1 parent 1281685 commit c1b4e9b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/bootloader/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

#include <driver_init.h>
#include <hardfault.h>
#ifdef BOOTLOADER_DEVDEVICE
#include <qtouch.h>
#endif
#include <screen.h>
#include <string.h>
#include <usb/usb_processing.h>
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/platform/driver_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,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
Expand Down

0 comments on commit c1b4e9b

Please sign in to comment.