1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-23 01:08: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))
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
FEATURES_WANTED = ["sd_card", "powerctl"]
FEATURES_WANTED = ["sd_card", "powerctl", "display"]
CCFLAGS_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)
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 = ''
CPPPATH_MOD = []

View File

@ -7,7 +7,7 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
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 = ''
CPPPATH_MOD = []

View File

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

View File

@ -45,7 +45,7 @@ FEATURE_FLAGS = {
"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 PYOPT != '0':
raise RuntimeError("DISABLE_OPTIGA requires PYOPT=0")

View File

@ -30,7 +30,7 @@ FEATURE_FLAGS = {
"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:
# TODO use PYOPT instead of PRODUCTION, same as in firmware, blocked on #4253
if PRODUCTION:

View File

@ -14,7 +14,7 @@ FEATURE_FLAGS = {
"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 = ''
CPPPATH_MOD = []

View File

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

View File

@ -21,7 +21,7 @@ if BENCHMARK and PYOPT != '0':
print("BENCHMARK=1 works only with PYOPT=0.")
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:
FEATURES_WANTED.append('tropic')

View File

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

View File

@ -37,33 +37,34 @@ def configure(
("USE_HSE", "1"),
]
sources += [
"embed/io/display/stm32f429i-disc1/display_driver.c",
"embed/io/display/stm32f429i-disc1/display_ltdc.c",
"embed/io/display/stm32f429i-disc1/ili9341_spi.c",
]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
sources += [
"embed/io/display/stm32f429i-disc1/display_driver.c",
"embed/io/display/stm32f429i-disc1/display_ltdc.c",
"embed/io/display/stm32f429i-disc1/ili9341_spi.c",
]
paths += ["embed/io/display/inc"]
sources += ["embed/gfx/bitblt/stm32/dma2d_bitblt.c"]
sources += ["embed/gfx/bitblt/stm32/dma2d_bitblt.c"]
sources += [
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c"
]
sources += [
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c"
]
defines += ["USE_DMA2D"]
features_available.append("dma2d")
sources += [
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c"
]
sources += [
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c"
]
defines += ["USE_DMA2D"]
features_available.append("dma2d")
defines += [
"FRAMEBUFFER",
"DISPLAY_RGB565",
("USE_RGB_COLORS", "1"),
("DISPLAY_RESX", "240"),
("DISPLAY_RESY", "320"),
]
features_available.append("framebuffer")
features_available.append("display_rgb565")
defines += [
"FRAMEBUFFER",
"DISPLAY_RGB565",
("USE_RGB_COLORS", "1"),
("DISPLAY_RESX", "240"),
("DISPLAY_RESY", "320"),
]
features_available.append("framebuffer")
features_available.append("display_rgb565")
sources += ["embed/sys/sdram/stm32f429i-disc1/sdram_bsp.c"]
paths += ["embed/sys/sdram/inc"]

View File

@ -38,20 +38,21 @@ def configure(
("USE_HSE", "1"),
]
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/stm32u5a9j-dk/stm32u5a9j-dk.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
# "embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/stm32u5a9j-dk/stm32u5a9j-dk.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
# "embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/backlight_pin.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/backlight_pin.c"]
paths += ["embed/io/backlight/inc"]
if "input" in features_wanted:
sources += ["embed/io/i2c_bus/stm32u5/i2c_bus.c"]

View File

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

View File

@ -45,20 +45,21 @@ def configure(
("USE_HSE", "1"),
]
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_io.c"]
sources += ["embed/io/display/st-7789/display_panel.c"]
sources += ["embed/io/display/st-7789/panels/tf15411a.c"]
sources += ["embed/io/display/st-7789/panels/154a.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2411.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2422.c"]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
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_io.c"]
sources += ["embed/io/display/st-7789/display_panel.c"]
sources += ["embed/io/display/st-7789/panels/tf15411a.c"]
sources += ["embed/io/display/st-7789/panels/154a.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2411.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2422.c"]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/tps61043.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/tps61043.c"]
paths += ["embed/io/backlight/inc"]
if "input" in features_wanted:
sources += ["embed/io/i2c_bus/stm32f4/i2c_bus.c"]

View File

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

View File

@ -46,22 +46,23 @@ def configure(
("HW_REVISION", str(hw_revision)),
]
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_io.c"]
sources += ["embed/io/display/st-7789/display_panel.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2482.c"]
sources += ["embed/io/display/fb_queue/fb_queue.c"]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
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_io.c"]
sources += ["embed/io/display/st-7789/display_panel.c"]
sources += ["embed/io/display/st-7789/panels/lx154a2482.c"]
sources += ["embed/io/display/fb_queue/fb_queue.c"]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/tps61043.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32/tps61043.c"]
paths += ["embed/io/backlight/inc"]
env_constraints = env.get("CONSTRAINTS")
if not (env_constraints and "limited_util_s" in env_constraints):
sources += ["embed/io/display/bg_copy/stm32u5/bg_copy.c"]
env_constraints = env.get("CONSTRAINTS")
if not (env_constraints and "limited_util_s" in env_constraints):
sources += ["embed/io/display/bg_copy/stm32u5/bg_copy.c"]
if "input" in features_wanted:
sources += ["embed/io/i2c_bus/stm32u5/i2c_bus.c"]

View File

@ -43,20 +43,21 @@ def configure(
("TERMINAL_Y_PADDING", "12"),
]
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
if "input" in features_wanted:
sources += ["embed/io/touch/ft6x36/ft6x36.c"]

View File

@ -43,20 +43,21 @@ def configure(
("TERMINAL_Y_PADDING", "12"),
]
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
if "input" in features_wanted:
sources += ["embed/io/touch/ft6x36/ft6x36.c"]

View File

@ -43,20 +43,21 @@ def configure(
("TERMINAL_Y_PADDING", "12"),
]
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
if "display" in features_wanted:
sources += [
"embed/io/display/ltdc_dsi/display_driver.c",
"embed/io/display/ltdc_dsi/panels/lx250a2401a/lx250a2401a.c",
"embed/io/display/ltdc_dsi/display_fb.c",
"embed/io/display/ltdc_dsi/display_fb_rgb888.c",
"embed/io/display/ltdc_dsi/display_gfxmmu.c",
"embed/io/display/fb_queue/fb_queue.c",
]
paths += ["embed/io/display/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]
sources += ["embed/io/backlight/stm32u5/tps61062.c"]
paths += ["embed/io/backlight/inc"]
if "input" in features_wanted:
sources += ["embed/io/touch/ft6x36/ft6x36.c"]