diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader index 091401b7e0..a473dd6a1c 100644 --- a/core/SConscript.bootloader +++ b/core/SConscript.bootloader @@ -7,7 +7,6 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0)) BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1' PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1' -DMA2D = False if TREZOR_MODEL in ('1', ): # skip bootloader build @@ -144,13 +143,6 @@ SOURCE_TREZORHAL = [ 'embed/trezorhal/vectortable.s', ] -if DMA2D: - SOURCE_STMHAL.append('vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c') - SOURCE_TREZORHAL.append('embed/trezorhal/dma2d.c') - CPPDEFINES_MOD += [ - 'USE_DMA2D', - ] - # fonts tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 80ad807ba7..0606d6bcf5 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -9,7 +9,6 @@ PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1' BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1' EVERYTHING = BITCOIN_ONLY != '1' TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') -DMA2D = TREZOR_MODEL in ('T', ) CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0)) @@ -19,7 +18,7 @@ FEATURE_FLAGS = { "SYSTEM_VIEW": False, } -FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led"] +FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led", "dma2d"] CCFLAGS_MOD = '' CPPPATH_MOD = [] @@ -383,17 +382,6 @@ SOURCE_TREZORHAL = [ ] -if DMA2D: - CPPDEFINES_MOD += [ - 'USE_DMA2D', - ] - SOURCE_TREZORHAL += [ - 'embed/trezorhal/dma2d.c', - ] - SOURCE_STMHAL += [ - 'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c', - ] - CPPDEFINES_MOD += ['USE_SVC_SHUTDOWN'] if FEATURE_FLAGS["RDI"]: @@ -741,8 +729,6 @@ def cargo_build(): features.append('ui') if PYOPT == '0': features.append('ui_debug') - if DMA2D: - features.append('dma2d') features.extend(FEATURES_AVAILABLE) diff --git a/core/SConscript.unix b/core/SConscript.unix index 3d423a51fb..01279446a6 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -367,7 +367,7 @@ if DMA2D: 'USE_DMA2D', ] SOURCE_UNIX += [ - 'embed/unix/dma2d.c', + 'embed/lib/dma2d_emul.c', ] diff --git a/core/embed/unix/dma2d.c b/core/embed/lib/dma2d_emul.c similarity index 99% rename from core/embed/unix/dma2d.c rename to core/embed/lib/dma2d_emul.c index 32af3438d6..a9ccd9d106 100644 --- a/core/embed/unix/dma2d.c +++ b/core/embed/lib/dma2d_emul.c @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -#include "dma2d.h" #include "colors.h" #include "display_interface.h" diff --git a/core/site_scons/boards/trezor_t.py b/core/site_scons/boards/trezor_t.py index 0047f66e61..41d8ebdf07 100644 --- a/core/site_scons/boards/trezor_t.py +++ b/core/site_scons/boards/trezor_t.py @@ -35,6 +35,12 @@ def configure( sources += ["embed/trezorhal/sbu.c"] features_available.append("sbu") - env.get("ENV")["TREZOR_BOARD"] = board + if "dma2d" in features_wanted: + defines += ["USE_DMA2D"] + sources += ["embed/trezorhal/dma2d.c"] + sources += ["vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c"] + features_available.append("dma2d") + + env.get('ENV')['TREZOR_BOARD'] = board return features_available