1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-23 09:18:46 +00:00

feat(core): add display feature to SConscript

[no changelog]
This commit is contained in:
cepetr 2025-05-07 16:17:07 +02:00 committed by cepetr
parent daa6ea25fb
commit 452e63c4fb
19 changed files with 129 additions and 117 deletions

View File

@ -7,7 +7,7 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0)) CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
HW_REVISION = ARGUMENTS.get('HW_REVISION', None) HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
FEATURES_WANTED = ["sd_card", "powerctl"] FEATURES_WANTED = ["sd_card", "powerctl", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -11,7 +11,7 @@ PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None) HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1' UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1'
FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga", "dma2d", "ble", "powerctl"] FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga", "dma2d", "ble", "powerctl", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -7,7 +7,7 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0)) CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
HW_REVISION = ARGUMENTS.get('HW_REVISION', None) HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga", "powerctl"] FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga", "powerctl", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -20,7 +20,7 @@ if not models.has_emulator(TREZOR_MODEL):
) )
Return() Return()
FEATURES_WANTED = ["input", "rgb_led", "dma2d", "optiga", "powerctl"] FEATURES_WANTED = ["input", "rgb_led", "dma2d", "optiga", "powerctl", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -45,7 +45,7 @@ FEATURE_FLAGS = {
"AES_GCM": BENCHMARK or THP, "AES_GCM": BENCHMARK or THP,
} }
FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic", "ble", "tropic", "powerctl"] FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic", "ble", "tropic", "powerctl", "display"]
if DISABLE_OPTIGA: if DISABLE_OPTIGA:
if PYOPT != '0': if PYOPT != '0':
raise RuntimeError("DISABLE_OPTIGA requires PYOPT=0") raise RuntimeError("DISABLE_OPTIGA requires PYOPT=0")

View File

@ -30,7 +30,7 @@ FEATURE_FLAGS = {
"AES_GCM": True, "AES_GCM": True,
} }
FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic", "ble", "tropic", "powerctl"] FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic", "ble", "tropic", "powerctl", "display"]
if DISABLE_OPTIGA: if DISABLE_OPTIGA:
# TODO use PYOPT instead of PRODUCTION, same as in firmware, blocked on #4253 # TODO use PYOPT instead of PRODUCTION, same as in firmware, blocked on #4253
if PRODUCTION: if PRODUCTION:

View File

@ -14,7 +14,7 @@ FEATURE_FLAGS = {
"AES_GCM": True, "AES_GCM": True,
} }
FEATURES_WANTED = ["input", "sbu", "nfc", "sd_card", "rgb_led", "usb", "consumption_mask", "optiga", "haptic", "tropic", "ble", "hw_revision", "powerctl"] FEATURES_WANTED = ["input", "sbu", "nfc", "sd_card", "rgb_led", "usb", "consumption_mask", "optiga", "haptic", "tropic", "ble", "hw_revision", "powerctl", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -18,7 +18,7 @@ if TREZOR_MODEL in ('D001', 'D002'):
action=build_reflash) action=build_reflash)
Return() Return()
FEATURES_WANTED = ["input", "sd_card"] FEATURES_WANTED = ["input", "sd_card", "display"]
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []

View File

@ -21,7 +21,7 @@ if BENCHMARK and PYOPT != '0':
print("BENCHMARK=1 works only with PYOPT=0.") print("BENCHMARK=1 works only with PYOPT=0.")
exit(1) exit(1)
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga", "ble", "rgb_led", "powerctl"] FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga", "ble", "rgb_led", "powerctl", "display"]
if not DISABLE_TROPIC: if not DISABLE_TROPIC:
FEATURES_WANTED.append('tropic') FEATURES_WANTED.append('tropic')

View File

@ -21,7 +21,6 @@
#include <trezor_model.h> #include <trezor_model.h>
#include <trezor_rtl.h> #include <trezor_rtl.h>
#include <io/display.h>
#include <sys/bootargs.h> #include <sys/bootargs.h>
#include <sys/bootutils.h> #include <sys/bootutils.h>
#include <sys/irq.h> #include <sys/irq.h>
@ -32,6 +31,10 @@
#include <sys/sysutils.h> #include <sys/sysutils.h>
#include <util/image.h> #include <util/image.h>
#ifdef STM32F4
#include <io/display.h>
#endif
#ifdef KERNEL_MODE #ifdef KERNEL_MODE
// Battery powered devices (USE_POWERCTL) should not stall // Battery powered devices (USE_POWERCTL) should not stall

