Files
RedLintu16andClaude Opus 5.5 55a0b90519 Import from Sony 73.1.A.2.74 open source archive
Source: opendevices.sony.net, "Open source archive for 73.1.A.2.74" (Xperia 1 VIII: XQ-GE74, XQ-GE54, SO-51G, SOG17, A601SO, XQ-GE44), unmodified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 22:52:53 +00:00

272 lines
7.9 KiB
Python

SMCINVOKE_PATH = "smcinvoke"
QSEECOM_PATH = "qseecom"
TZLOG_PATH = "tz_log"
TMECOM_PATH = "tmecom"
HDCP_PATH = "hdcp"
QCEDEV_PATH = "crypto-qti"
QRNG_PATH = "qrng"
SMMU_PROXY_PATH = "smmu-proxy"
QCEDEV_FE_PATH="qcedev_fe"
SI_CORE_TEST_PATH = "securemsm_tests/si_core_tests"
SECCAM_PATH = "securemsm_tests/seccam_test_driver"
HDCP_TEST_PATH="securemsm_tests/hdcp2p2_test"
TORNADO_MOD_PATH="securemsm_tests/tornado_mod"
HIBERNATE_TZDATA_MGR_PATH = "hibernate_tzdata_mgr"
QSEECOM_ENABLED=False
# This dictionary holds all the securemsm-kernel modules included by calling register_securemsm_module
securemsm_modules = {}
securemsm_modules_by_config = {}
# Registers securemsm module to kernel build system.
# name: The name of the module. The name of the file generated for this module will be {name}.ko.
# path: The path that will be prepended to all sources listed for this module.
# config_option: If this module is enabled, the config optiont that will get enabled if so. Not all modules have this, and this is an optional parameter.
# config_srcs: A dictionary of sources to be added to the module depending on if a configuration option is enabled or not. The keys to the dictionary are
# the name of the config option, and the value depends If it is a list, it will just be the list of sources to be added to the module if the config option
# is enabled. If the value is another dictionary, then you can specify sources to be added if the config option is DISABLED by having a list under the
# default_srcs: A list of sources to be added to the module regardless of configuration options.
# deps: A list of kernel_module or ddk_module rules that this module depends on.
def register_securemsm_module(name, path = None, config_option = None, default_srcs = [], config_srcs = {}, deps = [], srcs = [], copts = [], hdrs = []):
processed_config_srcs = {}
for config_src_name in config_srcs:
config_src = config_srcs[config_src_name]
if type(config_src) == "list":
processed_config_srcs[config_src_name] = {True: config_src}
else:
processed_config_srcs[config_src_name] = config_src
module = {
"name": name,
"path": path,
"default_srcs": default_srcs,
"config_srcs": processed_config_srcs,
"config_option": config_option,
"deps": deps,
"copts": copts,
"srcs": srcs,
"hdrs": hdrs,
}
securemsm_modules[name] = module
if config_option:
securemsm_modules_by_config[config_option] = name
if name == "qseecom_dlkm":
QSEECOM_ENABLED = True
# ------------------------------------ SECUREMSM MODULE DEFINITIONS ---------------------------------
register_securemsm_module(
name = "qseecom_dlkm",
path = QSEECOM_PATH,
default_srcs = [
"qseecom.c",
"ice.h",
"qseecom_32bit_impl.c"
],
deps = [":qseecom_kernel_headers"],
#srcs = ["config/sec-kernel_defconfig_qseecom.h"],
#copts = ["-include", "config/sec-kernel_defconfig_qseecom.h"],
)
register_securemsm_module(
name = "smcinvoke_dlkm",
path = SMCINVOKE_PATH,
default_srcs = [
"IQSEEComCompat.h",
"smci_qseecomcompat.h",
"IQSEEComCompatAppLoader.h",
"smci_qseecomcompatapploader.h",
],
config_srcs = {
"CONFIG_QCOM_SI_CORE": {
True: [
"si_core_xts/qseecom.c",
"si_core_xts/smci_kernel.c",
"si_core_xts/smci.c",
"si_core_xts/smci_impl.h",
"si_core_xts/trace_smci.h"
],
False: [
"compat/smcinvoke.c",
"compat/smcinvoke_kernel.c",
"compat/trace_smcinvoke.h",
],
}
},
deps = (["%b_qseecom_dlkm"] if QSEECOM_ENABLED else []) +
[":smcinvoke_kernel_headers", ":qseecom_kernel_headers"],
hdrs = [":smcinvoke_kernel_headers"],
)
register_securemsm_module(
name = "tz_log_dlkm",
path = TZLOG_PATH,
deps = [
":tmecom_kernel_headers",
"%b_tmecom-intf_dlkm",
],
default_srcs = [
"last_logs.h",
"tz_log.c",
],
)
register_securemsm_module(
name = "hdcp_qseecom_dlkm",
path = HDCP_PATH,
default_srcs = [
"hdcp_qseecom.c",
"hdcp_qseecom.h",
"hdcp_main.c",
"smcinvoke_object.h",
"smci_object.h",
"hdcp_main.h",
"hdcp_smcinvoke.c",
"hdcp_smcinvoke.h",
"CAppClient.h",
"CAppLoader.h",
"IAppClient.h",
"smci_appclient.h",
"IAppController.h",
"smci_appcontroller.h",
"IAppLoader.h",
"smci_apploader.h",
"IClientEnv.h",
"smci_clientenv.h",
"IOpener.h",
"smci_opener.h",
"hdcp1.h",
"hdcp1_ops.h",
"hdcp2p2.h",
],
deps = [":hdcp_qseecom_dlkm", "%b_smcinvoke_dlkm", "%b_qseecom_dlkm"],
srcs = ["config/sec-kernel_defconfig.h"],
copts = [
"-include",
"config/sec-kernel_defconfig.h",
],
)
register_securemsm_module(
name = "tmecom-intf_dlkm",
path = TMECOM_PATH,
deps = [":tmecom_kernel_headers"],
srcs = [
"tmelog.c",
"tmecom.c",
"tmecom.h",
],
)
register_securemsm_module(
name = "qce50_dlkm",
path = QCEDEV_PATH,
default_srcs = ["qce50.c"],
deps = [":qcedev_local_headers"],
)
register_securemsm_module(
name = "qcedev-mod_dlkm",
path = QCEDEV_PATH,
default_srcs = [
"qcedev.c",
"qcedev_smmu.c",
"compat_qcedev.c"],
deps = [":qcedev_local_headers",
"%b_qce50_dlkm"],
)
register_securemsm_module(
name = "qrng_dlkm",
path = QRNG_PATH,
default_srcs = ["msm_rng.c"],
deps = [":qcedev_local_headers"],
)
register_securemsm_module(
name = "qcrypto-msm_dlkm",
path = QCEDEV_PATH,
default_srcs = ["qcrypto.c"],
deps = [":qcedev_local_headers",
"%b_qce50_dlkm"],
)
register_securemsm_module(
name = "smmu_proxy_dlkm",
path = SMMU_PROXY_PATH,
config_srcs = {
"CONFIG_ARCH_QTI_VM": {
True: [
"qti-smmu-proxy-tvm.c",
"qti-smmu-proxy-common.c",
],
False: [
"qti-smmu-proxy-pvm.c",
"qti-smmu-proxy-common.c",
],
}
},
deps = ["%b_smcinvoke_dlkm", ":smmu_proxy_headers"],
)
register_securemsm_module(
name = "qcedev_fe_dlkm",
path = QCEDEV_FE_PATH,
srcs = [
"qcedev_fe.c",
"qcedev_smmu.c"],
deps = [":qcedev_fe_local_headers"],
)
# ------------------------------------ SECUREMSM TEST MODULE DEFINITIONS ---------------------------------
register_securemsm_module(
name = "si_core_test",
path = SI_CORE_TEST_PATH,
default_srcs = ["si_core_test.c"],
)
register_securemsm_module(
name = "hdcp2p2_test",
path = HDCP_TEST_PATH,
default_srcs = [
"hdcp2p2_test.c",
"hdcp2p2_test.h",],
deps = [":smcinvoke_kernel_headers", ":hdcp_qseecom_dlkm", "%b_smcinvoke_dlkm", "%b_hdcp_qseecom_dlkm"],
srcs = ["config/sec-kernel_defconfig.h"],
copts = [
"-include",
"config/sec-kernel_defconfig.h",
],
)
register_securemsm_module(
name = "tornado_mod",
path = TORNADO_MOD_PATH,
srcs = [
"tornado_mod.c",
"tornado_mod.h",],
)
register_securemsm_module(
name = "seccam_test_driver",
path = SECCAM_PATH,
srcs = [
"seccam_test_driver.c",
"scm_wrapper.h",
"seccam_test_driver.h",],
deps = [":smcinvoke_kernel_headers", ":%b_smcinvoke_dlkm", ":smmu_proxy_headers", "%b_smmu_proxy_dlkm"],
)
register_securemsm_module(
name = "hibernate_tzdata_mgr_dlkm",
path = HIBERNATE_TZDATA_MGR_PATH,
default_srcs = [
"hibernate_tzdata_mgr.c",
],
deps = [":hibernate_tzdata_mgr_headers", "%b_smcinvoke_dlkm"],
)