View File

@ -37,6 +37,7 @@ def configure(
("USE_HSE", "1"), ("USE_HSE", "1"),
] ]
if "display" in features_wanted:
sources += [ sources += [
"embed/io/display/stm32f429i-disc1/display_driver.c", "embed/io/display/stm32f429i-disc1/display_driver.c",
"embed/io/display/stm32f429i-disc1/display_ltdc.c", "embed/io/display/stm32f429i-disc1/display_ltdc.c",

View File

@ -38,6 +38,7 @@ def configure(
("USE_HSE", "1"), ("USE_HSE", "1"),
] ]
if "display" in features_wanted:
sources += [ sources += [
"embed/io/display/ltdc_dsi/display_driver.c", "embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/stm32u5a9j-dk/stm32u5a9j-dk.c", "embed/io/display/ltdc_dsi/panels/stm32u5a9j-dk/stm32u5a9j-dk.c",

View File

@ -45,6 +45,7 @@ def configure(
("USE_HSE", "1"), ("USE_HSE", "1"),
] ]
if "display" in features_wanted:
sources += ["embed/io/display/vg-2864/display_driver.c"] sources += ["embed/io/display/vg-2864/display_driver.c"]
paths += ["embed/io/display/inc"] paths += ["embed/io/display/inc"]

View File

@ -45,6 +45,7 @@ def configure(
("USE_HSE", "1"), ("USE_HSE", "1"),
] ]
if "display" in features_wanted:
sources += ["embed/io/display/st-7789/display_nofb.c"] sources += ["embed/io/display/st-7789/display_nofb.c"]
sources += ["embed/io/display/st-7789/display_driver.c"] sources += ["embed/io/display/st-7789/display_driver.c"]
sources += ["embed/io/display/st-7789/display_io.c"] sources += ["embed/io/display/st-7789/display_io.c"]

View File

@ -44,6 +44,7 @@ def configure(
("HW_REVISION", str(hw_revision)), ("HW_REVISION", str(hw_revision)),
] ]
if "display" in features_wanted:
sources += ["embed/io/display/vg-2864/display_driver.c"] sources += ["embed/io/display/vg-2864/display_driver.c"]
paths += ["embed/io/display/inc"] paths += ["embed/io/display/inc"]

View File

@ -46,6 +46,7 @@ def configure(
("HW_REVISION", str(hw_revision)), ("HW_REVISION", str(hw_revision)),
] ]
if "display" in features_wanted:
sources += ["embed/io/display/st-7789/display_fb.c"] sources += ["embed/io/display/st-7789/display_fb.c"]
sources += ["embed/io/display/st-7789/display_driver.c"] sources += ["embed/io/display/st-7789/display_driver.c"]
sources += ["embed/io/display/st-7789/display_io.c"] sources += ["embed/io/display/st-7789/display_io.c"]

View File

@ -43,6 +43,7 @@ def configure(
("TERMINAL_Y_PADDING", "12"), ("TERMINAL_Y_PADDING", "12"),
] ]
if "display" in features_wanted:
sources += [ sources += [
"embed/io/display/ltdc_dsi/display_driver.c", "embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c", "embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",

View File

@ -43,6 +43,7 @@ def configure(
("TERMINAL_Y_PADDING", "12"), ("TERMINAL_Y_PADDING", "12"),
] ]
if "display" in features_wanted:
sources += [ sources += [
"embed/io/display/ltdc_dsi/display_driver.c", "embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c", "embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",

View File

@ -43,6 +43,7 @@ def configure(
("TERMINAL_Y_PADDING", "12"), ("TERMINAL_Y_PADDING", "12"),
] ]
if "display" in features_wanted:
sources += [ sources += [
"embed/io/display/ltdc_dsi/display_driver.c", "embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c", "embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",