├── .checkpatch.conf ├── .clang-format ├── CHANGELOG.md ├── LICENSE ├── MAINTAINERS ├── Makefile ├── README.md ├── core ├── arch │ ├── arm │ │ ├── arm.mk │ │ ├── cpu │ │ │ ├── cortex-a15.mk │ │ │ ├── cortex-a5.mk │ │ │ ├── cortex-a7.mk │ │ │ ├── cortex-a9.mk │ │ │ ├── cortex-armv8-0.mk │ │ │ ├── cortex-armv9.mk │ │ │ └── neoverse-v2.mk │ │ ├── crypto │ │ │ ├── aes-gcm-ce.c │ │ │ ├── aes_armv8a_ce.c │ │ │ ├── aes_armv8a_ce.h │ │ │ ├── aes_modes_armv8a_ce_a32.S │ │ │ ├── aes_modes_armv8a_ce_a64.S │ │ │ ├── ghash-ce-core_a32.S │ │ │ ├── ghash-ce-core_a64.S │ │ │ ├── sha1_armv8a_ce.c │ │ │ ├── sha1_armv8a_ce_a32.S │ │ │ ├── sha1_armv8a_ce_a64.S │ │ │ ├── sha256_armv8a_ce.c │ │ │ ├── sha256_armv8a_ce_a32.S │ │ │ ├── sha256_armv8a_ce_a64.S │ │ │ ├── sha3_armv8a_ce.c │ │ │ ├── sha3_armv8a_ce_a64.S │ │ │ ├── sha512_armv8a_ce.c │ │ │ ├── sha512_armv8a_ce_a64.S │ │ │ ├── sm3_armv8a_ce.c │ │ │ ├── sm3_armv8a_ce_a64.S │ │ │ ├── sm4_armv8a_aese_a64.S │ │ │ ├── sm4_armv8a_ce.c │ │ │ ├── sm4_armv8a_ce.h │ │ │ ├── sm4_armv8a_ce_a64.S │ │ │ ├── sm4_armv8a_neon.c │ │ │ ├── sm4_armv8a_neon.h │ │ │ └── sub.mk │ │ ├── dts │ │ │ ├── at91-sama5d27_som1.dtsi │ │ │ ├── at91-sama5d27_som1_ek.dts │ │ │ ├── at91-sama5d27_wlsom1.dtsi │ │ │ ├── at91-sama5d27_wlsom1_ek.dts │ │ │ ├── at91-sama5d2_xplained.dts │ │ │ ├── at91-sama7g54_ek.dts │ │ │ ├── dt_driver_test.dtsi │ │ │ ├── embedded_dtb_test.dts │ │ │ ├── fsl-lx2160a-qds.dts │ │ │ ├── fsl-lx2160a-rdb.dts │ │ │ ├── fsl-lx2160a.dtsi │ │ │ ├── hikey.dts │ │ │ ├── sama5d2-pinfunc.h │ │ │ ├── sama5d2.dtsi │ │ │ ├── sama7g5-pinfunc.h │ │ │ ├── sama7g5.dtsi │ │ │ ├── stm32mp13-pinctrl.dtsi │ │ │ ├── stm32mp131.dtsi │ │ │ ├── stm32mp133.dtsi │ │ │ ├── stm32mp135.dtsi │ │ │ ├── stm32mp135f-dk.dts │ │ │ ├── stm32mp13xc.dtsi │ │ │ ├── stm32mp13xf.dtsi │ │ │ ├── stm32mp15-pinctrl.dtsi │ │ │ ├── stm32mp151.dtsi │ │ │ ├── stm32mp153.dtsi │ │ │ ├── stm32mp157.dtsi │ │ │ ├── stm32mp157a-dhcor-avenger96.dts │ │ │ ├── stm32mp157a-dk1-scmi.dts │ │ │ ├── stm32mp157a-dk1.dts │ │ │ ├── stm32mp157c-dhcom-pdk2.dts │ │ │ ├── stm32mp157c-dk2-scmi.dts │ │ │ ├── stm32mp157c-dk2.dts │ │ │ ├── stm32mp157c-ed1-scmi.dts │ │ │ ├── stm32mp157c-ed1.dts │ │ │ ├── stm32mp157c-ev1-scmi.dts │ │ │ ├── stm32mp157c-ev1.dts │ │ │ ├── stm32mp15xc.dtsi │ │ │ ├── stm32mp15xx-dhcom-pdk2.dtsi │ │ │ ├── stm32mp15xx-dhcom-som.dtsi │ │ │ ├── stm32mp15xx-dhcor-avenger96.dtsi │ │ │ ├── stm32mp15xx-dhcor-io1v8.dtsi │ │ │ ├── stm32mp15xx-dhcor-som.dtsi │ │ │ ├── stm32mp15xx-dkx.dtsi │ │ │ ├── stm32mp15xxaa-pinctrl.dtsi │ │ │ ├── stm32mp15xxab-pinctrl.dtsi │ │ │ ├── stm32mp15xxac-pinctrl.dtsi │ │ │ ├── stm32mp15xxad-pinctrl.dtsi │ │ │ ├── stm32mp25-pinctrl.dtsi │ │ │ ├── stm32mp251.dtsi │ │ │ ├── stm32mp253.dtsi │ │ │ ├── stm32mp255.dtsi │ │ │ ├── stm32mp257.dtsi │ │ │ ├── stm32mp257f-ev1-ca35tdcid-rcc.dtsi │ │ │ ├── stm32mp257f-ev1-ca35tdcid-resmem.dtsi │ │ │ ├── stm32mp257f-ev1-ca35tdcid-rif.dtsi │ │ │ ├── stm32mp257f-ev1.dts │ │ │ ├── stm32mp25xc.dtsi │ │ │ ├── stm32mp25xf.dtsi │ │ │ ├── stm32mp25xxai-pinctrl.dtsi │ │ │ ├── stm32mp25xxak-pinctrl.dtsi │ │ │ └── stm32mp25xxal-pinctrl.dtsi │ │ ├── include │ │ │ ├── arm.h │ │ │ ├── arm32.h │ │ │ ├── arm32_macros.S │ │ │ ├── arm32_macros_cortex_a9.S │ │ │ ├── arm64.h │ │ │ ├── arm64_macros.S │ │ │ ├── crypto │ │ │ │ └── ghash-ce-core.h │ │ │ ├── ffa.h │ │ │ ├── kernel │ │ │ │ ├── arch_scall.h │ │ │ │ ├── cache_helpers_arch.h │ │ │ │ ├── delay_arch.h │ │ │ │ ├── misc_arch.h │ │ │ │ ├── secure_partition.h │ │ │ │ ├── spmc_sp_handler.h │ │ │ │ ├── stmm_sp.h │ │ │ │ ├── tee_l2cc_mutex.h │ │ │ │ ├── thread_arch.h │ │ │ │ ├── thread_private_arch.h │ │ │ │ ├── thread_spmc.h │ │ │ │ ├── tlb_helpers.h │ │ │ │ ├── tz_proc_def.h │ │ │ │ ├── tz_ssvce_def.h │ │ │ │ ├── tz_ssvce_pl310.h │ │ │ │ ├── user_access_arch.h │ │ │ │ └── vfp.h │ │ │ ├── mm │ │ │ │ ├── core_mmu_arch.h │ │ │ │ └── generic_ram_layout.h │ │ │ ├── optee_ffa.h │ │ │ ├── pta_stmm.h │ │ │ ├── scmi │ │ │ │ └── scmi_server.h │ │ │ ├── sm │ │ │ │ ├── optee_smc.h │ │ │ │ ├── pm.h │ │ │ │ ├── psci.h │ │ │ │ ├── sm.h │ │ │ │ ├── std_smc.h │ │ │ │ ├── teesmc_opteed.h │ │ │ │ ├── teesmc_opteed_macros.h │ │ │ │ └── watchdog_smc.h │ │ │ ├── smccc.h │ │ │ └── tee │ │ │ │ └── entry_fast.h │ │ ├── kernel │ │ │ ├── abort.c │ │ │ ├── arch_scall.c │ │ │ ├── arch_scall_a32.S │ │ │ ├── arch_scall_a64.S │ │ │ ├── arm32_gicv3_sysreg.txt │ │ │ ├── arm32_sysreg.txt │ │ │ ├── asm-defines.c │ │ │ ├── boot.c │ │ │ ├── cache_helpers_a32.S │ │ │ ├── cache_helpers_a64.S │ │ │ ├── entry_a32.S │ │ │ ├── entry_a64.S │ │ │ ├── generic_timer.c │ │ │ ├── idle.c │ │ │ ├── kern.ld.S │ │ │ ├── link.mk │ │ │ ├── link_dummies_init.c │ │ │ ├── link_dummies_paged.c │ │ │ ├── link_dummy.ld │ │ │ ├── misc_a32.S │ │ │ ├── misc_a64.S │ │ │ ├── rpc_io_i2c.c │ │ │ ├── secure_partition.c │ │ │ ├── semihosting_a64.S │ │ │ ├── spin_lock_a32.S │ │ │ ├── spin_lock_a64.S │ │ │ ├── spmc_sp_handler.c │ │ │ ├── stmm_sp.c │ │ │ ├── sub.mk │ │ │ ├── tee_l2cc_mutex.c │ │ │ ├── tee_time_arm_cntpct.c │ │ │ ├── thread.c │ │ │ ├── thread_a32.S │ │ │ ├── thread_a64.S │ │ │ ├── thread_optee_smc.c │ │ │ ├── thread_optee_smc_a32.S │ │ │ ├── thread_optee_smc_a64.S │ │ │ ├── thread_spmc.c │ │ │ ├── thread_spmc_a64.S │ │ │ ├── timer_a64.c │ │ │ ├── tlb_helpers_a32.S │ │ │ ├── tlb_helpers_a64.S │ │ │ ├── tz_ssvce_pl310_a32.S │ │ │ ├── unwind_arm32.c │ │ │ ├── unwind_arm64.c │ │ │ ├── unwind_private.h │ │ │ ├── vfp.c │ │ │ ├── vfp_a32.S │ │ │ ├── vfp_a64.S │ │ │ ├── vfp_private.h │ │ │ └── virtualization.c │ │ ├── mm │ │ │ ├── core_mmu.c │ │ │ ├── core_mmu_lpae.c │ │ │ ├── core_mmu_v7.c │ │ │ ├── mobj_ffa.c │ │ │ ├── sp_mem.c │ │ │ ├── sub.mk │ │ │ └── tee_pager.c │ │ ├── plat-amlogic │ │ │ ├── conf.mk │ │ │ ├── link.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── scripts │ │ │ │ └── aml_bin2img.py │ │ │ └── sub.mk │ │ ├── plat-aspeed │ │ │ ├── conf.mk │ │ │ ├── core_pos_a32.S │ │ │ ├── platform_ast2600.c │ │ │ ├── platform_ast2700.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-bcm │ │ │ ├── bcm_elog.c │ │ │ ├── bcm_elog.h │ │ │ ├── conf.mk │ │ │ ├── crc32.c │ │ │ ├── crc32.h │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-corstone1000 │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-d02 │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-d06 │ │ │ ├── conf.mk │ │ │ ├── core_pos_a64.S │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-hikey │ │ │ ├── conf.mk │ │ │ ├── hikey_peripherals.h │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── spi_test.c │ │ │ └── sub.mk │ │ ├── plat-hisilicon │ │ │ ├── conf.mk │ │ │ ├── hi3519av100.h │ │ │ ├── hi3519av100_plat_init.S │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── psci.c │ │ │ └── sub.mk │ │ ├── plat-imx │ │ │ ├── a7_plat_init.S │ │ │ ├── a9_plat_init.S │ │ │ ├── conf.mk │ │ │ ├── config │ │ │ │ ├── imx6qdlsolo.h │ │ │ │ ├── imx6sl.h │ │ │ │ ├── imx6sll.h │ │ │ │ └── imx6sx.h │ │ │ ├── imx-common.c │ │ │ ├── imx-regs.h │ │ │ ├── imx.h │ │ │ ├── imx_pl310.c │ │ │ ├── imx_pl310.h │ │ │ ├── link.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── registers │ │ │ │ ├── imx6-crm.h │ │ │ │ ├── imx6-dcp.h │ │ │ │ ├── imx6-iomux.h │ │ │ │ ├── imx6-mmdc.h │ │ │ │ ├── imx6.h │ │ │ │ ├── imx7-crm.h │ │ │ │ ├── imx7-ddrc.h │ │ │ │ ├── imx7-iomux.h │ │ │ │ ├── imx7.h │ │ │ │ ├── imx7ulp-crm.h │ │ │ │ ├── imx7ulp.h │ │ │ │ ├── imx8m-crm.h │ │ │ │ ├── imx8m.h │ │ │ │ ├── imx8q.h │ │ │ │ ├── imx8ulp-crm.h │ │ │ │ ├── imx8ulp.h │ │ │ │ ├── imx93.h │ │ │ │ └── imx95.h │ │ │ ├── sm_platform_handler.c │ │ │ ├── sub.mk │ │ │ └── tzc380.c │ │ ├── plat-k3 │ │ │ ├── conf.mk │ │ │ ├── drivers │ │ │ │ ├── sa2ul.c │ │ │ │ ├── sa2ul.h │ │ │ │ ├── sa2ul_rng.c │ │ │ │ ├── sec_proxy.c │ │ │ │ ├── sec_proxy.h │ │ │ │ ├── sub.mk │ │ │ │ ├── ti_sci.c │ │ │ │ ├── ti_sci.h │ │ │ │ └── ti_sci_protocol.h │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-ls │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── plat_init.S │ │ │ ├── platform_config.h │ │ │ ├── pta │ │ │ │ ├── i2c_rtc_test.c │ │ │ │ └── sub.mk │ │ │ └── sub.mk │ │ ├── plat-marvell │ │ │ ├── armada3700 │ │ │ │ └── hal_sec_perf.c │ │ │ ├── armada7k8k │ │ │ │ └── hal_sec_perf.c │ │ │ ├── cn10k │ │ │ │ └── core_pos.S │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── otx2 │ │ │ │ └── core_pos.S │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-mediatek │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-nuvoton │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-poplar │ │ │ ├── conf.mk │ │ │ ├── hi3798cv200.h │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-rcar │ │ │ ├── conf.mk │ │ │ ├── core_pos_a64.S │ │ │ ├── hw_rng.c │ │ │ ├── link.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── rcar.h │ │ │ ├── romapi.c │ │ │ ├── romapi.h │ │ │ ├── romapi_call.S │ │ │ └── sub.mk │ │ ├── plat-rd1ae │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── rd1ae_core_pos.S │ │ │ └── sub.mk │ │ ├── plat-rockchip │ │ │ ├── common.h │ │ │ ├── conf.mk │ │ │ ├── core_pos_a32.S │ │ │ ├── cru.h │ │ │ ├── grf.h │ │ │ ├── main.c │ │ │ ├── plat_init.S │ │ │ ├── platform.c │ │ │ ├── platform.h │ │ │ ├── platform_config.h │ │ │ ├── platform_px30.c │ │ │ ├── platform_rk322x.c │ │ │ ├── platform_rk3399.c │ │ │ ├── psci_rk322x.c │ │ │ └── sub.mk │ │ ├── plat-rpi3 │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-rzg │ │ │ ├── conf.mk │ │ │ ├── link.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-rzn1 │ │ │ ├── a7_plat_init.S │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── psci.c │ │ │ ├── rzn1_regauth.h │ │ │ ├── rzn1_tz.h │ │ │ ├── sm_platform_handler.c │ │ │ └── sub.mk │ │ ├── plat-sam │ │ │ ├── conf.mk │ │ │ ├── freq.c │ │ │ ├── matrix.c │ │ │ ├── matrix.h │ │ │ ├── nsec-service │ │ │ │ ├── sm_platform_handler.c │ │ │ │ ├── smc_ids.h │ │ │ │ └── sub.mk │ │ │ ├── platform_config.h │ │ │ ├── platform_sama5d2.c │ │ │ ├── platform_sama7g5.c │ │ │ ├── pm │ │ │ │ ├── psci.c │ │ │ │ └── sub.mk │ │ │ ├── sam_pl310.c │ │ │ ├── sam_pl310.h │ │ │ ├── sam_sfr.c │ │ │ ├── sam_sfr.h │ │ │ ├── sama5d2.h │ │ │ ├── sama7g5.h │ │ │ ├── scmi_server.c │ │ │ ├── sub.mk │ │ │ └── tz_matrix.h │ │ ├── plat-sprd │ │ │ ├── conf.mk │ │ │ ├── console.c │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-stm │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── rng_support.c │ │ │ ├── sub.mk │ │ │ └── tz_a9init.S │ │ ├── plat-stm32mp1 │ │ │ ├── boot_api.h │ │ │ ├── conf.mk │ │ │ ├── drivers │ │ │ │ ├── stm32mp1_etzpc.h │ │ │ │ ├── stm32mp1_pmic.c │ │ │ │ ├── stm32mp1_pmic.h │ │ │ │ ├── stm32mp1_pwr.c │ │ │ │ ├── stm32mp1_pwr.h │ │ │ │ ├── stm32mp1_syscfg.c │ │ │ │ ├── stm32mp1_syscfg.h │ │ │ │ └── sub.mk │ │ │ ├── link.mk │ │ │ ├── link_dummies_paged.c │ │ │ ├── main.c │ │ │ ├── nsec-service │ │ │ │ ├── bsec_svc.c │ │ │ │ ├── bsec_svc.h │ │ │ │ ├── stm32mp1_smc.h │ │ │ │ ├── stm32mp1_svc_setup.c │ │ │ │ └── sub.mk │ │ │ ├── plat_tzc400.c │ │ │ ├── platform_config.h │ │ │ ├── pm │ │ │ │ ├── psci.c │ │ │ │ └── sub.mk │ │ │ ├── reset.S │ │ │ ├── scmi_server.c │ │ │ ├── scripts │ │ │ │ └── stm32image.py │ │ │ ├── shared_resources.c │ │ │ ├── stm32_util.h │ │ │ └── sub.mk │ │ ├── plat-stm32mp2 │ │ │ ├── conf.mk │ │ │ ├── drivers │ │ │ │ ├── stm32mp25_syscfg.c │ │ │ │ └── sub.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── stm32_sysconf.h │ │ │ ├── stm32_util.h │ │ │ ├── stm32mp_pm.c │ │ │ ├── stm32mp_pm.h │ │ │ └── sub.mk │ │ ├── plat-sunxi │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── plat_init.S │ │ │ ├── platform_config.h │ │ │ ├── psci.c │ │ │ └── sub.mk │ │ ├── plat-synquacer │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── rng_pta.c │ │ │ ├── sub.mk │ │ │ └── synquacer_rng_pta.h │ │ ├── plat-ti │ │ │ ├── a9_plat_init.S │ │ │ ├── api_monitor_index_a15.h │ │ │ ├── api_monitor_index_a9.h │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── sm_platform_handler_a15.c │ │ │ ├── sm_platform_handler_a9.c │ │ │ ├── sub.mk │ │ │ └── ti_pl310.c │ │ ├── plat-totalcompute │ │ │ ├── conf.mk │ │ │ ├── fdts │ │ │ │ └── optee_sp_manifest.dts │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-uniphier │ │ │ ├── conf.mk │ │ │ ├── kern.ld.S │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-versal │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── plat-vexpress │ │ │ ├── conf.mk │ │ │ ├── juno_core_pos_a32.S │ │ │ ├── juno_core_pos_a64.S │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ ├── sub.mk │ │ │ └── vendor_props.c │ │ ├── plat-zynq7k │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── plat_init.S │ │ │ ├── platform_config.h │ │ │ ├── platform_smc.h │ │ │ └── sub.mk │ │ ├── plat-zynqmp │ │ │ ├── conf.mk │ │ │ ├── main.c │ │ │ ├── platform_config.h │ │ │ └── sub.mk │ │ ├── sm │ │ │ ├── pm.c │ │ │ ├── pm_a32.S │ │ │ ├── psci-helper.S │ │ │ ├── psci.c │ │ │ ├── sm.c │ │ │ ├── sm_a32.S │ │ │ ├── sm_private.h │ │ │ ├── std_smc.c │ │ │ └── sub.mk │ │ └── tee │ │ │ ├── cache.c │ │ │ ├── entry_fast.c │ │ │ ├── sub.mk │ │ │ └── svc_cache.c │ └── riscv │ │ ├── include │ │ ├── encoding.h │ │ ├── kernel │ │ │ ├── arch_scall.h │ │ │ ├── cache_helpers_arch.h │ │ │ ├── clint.h │ │ │ ├── delay_arch.h │ │ │ ├── misc_arch.h │ │ │ ├── secure_partition.h │ │ │ ├── stmm_sp.h │ │ │ ├── tee_l2cc_mutex.h │ │ │ ├── thread_arch.h │ │ │ ├── thread_private_arch.h │ │ │ ├── tlb_helpers.h │ │ │ └── user_access_arch.h │ │ ├── mm │ │ │ ├── core_mmu_arch.h │ │ │ └── generic_ram_layout.h │ │ ├── riscv.h │ │ ├── riscv_macros.S │ │ ├── sbi.h │ │ ├── sub.mk │ │ └── tee │ │ │ ├── entry_fast.h │ │ │ ├── optee_abi.h │ │ │ ├── teeabi_opteed.h │ │ │ └── teeabi_opteed_macros.h │ │ ├── kernel │ │ ├── abort.c │ │ ├── arch_scall.c │ │ ├── arch_scall_rv.S │ │ ├── asm-defines.c │ │ ├── boot.c │ │ ├── cache_helpers_rv.S │ │ ├── csr_detect.S │ │ ├── entry.S │ │ ├── idle.c │ │ ├── kern.ld.S │ │ ├── link.mk │ │ ├── sbi.c │ │ ├── sbi_console.c │ │ ├── semihosting_rv.S │ │ ├── spinlock.S │ │ ├── sub.mk │ │ ├── tee_time_rdtime.c │ │ ├── thread_arch.c │ │ ├── thread_optee_abi.c │ │ ├── thread_optee_abi_rv.S │ │ ├── thread_rv.S │ │ └── unwind_rv.c │ │ ├── mm │ │ ├── core_mmu_arch.c │ │ ├── sub.mk │ │ └── tlb_helpers_rv.S │ │ ├── plat-spike │ │ ├── conf.mk │ │ ├── drivers │ │ │ ├── htif.c │ │ │ ├── htif.h │ │ │ └── sub.mk │ │ ├── kern.ld.S │ │ ├── main.c │ │ ├── platform_config.h │ │ └── sub.mk │ │ ├── plat-virt │ │ ├── conf.mk │ │ ├── main.c │ │ ├── platform_config.h │ │ └── sub.mk │ │ ├── riscv.mk │ │ └── tee │ │ ├── entry_fast.c │ │ └── sub.mk ├── core.mk ├── crypto.mk ├── crypto │ ├── aes-cts.c │ ├── aes-gcm-ghash-tbl.c │ ├── aes-gcm-sw.c │ ├── aes-gcm.c │ ├── cbc-mac.c │ ├── crypto.c │ ├── rng_fortuna.c │ ├── rng_hw.c │ ├── signed_hdr.c │ ├── sm2-kdf.c │ ├── sm3-hash.c │ ├── sm3-hmac.c │ ├── sm3.c │ ├── sm3.h │ ├── sm4-cbc.c │ ├── sm4-ctr.c │ ├── sm4-ecb.c │ ├── sm4-xts.c │ ├── sm4.c │ ├── sm4.h │ ├── sm4_accel.c │ └── sub.mk ├── drivers │ ├── amlogic_uart.c │ ├── atmel_piobu.c │ ├── atmel_rstc.c │ ├── atmel_rtc.c │ ├── atmel_saic.c │ ├── atmel_shdwc.c │ ├── atmel_shdwc_a32.S │ ├── atmel_tcb.c │ ├── atmel_trng.c │ ├── atmel_uart.c │ ├── atmel_wdt.c │ ├── bcm_gpio.c │ ├── bcm_hwrng.c │ ├── bcm_sotp.c │ ├── bnxt │ │ ├── bnxt.c │ │ ├── bnxt_fw.c │ │ ├── bnxt_images.c │ │ └── sub.mk │ ├── cbmem_console.c │ ├── cdns_uart.c │ ├── clk │ │ ├── clk-stm32-core.c │ │ ├── clk-stm32-core.h │ │ ├── clk-stm32mp13.c │ │ ├── clk-stm32mp15.c │ │ ├── clk-stm32mp25.c │ │ ├── clk.c │ │ ├── clk_dt.c │ │ ├── fixed_clk.c │ │ ├── sam │ │ │ ├── at91_audio_pll.c │ │ │ ├── at91_clk.h │ │ │ ├── at91_cpu_opp.c │ │ │ ├── at91_generated.c │ │ │ ├── at91_h32mx.c │ │ │ ├── at91_i2s_mux.c │ │ │ ├── at91_main.c │ │ │ ├── at91_master.c │ │ │ ├── at91_peripheral.c │ │ │ ├── at91_pll.c │ │ │ ├── at91_plldiv.c │ │ │ ├── at91_pmc.c │ │ │ ├── at91_pmc.h │ │ │ ├── at91_programmable.c │ │ │ ├── at91_sckc.c │ │ │ ├── at91_system.c │ │ │ ├── at91_usb.c │ │ │ ├── at91_utmi.c │ │ │ ├── clk-sam9x60-pll.c │ │ │ ├── phy-sama7-utmi-clk.c │ │ │ ├── sama5d2_clk.c │ │ │ ├── sama7g5_clk.c │ │ │ └── sub.mk │ │ └── sub.mk │ ├── crypto │ │ ├── aspeed │ │ │ ├── crypto_ast2600.c │ │ │ ├── hace_ast2600.c │ │ │ ├── hace_ast2600.h │ │ │ └── sub.mk │ │ ├── caam │ │ │ ├── acipher │ │ │ │ ├── caam_dh.c │ │ │ │ ├── caam_dsa.c │ │ │ │ ├── caam_ecc.c │ │ │ │ ├── caam_math.c │ │ │ │ ├── caam_prime_dsa.c │ │ │ │ ├── caam_prime_rsa.c │ │ │ │ ├── caam_rsa.c │ │ │ │ ├── local.h │ │ │ │ └── sub.mk │ │ │ ├── ae │ │ │ │ ├── caam_ae.c │ │ │ │ ├── caam_ae_ccm.c │ │ │ │ ├── caam_ae_gcm.c │ │ │ │ ├── local.h │ │ │ │ └── sub.mk │ │ │ ├── blob │ │ │ │ ├── caam_blob.c │ │ │ │ ├── caam_dek.c │ │ │ │ └── sub.mk │ │ │ ├── caam_ctrl.c │ │ │ ├── caam_desc.c │ │ │ ├── caam_jr.c │ │ │ ├── caam_key.c │ │ │ ├── caam_pwr.c │ │ │ ├── caam_rng.c │ │ │ ├── caam_sm.c │ │ │ ├── cipher │ │ │ │ ├── caam_cipher.c │ │ │ │ ├── caam_cipher_mac.c │ │ │ │ ├── caam_cipher_xts.c │ │ │ │ ├── local.h │ │ │ │ └── sub.mk │ │ │ ├── crypto.mk │ │ │ ├── hal │ │ │ │ ├── common │ │ │ │ │ ├── hal_cfg.c │ │ │ │ │ ├── hal_cfg_dt.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── hal_rng.c │ │ │ │ │ ├── hal_sm.c │ │ │ │ │ ├── hal_sm_dt.c │ │ │ │ │ ├── registers │ │ │ │ │ │ ├── jr_regs.h │ │ │ │ │ │ ├── rng_regs.h │ │ │ │ │ │ ├── sm_regs.h │ │ │ │ │ │ └── version_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ ├── imx_6_7 │ │ │ │ │ ├── hal_clk_mx6.c │ │ │ │ │ ├── hal_clk_mx7.c │ │ │ │ │ ├── hal_clk_mx7ulp.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── registers │ │ │ │ │ │ └── ctrl_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ ├── imx_8m │ │ │ │ │ ├── hal_cfg.c │ │ │ │ │ ├── hal_clk.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── registers │ │ │ │ │ │ └── ctrl_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ ├── imx_8q │ │ │ │ │ ├── hal_cfg.c │ │ │ │ │ ├── hal_clk.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── hal_rng.c │ │ │ │ │ ├── registers │ │ │ │ │ │ └── ctrl_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ ├── imx_8ulp │ │ │ │ │ ├── hal_clk.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── registers │ │ │ │ │ │ └── ctrl_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ ├── ls │ │ │ │ │ ├── hal_clk.c │ │ │ │ │ ├── hal_ctrl.c │ │ │ │ │ ├── hal_jr.c │ │ │ │ │ ├── registers │ │ │ │ │ │ └── ctrl_regs.h │ │ │ │ │ └── sub.mk │ │ │ │ └── sub.mk │ │ │ ├── hash │ │ │ │ ├── caam_hash.c │ │ │ │ ├── caam_hash_mac.c │ │ │ │ ├── local.h │ │ │ │ └── sub.mk │ │ │ ├── include │ │ │ │ ├── caam_acipher.h │ │ │ │ ├── caam_ae.h │ │ │ │ ├── caam_blob.h │ │ │ │ ├── caam_cipher.h │ │ │ │ ├── caam_common.h │ │ │ │ ├── caam_desc_ccb_defines.h │ │ │ │ ├── caam_desc_defines.h │ │ │ │ ├── caam_desc_helper.h │ │ │ │ ├── caam_hal_cfg.h │ │ │ │ ├── caam_hal_clk.h │ │ │ │ ├── caam_hal_ctrl.h │ │ │ │ ├── caam_hal_jr.h │ │ │ │ ├── caam_hal_rng.h │ │ │ │ ├── caam_hal_sm.h │ │ │ │ ├── caam_hash.h │ │ │ │ ├── caam_io.h │ │ │ │ ├── caam_jr.h │ │ │ │ ├── caam_jr_status.h │ │ │ │ ├── caam_key.h │ │ │ │ ├── caam_mp.h │ │ │ │ ├── caam_pwr.h │ │ │ │ ├── caam_rng.h │ │ │ │ ├── caam_sm.h │ │ │ │ ├── caam_status.h │ │ │ │ ├── caam_trace.h │ │ │ │ ├── caam_types.h │ │ │ │ ├── caam_utils_delay.h │ │ │ │ ├── caam_utils_dmaobj.h │ │ │ │ ├── caam_utils_mem.h │ │ │ │ ├── caam_utils_sgt.h │ │ │ │ └── caam_utils_status.h │ │ │ ├── mp │ │ │ │ ├── caam_mp.c │ │ │ │ └── sub.mk │ │ │ ├── sub.mk │ │ │ └── utils │ │ │ │ ├── sub.mk │ │ │ │ ├── utils_delay.c │ │ │ │ ├── utils_dmaobj.c │ │ │ │ ├── utils_mem.c │ │ │ │ ├── utils_sgt.c │ │ │ │ ├── utils_sgt_v1.c │ │ │ │ ├── utils_sgt_v2.c │ │ │ │ └── utils_status.c │ │ ├── crypto_api │ │ │ ├── acipher │ │ │ │ ├── dh.c │ │ │ │ ├── dsa.c │ │ │ │ ├── ecc.c │ │ │ │ ├── local.h │ │ │ │ ├── rsa.c │ │ │ │ ├── rsamgf.c │ │ │ │ ├── rsassa.c │ │ │ │ └── sub.mk │ │ │ ├── authenc │ │ │ │ ├── authenc.c │ │ │ │ └── sub.mk │ │ │ ├── cipher │ │ │ │ ├── cipher.c │ │ │ │ └── sub.mk │ │ │ ├── drvcrypt.c │ │ │ ├── hash │ │ │ │ ├── hash.c │ │ │ │ └── sub.mk │ │ │ ├── include │ │ │ │ ├── drvcrypt.h │ │ │ │ ├── drvcrypt_acipher.h │ │ │ │ ├── drvcrypt_asn1_oid.h │ │ │ │ ├── drvcrypt_authenc.h │ │ │ │ ├── drvcrypt_cipher.h │ │ │ │ ├── drvcrypt_hash.h │ │ │ │ ├── drvcrypt_mac.h │ │ │ │ └── drvcrypt_math.h │ │ │ ├── mac │ │ │ │ ├── mac.c │ │ │ │ └── sub.mk │ │ │ ├── math │ │ │ │ ├── modulus.c │ │ │ │ └── sub.mk │ │ │ ├── oid │ │ │ │ ├── hash_oid.c │ │ │ │ └── sub.mk │ │ │ └── sub.mk │ │ ├── ele │ │ │ ├── acipher │ │ │ │ ├── ecc.c │ │ │ │ └── sub.mk │ │ │ ├── crypto.mk │ │ │ ├── ele.c │ │ │ ├── fuse.c │ │ │ ├── include │ │ │ │ ├── ecc.h │ │ │ │ └── utils_trace.h │ │ │ ├── key_mgmt.c │ │ │ ├── key_store.c │ │ │ ├── sign_verify.c │ │ │ ├── sub.mk │ │ │ ├── utils_mem.c │ │ │ └── utils_trace.c │ │ ├── hisilicon │ │ │ ├── crypto.mk │ │ │ ├── hisi_qm.c │ │ │ ├── hisi_qm.h │ │ │ ├── hpre_dh.c │ │ │ ├── hpre_dh.h │ │ │ ├── hpre_ecc.c │ │ │ ├── hpre_ecc.h │ │ │ ├── hpre_main.c │ │ │ ├── hpre_main.h │ │ │ ├── hpre_montgomery.c │ │ │ ├── hpre_montgomery.h │ │ │ ├── sec_authenc.c │ │ │ ├── sec_authenc.h │ │ │ ├── sec_cipher.c │ │ │ ├── sec_cipher.h │ │ │ ├── sec_hash.c │ │ │ ├── sec_hash.h │ │ │ ├── sec_hmac.c │ │ │ ├── sec_main.c │ │ │ ├── sec_main.h │ │ │ └── sub.mk │ │ ├── se050 │ │ │ ├── adaptors │ │ │ │ ├── apis │ │ │ │ │ ├── apdu.c │ │ │ │ │ ├── sss.c │ │ │ │ │ └── user.c │ │ │ │ ├── include │ │ │ │ │ ├── se050.h │ │ │ │ │ ├── se050_apdu_apis.h │ │ │ │ │ ├── se050_sss_apis.h │ │ │ │ │ ├── se050_user_apis.h │ │ │ │ │ └── se050_utils.h │ │ │ │ ├── sub.mk │ │ │ │ └── utils │ │ │ │ │ ├── info.c │ │ │ │ │ ├── scp_config.c │ │ │ │ │ └── utils.c │ │ │ ├── core │ │ │ │ ├── apdu.c │ │ │ │ ├── cipher.c │ │ │ │ ├── ctr.c │ │ │ │ ├── die_id.c │ │ │ │ ├── ecc.c │ │ │ │ ├── include │ │ │ │ │ └── se050_cipher_algorithms.h │ │ │ │ ├── rng.c │ │ │ │ ├── rsa.c │ │ │ │ ├── scp03.c │ │ │ │ ├── storage.c │ │ │ │ └── sub.mk │ │ │ ├── crypto.mk │ │ │ ├── glue │ │ │ │ ├── i2c.c │ │ │ │ ├── i2c_imx.c │ │ │ │ ├── i2c_stm32.c │ │ │ │ ├── include │ │ │ │ │ └── i2c_native.h │ │ │ │ └── user.c │ │ │ ├── session.c │ │ │ └── sub.mk │ │ ├── stm32 │ │ │ ├── authenc.c │ │ │ ├── cipher.c │ │ │ ├── common.h │ │ │ ├── crypto.mk │ │ │ ├── stm32_cryp.c │ │ │ ├── stm32_cryp.h │ │ │ ├── stm32_saes.c │ │ │ ├── stm32_saes.h │ │ │ └── sub.mk │ │ ├── sub.mk │ │ └── versal │ │ │ ├── authenc.c │ │ │ ├── crypto.mk │ │ │ ├── ecc.c │ │ │ ├── include │ │ │ └── ipi.h │ │ │ ├── ipi.c │ │ │ ├── rsa.c │ │ │ └── sub.mk │ ├── dra7_rng.c │ ├── ffa_console.c │ ├── firewall │ │ ├── firewall.c │ │ ├── stm32_iac.c │ │ ├── stm32_rif.c │ │ ├── stm32_rifsc.c │ │ ├── stm32_risaf.c │ │ ├── stm32_serc.c │ │ └── sub.mk │ ├── gic.c │ ├── gpio │ │ ├── gpio.c │ │ └── sub.mk │ ├── hfic.c │ ├── hi16xx_rng.c │ ├── hi16xx_uart.c │ ├── hisi_trng.c │ ├── i2c │ │ ├── atmel_i2c.c │ │ ├── i2c.c │ │ └── sub.mk │ ├── imx │ │ ├── dcp │ │ │ ├── dcp.c │ │ │ ├── dcp_huk.c │ │ │ ├── dcp_utils.c │ │ │ ├── include │ │ │ │ ├── dcp_utils.h │ │ │ │ └── local.h │ │ │ └── sub.mk │ │ ├── mu │ │ │ ├── imx_mu.c │ │ │ ├── imx_mu_8q.c │ │ │ ├── imx_mu_8ulp.c │ │ │ ├── imx_mu_platform.h │ │ │ └── sub.mk │ │ └── sub.mk │ ├── imx_caam.c │ ├── imx_csu.c │ ├── imx_i2c.c │ ├── imx_lpuart.c │ ├── imx_ocotp.c │ ├── imx_rngb.c │ ├── imx_sc_api.c │ ├── imx_scu.c │ ├── imx_snvs.c │ ├── imx_trusted_arm_ce.c │ ├── imx_uart.c │ ├── imx_wdog.c │ ├── lpc_uart.c │ ├── ls_dspi.c │ ├── ls_gpio.c │ ├── ls_i2c.c │ ├── ls_sec_mon.c │ ├── ls_sfp.c │ ├── mvebu_uart.c │ ├── ns16550.c │ ├── nvmem │ │ ├── atmel_sfc.c │ │ ├── nvmem.c │ │ ├── nvmem_die_id.c │ │ ├── nvmem_huk.c │ │ └── sub.mk │ ├── pinctrl │ │ ├── atmel_pio.c │ │ ├── pinctrl.c │ │ └── sub.mk │ ├── pl011.c │ ├── pl022_spi.c │ ├── pl061_gpio.c │ ├── plic.c │ ├── pm │ │ ├── imx │ │ │ ├── busfreq │ │ │ │ ├── busfreq.c │ │ │ │ ├── busfreq_asm_imx7.S │ │ │ │ ├── busfreq_ddr3_imx6.S │ │ │ │ ├── busfreq_imx6.c │ │ │ │ ├── busfreq_imx6.h │ │ │ │ ├── busfreq_imx6_defines.c │ │ │ │ ├── busfreq_imx7.c │ │ │ │ ├── busfreq_imx7.h │ │ │ │ ├── busfreq_imx7_defines.c │ │ │ │ ├── busfreq_lpddr2_imx6.S │ │ │ │ ├── busfreq_macro_imx6.S │ │ │ │ ├── sub.mk │ │ │ │ └── utils.S │ │ │ ├── cpuidle │ │ │ │ ├── cpuidle-imx6sl.c │ │ │ │ ├── cpuidle-imx6sll.c │ │ │ │ ├── cpuidle-imx6sx.c │ │ │ │ ├── cpuidle-imx6ul.c │ │ │ │ ├── cpuidle-imx7d.c │ │ │ │ ├── psci-cpuidle-imx6sl.S │ │ │ │ ├── psci-cpuidle-imx6sll.S │ │ │ │ ├── psci-cpuidle-imx6sx.S │ │ │ │ ├── psci-cpuidle-imx6ul.S │ │ │ │ ├── psci-cpuidle-imx6ull.S │ │ │ │ ├── psci-cpuidle-imx7.S │ │ │ │ └── sub.mk │ │ │ ├── gpcv2.c │ │ │ ├── imx_ocram.c │ │ │ ├── imx_pm.h │ │ │ ├── imx_pm_asm_defines.c │ │ │ ├── local.h │ │ │ ├── mmdc.c │ │ │ ├── pm-imx6.c │ │ │ ├── pm-imx7.c │ │ │ ├── pm-imx7ulp.c │ │ │ ├── pm-imx8.c │ │ │ ├── psci.c │ │ │ ├── src.c │ │ │ ├── sub.mk │ │ │ └── suspend │ │ │ │ ├── imx6_suspend.c │ │ │ │ ├── imx7_suspend.c │ │ │ │ ├── imx7ulp_suspend.c │ │ │ │ ├── psci-suspend-imx6.S │ │ │ │ ├── psci-suspend-imx7.S │ │ │ │ ├── psci-suspend-imx7ulp.S │ │ │ │ └── sub.mk │ │ ├── sam │ │ │ ├── at91_pm.c │ │ │ ├── at91_pm.h │ │ │ ├── pm-defines.c │ │ │ ├── pm_resume.S │ │ │ ├── pm_suspend.S │ │ │ └── sub.mk │ │ └── sub.mk │ ├── regulator │ │ ├── regulator.c │ │ ├── regulator_dt.c │ │ ├── regulator_fixed.c │ │ ├── regulator_gpio.c │ │ ├── stm32_vrefbuf.c │ │ ├── stm32mp13_regulator_iod.c │ │ └── sub.mk │ ├── remoteproc │ │ ├── stm32_remoteproc.c │ │ └── sub.mk │ ├── riscv_zkr_rng.c │ ├── rstctrl │ │ ├── rstctrl.c │ │ ├── stm32_rstctrl.c │ │ ├── stm32_rstctrl.h │ │ ├── stm32mp1_rstctrl.c │ │ ├── stm32mp25_rstctrl.c │ │ └── sub.mk │ ├── rtc │ │ ├── rtc.c │ │ └── sub.mk │ ├── scif.c │ ├── scmi-msg │ │ ├── base.c │ │ ├── base.h │ │ ├── clock.c │ │ ├── clock.h │ │ ├── clock_generic.c │ │ ├── common.h │ │ ├── entry.c │ │ ├── reset_domain.c │ │ ├── reset_domain.h │ │ ├── shm_msg.c │ │ ├── smt.c │ │ ├── sub.mk │ │ ├── voltage_domain.c │ │ └── voltage_domain.h │ ├── semihosting_console.c │ ├── serial8250_uart.c │ ├── smccc_trng.c │ ├── sp805_wdt.c │ ├── sprd_uart.c │ ├── stih_asc.c │ ├── stm32_bsec.c │ ├── stm32_etzpc.c │ ├── stm32_fmc.c │ ├── stm32_gpio.c │ ├── stm32_hpdma.c │ ├── stm32_hsem.c │ ├── stm32_i2c.c │ ├── stm32_ipcc.c │ ├── stm32_iwdg.c │ ├── stm32_rng.c │ ├── stm32_shared_io.c │ ├── stm32_tamp.c │ ├── stm32_uart.c │ ├── stm32mp15_huk.c │ ├── stpmic1.c │ ├── sub.mk │ ├── tzc380.c │ ├── tzc400.c │ ├── versal_gpio.c │ ├── versal_huk.c │ ├── versal_mbox.c │ ├── versal_nvm.c │ ├── versal_pm.c │ ├── versal_puf.c │ ├── versal_sha3_384.c │ ├── versal_trng.c │ ├── wdt │ │ ├── sub.mk │ │ ├── watchdog.c │ │ └── watchdog_sm.c │ ├── widevine_huk.c │ ├── xiphera_trng.c │ ├── zynqmp_csu_aes.c │ ├── zynqmp_csu_puf.c │ ├── zynqmp_csudma.c │ ├── zynqmp_huk.c │ └── zynqmp_pm.c ├── include │ ├── console.h │ ├── crypto │ │ ├── crypto.h │ │ ├── crypto_accel.h │ │ ├── crypto_impl.h │ │ ├── crypto_se.h │ │ ├── internal_aes-gcm.h │ │ └── sm2-kdf.h │ ├── drivers │ │ ├── amlogic_uart.h │ │ ├── atmel_rstc.h │ │ ├── atmel_rtc.h │ │ ├── atmel_saic.h │ │ ├── atmel_shdwc.h │ │ ├── atmel_uart.h │ │ ├── bcm │ │ │ └── bnxt.h │ │ ├── bcm_gpio.h │ │ ├── bcm_hwrng.h │ │ ├── bcm_sotp.h │ │ ├── caam_extension.h │ │ ├── cbmem_console.h │ │ ├── cdns_uart.h │ │ ├── clk.h │ │ ├── clk_dt.h │ │ ├── ele │ │ │ ├── ele.h │ │ │ ├── key_mgmt.h │ │ │ ├── key_store.h │ │ │ ├── sign_verify.h │ │ │ └── utils_mem.h │ │ ├── ele_extension.h │ │ ├── ffa_console.h │ │ ├── firewall.h │ │ ├── firewall_device.h │ │ ├── gic.h │ │ ├── gpio.h │ │ ├── hfic.h │ │ ├── hi16xx_uart.h │ │ ├── i2c.h │ │ ├── imx │ │ │ └── dcp.h │ │ ├── imx_i2c.h │ │ ├── imx_mu.h │ │ ├── imx_ocotp.h │ │ ├── imx_sc_api.h │ │ ├── imx_scu.h │ │ ├── imx_snvs.h │ │ ├── imx_trusted_arm_ce.h │ │ ├── imx_uart.h │ │ ├── imx_wdog.h │ │ ├── lpc_uart.h │ │ ├── ls_dspi.h │ │ ├── ls_gpio.h │ │ ├── ls_i2c.h │ │ ├── ls_sec_mon.h │ │ ├── ls_sfp.h │ │ ├── mvebu_uart.h │ │ ├── ns16550.h │ │ ├── nvmem.h │ │ ├── pinctrl.h │ │ ├── pl011.h │ │ ├── pl022_spi.h │ │ ├── pl061_gpio.h │ │ ├── plic.h │ │ ├── pm │ │ │ ├── imx │ │ │ │ └── busfreq.h │ │ │ └── sam │ │ │ │ └── atmel_pm.h │ │ ├── regulator.h │ │ ├── rstctrl.h │ │ ├── rtc.h │ │ ├── sam │ │ │ ├── at91_ddr.h │ │ │ └── sama7-ddr.h │ │ ├── scif.h │ │ ├── scmi-msg.h │ │ ├── scmi.h │ │ ├── semihosting_console.h │ │ ├── serial.h │ │ ├── serial8250_uart.h │ │ ├── sp805_wdt.h │ │ ├── sprd_uart.h │ │ ├── stih_asc.h │ │ ├── stm32_bsec.h │ │ ├── stm32_etzpc.h │ │ ├── stm32_gpio.h │ │ ├── stm32_i2c.h │ │ ├── stm32_iwdg.h │ │ ├── stm32_remoteproc.h │ │ ├── stm32_rif.h │ │ ├── stm32_risaf.h │ │ ├── stm32_shared_io.h │ │ ├── stm32_tamp.h │ │ ├── stm32_uart.h │ │ ├── stm32_vrefbuf.h │ │ ├── stm32mp13_rcc.h │ │ ├── stm32mp13_regulator_iod.h │ │ ├── stm32mp1_rcc.h │ │ ├── stm32mp25_rcc.h │ │ ├── stm32mp2_rcc_util.h │ │ ├── stm32mp_dt_bindings.h │ │ ├── stpmic1.h │ │ ├── stpmic1_regulator.h │ │ ├── tzc380.h │ │ ├── tzc400.h │ │ ├── versal_gpio.h │ │ ├── versal_mbox.h │ │ ├── versal_nvm.h │ │ ├── versal_pm.h │ │ ├── versal_puf.h │ │ ├── versal_sha3_384.h │ │ ├── wdt.h │ │ ├── zynqmp_csu.h │ │ ├── zynqmp_csu_aes.h │ │ ├── zynqmp_csu_puf.h │ │ ├── zynqmp_csudma.h │ │ ├── zynqmp_efuse.h │ │ ├── zynqmp_huk.h │ │ └── zynqmp_pm.h │ ├── dt-bindings │ │ ├── clock │ │ │ ├── at91.h │ │ │ ├── st,stm32mp25-rcc.h │ │ │ ├── stm32mp1-clks.h │ │ │ ├── stm32mp13-clks.h │ │ │ ├── stm32mp13-clksrc.h │ │ │ └── stm32mp25-clksrc.h │ │ ├── dma │ │ │ └── at91.h │ │ ├── firewall │ │ │ ├── stm32mp25-rif.h │ │ │ ├── stm32mp25-rifsc.h │ │ │ └── stm32mp25-risaf.h │ │ ├── gpio │ │ │ ├── atmel,piobu.h │ │ │ ├── gpio.h │ │ │ └── stm32mp_gpio.h │ │ ├── iio │ │ │ └── adc │ │ │ │ └── at91-sama5d2_adc.h │ │ ├── interrupt-controller │ │ │ ├── arm-gic.h │ │ │ └── irq.h │ │ ├── mfd │ │ │ ├── atmel-flexcom.h │ │ │ └── st,stpmic1.h │ │ ├── pinctrl │ │ │ └── stm32-pinfunc.h │ │ ├── regulator │ │ │ ├── active-semi,8945a-regulator.h │ │ │ ├── st,stm32mp13-regulator.h │ │ │ └── st,stm32mp15-regulator.h │ │ ├── reset │ │ │ ├── st,stm32mp25-rcc.h │ │ │ ├── stm32mp1-resets.h │ │ │ └── stm32mp13-resets.h │ │ └── rtc │ │ │ └── rtc-stm32.h │ ├── gen-asm-defines.h │ ├── initcall.h │ ├── io.h │ ├── keep.h │ ├── kernel │ │ ├── abort.h │ │ ├── asan.h │ │ ├── boot.h │ │ ├── cache_helpers.h │ │ ├── callout.h │ │ ├── chip_services.h │ │ ├── delay.h │ │ ├── dt.h │ │ ├── dt_driver.h │ │ ├── early_ta.h │ │ ├── embedded_ts.h │ │ ├── handle.h │ │ ├── huk_subkey.h │ │ ├── interrupt.h │ │ ├── ldelf_loader.h │ │ ├── ldelf_syscalls.h │ │ ├── linker.h │ │ ├── lockdep.h │ │ ├── misc.h │ │ ├── msg_param.h │ │ ├── mutex.h │ │ ├── mutex_pm_aware.h │ │ ├── notif.h │ │ ├── nv_counter.h │ │ ├── panic.h │ │ ├── pm.h │ │ ├── pseudo_ta.h │ │ ├── refcount.h │ │ ├── rpc_io_i2c.h │ │ ├── scall.h │ │ ├── semihosting.h │ │ ├── spinlock.h │ │ ├── tee_common.h │ │ ├── tee_common_otp.h │ │ ├── tee_misc.h │ │ ├── tee_ta_manager.h │ │ ├── tee_time.h │ │ ├── thread.h │ │ ├── thread_private.h │ │ ├── timer.h │ │ ├── tpm.h │ │ ├── trace_ta.h │ │ ├── transfer_list.h │ │ ├── ts_manager.h │ │ ├── ts_store.h │ │ ├── unwind.h │ │ ├── user_access.h │ │ ├── user_mode_ctx.h │ │ ├── user_mode_ctx_struct.h │ │ ├── user_ta.h │ │ ├── virtualization.h │ │ └── wait_queue.h │ ├── mm │ │ ├── core_memprot.h │ │ ├── core_mmu.h │ │ ├── file.h │ │ ├── fobj.h │ │ ├── mobj.h │ │ ├── pgt_cache.h │ │ ├── phys_mem.h │ │ ├── sp_mem.h │ │ ├── tee_mm.h │ │ ├── tee_mmu_types.h │ │ ├── tee_pager.h │ │ └── vm.h │ ├── optee_msg.h │ ├── optee_rpc_cmd.h │ ├── rng_support.h │ ├── scattered_array.h │ ├── signed_hdr.h │ ├── spi.h │ ├── ta_pub_key.h │ └── tee │ │ ├── cache.h │ │ ├── entry_std.h │ │ ├── fs_dirfile.h │ │ ├── fs_htree.h │ │ ├── svc_cache.h │ │ ├── tadb.h │ │ ├── tee_cryp_concat_kdf.h │ │ ├── tee_cryp_hkdf.h │ │ ├── tee_cryp_pbkdf2.h │ │ ├── tee_cryp_utl.h │ │ ├── tee_fs.h │ │ ├── tee_fs_key_manager.h │ │ ├── tee_fs_rpc.h │ │ ├── tee_obj.h │ │ ├── tee_pobj.h │ │ ├── tee_supp_plugin_rpc.h │ │ ├── tee_svc.h │ │ ├── tee_svc_cryp.h │ │ ├── tee_svc_storage.h │ │ ├── tee_ta_enc_manager.h │ │ └── uuid.h ├── kernel │ ├── asan.c │ ├── assert.c │ ├── boot.c │ ├── callout.c │ ├── console.c │ ├── delay.c │ ├── dt.c │ ├── dt_driver.c │ ├── early_ta.c │ ├── embedded_ts.c │ ├── handle.c │ ├── huk_subkey.c │ ├── initcall.c │ ├── interrupt.c │ ├── ldelf_loader.c │ ├── ldelf_syscalls.c │ ├── lockdep.c │ ├── msg_param.c │ ├── mutex.c │ ├── mutex_lockdep.c │ ├── mutex_lockdep.h │ ├── notif.c │ ├── notif_default.c │ ├── nv_counter.c │ ├── otp_stubs.c │ ├── panic.c │ ├── pm.c │ ├── pseudo_ta.c │ ├── ree_fs_ta.c │ ├── refcount.c │ ├── scall.c │ ├── scattered_array.c │ ├── secstor_ta.c │ ├── semihosting.c │ ├── show_conf.c │ ├── spin_lock_debug.c │ ├── sub.mk │ ├── tee_misc.c │ ├── tee_ta_manager.c │ ├── tee_time.c │ ├── tee_time_ree.c │ ├── thread.c │ ├── tpm.c │ ├── trace_ext.c │ ├── transfer_list.c │ ├── ts_manager.c │ ├── ubsan.c │ ├── user_access.c │ ├── user_mode_ctx.c │ ├── user_ta.c │ └── wait_queue.c ├── lib │ ├── libfdt │ │ ├── README.license │ │ ├── fdt.c │ │ ├── fdt_addresses.c │ │ ├── fdt_empty_tree.c │ │ ├── fdt_overlay.c │ │ ├── fdt_ro.c │ │ ├── fdt_rw.c │ │ ├── fdt_strerror.c │ │ ├── fdt_sw.c │ │ ├── fdt_wip.c │ │ ├── include │ │ │ ├── fdt.h │ │ │ ├── libfdt.h │ │ │ └── libfdt_env.h │ │ ├── libfdt_internal.h │ │ └── sub.mk │ ├── libtomcrypt │ │ ├── acipher_helpers.h │ │ ├── aes.c │ │ ├── aes_accel.c │ │ ├── cbc.c │ │ ├── ccm.c │ │ ├── cmac.c │ │ ├── ctr.c │ │ ├── des2_key.h │ │ ├── dh.c │ │ ├── dsa.c │ │ ├── ecb.c │ │ ├── ecc.c │ │ ├── ed25519.c │ │ ├── gcm.c │ │ ├── hash.c │ │ ├── hmac.c │ │ ├── include │ │ │ ├── tomcrypt_init.h │ │ │ └── tomcrypt_mp.h │ │ ├── mpi_desc.c │ │ ├── rsa.c │ │ ├── sha1_accel.c │ │ ├── sha256_accel.c │ │ ├── sha3_accel.c │ │ ├── sha512_accel.c │ │ ├── shake.c │ │ ├── sm2-dsa.c │ │ ├── sm2-kep.c │ │ ├── sm2-pke.c │ │ ├── src │ │ │ ├── ciphers │ │ │ │ ├── aes │ │ │ │ │ ├── aes.c │ │ │ │ │ ├── aes_desc.c │ │ │ │ │ ├── aes_tab.c │ │ │ │ │ └── aesni.c │ │ │ │ ├── anubis.c │ │ │ │ ├── blowfish.c │ │ │ │ ├── camellia.c │ │ │ │ ├── cast5.c │ │ │ │ ├── des.c │ │ │ │ ├── idea.c │ │ │ │ ├── kasumi.c │ │ │ │ ├── khazad.c │ │ │ │ ├── kseed.c │ │ │ │ ├── multi2.c │ │ │ │ ├── noekeon.c │ │ │ │ ├── rc2.c │ │ │ │ ├── rc5.c │ │ │ │ ├── rc6.c │ │ │ │ ├── safer │ │ │ │ │ ├── safer.c │ │ │ │ │ ├── safer_tab.c │ │ │ │ │ └── saferp.c │ │ │ │ ├── serpent.c │ │ │ │ ├── skipjack.c │ │ │ │ ├── tea.c │ │ │ │ ├── twofish │ │ │ │ │ ├── twofish.c │ │ │ │ │ └── twofish_tab.c │ │ │ │ └── xtea.c │ │ │ ├── encauth │ │ │ │ ├── ccm │ │ │ │ │ ├── ccm_add_aad.c │ │ │ │ │ ├── ccm_add_nonce.c │ │ │ │ │ ├── ccm_done.c │ │ │ │ │ ├── ccm_init.c │ │ │ │ │ ├── ccm_memory.c │ │ │ │ │ ├── ccm_process.c │ │ │ │ │ ├── ccm_reset.c │ │ │ │ │ └── ccm_test.c │ │ │ │ ├── chachapoly │ │ │ │ │ ├── chacha20poly1305_add_aad.c │ │ │ │ │ ├── chacha20poly1305_decrypt.c │ │ │ │ │ ├── chacha20poly1305_done.c │ │ │ │ │ ├── chacha20poly1305_encrypt.c │ │ │ │ │ ├── chacha20poly1305_init.c │ │ │ │ │ ├── chacha20poly1305_memory.c │ │ │ │ │ ├── chacha20poly1305_setiv.c │ │ │ │ │ ├── chacha20poly1305_setiv_rfc7905.c │ │ │ │ │ └── chacha20poly1305_test.c │ │ │ │ ├── eax │ │ │ │ │ ├── eax_addheader.c │ │ │ │ │ ├── eax_decrypt.c │ │ │ │ │ ├── eax_decrypt_verify_memory.c │ │ │ │ │ ├── eax_done.c │ │ │ │ │ ├── eax_encrypt.c │ │ │ │ │ ├── eax_encrypt_authenticate_memory.c │ │ │ │ │ ├── eax_init.c │ │ │ │ │ └── eax_test.c │ │ │ │ ├── gcm │ │ │ │ │ ├── gcm_add_aad.c │ │ │ │ │ ├── gcm_add_iv.c │ │ │ │ │ ├── gcm_done.c │ │ │ │ │ ├── gcm_gf_mult.c │ │ │ │ │ ├── gcm_init.c │ │ │ │ │ ├── gcm_memory.c │ │ │ │ │ ├── gcm_mult_h.c │ │ │ │ │ ├── gcm_mult_h_arm_ce.c │ │ │ │ │ ├── gcm_process.c │ │ │ │ │ ├── gcm_reset.c │ │ │ │ │ └── gcm_test.c │ │ │ │ ├── ocb │ │ │ │ │ ├── ocb_decrypt.c │ │ │ │ │ ├── ocb_decrypt_verify_memory.c │ │ │ │ │ ├── ocb_done_decrypt.c │ │ │ │ │ ├── ocb_done_encrypt.c │ │ │ │ │ ├── ocb_encrypt.c │ │ │ │ │ ├── ocb_encrypt_authenticate_memory.c │ │ │ │ │ ├── ocb_init.c │ │ │ │ │ ├── ocb_ntz.c │ │ │ │ │ ├── ocb_shift_xor.c │ │ │ │ │ ├── ocb_test.c │ │ │ │ │ └── s_ocb_done.c │ │ │ │ └── ocb3 │ │ │ │ │ ├── ocb3_add_aad.c │ │ │ │ │ ├── ocb3_decrypt.c │ │ │ │ │ ├── ocb3_decrypt_last.c │ │ │ │ │ ├── ocb3_decrypt_verify_memory.c │ │ │ │ │ ├── ocb3_done.c │ │ │ │ │ ├── ocb3_encrypt.c │ │ │ │ │ ├── ocb3_encrypt_authenticate_memory.c │ │ │ │ │ ├── ocb3_encrypt_last.c │ │ │ │ │ ├── ocb3_init.c │ │ │ │ │ ├── ocb3_int_ntz.c │ │ │ │ │ ├── ocb3_int_xor_blocks.c │ │ │ │ │ └── ocb3_test.c │ │ │ ├── hashes │ │ │ │ ├── blake2b.c │ │ │ │ ├── blake2s.c │ │ │ │ ├── chc │ │ │ │ │ └── chc.c │ │ │ │ ├── helper │ │ │ │ │ ├── hash_file.c │ │ │ │ │ ├── hash_filehandle.c │ │ │ │ │ ├── hash_memory.c │ │ │ │ │ └── hash_memory_multi.c │ │ │ │ ├── md2.c │ │ │ │ ├── md4.c │ │ │ │ ├── md5.c │ │ │ │ ├── rmd128.c │ │ │ │ ├── rmd160.c │ │ │ │ ├── rmd256.c │ │ │ │ ├── rmd320.c │ │ │ │ ├── sha1.c │ │ │ │ ├── sha2 │ │ │ │ │ ├── sha224.c │ │ │ │ │ ├── sha256.c │ │ │ │ │ ├── sha384.c │ │ │ │ │ ├── sha512.c │ │ │ │ │ ├── sha512_224.c │ │ │ │ │ └── sha512_256.c │ │ │ │ ├── sha3.c │ │ │ │ ├── sha3_test.c │ │ │ │ ├── tiger.c │ │ │ │ └── whirl │ │ │ │ │ ├── whirl.c │ │ │ │ │ └── whirltab.c │ │ │ ├── headers │ │ │ │ ├── tomcrypt.h │ │ │ │ ├── tomcrypt_argchk.h │ │ │ │ ├── tomcrypt_arm_neon.h │ │ │ │ ├── tomcrypt_cfg.h │ │ │ │ ├── tomcrypt_cipher.h │ │ │ │ ├── tomcrypt_custom.h │ │ │ │ ├── tomcrypt_hash.h │ │ │ │ ├── tomcrypt_mac.h │ │ │ │ ├── tomcrypt_macros.h │ │ │ │ ├── tomcrypt_math.h │ │ │ │ ├── tomcrypt_misc.h │ │ │ │ ├── tomcrypt_pk.h │ │ │ │ ├── tomcrypt_pkcs.h │ │ │ │ ├── tomcrypt_private.h │ │ │ │ └── tomcrypt_prng.h │ │ │ ├── mac │ │ │ │ ├── blake2 │ │ │ │ │ ├── blake2bmac.c │ │ │ │ │ ├── blake2bmac_file.c │ │ │ │ │ ├── blake2bmac_memory.c │ │ │ │ │ ├── blake2bmac_memory_multi.c │ │ │ │ │ ├── blake2bmac_test.c │ │ │ │ │ ├── blake2smac.c │ │ │ │ │ ├── blake2smac_file.c │ │ │ │ │ ├── blake2smac_memory.c │ │ │ │ │ ├── blake2smac_memory_multi.c │ │ │ │ │ └── blake2smac_test.c │ │ │ │ ├── f9 │ │ │ │ │ ├── f9_done.c │ │ │ │ │ ├── f9_file.c │ │ │ │ │ ├── f9_init.c │ │ │ │ │ ├── f9_memory.c │ │ │ │ │ ├── f9_memory_multi.c │ │ │ │ │ ├── f9_process.c │ │ │ │ │ └── f9_test.c │ │ │ │ ├── hmac │ │ │ │ │ ├── hmac_done.c │ │ │ │ │ ├── hmac_file.c │ │ │ │ │ ├── hmac_init.c │ │ │ │ │ ├── hmac_memory.c │ │ │ │ │ ├── hmac_memory_multi.c │ │ │ │ │ ├── hmac_process.c │ │ │ │ │ └── hmac_test.c │ │ │ │ ├── omac │ │ │ │ │ ├── omac_done.c │ │ │ │ │ ├── omac_file.c │ │ │ │ │ ├── omac_init.c │ │ │ │ │ ├── omac_memory.c │ │ │ │ │ ├── omac_memory_multi.c │ │ │ │ │ ├── omac_process.c │ │ │ │ │ └── omac_test.c │ │ │ │ ├── pelican │ │ │ │ │ ├── pelican.c │ │ │ │ │ ├── pelican_memory.c │ │ │ │ │ └── pelican_test.c │ │ │ │ ├── pmac │ │ │ │ │ ├── pmac_done.c │ │ │ │ │ ├── pmac_file.c │ │ │ │ │ ├── pmac_init.c │ │ │ │ │ ├── pmac_memory.c │ │ │ │ │ ├── pmac_memory_multi.c │ │ │ │ │ ├── pmac_ntz.c │ │ │ │ │ ├── pmac_process.c │ │ │ │ │ ├── pmac_shift_xor.c │ │ │ │ │ └── pmac_test.c │ │ │ │ ├── poly1305 │ │ │ │ │ ├── poly1305.c │ │ │ │ │ ├── poly1305_file.c │ │ │ │ │ ├── poly1305_memory.c │ │ │ │ │ ├── poly1305_memory_multi.c │ │ │ │ │ └── poly1305_test.c │ │ │ │ └── xcbc │ │ │ │ │ ├── xcbc_done.c │ │ │ │ │ ├── xcbc_file.c │ │ │ │ │ ├── xcbc_init.c │ │ │ │ │ ├── xcbc_memory.c │ │ │ │ │ ├── xcbc_memory_multi.c │ │ │ │ │ ├── xcbc_process.c │ │ │ │ │ └── xcbc_test.c │ │ │ ├── math │ │ │ │ ├── fp │ │ │ │ │ └── ltc_ecc_fp_mulmod.c │ │ │ │ ├── gmp_desc.c │ │ │ │ ├── ltm_desc.c │ │ │ │ ├── multi.c │ │ │ │ ├── radix_to_bin.c │ │ │ │ ├── rand_bn.c │ │ │ │ ├── rand_prime.c │ │ │ │ └── tfm_desc.c │ │ │ ├── misc │ │ │ │ ├── adler32.c │ │ │ │ ├── base16 │ │ │ │ │ ├── base16_decode.c │ │ │ │ │ └── base16_encode.c │ │ │ │ ├── base32 │ │ │ │ │ ├── base32_decode.c │ │ │ │ │ └── base32_encode.c │ │ │ │ ├── base64 │ │ │ │ │ ├── base64_decode.c │ │ │ │ │ └── base64_encode.c │ │ │ │ ├── bcrypt │ │ │ │ │ └── bcrypt.c │ │ │ │ ├── burn_stack.c │ │ │ │ ├── compare_testvector.c │ │ │ │ ├── copy_or_zeromem.c │ │ │ │ ├── crc32.c │ │ │ │ ├── crypt │ │ │ │ │ ├── crypt.c │ │ │ │ │ ├── crypt_argchk.c │ │ │ │ │ ├── crypt_cipher_descriptor.c │ │ │ │ │ ├── crypt_cipher_is_valid.c │ │ │ │ │ ├── crypt_constants.c │ │ │ │ │ ├── crypt_find_cipher.c │ │ │ │ │ ├── crypt_find_cipher_any.c │ │ │ │ │ ├── crypt_find_cipher_id.c │ │ │ │ │ ├── crypt_find_hash.c │ │ │ │ │ ├── crypt_find_hash_any.c │ │ │ │ │ ├── crypt_find_hash_id.c │ │ │ │ │ ├── crypt_find_hash_oid.c │ │ │ │ │ ├── crypt_find_prng.c │ │ │ │ │ ├── crypt_fsa.c │ │ │ │ │ ├── crypt_hash_descriptor.c │ │ │ │ │ ├── crypt_hash_is_valid.c │ │ │ │ │ ├── crypt_inits.c │ │ │ │ │ ├── crypt_ltc_mp_descriptor.c │ │ │ │ │ ├── crypt_prng_descriptor.c │ │ │ │ │ ├── crypt_prng_is_valid.c │ │ │ │ │ ├── crypt_prng_rng_descriptor.c │ │ │ │ │ ├── crypt_register_all_ciphers.c │ │ │ │ │ ├── crypt_register_all_hashes.c │ │ │ │ │ ├── crypt_register_all_prngs.c │ │ │ │ │ ├── crypt_register_cipher.c │ │ │ │ │ ├── crypt_register_hash.c │ │ │ │ │ ├── crypt_register_prng.c │ │ │ │ │ ├── crypt_sizes.c │ │ │ │ │ ├── crypt_unregister_cipher.c │ │ │ │ │ ├── crypt_unregister_hash.c │ │ │ │ │ └── crypt_unregister_prng.c │ │ │ │ ├── error_to_string.c │ │ │ │ ├── hkdf │ │ │ │ │ ├── hkdf.c │ │ │ │ │ └── hkdf_test.c │ │ │ │ ├── mem_neq.c │ │ │ │ ├── padding │ │ │ │ │ ├── padding_depad.c │ │ │ │ │ └── padding_pad.c │ │ │ │ ├── pbes │ │ │ │ │ ├── pbes.c │ │ │ │ │ ├── pbes1.c │ │ │ │ │ └── pbes2.c │ │ │ │ ├── pkcs12 │ │ │ │ │ ├── pkcs12_kdf.c │ │ │ │ │ └── pkcs12_utf8_to_utf16.c │ │ │ │ ├── pkcs5 │ │ │ │ │ ├── pkcs_5_1.c │ │ │ │ │ ├── pkcs_5_2.c │ │ │ │ │ └── pkcs_5_test.c │ │ │ │ ├── ssh │ │ │ │ │ ├── ssh_decode_sequence_multi.c │ │ │ │ │ └── ssh_encode_sequence_multi.c │ │ │ │ └── zeromem.c │ │ │ ├── modes │ │ │ │ ├── cbc │ │ │ │ │ ├── cbc_decrypt.c │ │ │ │ │ ├── cbc_done.c │ │ │ │ │ ├── cbc_encrypt.c │ │ │ │ │ ├── cbc_getiv.c │ │ │ │ │ ├── cbc_setiv.c │ │ │ │ │ └── cbc_start.c │ │ │ │ ├── cfb │ │ │ │ │ ├── cfb_decrypt.c │ │ │ │ │ ├── cfb_done.c │ │ │ │ │ ├── cfb_encrypt.c │ │ │ │ │ ├── cfb_getiv.c │ │ │ │ │ ├── cfb_setiv.c │ │ │ │ │ └── cfb_start.c │ │ │ │ ├── ctr │ │ │ │ │ ├── ctr_decrypt.c │ │ │ │ │ ├── ctr_done.c │ │ │ │ │ ├── ctr_encrypt.c │ │ │ │ │ ├── ctr_getiv.c │ │ │ │ │ ├── ctr_setiv.c │ │ │ │ │ ├── ctr_start.c │ │ │ │ │ └── ctr_test.c │ │ │ │ ├── ecb │ │ │ │ │ ├── ecb_decrypt.c │ │ │ │ │ ├── ecb_done.c │ │ │ │ │ ├── ecb_encrypt.c │ │ │ │ │ └── ecb_start.c │ │ │ │ ├── f8 │ │ │ │ │ ├── f8_decrypt.c │ │ │ │ │ ├── f8_done.c │ │ │ │ │ ├── f8_encrypt.c │ │ │ │ │ ├── f8_getiv.c │ │ │ │ │ ├── f8_setiv.c │ │ │ │ │ ├── f8_start.c │ │ │ │ │ └── f8_test_mode.c │ │ │ │ ├── lrw │ │ │ │ │ ├── lrw_decrypt.c │ │ │ │ │ ├── lrw_done.c │ │ │ │ │ ├── lrw_encrypt.c │ │ │ │ │ ├── lrw_getiv.c │ │ │ │ │ ├── lrw_process.c │ │ │ │ │ ├── lrw_setiv.c │ │ │ │ │ ├── lrw_start.c │ │ │ │ │ └── lrw_test.c │ │ │ │ ├── ofb │ │ │ │ │ ├── ofb_decrypt.c │ │ │ │ │ ├── ofb_done.c │ │ │ │ │ ├── ofb_encrypt.c │ │ │ │ │ ├── ofb_getiv.c │ │ │ │ │ ├── ofb_setiv.c │ │ │ │ │ └── ofb_start.c │ │ │ │ └── xts │ │ │ │ │ ├── xts_decrypt.c │ │ │ │ │ ├── xts_done.c │ │ │ │ │ ├── xts_encrypt.c │ │ │ │ │ ├── xts_init.c │ │ │ │ │ ├── xts_mult_x.c │ │ │ │ │ └── xts_test.c │ │ │ ├── pk │ │ │ │ ├── asn1 │ │ │ │ │ ├── der │ │ │ │ │ │ ├── bit │ │ │ │ │ │ │ ├── der_decode_bit_string.c │ │ │ │ │ │ │ ├── der_decode_raw_bit_string.c │ │ │ │ │ │ │ ├── der_encode_bit_string.c │ │ │ │ │ │ │ ├── der_encode_raw_bit_string.c │ │ │ │ │ │ │ └── der_length_bit_string.c │ │ │ │ │ │ ├── boolean │ │ │ │ │ │ │ ├── der_decode_boolean.c │ │ │ │ │ │ │ ├── der_encode_boolean.c │ │ │ │ │ │ │ └── der_length_boolean.c │ │ │ │ │ │ ├── choice │ │ │ │ │ │ │ └── der_decode_choice.c │ │ │ │ │ │ ├── custom_type │ │ │ │ │ │ │ ├── der_decode_custom_type.c │ │ │ │ │ │ │ ├── der_encode_custom_type.c │ │ │ │ │ │ │ └── der_length_custom_type.c │ │ │ │ │ │ ├── general │ │ │ │ │ │ │ ├── der_asn1_maps.c │ │ │ │ │ │ │ ├── der_decode_asn1_identifier.c │ │ │ │ │ │ │ ├── der_decode_asn1_length.c │ │ │ │ │ │ │ ├── der_encode_asn1_identifier.c │ │ │ │ │ │ │ ├── der_encode_asn1_length.c │ │ │ │ │ │ │ ├── der_length_asn1_identifier.c │ │ │ │ │ │ │ └── der_length_asn1_length.c │ │ │ │ │ │ ├── generalizedtime │ │ │ │ │ │ │ ├── der_decode_generalizedtime.c │ │ │ │ │ │ │ ├── der_encode_generalizedtime.c │ │ │ │ │ │ │ └── der_length_generalizedtime.c │ │ │ │ │ │ ├── ia5 │ │ │ │ │ │ │ ├── der_decode_ia5_string.c │ │ │ │ │ │ │ ├── der_encode_ia5_string.c │ │ │ │ │ │ │ └── der_length_ia5_string.c │ │ │ │ │ │ ├── integer │ │ │ │ │ │ │ ├── der_decode_integer.c │ │ │ │ │ │ │ ├── der_encode_integer.c │ │ │ │ │ │ │ └── der_length_integer.c │ │ │ │ │ │ ├── object_identifier │ │ │ │ │ │ │ ├── der_decode_object_identifier.c │ │ │ │ │ │ │ ├── der_encode_object_identifier.c │ │ │ │ │ │ │ └── der_length_object_identifier.c │ │ │ │ │ │ ├── octet │ │ │ │ │ │ │ ├── der_decode_octet_string.c │ │ │ │ │ │ │ ├── der_encode_octet_string.c │ │ │ │ │ │ │ └── der_length_octet_string.c │ │ │ │ │ │ ├── printable_string │ │ │ │ │ │ │ ├── der_decode_printable_string.c │ │ │ │ │ │ │ ├── der_encode_printable_string.c │ │ │ │ │ │ │ └── der_length_printable_string.c │ │ │ │ │ │ ├── sequence │ │ │ │ │ │ │ ├── der_decode_sequence_ex.c │ │ │ │ │ │ │ ├── der_decode_sequence_flexi.c │ │ │ │ │ │ │ ├── der_decode_sequence_multi.c │ │ │ │ │ │ │ ├── der_encode_sequence_ex.c │ │ │ │ │ │ │ ├── der_encode_sequence_multi.c │ │ │ │ │ │ │ ├── der_length_sequence.c │ │ │ │ │ │ │ ├── der_sequence_free.c │ │ │ │ │ │ │ └── der_sequence_shrink.c │ │ │ │ │ │ ├── set │ │ │ │ │ │ │ ├── der_encode_set.c │ │ │ │ │ │ │ └── der_encode_setof.c │ │ │ │ │ │ ├── short_integer │ │ │ │ │ │ │ ├── der_decode_short_integer.c │ │ │ │ │ │ │ ├── der_encode_short_integer.c │ │ │ │ │ │ │ └── der_length_short_integer.c │ │ │ │ │ │ ├── teletex_string │ │ │ │ │ │ │ ├── der_decode_teletex_string.c │ │ │ │ │ │ │ └── der_length_teletex_string.c │ │ │ │ │ │ ├── utctime │ │ │ │ │ │ │ ├── der_decode_utctime.c │ │ │ │ │ │ │ ├── der_encode_utctime.c │ │ │ │ │ │ │ └── der_length_utctime.c │ │ │ │ │ │ └── utf8 │ │ │ │ │ │ │ ├── der_decode_utf8_string.c │ │ │ │ │ │ │ ├── der_encode_utf8_string.c │ │ │ │ │ │ │ └── der_length_utf8_string.c │ │ │ │ │ ├── oid │ │ │ │ │ │ ├── pk_get_oid.c │ │ │ │ │ │ ├── pk_oid_cmp.c │ │ │ │ │ │ └── pk_oid_str.c │ │ │ │ │ ├── pkcs8 │ │ │ │ │ │ └── pkcs8_decode_flexi.c │ │ │ │ │ └── x509 │ │ │ │ │ │ ├── x509_decode_public_key_from_certificate.c │ │ │ │ │ │ ├── x509_decode_subject_public_key_info.c │ │ │ │ │ │ └── x509_encode_subject_public_key_info.c │ │ │ │ ├── dh │ │ │ │ │ ├── dh.c │ │ │ │ │ ├── dh_check_pubkey.c │ │ │ │ │ ├── dh_export.c │ │ │ │ │ ├── dh_export_key.c │ │ │ │ │ ├── dh_free.c │ │ │ │ │ ├── dh_generate_key.c │ │ │ │ │ ├── dh_import.c │ │ │ │ │ ├── dh_make_key.c │ │ │ │ │ ├── dh_set.c │ │ │ │ │ ├── dh_set_pg_dhparam.c │ │ │ │ │ └── dh_shared_secret.c │ │ │ │ ├── dsa │ │ │ │ │ ├── dsa_decrypt_key.c │ │ │ │ │ ├── dsa_encrypt_key.c │ │ │ │ │ ├── dsa_export.c │ │ │ │ │ ├── dsa_free.c │ │ │ │ │ ├── dsa_generate_key.c │ │ │ │ │ ├── dsa_generate_pqg.c │ │ │ │ │ ├── dsa_import.c │ │ │ │ │ ├── dsa_make_key.c │ │ │ │ │ ├── dsa_set.c │ │ │ │ │ ├── dsa_set_pqg_dsaparam.c │ │ │ │ │ ├── dsa_shared_secret.c │ │ │ │ │ ├── dsa_sign_hash.c │ │ │ │ │ ├── dsa_verify_hash.c │ │ │ │ │ └── dsa_verify_key.c │ │ │ │ ├── ec25519 │ │ │ │ │ ├── ec25519_crypto_ctx.c │ │ │ │ │ ├── ec25519_export.c │ │ │ │ │ ├── ec25519_import_pkcs8.c │ │ │ │ │ └── tweetnacl.c │ │ │ │ ├── ecc │ │ │ │ │ ├── ecc.c │ │ │ │ │ ├── ecc_ansi_x963_export.c │ │ │ │ │ ├── ecc_ansi_x963_import.c │ │ │ │ │ ├── ecc_decrypt_key.c │ │ │ │ │ ├── ecc_encrypt_key.c │ │ │ │ │ ├── ecc_export.c │ │ │ │ │ ├── ecc_export_openssl.c │ │ │ │ │ ├── ecc_find_curve.c │ │ │ │ │ ├── ecc_free.c │ │ │ │ │ ├── ecc_get_key.c │ │ │ │ │ ├── ecc_get_oid_str.c │ │ │ │ │ ├── ecc_get_size.c │ │ │ │ │ ├── ecc_import.c │ │ │ │ │ ├── ecc_import_openssl.c │ │ │ │ │ ├── ecc_import_pkcs8.c │ │ │ │ │ ├── ecc_import_x509.c │ │ │ │ │ ├── ecc_make_key.c │ │ │ │ │ ├── ecc_recover_key.c │ │ │ │ │ ├── ecc_set_curve.c │ │ │ │ │ ├── ecc_set_curve_internal.c │ │ │ │ │ ├── ecc_set_key.c │ │ │ │ │ ├── ecc_shared_secret.c │ │ │ │ │ ├── ecc_sign_hash.c │ │ │ │ │ ├── ecc_sizes.c │ │ │ │ │ ├── ecc_ssh_ecdsa_encode_name.c │ │ │ │ │ ├── ecc_verify_hash.c │ │ │ │ │ ├── ltc_ecc_export_point.c │ │ │ │ │ ├── ltc_ecc_import_point.c │ │ │ │ │ ├── ltc_ecc_is_point.c │ │ │ │ │ ├── ltc_ecc_is_point_at_infinity.c │ │ │ │ │ ├── ltc_ecc_map.c │ │ │ │ │ ├── ltc_ecc_mul2add.c │ │ │ │ │ ├── ltc_ecc_mulmod.c │ │ │ │ │ ├── ltc_ecc_mulmod_timing.c │ │ │ │ │ ├── ltc_ecc_points.c │ │ │ │ │ ├── ltc_ecc_projective_add_point.c │ │ │ │ │ ├── ltc_ecc_projective_dbl_point.c │ │ │ │ │ └── ltc_ecc_verify_key.c │ │ │ │ ├── ed25519 │ │ │ │ │ ├── ed25519_export.c │ │ │ │ │ ├── ed25519_import.c │ │ │ │ │ ├── ed25519_import_pkcs8.c │ │ │ │ │ ├── ed25519_import_raw.c │ │ │ │ │ ├── ed25519_import_x509.c │ │ │ │ │ ├── ed25519_make_key.c │ │ │ │ │ ├── ed25519_sign.c │ │ │ │ │ └── ed25519_verify.c │ │ │ │ ├── pkcs1 │ │ │ │ │ ├── pkcs_1_i2osp.c │ │ │ │ │ ├── pkcs_1_mgf1.c │ │ │ │ │ ├── pkcs_1_oaep_decode.c │ │ │ │ │ ├── pkcs_1_oaep_encode.c │ │ │ │ │ ├── pkcs_1_os2ip.c │ │ │ │ │ ├── pkcs_1_pss_decode.c │ │ │ │ │ ├── pkcs_1_pss_encode.c │ │ │ │ │ ├── pkcs_1_v1_5_decode.c │ │ │ │ │ └── pkcs_1_v1_5_encode.c │ │ │ │ ├── rsa │ │ │ │ │ ├── rsa_decrypt_key.c │ │ │ │ │ ├── rsa_encrypt_key.c │ │ │ │ │ ├── rsa_export.c │ │ │ │ │ ├── rsa_exptmod.c │ │ │ │ │ ├── rsa_get_size.c │ │ │ │ │ ├── rsa_import.c │ │ │ │ │ ├── rsa_import_pkcs8.c │ │ │ │ │ ├── rsa_import_x509.c │ │ │ │ │ ├── rsa_key.c │ │ │ │ │ ├── rsa_make_key.c │ │ │ │ │ ├── rsa_set.c │ │ │ │ │ ├── rsa_sign_hash.c │ │ │ │ │ ├── rsa_sign_saltlen_get.c │ │ │ │ │ └── rsa_verify_hash.c │ │ │ │ └── x25519 │ │ │ │ │ ├── x25519_export.c │ │ │ │ │ ├── x25519_import.c │ │ │ │ │ ├── x25519_import_pkcs8.c │ │ │ │ │ ├── x25519_import_raw.c │ │ │ │ │ ├── x25519_import_x509.c │ │ │ │ │ ├── x25519_make_key.c │ │ │ │ │ └── x25519_shared_secret.c │ │ │ ├── prngs │ │ │ │ ├── chacha20.c │ │ │ │ ├── fortuna.c │ │ │ │ ├── rc4.c │ │ │ │ ├── rng_get_bytes.c │ │ │ │ ├── rng_make_prng.c │ │ │ │ ├── sober128.c │ │ │ │ ├── sprng.c │ │ │ │ └── yarrow.c │ │ │ └── stream │ │ │ │ ├── chacha │ │ │ │ ├── chacha_crypt.c │ │ │ │ ├── chacha_done.c │ │ │ │ ├── chacha_ivctr32.c │ │ │ │ ├── chacha_ivctr64.c │ │ │ │ ├── chacha_keystream.c │ │ │ │ ├── chacha_memory.c │ │ │ │ ├── chacha_setup.c │ │ │ │ └── chacha_test.c │ │ │ │ ├── rabbit │ │ │ │ ├── rabbit.c │ │ │ │ └── rabbit_memory.c │ │ │ │ ├── rc4 │ │ │ │ ├── rc4_stream.c │ │ │ │ ├── rc4_stream_memory.c │ │ │ │ └── rc4_test.c │ │ │ │ ├── salsa20 │ │ │ │ ├── salsa20_crypt.c │ │ │ │ ├── salsa20_done.c │ │ │ │ ├── salsa20_ivctr64.c │ │ │ │ ├── salsa20_keystream.c │ │ │ │ ├── salsa20_memory.c │ │ │ │ ├── salsa20_setup.c │ │ │ │ ├── salsa20_test.c │ │ │ │ ├── xsalsa20_memory.c │ │ │ │ ├── xsalsa20_setup.c │ │ │ │ └── xsalsa20_test.c │ │ │ │ ├── sober128 │ │ │ │ ├── sober128_stream.c │ │ │ │ ├── sober128_stream_memory.c │ │ │ │ ├── sober128_test.c │ │ │ │ └── sober128tab.c │ │ │ │ └── sosemanuk │ │ │ │ ├── sosemanuk.c │ │ │ │ ├── sosemanuk_memory.c │ │ │ │ └── sosemanuk_test.c │ │ ├── sub.mk │ │ ├── tomcrypt.c │ │ ├── x25519.c │ │ └── xts.c │ ├── scmi-server │ │ ├── conf-optee-fvp.mk │ │ ├── conf-optee-stm32mp1.mk │ │ ├── conf.mk │ │ ├── include │ │ │ └── optee_scmi.h │ │ ├── scmi_server.c │ │ └── sub.mk │ └── zlib │ │ ├── adler32.c │ │ ├── gzguts.h │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── sub.mk │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zutil.c │ │ └── zutil.h ├── mm │ ├── core_mmu.c │ ├── file.c │ ├── fobj.c │ ├── mobj.c │ ├── mobj_dyn_shm.c │ ├── pgt_cache.c │ ├── phys_mem.c │ ├── sub.mk │ ├── tee_mm.c │ └── vm.c ├── pta │ ├── apdu.c │ ├── attestation.c │ ├── bcm │ │ ├── bnxt.c │ │ ├── elog.c │ │ ├── gpio.c │ │ ├── hwrng.c │ │ ├── sotp.c │ │ ├── sub.mk │ │ └── wdt.c │ ├── device.c │ ├── gprof.c │ ├── hwrng.c │ ├── imx │ │ ├── dek_blob.c │ │ ├── digprog.c │ │ ├── ele_test.c │ │ ├── manufacturing_protection.c │ │ ├── ocotp.c │ │ ├── sub.mk │ │ └── trusted_arm_ce.c │ ├── k3 │ │ ├── otp.c │ │ └── sub.mk │ ├── rtc.c │ ├── scmi.c │ ├── scp03.c │ ├── secstor_ta_mgmt.c │ ├── stats.c │ ├── stm32mp │ │ ├── bsec_pta.c │ │ ├── remoteproc_pta.c │ │ ├── rproc_pub_key.h │ │ └── sub.mk │ ├── sub.mk │ ├── system.c │ ├── tests │ │ ├── aes_perf.c │ │ ├── dt_driver_test.c │ │ ├── fs_htree.c │ │ ├── invoke.c │ │ ├── lockdep.c │ │ ├── misc.c │ │ ├── misc.h │ │ ├── mutex.c │ │ └── sub.mk │ └── widevine.c ├── sub.mk ├── tee │ ├── entry_std.c │ ├── fs_dirfile.c │ ├── fs_htree.c │ ├── socket.c │ ├── sub.mk │ ├── tadb.c │ ├── tee_cryp_concat_kdf.c │ ├── tee_cryp_hkdf.c │ ├── tee_cryp_pbkdf2.c │ ├── tee_cryp_utl.c │ ├── tee_fs_key_manager.c │ ├── tee_fs_rpc.c │ ├── tee_obj.c │ ├── tee_pobj.c │ ├── tee_ree_fs.c │ ├── tee_rpmb_fs.c │ ├── tee_supp_plugin_rpc.c │ ├── tee_svc.c │ ├── tee_svc_cryp.c │ ├── tee_svc_storage.c │ ├── tee_ta_enc_manager.c │ ├── tee_time_generic.c │ └── uuid.c └── tests │ ├── ftmn_boot_tests.c │ ├── notif_test_wd.c │ └── sub.mk ├── keys ├── default.pem └── default_ta.pem ├── ldelf ├── dl.c ├── dl.h ├── ftrace.c ├── ftrace.h ├── include │ ├── ldelf.h │ └── ldelf_syscalls.h ├── ldelf.ld.S ├── ldelf.mk ├── link.mk ├── main.c ├── pauth.c ├── pauth.h ├── start_a32.S ├── start_a64.S ├── start_rv64.S ├── sub.mk ├── sys.c ├── sys.h ├── syscalls_a32.S ├── syscalls_a64.S ├── syscalls_asm.S ├── syscalls_rv.S ├── ta_elf.c ├── ta_elf.h ├── ta_elf_rel.c └── tlsdesc_rel_a64.S ├── lib ├── libdl │ ├── dlfcn.c │ ├── include │ │ └── dlfcn.h │ └── sub.mk ├── libmbedtls │ ├── core │ │ ├── aes.c │ │ ├── aes_cbc.c │ │ ├── aes_ctr.c │ │ ├── aes_ecb.c │ │ ├── bignum.c │ │ ├── cmac.c │ │ ├── des3_cbc.c │ │ ├── des3_ecb.c │ │ ├── des_cbc.c │ │ ├── des_ecb.c │ │ ├── dh.c │ │ ├── ecc.c │ │ ├── hash.c │ │ ├── hmac.c │ │ ├── mbed_helpers.c │ │ ├── mbed_helpers.h │ │ ├── rsa.c │ │ ├── sm2-dsa.c │ │ ├── sm2-dsa.h │ │ ├── sm2-kep.c │ │ ├── sm2-pke.c │ │ ├── sm2-pke.h │ │ ├── sub.mk │ │ └── tomcrypt.c │ ├── include │ │ ├── aes_alt.h │ │ ├── mbedtls_config_kernel.h │ │ └── mbedtls_config_uta.h │ ├── mbedtls │ │ ├── .uncrustify.cfg │ │ ├── BUGS.md │ │ ├── CONTRIBUTING.md │ │ ├── ChangeLog │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── SUPPORT.md │ │ ├── dco.txt │ │ ├── include │ │ │ ├── mbedtls │ │ │ │ ├── aes.h │ │ │ │ ├── aria.h │ │ │ │ ├── asn1.h │ │ │ │ ├── asn1write.h │ │ │ │ ├── base64.h │ │ │ │ ├── bignum.h │ │ │ │ ├── block_cipher.h │ │ │ │ ├── build_info.h │ │ │ │ ├── camellia.h │ │ │ │ ├── ccm.h │ │ │ │ ├── chacha20.h │ │ │ │ ├── chachapoly.h │ │ │ │ ├── check_config.h │ │ │ │ ├── cipher.h │ │ │ │ ├── cmac.h │ │ │ │ ├── compat-2.x.h │ │ │ │ ├── config_adjust_legacy_crypto.h │ │ │ │ ├── config_adjust_legacy_from_psa.h │ │ │ │ ├── config_adjust_psa_from_legacy.h │ │ │ │ ├── config_adjust_psa_superset_legacy.h │ │ │ │ ├── config_adjust_ssl.h │ │ │ │ ├── config_adjust_x509.h │ │ │ │ ├── config_psa.h │ │ │ │ ├── constant_time.h │ │ │ │ ├── ctr_drbg.h │ │ │ │ ├── debug.h │ │ │ │ ├── des.h │ │ │ │ ├── dhm.h │ │ │ │ ├── ecdh.h │ │ │ │ ├── ecdsa.h │ │ │ │ ├── ecjpake.h │ │ │ │ ├── ecp.h │ │ │ │ ├── entropy.h │ │ │ │ ├── error.h │ │ │ │ ├── gcm.h │ │ │ │ ├── hkdf.h │ │ │ │ ├── hmac_drbg.h │ │ │ │ ├── lms.h │ │ │ │ ├── mbedtls_config.h │ │ │ │ ├── md.h │ │ │ │ ├── md5.h │ │ │ │ ├── memory_buffer_alloc.h │ │ │ │ ├── net_sockets.h │ │ │ │ ├── nist_kw.h │ │ │ │ ├── oid.h │ │ │ │ ├── pem.h │ │ │ │ ├── pk.h │ │ │ │ ├── pkcs12.h │ │ │ │ ├── pkcs5.h │ │ │ │ ├── pkcs7.h │ │ │ │ ├── platform.h │ │ │ │ ├── platform_time.h │ │ │ │ ├── platform_util.h │ │ │ │ ├── poly1305.h │ │ │ │ ├── private_access.h │ │ │ │ ├── psa_util.h │ │ │ │ ├── ripemd160.h │ │ │ │ ├── rsa.h │ │ │ │ ├── sha1.h │ │ │ │ ├── sha256.h │ │ │ │ ├── sha3.h │ │ │ │ ├── sha512.h │ │ │ │ ├── ssl.h │ │ │ │ ├── ssl_cache.h │ │ │ │ ├── ssl_ciphersuites.h │ │ │ │ ├── ssl_cookie.h │ │ │ │ ├── ssl_ticket.h │ │ │ │ ├── threading.h │ │ │ │ ├── timing.h │ │ │ │ ├── version.h │ │ │ │ ├── x509.h │ │ │ │ ├── x509_crl.h │ │ │ │ ├── x509_crt.h │ │ │ │ └── x509_csr.h │ │ │ └── psa │ │ │ │ ├── build_info.h │ │ │ │ ├── crypto.h │ │ │ │ ├── crypto_adjust_auto_enabled.h │ │ │ │ ├── crypto_adjust_config_key_pair_types.h │ │ │ │ ├── crypto_adjust_config_synonyms.h │ │ │ │ ├── crypto_builtin_composites.h │ │ │ │ ├── crypto_builtin_key_derivation.h │ │ │ │ ├── crypto_builtin_primitives.h │ │ │ │ ├── crypto_compat.h │ │ │ │ ├── crypto_config.h │ │ │ │ ├── crypto_driver_common.h │ │ │ │ ├── crypto_driver_contexts_composites.h │ │ │ │ ├── crypto_driver_contexts_key_derivation.h │ │ │ │ ├── crypto_driver_contexts_primitives.h │ │ │ │ ├── crypto_extra.h │ │ │ │ ├── crypto_legacy.h │ │ │ │ ├── crypto_platform.h │ │ │ │ ├── crypto_se_driver.h │ │ │ │ ├── crypto_sizes.h │ │ │ │ ├── crypto_struct.h │ │ │ │ ├── crypto_types.h │ │ │ │ └── crypto_values.h │ │ └── library │ │ │ ├── aes.c │ │ │ ├── aesce.c │ │ │ ├── aesce.h │ │ │ ├── aesni.c │ │ │ ├── aesni.h │ │ │ ├── alignment.h │ │ │ ├── aria.c │ │ │ ├── asn1parse.c │ │ │ ├── asn1write.c │ │ │ ├── base64.c │ │ │ ├── base64_internal.h │ │ │ ├── bignum.c │ │ │ ├── bignum_core.c │ │ │ ├── bignum_core.h │ │ │ ├── bignum_mod.c │ │ │ ├── bignum_mod.h │ │ │ ├── bignum_mod_raw.c │ │ │ ├── bignum_mod_raw.h │ │ │ ├── bignum_mod_raw_invasive.h │ │ │ ├── block_cipher.c │ │ │ ├── block_cipher_internal.h │ │ │ ├── bn_mul.h │ │ │ ├── camellia.c │ │ │ ├── ccm.c │ │ │ ├── chacha20.c │ │ │ ├── chachapoly.c │ │ │ ├── check_crypto_config.h │ │ │ ├── cipher.c │ │ │ ├── cipher_wrap.c │ │ │ ├── cipher_wrap.h │ │ │ ├── cmac.c │ │ │ ├── common.h │ │ │ ├── constant_time.c │ │ │ ├── constant_time_impl.h │ │ │ ├── constant_time_internal.h │ │ │ ├── ctr.h │ │ │ ├── ctr_drbg.c │ │ │ ├── debug.c │ │ │ ├── debug_internal.h │ │ │ ├── des.c │ │ │ ├── dhm.c │ │ │ ├── ecdh.c │ │ │ ├── ecdsa.c │ │ │ ├── ecjpake.c │ │ │ ├── ecp.c │ │ │ ├── ecp_curves.c │ │ │ ├── ecp_curves_new.c │ │ │ ├── ecp_internal_alt.h │ │ │ ├── ecp_invasive.h │ │ │ ├── entropy.c │ │ │ ├── entropy_poll.c │ │ │ ├── entropy_poll.h │ │ │ ├── error.c │ │ │ ├── gcm.c │ │ │ ├── hkdf.c │ │ │ ├── hmac_drbg.c │ │ │ ├── lmots.c │ │ │ ├── lmots.h │ │ │ ├── lms.c │ │ │ ├── md.c │ │ │ ├── md5.c │ │ │ ├── md_psa.h │ │ │ ├── md_wrap.h │ │ │ ├── memory_buffer_alloc.c │ │ │ ├── net_sockets.c │ │ │ ├── nist_kw.c │ │ │ ├── oid.c │ │ │ ├── padlock.c │ │ │ ├── padlock.h │ │ │ ├── pem.c │ │ │ ├── pk.c │ │ │ ├── pk_ecc.c │ │ │ ├── pk_internal.h │ │ │ ├── pk_wrap.c │ │ │ ├── pk_wrap.h │ │ │ ├── pkcs12.c │ │ │ ├── pkcs5.c │ │ │ ├── pkcs7.c │ │ │ ├── pkparse.c │ │ │ ├── pkwrite.c │ │ │ ├── pkwrite.h │ │ │ ├── platform.c │ │ │ ├── platform_util.c │ │ │ ├── poly1305.c │ │ │ ├── psa_crypto.c │ │ │ ├── psa_crypto_aead.c │ │ │ ├── psa_crypto_aead.h │ │ │ ├── psa_crypto_cipher.c │ │ │ ├── psa_crypto_cipher.h │ │ │ ├── psa_crypto_client.c │ │ │ ├── psa_crypto_core.h │ │ │ ├── psa_crypto_core_common.h │ │ │ ├── psa_crypto_driver_wrappers.h │ │ │ ├── psa_crypto_driver_wrappers_no_static.c │ │ │ ├── psa_crypto_driver_wrappers_no_static.h │ │ │ ├── psa_crypto_ecp.c │ │ │ ├── psa_crypto_ecp.h │ │ │ ├── psa_crypto_ffdh.c │ │ │ ├── psa_crypto_ffdh.h │ │ │ ├── psa_crypto_hash.c │ │ │ ├── psa_crypto_hash.h │ │ │ ├── psa_crypto_invasive.h │ │ │ ├── psa_crypto_its.h │ │ │ ├── psa_crypto_mac.c │ │ │ ├── psa_crypto_mac.h │ │ │ ├── psa_crypto_pake.c │ │ │ ├── psa_crypto_pake.h │ │ │ ├── psa_crypto_random_impl.h │ │ │ ├── psa_crypto_rsa.c │ │ │ ├── psa_crypto_rsa.h │ │ │ ├── psa_crypto_se.c │ │ │ ├── psa_crypto_se.h │ │ │ ├── psa_crypto_slot_management.c │ │ │ ├── psa_crypto_slot_management.h │ │ │ ├── psa_crypto_storage.c │ │ │ ├── psa_crypto_storage.h │ │ │ ├── psa_its_file.c │ │ │ ├── psa_util.c │ │ │ ├── psa_util_internal.h │ │ │ ├── ripemd160.c │ │ │ ├── rsa.c │ │ │ ├── rsa_alt_helpers.c │ │ │ ├── rsa_alt_helpers.h │ │ │ ├── rsa_internal.h │ │ │ ├── sha1.c │ │ │ ├── sha256.c │ │ │ ├── sha3.c │ │ │ ├── sha512.c │ │ │ ├── ssl_cache.c │ │ │ ├── ssl_ciphersuites.c │ │ │ ├── ssl_ciphersuites_internal.h │ │ │ ├── ssl_client.c │ │ │ ├── ssl_client.h │ │ │ ├── ssl_cookie.c │ │ │ ├── ssl_debug_helpers.h │ │ │ ├── ssl_debug_helpers_generated.c │ │ │ ├── ssl_misc.h │ │ │ ├── ssl_msg.c │ │ │ ├── ssl_ticket.c │ │ │ ├── ssl_tls.c │ │ │ ├── ssl_tls12_client.c │ │ │ ├── ssl_tls12_server.c │ │ │ ├── ssl_tls13_client.c │ │ │ ├── ssl_tls13_generic.c │ │ │ ├── ssl_tls13_invasive.h │ │ │ ├── ssl_tls13_keys.c │ │ │ ├── ssl_tls13_keys.h │ │ │ ├── ssl_tls13_server.c │ │ │ ├── threading.c │ │ │ ├── timing.c │ │ │ ├── version.c │ │ │ ├── version_features.c │ │ │ ├── x509.c │ │ │ ├── x509_create.c │ │ │ ├── x509_crl.c │ │ │ ├── x509_crt.c │ │ │ ├── x509_csr.c │ │ │ ├── x509_internal.h │ │ │ ├── x509write.c │ │ │ ├── x509write_crt.c │ │ │ └── x509write_csr.c │ └── sub.mk ├── libunw │ ├── include │ │ └── unw │ │ │ └── unwind.h │ ├── sub.mk │ ├── unwind_arm32.c │ ├── unwind_arm64.c │ └── unwind_riscv.c ├── libutee │ ├── abort.c │ ├── arch │ │ ├── arm │ │ │ ├── arm32_user_sysreg.txt │ │ │ ├── gprof │ │ │ │ ├── gmon.h │ │ │ │ ├── gmon_out.h │ │ │ │ ├── gprof.c │ │ │ │ ├── gprof_pta.c │ │ │ │ ├── gprof_pta.h │ │ │ │ └── sub.mk │ │ │ ├── sub.mk │ │ │ ├── utee_syscalls_a32.S │ │ │ └── utee_syscalls_a64.S │ │ └── riscv │ │ │ ├── sub.mk │ │ │ └── utee_syscalls_rv.S │ ├── assert.c │ ├── include │ │ ├── __tee_ipsocket.h │ │ ├── __tee_isocket_defines.h │ │ ├── __tee_tcpsocket_defines.h │ │ ├── __tee_tcpsocket_defines_extensions.h │ │ ├── __tee_udpsocket_defines.h │ │ ├── arm64_user_sysreg.h │ │ ├── arm_user_sysreg.h │ │ ├── elf.h │ │ ├── elf32.h │ │ ├── elf64.h │ │ ├── elf_common.h │ │ ├── k3 │ │ │ └── otp_keywriting_ta.h │ │ ├── link.h │ │ ├── pta_apdu.h │ │ ├── pta_attestation.h │ │ ├── pta_device.h │ │ ├── pta_ele_test.h │ │ ├── pta_gprof.h │ │ ├── pta_i2c_rtc_test.h │ │ ├── pta_imx_dek_blob.h │ │ ├── pta_imx_digprog.h │ │ ├── pta_imx_manufacturing_protection.h │ │ ├── pta_imx_ocotp.h │ │ ├── pta_imx_trusted_arm_ce.h │ │ ├── pta_invoke_tests.h │ │ ├── pta_rng.h │ │ ├── pta_rtc.h │ │ ├── pta_scmi_client.h │ │ ├── pta_scp03.h │ │ ├── pta_secstor_ta_mgmt.h │ │ ├── pta_socket.h │ │ ├── pta_stats.h │ │ ├── pta_stm32mp_bsec.h │ │ ├── pta_system.h │ │ ├── pta_widevine.h │ │ ├── remoteproc_pta.h │ │ ├── riscv_user_sysreg.h │ │ ├── rng_pta_client.h │ │ ├── tee_api.h │ │ ├── tee_api_compat.h │ │ ├── tee_api_defines.h │ │ ├── tee_api_defines_extensions.h │ │ ├── tee_api_types.h │ │ ├── tee_arith_internal.h │ │ ├── tee_internal_api.h │ │ ├── tee_internal_api_extensions.h │ │ ├── tee_isocket.h │ │ ├── tee_syscall_numbers.h │ │ ├── tee_ta_api.h │ │ ├── tee_tcpsocket.h │ │ ├── tee_udpsocket.h │ │ ├── user_ta_header.h │ │ ├── utee_defines.h │ │ ├── utee_syscalls.h │ │ ├── utee_syscalls_asm.S │ │ └── utee_types.h │ ├── sub.mk │ ├── tcb.c │ ├── tee_api.c │ ├── tee_api_arith_mpi.c │ ├── tee_api_objects.c │ ├── tee_api_operations.c │ ├── tee_api_panic.c │ ├── tee_api_private.h │ ├── tee_api_property.c │ ├── tee_socket_private.h │ ├── tee_socket_pta.c │ ├── tee_system_pta.c │ ├── tee_tcpudp_socket.c │ ├── tee_uuid_from_str.c │ ├── trace_ext.c │ ├── user_ta_entry.c │ └── user_ta_entry_compat.c └── libutils │ ├── ext │ ├── arch │ │ ├── arm │ │ │ ├── aeabi_unwind.c │ │ │ ├── atomic_a32.S │ │ │ ├── atomic_a64.S │ │ │ ├── auxval.c │ │ │ ├── mcount_a32.S │ │ │ ├── mcount_a64.S │ │ │ ├── memtag.c │ │ │ └── sub.mk │ │ └── riscv │ │ │ ├── atomic_rv.S │ │ │ ├── mcount_rv.S │ │ │ └── sub.mk │ ├── array.c │ ├── base64.c │ ├── consttime_memcmp.c │ ├── fault_mitigation.c │ ├── ftrace │ │ ├── ftrace.c │ │ ├── ftrace.h │ │ └── sub.mk │ ├── include │ │ ├── arm64_bti.S │ │ ├── asm.S │ │ ├── atomic.h │ │ ├── base64.h │ │ ├── bitstring.h │ │ ├── compiler.h │ │ ├── config.h │ │ ├── confine_array_index.h │ │ ├── fault_mitigation.h │ │ ├── mempool.h │ │ ├── memtag.h │ │ ├── printk.h │ │ ├── riscv.S │ │ ├── speculation_barrier.h │ │ ├── stdlib_ext.h │ │ ├── string_ext.h │ │ ├── trace.h │ │ ├── trace_levels.h │ │ ├── types_ext.h │ │ └── util.h │ ├── mempool.c │ ├── memzero_explicit.c │ ├── nex_strdup.c │ ├── pthread_stubs.c │ ├── qsort_helpers.c │ ├── snprintk.c │ ├── strlcat.c │ ├── strlcpy.c │ ├── sub.mk │ └── trace.c │ ├── isoc │ ├── arch │ │ ├── arm │ │ │ ├── arm32_aeabi_divmod.c │ │ │ ├── arm32_aeabi_divmod_a32.S │ │ │ ├── arm32_aeabi_ldivmod.c │ │ │ ├── arm32_aeabi_ldivmod_a32.S │ │ │ ├── arm32_aeabi_shift.c │ │ │ ├── arm32_aeabi_softfloat.c │ │ │ ├── setjmp_a32.S │ │ │ ├── setjmp_a64.S │ │ │ ├── softfloat │ │ │ │ ├── COPYING.txt │ │ │ │ ├── README.html │ │ │ │ ├── README.txt │ │ │ │ ├── arm32_include │ │ │ │ │ └── platform.h │ │ │ │ ├── build │ │ │ │ │ ├── Linux-386-GCC │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── Linux-386-SSE2-GCC │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── Linux-x86_64-GCC │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── Win32-MinGW │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── Win32-SSE2-MinGW │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── Win64-MinGW-w64 │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ ├── template-FAST_INT64 │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ │ └── template-not-FAST_INT64 │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── platform.h │ │ │ │ ├── doc │ │ │ │ │ ├── SoftFloat-history.html │ │ │ │ │ ├── SoftFloat-source.html │ │ │ │ │ └── SoftFloat.html │ │ │ │ ├── source │ │ │ │ │ ├── 8086 │ │ │ │ │ │ ├── extF80M_isSignalingNaN.c │ │ │ │ │ │ ├── f128M_isSignalingNaN.c │ │ │ │ │ │ ├── s_commonNaNToExtF80M.c │ │ │ │ │ │ ├── s_commonNaNToExtF80UI.c │ │ │ │ │ │ ├── s_commonNaNToF128M.c │ │ │ │ │ │ ├── s_commonNaNToF128UI.c │ │ │ │ │ │ ├── s_commonNaNToF32UI.c │ │ │ │ │ │ ├── s_commonNaNToF64UI.c │ │ │ │ │ │ ├── s_extF80MToCommonNaN.c │ │ │ │ │ │ ├── s_extF80UIToCommonNaN.c │ │ │ │ │ │ ├── s_f128MToCommonNaN.c │ │ │ │ │ │ ├── s_f128UIToCommonNaN.c │ │ │ │ │ │ ├── s_f32UIToCommonNaN.c │ │ │ │ │ │ ├── s_f64UIToCommonNaN.c │ │ │ │ │ │ ├── s_propagateNaNExtF80M.c │ │ │ │ │ │ ├── s_propagateNaNExtF80UI.c │ │ │ │ │ │ ├── s_propagateNaNF128M.c │ │ │ │ │ │ ├── s_propagateNaNF128UI.c │ │ │ │ │ │ ├── s_propagateNaNF32UI.c │ │ │ │ │ │ ├── s_propagateNaNF64UI.c │ │ │ │ │ │ ├── softfloat_raiseFlags.c │ │ │ │ │ │ └── specialize.h │ │ │ │ │ ├── 8086-SSE │ │ │ │ │ │ ├── extF80M_isSignalingNaN.c │ │ │ │ │ │ ├── f128M_isSignalingNaN.c │ │ │ │ │ │ ├── s_commonNaNToExtF80M.c │ │ │ │ │ │ ├── s_commonNaNToExtF80UI.c │ │ │ │ │ │ ├── s_commonNaNToF128M.c │ │ │ │ │ │ ├── s_commonNaNToF128UI.c │ │ │ │ │ │ ├── s_commonNaNToF32UI.c │ │ │ │ │ │ ├── s_commonNaNToF64UI.c │ │ │ │ │ │ ├── s_extF80MToCommonNaN.c │ │ │ │ │ │ ├── s_extF80UIToCommonNaN.c │ │ │ │ │ │ ├── s_f128MToCommonNaN.c │ │ │ │ │ │ ├── s_f128UIToCommonNaN.c │ │ │ │ │ │ ├── s_f32UIToCommonNaN.c │ │ │ │ │ │ ├── s_f64UIToCommonNaN.c │ │ │ │ │ │ ├── s_propagateNaNExtF80M.c │ │ │ │ │ │ ├── s_propagateNaNExtF80UI.c │ │ │ │ │ │ ├── s_propagateNaNF128M.c │ │ │ │ │ │ ├── s_propagateNaNF128UI.c │ │ │ │ │ │ ├── s_propagateNaNF32UI.c │ │ │ │ │ │ ├── s_propagateNaNF64UI.c │ │ │ │ │ │ ├── softfloat_raiseFlags.c │ │ │ │ │ │ ├── specialize.h │ │ │ │ │ │ └── sub.mk │ │ │ │ │ ├── extF80M_add.c │ │ │ │ │ ├── extF80M_div.c │ │ │ │ │ ├── extF80M_eq.c │ │ │ │ │ ├── extF80M_eq_signaling.c │ │ │ │ │ ├── extF80M_le.c │ │ │ │ │ ├── extF80M_le_quiet.c │ │ │ │ │ ├── extF80M_lt.c │ │ │ │ │ ├── extF80M_lt_quiet.c │ │ │ │ │ ├── extF80M_mul.c │ │ │ │ │ ├── extF80M_rem.c │ │ │ │ │ ├── extF80M_roundToInt.c │ │ │ │ │ ├── extF80M_sqrt.c │ │ │ │ │ ├── extF80M_sub.c │ │ │ │ │ ├── extF80M_to_f128M.c │ │ │ │ │ ├── extF80M_to_f32.c │ │ │ │ │ ├── extF80M_to_f64.c │ │ │ │ │ ├── extF80M_to_i32.c │ │ │ │ │ ├── extF80M_to_i32_r_minMag.c │ │ │ │ │ ├── extF80M_to_i64.c │ │ │ │ │ ├── extF80M_to_i64_r_minMag.c │ │ │ │ │ ├── extF80M_to_ui32.c │ │ │ │ │ ├── extF80M_to_ui32_r_minMag.c │ │ │ │ │ ├── extF80M_to_ui64.c │ │ │ │ │ ├── extF80M_to_ui64_r_minMag.c │ │ │ │ │ ├── extF80_add.c │ │ │ │ │ ├── extF80_div.c │ │ │ │ │ ├── extF80_eq.c │ │ │ │ │ ├── extF80_eq_signaling.c │ │ │ │ │ ├── extF80_isSignalingNaN.c │ │ │ │ │ ├── extF80_le.c │ │ │ │ │ ├── extF80_le_quiet.c │ │ │ │ │ ├── extF80_lt.c │ │ │ │ │ ├── extF80_lt_quiet.c │ │ │ │ │ ├── extF80_mul.c │ │ │ │ │ ├── extF80_rem.c │ │ │ │ │ ├── extF80_roundToInt.c │ │ │ │ │ ├── extF80_sqrt.c │ │ │ │ │ ├── extF80_sub.c │ │ │ │ │ ├── extF80_to_f128.c │ │ │ │ │ ├── extF80_to_f32.c │ │ │ │ │ ├── extF80_to_f64.c │ │ │ │ │ ├── extF80_to_i32.c │ │ │ │ │ ├── extF80_to_i32_r_minMag.c │ │ │ │ │ ├── extF80_to_i64.c │ │ │ │ │ ├── extF80_to_i64_r_minMag.c │ │ │ │ │ ├── extF80_to_ui32.c │ │ │ │ │ ├── extF80_to_ui32_r_minMag.c │ │ │ │ │ ├── extF80_to_ui64.c │ │ │ │ │ ├── extF80_to_ui64_r_minMag.c │ │ │ │ │ ├── f128M_add.c │ │ │ │ │ ├── f128M_div.c │ │ │ │ │ ├── f128M_eq.c │ │ │ │ │ ├── f128M_eq_signaling.c │ │ │ │ │ ├── f128M_le.c │ │ │ │ │ ├── f128M_le_quiet.c │ │ │ │ │ ├── f128M_lt.c │ │ │ │ │ ├── f128M_lt_quiet.c │ │ │ │ │ ├── f128M_mul.c │ │ │ │ │ ├── f128M_mulAdd.c │ │ │ │ │ ├── f128M_rem.c │ │ │ │ │ ├── f128M_roundToInt.c │ │ │ │ │ ├── f128M_sqrt.c │ │ │ │ │ ├── f128M_sub.c │ │ │ │ │ ├── f128M_to_extF80M.c │ │ │ │ │ ├── f128M_to_f32.c │ │ │ │ │ ├── f128M_to_f64.c │ │ │ │ │ ├── f128M_to_i32.c │ │ │ │ │ ├── f128M_to_i32_r_minMag.c │ │ │ │ │ ├── f128M_to_i64.c │ │ │ │ │ ├── f128M_to_i64_r_minMag.c │ │ │ │ │ ├── f128M_to_ui32.c │ │ │ │ │ ├── f128M_to_ui32_r_minMag.c │ │ │ │ │ ├── f128M_to_ui64.c │ │ │ │ │ ├── f128M_to_ui64_r_minMag.c │ │ │ │ │ ├── f128_add.c │ │ │ │ │ ├── f128_div.c │ │ │ │ │ ├── f128_eq.c │ │ │ │ │ ├── f128_eq_signaling.c │ │ │ │ │ ├── f128_isSignalingNaN.c │ │ │ │ │ ├── f128_le.c │ │ │ │ │ ├── f128_le_quiet.c │ │ │ │ │ ├── f128_lt.c │ │ │ │ │ ├── f128_lt_quiet.c │ │ │ │ │ ├── f128_mul.c │ │ │ │ │ ├── f128_mulAdd.c │ │ │ │ │ ├── f128_rem.c │ │ │ │ │ ├── f128_roundToInt.c │ │ │ │ │ ├── f128_sqrt.c │ │ │ │ │ ├── f128_sub.c │ │ │ │ │ ├── f128_to_extF80.c │ │ │ │ │ ├── f128_to_f32.c │ │ │ │ │ ├── f128_to_f64.c │ │ │ │ │ ├── f128_to_i32.c │ │ │ │ │ ├── f128_to_i32_r_minMag.c │ │ │ │ │ ├── f128_to_i64.c │ │ │ │ │ ├── f128_to_i64_r_minMag.c │ │ │ │ │ ├── f128_to_ui32.c │ │ │ │ │ ├── f128_to_ui32_r_minMag.c │ │ │ │ │ ├── f128_to_ui64.c │ │ │ │ │ ├── f128_to_ui64_r_minMag.c │ │ │ │ │ ├── f32_add.c │ │ │ │ │ ├── f32_div.c │ │ │ │ │ ├── f32_eq.c │ │ │ │ │ ├── f32_eq_signaling.c │ │ │ │ │ ├── f32_isSignalingNaN.c │ │ │ │ │ ├── f32_le.c │ │ │ │ │ ├── f32_le_quiet.c │ │ │ │ │ ├── f32_lt.c │ │ │ │ │ ├── f32_lt_quiet.c │ │ │ │ │ ├── f32_mul.c │ │ │ │ │ ├── f32_mulAdd.c │ │ │ │ │ ├── f32_rem.c │ │ │ │ │ ├── f32_roundToInt.c │ │ │ │ │ ├── f32_sqrt.c │ │ │ │ │ ├── f32_sub.c │ │ │ │ │ ├── f32_to_extF80.c │ │ │ │ │ ├── f32_to_extF80M.c │ │ │ │ │ ├── f32_to_f128.c │ │ │ │ │ ├── f32_to_f128M.c │ │ │ │ │ ├── f32_to_f64.c │ │ │ │ │ ├── f32_to_i32.c │ │ │ │ │ ├── f32_to_i32_r_minMag.c │ │ │ │ │ ├── f32_to_i64.c │ │ │ │ │ ├── f32_to_i64_r_minMag.c │ │ │ │ │ ├── f32_to_ui32.c │ │ │ │ │ ├── f32_to_ui32_r_minMag.c │ │ │ │ │ ├── f32_to_ui64.c │ │ │ │ │ ├── f32_to_ui64_r_minMag.c │ │ │ │ │ ├── f64_add.c │ │ │ │ │ ├── f64_div.c │ │ │ │ │ ├── f64_eq.c │ │ │ │ │ ├── f64_eq_signaling.c │ │ │ │ │ ├── f64_isSignalingNaN.c │ │ │ │ │ ├── f64_le.c │ │ │ │ │ ├── f64_le_quiet.c │ │ │ │ │ ├── f64_lt.c │ │ │ │ │ ├── f64_lt_quiet.c │ │ │ │ │ ├── f64_mul.c │ │ │ │ │ ├── f64_mulAdd.c │ │ │ │ │ ├── f64_rem.c │ │ │ │ │ ├── f64_roundToInt.c │ │ │ │ │ ├── f64_sqrt.c │ │ │ │ │ ├── f64_sub.c │ │ │ │ │ ├── f64_to_extF80.c │ │ │ │ │ ├── f64_to_extF80M.c │ │ │ │ │ ├── f64_to_f128.c │ │ │ │ │ ├── f64_to_f128M.c │ │ │ │ │ ├── f64_to_f32.c │ │ │ │ │ ├── f64_to_i32.c │ │ │ │ │ ├── f64_to_i32_r_minMag.c │ │ │ │ │ ├── f64_to_i64.c │ │ │ │ │ ├── f64_to_i64_r_minMag.c │ │ │ │ │ ├── f64_to_ui32.c │ │ │ │ │ ├── f64_to_ui32_r_minMag.c │ │ │ │ │ ├── f64_to_ui64.c │ │ │ │ │ ├── f64_to_ui64_r_minMag.c │ │ │ │ │ ├── i32_to_extF80.c │ │ │ │ │ ├── i32_to_extF80M.c │ │ │ │ │ ├── i32_to_f128.c │ │ │ │ │ ├── i32_to_f128M.c │ │ │ │ │ ├── i32_to_f32.c │ │ │ │ │ ├── i32_to_f64.c │ │ │ │ │ ├── i64_to_extF80.c │ │ │ │ │ ├── i64_to_extF80M.c │ │ │ │ │ ├── i64_to_f128.c │ │ │ │ │ ├── i64_to_f128M.c │ │ │ │ │ ├── i64_to_f32.c │ │ │ │ │ ├── i64_to_f64.c │ │ │ │ │ ├── include │ │ │ │ │ │ ├── internals.h │ │ │ │ │ │ ├── primitiveTypes.h │ │ │ │ │ │ ├── primitives.h │ │ │ │ │ │ ├── softfloat.h │ │ │ │ │ │ └── softfloat_types.h │ │ │ │ │ ├── s_add128.c │ │ │ │ │ ├── s_add256M.c │ │ │ │ │ ├── s_addCarryM.c │ │ │ │ │ ├── s_addComplCarryM.c │ │ │ │ │ ├── s_addExtF80M.c │ │ │ │ │ ├── s_addF128M.c │ │ │ │ │ ├── s_addM.c │ │ │ │ │ ├── s_addMagsExtF80.c │ │ │ │ │ ├── s_addMagsF128.c │ │ │ │ │ ├── s_addMagsF32.c │ │ │ │ │ ├── s_addMagsF64.c │ │ │ │ │ ├── s_approxRecip32_1.c │ │ │ │ │ ├── s_approxRecipSqrt32_1.c │ │ │ │ │ ├── s_compare128M.c │ │ │ │ │ ├── s_compare96M.c │ │ │ │ │ ├── s_compareNonnormExtF80M.c │ │ │ │ │ ├── s_countLeadingZeros32.c │ │ │ │ │ ├── s_countLeadingZeros64.c │ │ │ │ │ ├── s_countLeadingZeros8.c │ │ │ │ │ ├── s_eq128.c │ │ │ │ │ ├── s_invalidExtF80M.c │ │ │ │ │ ├── s_invalidF128M.c │ │ │ │ │ ├── s_isNaNF128M.c │ │ │ │ │ ├── s_le128.c │ │ │ │ │ ├── s_lt128.c │ │ │ │ │ ├── s_mul128By32.c │ │ │ │ │ ├── s_mul128MTo256M.c │ │ │ │ │ ├── s_mul128To256M.c │ │ │ │ │ ├── s_mul64ByShifted32To128.c │ │ │ │ │ ├── s_mul64To128.c │ │ │ │ │ ├── s_mul64To128M.c │ │ │ │ │ ├── s_mulAddF128.c │ │ │ │ │ ├── s_mulAddF128M.c │ │ │ │ │ ├── s_mulAddF32.c │ │ │ │ │ ├── s_mulAddF64.c │ │ │ │ │ ├── s_negXM.c │ │ │ │ │ ├── s_normExtF80SigM.c │ │ │ │ │ ├── s_normRoundPackMToExtF80M.c │ │ │ │ │ ├── s_normRoundPackMToF128M.c │ │ │ │ │ ├── s_normRoundPackToExtF80.c │ │ │ │ │ ├── s_normRoundPackToF128.c │ │ │ │ │ ├── s_normRoundPackToF32.c │ │ │ │ │ ├── s_normRoundPackToF64.c │ │ │ │ │ ├── s_normSubnormalExtF80Sig.c │ │ │ │ │ ├── s_normSubnormalF128Sig.c │ │ │ │ │ ├── s_normSubnormalF128SigM.c │ │ │ │ │ ├── s_normSubnormalF32Sig.c │ │ │ │ │ ├── s_normSubnormalF64Sig.c │ │ │ │ │ ├── s_remStepMBy32.c │ │ │ │ │ ├── s_roundPackMToExtF80M.c │ │ │ │ │ ├── s_roundPackMToF128M.c │ │ │ │ │ ├── s_roundPackMToI64.c │ │ │ │ │ ├── s_roundPackMToUI64.c │ │ │ │ │ ├── s_roundPackToExtF80.c │ │ │ │ │ ├── s_roundPackToF128.c │ │ │ │ │ ├── s_roundPackToF32.c │ │ │ │ │ ├── s_roundPackToF64.c │ │ │ │ │ ├── s_roundPackToI32.c │ │ │ │ │ ├── s_roundPackToI64.c │ │ │ │ │ ├── s_roundPackToUI32.c │ │ │ │ │ ├── s_roundPackToUI64.c │ │ │ │ │ ├── s_shiftLeftM.c │ │ │ │ │ ├── s_shiftNormSigF128M.c │ │ │ │ │ ├── s_shiftRightJam128.c │ │ │ │ │ ├── s_shiftRightJam128Extra.c │ │ │ │ │ ├── s_shiftRightJam256M.c │ │ │ │ │ ├── s_shiftRightJam32.c │ │ │ │ │ ├── s_shiftRightJam64.c │ │ │ │ │ ├── s_shiftRightJam64Extra.c │ │ │ │ │ ├── s_shiftRightJamM.c │ │ │ │ │ ├── s_shiftRightM.c │ │ │ │ │ ├── s_shortShiftLeft128.c │ │ │ │ │ ├── s_shortShiftLeft64To96M.c │ │ │ │ │ ├── s_shortShiftLeftM.c │ │ │ │ │ ├── s_shortShiftRight128.c │ │ │ │ │ ├── s_shortShiftRightExtendM.c │ │ │ │ │ ├── s_shortShiftRightJam128.c │ │ │ │ │ ├── s_shortShiftRightJam128Extra.c │ │ │ │ │ ├── s_shortShiftRightJam64.c │ │ │ │ │ ├── s_shortShiftRightJam64Extra.c │ │ │ │ │ ├── s_shortShiftRightJamM.c │ │ │ │ │ ├── s_shortShiftRightM.c │ │ │ │ │ ├── s_sub128.c │ │ │ │ │ ├── s_sub1XM.c │ │ │ │ │ ├── s_sub256M.c │ │ │ │ │ ├── s_subM.c │ │ │ │ │ ├── s_subMagsExtF80.c │ │ │ │ │ ├── s_subMagsF128.c │ │ │ │ │ ├── s_subMagsF32.c │ │ │ │ │ ├── s_subMagsF64.c │ │ │ │ │ ├── s_tryPropagateNaNExtF80M.c │ │ │ │ │ ├── s_tryPropagateNaNF128M.c │ │ │ │ │ ├── softfloat_state.c │ │ │ │ │ ├── sub.mk │ │ │ │ │ ├── ui32_to_extF80.c │ │ │ │ │ ├── ui32_to_extF80M.c │ │ │ │ │ ├── ui32_to_f128.c │ │ │ │ │ ├── ui32_to_f128M.c │ │ │ │ │ ├── ui32_to_f32.c │ │ │ │ │ ├── ui32_to_f64.c │ │ │ │ │ ├── ui64_to_extF80.c │ │ │ │ │ ├── ui64_to_extF80M.c │ │ │ │ │ ├── ui64_to_f128.c │ │ │ │ │ ├── ui64_to_f128M.c │ │ │ │ │ ├── ui64_to_f32.c │ │ │ │ │ └── ui64_to_f64.c │ │ │ │ └── sub.mk │ │ │ └── sub.mk │ │ └── riscv │ │ │ ├── setjmp_rv.S │ │ │ └── sub.mk │ ├── bget.c │ ├── bget.doc │ ├── bget.h │ ├── bget_malloc.c │ ├── fp.c │ ├── fputc.c │ ├── fputs.c │ ├── fwrite.c │ ├── include │ │ ├── assert.h │ │ ├── ctype.h │ │ ├── inttypes.h │ │ ├── limits.h │ │ ├── malloc.h │ │ ├── memory.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stdint.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── strings.h │ │ ├── sys │ │ │ ├── cdefs.h │ │ │ ├── fcntl.h │ │ │ ├── queue.h │ │ │ └── types.h │ │ ├── time.h │ │ ├── unistd.h │ │ └── wchar.h │ ├── isalnum.c │ ├── isalpha.c │ ├── iscntrl.c │ ├── isdigit.c │ ├── isgraph.c │ ├── islower.c │ ├── isprint.c │ ├── ispunct.c │ ├── isspace.c │ ├── isupper.c │ ├── isxdigit.c │ ├── newlib │ │ ├── _ansi.h │ │ ├── abs.c │ │ ├── bcmp.c │ │ ├── memchr.c │ │ ├── memcmp.c │ │ ├── memcpy.c │ │ ├── memmove.c │ │ ├── memset.c │ │ ├── str-two-way.h │ │ ├── strchr.c │ │ ├── strcmp.c │ │ ├── strcpy.c │ │ ├── strlen.c │ │ ├── strncmp.c │ │ ├── strncpy.c │ │ ├── strnlen.c │ │ ├── strrchr.c │ │ ├── strstr.c │ │ ├── strtok_r.c │ │ ├── strtoul.c │ │ └── sub.mk │ ├── qsort.c │ ├── snprintf.c │ ├── sprintf.c │ ├── stack_check.c │ ├── strdup.c │ ├── strndup.c │ ├── sub.mk │ ├── tolower.c │ ├── toupper.c │ └── write.c │ └── sub.mk ├── mk ├── aosp_optee.mk ├── cc-option.mk ├── checkconf.mk ├── clang.mk ├── cleandirs.mk ├── cleanvars.mk ├── compile.mk ├── config.mk ├── gcc.mk ├── lib.mk ├── macros.mk └── subdir.mk ├── scripts ├── arm32_sysreg.py ├── bin_to_c.py ├── checkpatch.sh ├── checkpatch_inc.sh ├── derive_rpmb_key.py ├── ftrace_format.py ├── gen_compile_commands.py ├── gen_ld_sects.py ├── gen_ldelf_hex.py ├── gen_stmm_hex.py ├── gen_tee_bin.py ├── get_maintainer.py ├── mem_usage.py ├── nxp_build.sh ├── pem_to_pub_c.py ├── print_tee_hash.py ├── sign_encrypt.py ├── sign_helper_kms.py ├── sign_rproc_fw.py ├── symbolize.py ├── tee_bin_parser.py ├── ts_bin_to_c.py └── update_changelog.py ├── ta ├── arch │ ├── arm │ │ ├── ta.ld.S │ │ └── ta_entry_a32.S │ └── riscv │ │ └── ta.ld.S ├── avb │ ├── Makefile │ ├── entry.c │ ├── include │ │ └── ta_avb.h │ ├── sub.mk │ ├── user_ta.mk │ └── user_ta_header_defines.h ├── link.mk ├── link_shlib.mk ├── mk │ ├── build-user-ta.mk │ └── ta_dev_kit.mk ├── pkcs11 │ ├── Android.mk │ ├── Makefile │ ├── include │ │ └── pkcs11_ta.h │ ├── scripts │ │ ├── dump_ec_curve_params.sh │ │ └── verify-helpers.sh │ ├── src │ │ ├── attributes.c │ │ ├── attributes.h │ │ ├── entry.c │ │ ├── handle.c │ │ ├── handle.h │ │ ├── object.c │ │ ├── object.h │ │ ├── persistent_token.c │ │ ├── pkcs11_attributes.c │ │ ├── pkcs11_attributes.h │ │ ├── pkcs11_helpers.c │ │ ├── pkcs11_helpers.h │ │ ├── pkcs11_token.c │ │ ├── pkcs11_token.h │ │ ├── processing.c │ │ ├── processing.h │ │ ├── processing_aes.c │ │ ├── processing_asymm.c │ │ ├── processing_digest.c │ │ ├── processing_ec.c │ │ ├── processing_rsa.c │ │ ├── processing_symm.c │ │ ├── sanitize_object.c │ │ ├── sanitize_object.h │ │ ├── serializer.c │ │ ├── serializer.h │ │ ├── sub.mk │ │ ├── token_capabilities.c │ │ ├── token_capabilities.h │ │ └── user_ta_header_defines.h │ ├── sub.mk │ └── user_ta.mk ├── remoteproc │ ├── Makefile │ ├── include │ │ └── ta_remoteproc.h │ ├── src │ │ ├── elf_parser.c │ │ ├── elf_parser.h │ │ ├── remoteproc_core.c │ │ ├── sub.mk │ │ └── user_ta_header_defines.h │ ├── sub.mk │ └── user_ta.mk ├── ta.mk ├── trusted_keys │ ├── entry.c │ ├── include │ │ └── trusted_keys.h │ ├── sub.mk │ ├── user_ta.mk │ └── user_ta_header_defines.h └── user_ta_header.c └── typedefs.checkpatch /.checkpatch.conf: -------------------------------------------------------------------------------- 1 | --codespell 2 | --no-tree 3 | --quiet 4 | --strict 5 | --max-line-length=80 6 | --ignore=CAMELCASE 7 | --ignore=CONCATENATED_STRING 8 | --ignore=FILE_PATH_CHANGES 9 | --ignore=GERRIT_CHANGE_ID 10 | --ignore=NOT_UNIFIED_DIFF 11 | --ignore=STRLCPY 12 | --ignore=PREFER_KERNEL_TYPES 13 | --ignore=USLEEP_RANGE 14 | --kconfig-prefix=CFG_ 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OP-TEE Trusted OS 2 | This git contains source code for the secure side implementation of OP-TEE 3 | project. 4 | 5 | All official OP-TEE documentation has moved to http://optee.readthedocs.io. 6 | 7 | // OP-TEE core maintainers 8 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-a15.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_ARM32_core,y) 2 | $(call force,CFG_ARM64_core,n) 3 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,y) 4 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,y) 5 | arm32-platform-cpuarch := cortex-a15 6 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 7 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 8 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 9 | # Program flow prediction may need manual enablement 10 | CFG_ENABLE_SCTLR_Z ?= y 11 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-a5.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_ARM32_core,y) 2 | $(call force,CFG_ARM64_core,n) 3 | $(call force,CFG_WITH_LPAE,n) 4 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,n) 5 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,n) 6 | $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,n) 7 | arm32-platform-cpuarch := cortex-a5 8 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 9 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 10 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 11 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-a7.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_ARM32_core,y) 2 | $(call force,CFG_ARM64_core,n) 3 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,y) 4 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,y) 5 | $(call force,CFG_ENABLE_SCTLR_Z,n) 6 | arm32-platform-cpuarch := cortex-a7 7 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 8 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 9 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 10 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-a9.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_ARM32_core,y) 2 | $(call force,CFG_ARM64_core,n) 3 | $(call force,CFG_WITH_LPAE,n) 4 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,n) 5 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,n) 6 | $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,n) 7 | arm32-platform-cpuarch := cortex-a9 8 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 9 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 10 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 11 | # Program flow prediction may need manual enablement 12 | CFG_ENABLE_SCTLR_Z ?= y 13 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-armv8-0.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,y) 2 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,y) 3 | $(call force,CFG_ENABLE_SCTLR_RR,n) 4 | $(call force,CFG_ENABLE_SCTLR_Z,n) 5 | # cortex-a53 and cortex-a57 complies on arm32 architectures 6 | arm32-platform-cpuarch := cortex-a53 7 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 8 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 9 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 10 | platform-flavor-armv8 := 1 11 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/cortex-armv9.mk: -------------------------------------------------------------------------------- 1 | $(call force,CFG_HWSUPP_MEM_PERM_WXN,y) 2 | $(call force,CFG_HWSUPP_MEM_PERM_PXN,y) 3 | $(call force,CFG_ENABLE_SCTLR_RR,n) 4 | $(call force,CFG_ENABLE_SCTLR_Z,n) 5 | 6 | arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) 7 | arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) 8 | arm32-platform-cxxflags += -mcpu=$(arm32-platform-cpuarch) 9 | 10 | arm64-platform-cflags += -mcpu=$(arm64-platform-cpuarch) 11 | arm64-platform-aflags += -mcpu=$(arm64-platform-cpuarch) 12 | arm64-platform-cxxflags += -mcpu=$(arm64-platform-cpuarch) 13 | 14 | platform-flavor-armv9 := 1 15 | -------------------------------------------------------------------------------- /core/arch/arm/cpu/neoverse-v2.mk: -------------------------------------------------------------------------------- 1 | arm32-platform-cpuarch := neoverse-v2 2 | arm64-platform-cpuarch := neoverse-v2 3 | 4 | include core/arch/arm/cpu/cortex-armv9.mk 5 | -------------------------------------------------------------------------------- /core/arch/arm/crypto/sha1_armv8a_ce.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* Prototype for assembly function */ 10 | void sha1_ce_transform(uint32_t state[5], const void *src, 11 | unsigned int block_count); 12 | 13 | void crypto_accel_sha1_compress(uint32_t state[5], const void *src, 14 | unsigned int block_count) 15 | { 16 | uint32_t vfp_state = 0; 17 | 18 | vfp_state = thread_kernel_enable_vfp(); 19 | sha1_ce_transform(state, src, block_count); 20 | thread_kernel_disable_vfp(vfp_state); 21 | } 22 | -------------------------------------------------------------------------------- /core/arch/arm/crypto/sha256_armv8a_ce.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* Prototype for assembly function */ 10 | void sha256_ce_transform(uint32_t state[8], const void *src, 11 | unsigned int block_count); 12 | 13 | void crypto_accel_sha256_compress(uint32_t state[8], const void *src, 14 | unsigned int block_count) 15 | { 16 | uint32_t vfp_state = 0; 17 | 18 | vfp_state = thread_kernel_enable_vfp(); 19 | sha256_ce_transform(state, src, block_count); 20 | thread_kernel_disable_vfp(vfp_state); 21 | } 22 | -------------------------------------------------------------------------------- /core/arch/arm/crypto/sha512_armv8a_ce.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* Prototype for assembly function */ 10 | void sha512_ce_transform(uint64_t state[8], const void *src, 11 | unsigned int block_count); 12 | 13 | void crypto_accel_sha512_compress(uint64_t state[8], const void *src, 14 | unsigned int block_count) 15 | { 16 | uint32_t vfp_state = 0; 17 | 18 | vfp_state = thread_kernel_enable_vfp(); 19 | sha512_ce_transform(state, src, block_count); 20 | thread_kernel_disable_vfp(vfp_state); 21 | } 22 | -------------------------------------------------------------------------------- /core/arch/arm/crypto/sm3_armv8a_ce.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022 Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* Prototype for assembly function */ 10 | void sm3_ce_transform(uint32_t state[8], const void *src, 11 | unsigned int block_count); 12 | 13 | void crypto_accel_sm3_compress(uint32_t state[8], const void *src, 14 | unsigned int block_count) 15 | { 16 | uint32_t vfp_state = 0; 17 | 18 | vfp_state = thread_kernel_enable_vfp(); 19 | sm3_ce_transform(state, src, block_count); 20 | thread_kernel_disable_vfp(vfp_state); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /core/arch/arm/dts/embedded_dtb_test.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | /dts-v1/; 6 | 7 | #include "dt_driver_test.dtsi" 8 | 9 | / { 10 | model = "Embedded device tree for OP-TEE/Qemu platform test purpose"; 11 | }; 12 | -------------------------------------------------------------------------------- /core/arch/arm/dts/hikey.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | / { 9 | #address-cells = <1>; 10 | #size-cells = <0>; 11 | 12 | reserved-memory { 13 | #address-cells = <1>; 14 | #size-cells = <1>; 15 | 16 | sdp@3e800000 { 17 | compatible = "linaro,secure-heap"; 18 | no-map; 19 | reg = <0x3E800000 0x00400000>; 20 | }; 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp133.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2021-2022 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | 7 | #include "stm32mp131.dtsi" 8 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp135.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2021-2022 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | 7 | #include "stm32mp133.dtsi" 8 | 9 | / { 10 | soc { 11 | etzpc: etzpc@5c007000 { 12 | ltdc: display-controller@5a001000 { 13 | compatible = "st,stm32-ltdc"; 14 | reg = <0x5a001000 0x400>; 15 | interrupts = , 16 | ; 17 | clocks = <&rcc LTDC_PX>; 18 | clock-names = "lcd"; 19 | resets = <&rcc LTDC_R>; 20 | status = "disabled"; 21 | }; 22 | }; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp157a-dk1-scmi.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | #include "stm32mp157a-dk1.dts" 9 | 10 | / { 11 | model = "STMicroelectronics STM32MP157A-DK1 SCMI Discovery Board"; 12 | compatible = "st,stm32mp157a-dk1-scmi", "st,stm32mp157"; 13 | }; 14 | 15 | &rcc { 16 | compatible = "st,stm32mp1-rcc-secure"; 17 | status = "okay"; 18 | }; 19 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp157c-dk2-scmi.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | #include "stm32mp157c-dk2.dts" 9 | 10 | / { 11 | model = "STMicroelectronics STM32MP157C-DK2 SCMI Discovery Board"; 12 | compatible = "st,stm32mp157c-dk2-scmi", "st,stm32mp157"; 13 | }; 14 | 15 | &rcc { 16 | compatible = "st,stm32mp1-rcc-secure"; 17 | status = "okay"; 18 | }; 19 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp157c-ed1-scmi.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 4 | */ 5 | /dts-v1/; 6 | 7 | #include "stm32mp157c-ed1.dts" 8 | 9 | / { 10 | model = "STMicroelectronics STM32MP157C SCMI eval daughter"; 11 | compatible = "st,stm32mp157c-ed1-scmi", "st,stm32mp157"; 12 | }; 13 | 14 | &iwdg1 { 15 | timeout-sec = <32>; 16 | }; 17 | 18 | &iwdg2 { 19 | timeout-sec = <32>; 20 | status = "okay"; 21 | secure-status = "disabled"; 22 | }; 23 | 24 | &rcc { 25 | compatible = "st,stm32mp1-rcc-secure"; 26 | status = "okay"; 27 | }; 28 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp157c-ev1-scmi.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 4 | */ 5 | /dts-v1/; 6 | 7 | #include "stm32mp157c-ev1.dts" 8 | 9 | / { 10 | model = "STMicroelectronics STM32MP157C SCMI eval daughter on eval mother"; 11 | compatible = "st,stm32mp157c-ev1-scmi", "st,stm32mp157c-ed1-scmi", "st,stm32mp157"; 12 | }; 13 | 14 | &rcc { 15 | compatible = "st,stm32mp1-rcc-secure"; 16 | status = "okay"; 17 | }; 18 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp15xc.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2019 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | 7 | / { 8 | soc { 9 | cryp1: cryp@54001000 { 10 | compatible = "st,stm32mp1-cryp"; 11 | reg = <0x54001000 0x400>; 12 | interrupts = ; 13 | clocks = <&rcc CRYP1>; 14 | resets = <&rcc CRYP1_R>; 15 | status = "disabled"; 16 | }; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp15xx-dhcor-io1v8.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) Linaro Ltd 2019 - All Rights Reserved 4 | * Author: Manivannan Sadhasivam 5 | * Copyright (C) 2020 Marek Vasut 6 | */ 7 | 8 | / { 9 | /* Enpirion EP3A8LQI U2 on the DHCOR */ 10 | vdd_io: regulator-buck-io { 11 | compatible = "regulator-fixed"; 12 | regulator-name = "buck-io"; 13 | regulator-min-microvolt = <1800000>; 14 | regulator-max-microvolt = <1800000>; 15 | regulator-always-on; 16 | regulator-boot-on; 17 | vin-supply = <&vdd>; 18 | }; 19 | }; 20 | 21 | &pwr_regulators { 22 | vdd-supply = <&vdd_io>; 23 | }; 24 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp25-pinctrl.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | #include 7 | 8 | &pinctrl { 9 | usart2_pins_a: usart2-0 { 10 | pins1 { 11 | pinmux = ; /* USART2_TX */ 12 | bias-disable; 13 | drive-push-pull; 14 | slew-rate = <0>; 15 | }; 16 | pins2 { 17 | pinmux = ; /* USART2_RX */ 18 | bias-disable; 19 | }; 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp253.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | #include "stm32mp251.dtsi" 7 | 8 | / { 9 | cpus { 10 | cpu1: cpu@1 { 11 | compatible = "arm,cortex-a35"; 12 | device_type = "cpu"; 13 | reg = <1>; 14 | enable-method = "psci"; 15 | }; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp255.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | #include "stm32mp253.dtsi" 7 | 8 | / { 9 | }; 10 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp257.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | #include "stm32mp255.dtsi" 7 | 8 | / { 9 | }; 10 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp25xc.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | 7 | / { 8 | }; 9 | -------------------------------------------------------------------------------- /core/arch/arm/dts/stm32mp25xf.dtsi: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | * Author: Alexandre Torgue for STMicroelectronics. 5 | */ 6 | 7 | / { 8 | }; 9 | -------------------------------------------------------------------------------- /core/arch/arm/include/arm32_macros.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #include 7 | #ifdef CFG_ARM_GICV3 8 | #include 9 | #endif 10 | 11 | .macro mov_imm reg, val 12 | .if ((\val) & 0xffff0000) == 0 13 | movw \reg, #(\val) 14 | .else 15 | movw \reg, #((\val) & 0xffff) 16 | movt \reg, #((\val) >> 16) 17 | .endif 18 | .endm 19 | 20 | .macro panic_at_smc_return 21 | #if defined(CFG_TEE_CORE_DEBUG) 22 | bl __panic_at_smc_return 23 | #else 24 | b . 25 | #endif 26 | .endm 27 | -------------------------------------------------------------------------------- /core/arch/arm/include/kernel/cache_helpers_arch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2017, Linaro Limited 4 | */ 5 | 6 | #ifndef __KERNEL_CACHE_HELPERS_ARCH_H 7 | #define __KERNEL_CACHE_HELPERS_ARCH_H 8 | 9 | #ifndef __ASSEMBLER__ 10 | #include 11 | #include 12 | #endif 13 | 14 | #ifndef __ASSEMBLER__ 15 | 16 | static inline unsigned int dcache_get_line_size(void) 17 | { 18 | uint32_t value = read_ctr(); 19 | 20 | return CTR_WORD_SIZE << 21 | ((value >> CTR_DMINLINE_SHIFT) & CTR_DMINLINE_MASK); 22 | } 23 | 24 | #endif /*!__ASSEMBLER__*/ 25 | 26 | #endif /*__KERNEL_CACHE_HELPERS_ARCH_H*/ 27 | -------------------------------------------------------------------------------- /core/arch/arm/include/kernel/misc_arch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #ifndef __KERNEL_MISC_ARCH_H 7 | #define __KERNEL_MISC_ARCH_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | size_t get_core_pos_mpidr(uint32_t mpidr); 14 | 15 | uint32_t read_mode_sp(int cpu_mode); 16 | uint32_t read_mode_lr(int cpu_mode); 17 | 18 | void wait_cycles(unsigned long cycles); 19 | 20 | #endif /*__KERNEL_MISC_ARCH_H*/ 21 | -------------------------------------------------------------------------------- /core/arch/arm/include/pta_stmm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2018-2020, Linaro Limited 4 | */ 5 | #ifndef __PTA_STMM_H 6 | #define __PTA_STMM_H 7 | 8 | /* 9 | * Interface to the pseudo TA, which provides a communication channel with 10 | * the Standalone MM SP (StMM) running at S-EL0. 11 | */ 12 | 13 | #define PTA_STMM_UUID { 0xed32d533, 0x99e6, 0x4209, {\ 14 | 0x9c, 0xc0, 0x2d, 0x72, 0xcd, 0xd9, 0x98, 0xa7 } } 15 | 16 | /* 17 | * Pass a buffer to Standalone MM SP 18 | * 19 | * [in/out] memref[0]: EFI Communication buffer 20 | * [out] value[1].a: EFI return code 21 | */ 22 | #define PTA_STMM_CMD_COMMUNICATE 0 23 | 24 | #endif /* __PTA_STMM_H */ 25 | 26 | -------------------------------------------------------------------------------- /core/arch/arm/include/sm/teesmc_opteed_macros.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | 6 | #ifndef __SM_TEESMC_OPTEED_MACROS_H 7 | #define __SM_TEESMC_OPTEED_MACROS_H 8 | 9 | #define TEESMC_OPTEED_RV(func_num) \ 10 | OPTEE_SMC_CALL_VAL(OPTEE_SMC_32, OPTEE_SMC_FAST_CALL, \ 11 | OPTEE_SMC_OWNER_TRUSTED_OS_OPTEED, (func_num)) 12 | 13 | #endif /*__SM_TEESMC_OPTEED_MACROS_H*/ 14 | -------------------------------------------------------------------------------- /core/arch/arm/kernel/idle.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2021, Huawei Technology Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | void cpu_idle(void) 10 | { 11 | dsb(); 12 | wfi(); 13 | } 14 | -------------------------------------------------------------------------------- /core/arch/arm/kernel/semihosting_a64.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2024 Linaro, Ltd. 4 | */ 5 | 6 | #include 7 | 8 | /* 9 | * uintptr_t __do_semihosting(uintptr_t op, uintptr_t arg) 10 | * 11 | * Refer to "Semihosting for Aarch32 and Aarch64": 12 | * https://github.com/ARM-software/abi-aa/blob/main/semihosting/semihosting.rst 13 | */ 14 | FUNC __do_semihosting , : 15 | hlt #0xf000 16 | ret 17 | END_FUNC __do_semihosting 18 | -------------------------------------------------------------------------------- /core/arch/arm/kernel/unwind_private.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | static inline void *unw_grow(void *p, size_t *cur_size, size_t new_size) 10 | { 11 | size_t rounded_size = 0; 12 | void *tmp = NULL; 13 | 14 | if (*cur_size >= new_size) 15 | return p; 16 | 17 | rounded_size = ROUNDUP(new_size, 16 * sizeof(vaddr_t)); 18 | tmp = realloc(p, rounded_size); 19 | 20 | if (tmp) 21 | *cur_size = rounded_size; 22 | return tmp; 23 | } 24 | -------------------------------------------------------------------------------- /core/arch/arm/mm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += core_mmu.c 2 | srcs-$(CFG_WITH_PAGER) += tee_pager.c 3 | ifeq ($(CFG_WITH_LPAE),y) 4 | srcs-y += core_mmu_lpae.c 5 | else 6 | srcs-y += core_mmu_v7.c 7 | endif 8 | srcs-$(CFG_CORE_FFA) += mobj_ffa.c 9 | srcs-$(CFG_SECURE_PARTITION) += sp_mem.c 10 | 11 | ifeq ($(CFG_SYSCALL_FTRACE),y) 12 | # We would not like to profile MMU APIs as these are used to switch TA 13 | # context which may cause undesired behaviour as ftrace requires TA context 14 | # to be active. Moreover profiling code uses some of MMU APIs to check 15 | # if TA context is active or not. 16 | ifeq ($(CFG_WITH_LPAE),y) 17 | cflags-remove-core_mmu_lpae.c-y += -pg 18 | else 19 | cflags-remove-core_mmu_v7.c-y += -pg 20 | endif 21 | endif 22 | -------------------------------------------------------------------------------- /core/arch/arm/plat-amlogic/conf.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_FLAVOR ?= axg 2 | 3 | include core/arch/arm/cpu/cortex-armv8-0.mk 4 | 5 | $(call force,CFG_TEE_CORE_NB_CORE,4) 6 | 7 | CFG_TZDRAM_START ?= 0x05300000 8 | CFG_TZDRAM_SIZE ?= 0x00c00000 9 | CFG_SHMEM_START ?= 0x05000000 10 | CFG_SHMEM_SIZE ?= 0x00100000 11 | 12 | $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) 13 | $(call force,CFG_WITH_ARM_TRUSTED_FW,y) 14 | $(call force,CFG_AMLOGIC_UART,y) 15 | 16 | $(call force,CFG_WITH_PAGER,n) 17 | $(call force,CFG_ARM64_core,y) 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-amlogic/link.mk: -------------------------------------------------------------------------------- 1 | include core/arch/arm/kernel/link.mk 2 | 3 | # Create BL32 image from the native binary images 4 | 5 | define aml_bin2img_cmd 6 | @$(cmd-echo-silent) ' GEN $@' 7 | $(q)./core/arch/arm/plat-amlogic/scripts/aml_bin2img.py 8 | endef 9 | 10 | ifneq (,$(filter $(PLATFORM_FLAVOR),axg)) 11 | all: $(link-out-dir)/bl32.img 12 | cleanfiles += $(link-out-dir)/bl32.img 13 | $(link-out-dir)/bl32.img: $(link-out-dir)/tee-pager_v2.bin 14 | $(aml_bin2img_cmd) --source $< --dest $@ --entry 0x5300000 \ 15 | --res_mem_start 0x5300000 --res_mem_size 0x1000000 \ 16 | --sec_mem_start 0x5300000 --sec_mem_size 0xc00000 17 | endif 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-amlogic/main.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020 Carlo Caione 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static struct amlogic_uart_data console_data; 13 | register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE, 14 | CORE_MMU_PGDIR_SIZE); 15 | 16 | void plat_console_init(void) 17 | { 18 | amlogic_uart_init(&console_data, CONSOLE_UART_BASE); 19 | register_serial_console(&console_data.chip); 20 | } 21 | -------------------------------------------------------------------------------- /core/arch/arm/plat-amlogic/platform_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020 Carlo Caione 4 | */ 5 | 6 | #ifndef PLATFORM_CONFIG_H 7 | #define PLATFORM_CONFIG_H 8 | 9 | #include 10 | 11 | /* Make stacks aligned to data cache line length */ 12 | #define STACK_ALIGNMENT 64 13 | 14 | #define GIC_BASE 0xFFC01000 15 | #define GICC_OFFSET 0x2000 16 | #define GICD_OFFSET 0x1000 17 | 18 | #define CONSOLE_UART_BASE 0xFF803000 19 | 20 | #endif /*PLATFORM_CONFIG_H*/ 21 | -------------------------------------------------------------------------------- /core/arch/arm/plat-amlogic/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-aspeed/core_pos_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2021, Aspeed Technology Inc. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | FUNC get_core_pos_mpidr , : 11 | /* 12 | * need this to correct core0 - 0xf00, core1 - 0xf01, ... 13 | */ 14 | and r0, r0, #MPIDR_CPU_MASK 15 | bx lr 16 | END_FUNC get_core_pos_mpidr 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-aspeed/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-$(PLATFORM_FLAVOR_ast2600) += platform_ast2600.c core_pos_a32.S 3 | srcs-$(PLATFORM_FLAVOR_ast2700) += platform_ast2700.c 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-bcm/crc32.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2019 Broadcom. 4 | */ 5 | 6 | #ifndef CRC32_H 7 | #define CRC32_H 8 | 9 | #include 10 | #include 11 | 12 | #define CRC32_INIT_VAL (~0) 13 | #define CRC32 crc32i 14 | 15 | uint32_t crc32i(uint32_t crc, const char *buf, size_t len); 16 | 17 | #endif /* CRC32_H */ 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-bcm/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += crc32.c 4 | srcs-y += bcm_elog.c 5 | -------------------------------------------------------------------------------- /core/arch/arm/plat-corstone1000/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-d02/main.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | static struct hi16xx_uart_data console_data; 15 | 16 | register_phys_mem_pgdir(MEM_AREA_IO_NSEC, CONSOLE_UART_BASE, 17 | HI16XX_UART_REG_SIZE); 18 | 19 | void plat_console_init(void) 20 | { 21 | hi16xx_uart_init(&console_data, CONSOLE_UART_BASE, 22 | CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); 23 | register_serial_console(&console_data.chip); 24 | } 25 | -------------------------------------------------------------------------------- /core/arch/arm/plat-d02/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-d06/main.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | * Copyright (c) 2022, Huawei Technologies Co., Ltd 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | static struct lpc_uart_data console_data __nex_bss; 11 | 12 | register_phys_mem_pgdir(MEM_AREA_IO_NSEC, LPC_BASE, LPC_SIZE); 13 | 14 | void plat_console_init(void) 15 | { 16 | lpc_uart_init(&console_data, LPC_BASE, CONSOLE_UART_CLK_IN_HZ, 17 | CONSOLE_BAUDRATE); 18 | 19 | register_serial_console(&console_data.chip); 20 | } 21 | -------------------------------------------------------------------------------- /core/arch/arm/plat-d06/platform_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | * Copyright (c) 2022, Huawei Technologies Co., Ltd 5 | */ 6 | 7 | #ifndef PLATFORM_CONFIG_H 8 | #define PLATFORM_CONFIG_H 9 | 10 | #include 11 | 12 | /* Make stacks aligned to data cache line length */ 13 | #define STACK_ALIGNMENT 64 14 | 15 | /* UART */ 16 | #define UART_BASE 0x2f8 17 | #define CONSOLE_BAUDRATE 115200 18 | #define CONSOLE_UART_CLK_IN_HZ 200 19 | 20 | /* HISI_TRNG */ 21 | #define HISI_TRNG_BASE 0x2010C0000 22 | #define HISI_TRNG_SIZE 0x100 23 | 24 | #endif /* PLATFORM_CONFIG_H */ 25 | -------------------------------------------------------------------------------- /core/arch/arm/plat-d06/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += core_pos_a64.S 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-hikey/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | ifeq ($(PLATFORM_FLAVOR),hikey) 4 | srcs-$(CFG_SPI_TEST) += spi_test.c 5 | endif 6 | -------------------------------------------------------------------------------- /core/arch/arm/plat-hisilicon/platform_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, HiSilicon Technologies Co., Ltd. 4 | */ 5 | 6 | #ifndef PLATFORM_CONFIG_H 7 | #define PLATFORM_CONFIG_H 8 | 9 | #include 10 | 11 | /* Make stacks aligned to data cache line length */ 12 | #define STACK_ALIGNMENT 64 13 | 14 | /* PL011 UART */ 15 | #define CONSOLE_UART_BASE PL011_UART0_BASE 16 | #define CONSOLE_BAUDRATE PL011_BAUDRATE 17 | #define CONSOLE_UART_CLK_IN_HZ PL011_UART0_CLK_IN_HZ 18 | 19 | #endif /* PLATFORM_CONFIG_H */ 20 | -------------------------------------------------------------------------------- /core/arch/arm/plat-hisilicon/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-$(CFG_HI3519AV100) += hi3519av100_plat_init.S 4 | srcs-$(CFG_PSCI_ARM32) += psci.c 5 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/imx_pl310.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | */ 5 | #ifndef __IMX_PL310_H__ 6 | #define __IMX_PL310_H__ 7 | 8 | uint32_t pl310_enable(void); 9 | uint32_t pl310_disable(void); 10 | bool pl310_enabled(vaddr_t pl310_base); 11 | uint32_t pl310_enable_writeback(void); 12 | uint32_t pl310_disable_writeback(void); 13 | uint32_t pl310_enable_wflz(void); 14 | 15 | #endif /* __IMX_PL310_H__ */ 16 | 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/link.mk: -------------------------------------------------------------------------------- 1 | include core/arch/arm/kernel/link.mk 2 | 3 | .PHONY: uTee 4 | uTee: $(link-out-dir)/uTee 5 | cleanfiles += $(link-out-dir)/uTee 6 | $(link-out-dir)/uTee: $(link-out-dir)/tee-raw.bin 7 | @$(cmd-echo-silent) ' MKIMAGE $@' 8 | $(q)ADDR=`printf 0x%x $$(($(subst UL,,$(CFG_TZDRAM_START))))`; \ 9 | mkimage -A arm -O linux -C none -a $$ADDR -e $$ADDR -d $< $@ 10 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx7ulp-crm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2017-2019 NXP 4 | */ 5 | #ifndef __IMX7ULP_CRM_H__ 6 | #define __IMX7ULP_CRM_H__ 7 | 8 | #include 9 | 10 | #define PCC_CGC_BIT_SHIFT 30 11 | 12 | #define PCC_ENABLE_CLOCK BIT32(PCC_CGC_BIT_SHIFT) 13 | #define PCC_DISABLE_CLOCK BIT32(0) 14 | 15 | #define PCC_CAAM 0x90 16 | 17 | #endif /* __IMX7ULP_CRM_H__ */ 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx8q.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2018-2021 NXP 4 | */ 5 | 6 | #ifndef __IMX8Q_H__ 7 | #define __IMX8Q_H__ 8 | 9 | #define GICD_BASE 0x51a00000 10 | #define GICR_BASE 0x51b00000 11 | #define UART0_BASE 0x5a060000 12 | #define UART1_BASE 0x5a070000 13 | #define UART2_BASE 0x5a080000 14 | #define UART3_BASE 0x5a090000 15 | #define UART4_BASE 0x5a0a0000 16 | #define CAAM_BASE 0x31400000 17 | #define CAAM_SIZE 0x40000 18 | #define SC_IPC0_BASE 0x5d1b0000 19 | #define SC_IPC3_BASE 0x5d1e0000 20 | #define SC_IPC_SIZE 0x10000 21 | 22 | #endif /* __IMX8Q_H__ */ 23 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx8ulp-crm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2021 NXP 4 | */ 5 | #ifndef __IMX8ULP_CRM_H__ 6 | #define __IMX8ULP_CRM_H__ 7 | 8 | #include 9 | 10 | #define PCC_CGC_BIT_SHIFT 30 11 | #define PCC_ENABLE_CLOCK BIT32(PCC_CGC_BIT_SHIFT) 12 | #define PCC_CAAM 0xB8 13 | 14 | #endif /* __IMX8ULP_CRM_H__ */ 15 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx8ulp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2021 NXP 4 | */ 5 | #ifndef __IMX8ULP_H__ 6 | #define __IMX8ULP_H__ 7 | 8 | #include 9 | 10 | #define GICD_BASE 0x2d400000 11 | #define GICR_BASE 0x2d440000 12 | #define UART4_BASE 0x29390000 13 | #define UART5_BASE 0x293a0000 14 | #define CAAM_BASE 0x292e0000 15 | #define CAAM_SIZE 0x10000 16 | #define PCC3_BASE 0x292d0000 17 | #define PCC3_SIZE 0x1000 18 | #define AIPS3_BASE 0x29000000 19 | #define AIPS3_SIZE 0x400000 20 | #define SECMEM_BASE 0x00100000 21 | #define SECMEM_SIZE 0x80000 22 | #define MU_BASE 0x27020000 23 | #define MU_SIZE 0x10000 24 | 25 | #endif /* __IMX8ULP_H__ */ 26 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx93.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022-2023 NXP 4 | */ 5 | #ifndef __IMX93_H__ 6 | #define __IMX93_H__ 7 | 8 | #define GICD_BASE 0x48000000 9 | #define GICR_BASE 0x48040000 10 | 11 | #define UART1_BASE 0x44380000 12 | /* 13 | * For Normal MU - Use MU_BASE as 0x47520000 14 | * For Trust MU - Use MU_BASE as 0x47530000 15 | */ 16 | #define MU_BASE 0x47530000 17 | #define MU_SIZE 0x10000 18 | 19 | #define MU_TRUST_BASE 0x47530000 20 | 21 | #endif /* __IMX93_H__ */ 22 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/registers/imx95.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2024 NXP 4 | */ 5 | #ifndef __IMX95_H__ 6 | #define __IMX95_H__ 7 | 8 | #define GICD_BASE 0x48000000 9 | #define GICR_BASE 0x48060000 10 | 11 | #define UART1_BASE 0x44380000 12 | 13 | #define MU_BASE 0x47530000 14 | #define MU_SIZE 0x10000 15 | 16 | #endif /* __IMX95_H__ */ 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-imx/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c imx-common.c 3 | 4 | srcs-$(CFG_PL310) += imx_pl310.c 5 | 6 | ifneq (,$(filter y, $(CFG_MX6Q) $(CFG_MX6QP) $(CFG_MX6D) $(CFG_MX6DL) \ 7 | $(CFG_MX6S) $(CFG_MX6SL) $(CFG_MX6SLL) $(CFG_MX6SX))) 8 | srcs-y += a9_plat_init.S 9 | endif 10 | 11 | ifneq (,$(filter y, $(CFG_MX7) $(CFG_MX7ULP) $(CFG_MX6UL) $(CFG_MX6ULL))) 12 | srcs-y += a7_plat_init.S 13 | endif 14 | 15 | srcs-$(CFG_TZC380) += tzc380.c 16 | srcs-$(CFG_SM_PLATFORM_HANDLER) += sm_platform_handler.c 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-k3/drivers/sa2ul.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Texas Instruments K3 SA2UL Driver 4 | * 5 | * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ 6 | * Andrew Davis 7 | */ 8 | 9 | #ifndef __DRIVERS_SA2UL_H 10 | #define __DRIVERS_SA2UL_H 11 | 12 | #include 13 | 14 | TEE_Result sa2ul_rng_init(void); 15 | 16 | #endif /* __DRIVERS_SA2UL_H */ 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-k3/drivers/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += sec_proxy.c 2 | srcs-y += ti_sci.c 3 | srcs-$(CFG_SA2UL) += sa2ul.c 4 | srcs-$(CFG_SA2UL) += sa2ul_rng.c 5 | -------------------------------------------------------------------------------- /core/arch/arm/plat-k3/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | subdirs-y += drivers 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-ls/pta/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_PTA_LS_I2C_RTC_TEST) += i2c_rtc_test.c 2 | -------------------------------------------------------------------------------- /core/arch/arm/plat-ls/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-$(CFG_ARM32_core) += plat_init.S 4 | 5 | # Build PTA 6 | subdirs-y += pta 7 | -------------------------------------------------------------------------------- /core/arch/arm/plat-marvell/cn10k/core_pos.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2023 Marvell. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | FUNC get_core_pos_mpidr , : 11 | /* No clusters, core position is affinity2 of MPIDR_EL1 */ 12 | mov_imm x1, MPIDR_AFFLVL_MASK 13 | and x0, x1, x0, LSR #MPIDR_AFF2_SHIFT 14 | ret 15 | END_FUNC get_core_pos_mpidr 16 | -------------------------------------------------------------------------------- /core/arch/arm/plat-marvell/otx2/core_pos.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020, Marvell International Ltd. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | FUNC get_core_pos_mpidr , : 10 | ubfx x1, x0, #MPIDR_AFF0_SHIFT, #MPIDR_AFFINITY_BITS 11 | mov x2, #CFG_CLUSTERS_PER_NODE 12 | mul x1, x1, x2 13 | ubfx x2, x0, #MPIDR_AFF1_SHIFT, #MPIDR_AFFINITY_BITS 14 | add x0, x1, x2 15 | ret 16 | END_FUNC get_core_pos_mpidr 17 | -------------------------------------------------------------------------------- /core/arch/arm/plat-marvell/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | ifneq (,$(filter $(PLATFORM_FLAVOR),otx2t96 otx2f95 otx2t98)) 4 | srcs-$(CFG_ARM64_core) += otx2/core_pos.S 5 | endif 6 | ifneq (,$(filter $(PLATFORM_FLAVOR),cn10ka cn10kb cnf10ka cnf10kb)) 7 | srcs-$(CFG_ARM64_core) += cn10k/core_pos.S 8 | endif 9 | srcs-$(PLATFORM_FLAVOR_armada7k8k) += armada7k8k/hal_sec_perf.c 10 | srcs-$(PLATFORM_FLAVOR_armada3700) += armada3700/hal_sec_perf.c 11 | -------------------------------------------------------------------------------- /core/arch/arm/plat-mediatek/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-nuvoton/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-poplar/hi3798cv200.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Linaro Limited 3 | * SPDX-License-Identifier: BSD-2-Clause 4 | */ 5 | 6 | #ifndef __HI3798cv200_H__ 7 | #define __HI3798cv200_H__ 8 | 9 | /* PL011 */ 10 | #define PL011_UART0_BASE (0xF8B00000) 11 | #define PL011_BAUDRATE (115200) 12 | #define PL011_UART0_CLK_IN_HZ (75000000) 13 | 14 | #endif /* __HI3798cv200_H__ */ 15 | -------------------------------------------------------------------------------- /core/arch/arm/plat-poplar/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rcar/link.mk: -------------------------------------------------------------------------------- 1 | include core/arch/arm/kernel/link.mk 2 | 3 | SRECFLAGS ?= --srec-forceS3 --adjust-vma=$(CFG_TZDRAM_START) 4 | 5 | all: $(link-out-dir)/tee.srec 6 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rcar/rcar.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* Copyright (c) 2021, EPAM Systems. All rights reserved. */ 3 | 4 | #ifndef PLAT_RCAR_RCAR_H 5 | #define PLAT_RCAR_RCAR_H 6 | 7 | #define PRR_OFFSET 0x44 8 | #define PRR_PRODUCT_H3 0x4F00 9 | #define PRR_PRODUCT_M3W 0x5200 10 | #define PRR_PRODUCT_MASK 0xFF00 11 | #define PRR_CUT_MASK 0xFF 12 | #define PRR_CUT_10 0x00 /* Ver 1.0 */ 13 | #define PRR_CUT_11 0x01 /* Ver 1.1 */ 14 | #define PRR_CUT_20 0x10 /* Ver 2.0 */ 15 | #define PRR_CUT_30 0x20 /* Ver.3.0 */ 16 | 17 | #ifndef __ASSEMBLER__ 18 | extern uint32_t rcar_prr_value; 19 | #endif 20 | 21 | #endif /* PLAT_RCAR_RCAR_H */ 22 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rcar/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-${CFG_RCAR_GEN3} += core_pos_a64.S 4 | srcs-${CFG_RCAR_ROMAPI} += romapi.c 5 | srcs-${CFG_RCAR_ROMAPI} += romapi_call.S 6 | srcs-${CFG_RCAR_ROMAPI} += hw_rng.c 7 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rd1ae/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += rd1ae_core_pos.S 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rockchip/core_pos_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2017, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | FUNC get_core_pos_mpidr , : 11 | /* 12 | * Because mpidr is designed mistake in hardware, ie. core0 is 0xf00, 13 | * core1 is 0xf01..., so we need implement the function to correct this. 14 | */ 15 | and r0, r0, #MPIDR_CPU_MASK 16 | bx lr 17 | END_FUNC get_core_pos_mpidr 18 | 19 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rockchip/grf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2017, Fuzhou Rockchip Electronics Co., Ltd. 4 | */ 5 | 6 | #ifndef PLAT_ROCKCHIP_GRF_H 7 | #define PLAT_ROCKCHIP_GRF_H 8 | 9 | #if defined(PLATFORM_FLAVOR_rk322x) 10 | #define GRF_CPU_STATUS1 0x524 11 | 12 | #define CORE_WFE_MASK(core) SHIFT_U32(0x02, (core)) 13 | #define CORE_WFI_MASK(core) SHIFT_U32(0x20, (core)) 14 | #define CORE_WFE_I_MASK(core) (CORE_WFI_MASK(core) | CORE_WFE_MASK(core)) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rockchip/plat_init.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2017, Fuzhou Rockchip Electronics Co., Ltd. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | FUNC plat_cpu_reset_early , : 11 | 12 | /* Enable SMP bit */ 13 | read_actlr r0 14 | orr r0, r0, #ACTLR_SMP 15 | write_actlr r0 16 | bx lr 17 | END_FUNC plat_cpu_reset_early 18 | 19 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rockchip/platform.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2019, Theobroma Systems Design und Consulting GmbH 4 | */ 5 | 6 | #ifndef PLAT_ROCKCHIP_PLATFORM_H 7 | #define PLAT_ROCKCHIP_PLATFORM_H 8 | 9 | int platform_secure_init(void); 10 | int platform_secure_ddr_region(int rgn, paddr_t st, size_t sz); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rockchip/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += platform.c 4 | srcs-$(PLATFORM_FLAVOR_px30) += platform_px30.c 5 | srcs-$(PLATFORM_FLAVOR_rk322x) += platform_rk322x.c 6 | srcs-$(PLATFORM_FLAVOR_rk3399) += platform_rk3399.c 7 | 8 | ifeq ($(PLATFORM_FLAVOR),rk322x) 9 | srcs-y += plat_init.S 10 | srcs-y += core_pos_a32.S 11 | srcs-$(CFG_PSCI_ARM32) += psci_rk322x.c 12 | endif 13 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rpi3/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rzg/link.mk: -------------------------------------------------------------------------------- 1 | include core/arch/arm/kernel/link.mk 2 | 3 | all: $(link-out-dir)/tee.srec 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rzg/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-rzn1/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += psci.c 4 | srcs-y += sm_platform_handler.c 5 | srcs-y += a7_plat_init.S 6 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sam/nsec-service/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += sm_platform_handler.c 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sam/pm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_PSCI_ARM32) += psci.c 2 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sam/sam_pl310.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2024, Microchip Technology Inc. and its subsidiaries. 4 | */ 5 | 6 | #ifndef __SAM_PL310_H__ 7 | #define __SAM_PL310_H__ 8 | 9 | TEE_Result pl310_enable(void); 10 | TEE_Result pl310_disable(void); 11 | TEE_Result pl310_enable_writeback(void); 12 | TEE_Result pl310_disable_writeback(void); 13 | 14 | #endif /* __SAM_PL310_H__ */ 15 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sam/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += freq.c sam_sfr.c 3 | srcs-$(CFG_SAMA5D2) += platform_sama5d2.c 4 | srcs-$(CFG_SAMA7G5) += platform_sama7g5.c 5 | srcs-$(CFG_AT91_MATRIX) += matrix.c 6 | srcs-$(CFG_PL310) += sam_pl310.c 7 | srcs-$(CFG_SCMI_MSG_DRIVERS) += scmi_server.c 8 | 9 | subdirs-y += pm 10 | subdirs-y += nsec-service 11 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sprd/conf.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_FLAVOR ?= sc9860 2 | 3 | include core/arch/arm/cpu/cortex-armv8-0.mk 4 | 5 | $(call force,CFG_TEE_CORE_NB_CORE,8) 6 | $(call force,CFG_WITH_ARM_TRUSTED_FW,y) 7 | $(call force,CFG_GIC,y) 8 | $(call force,CFG_SPRD_UART,y) 9 | $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) 10 | 11 | # Overrides default in mk/config.mk with 128 kB 12 | CFG_CORE_HEAP_SIZE ?= 131072 13 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sprd/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += console.c 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += rng_support.c 4 | srcs-y += tz_a9init.S 5 | srcs-y += main.c 6 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/boot_api.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright (C) 2017-2018, STMicroelectronics 4 | */ 5 | 6 | #ifndef __BOOT_API_H__ 7 | #define __BOOT_API_H__ 8 | 9 | /* 10 | * Backup registers mapping 11 | */ 12 | 13 | /* Backup register #4: magic to request core1 boot up */ 14 | #define BCKR_CORE1_MAGIC_NUMBER 4 15 | 16 | /* Value for BCKR_CORE1_MAGIC_NUMBER entry */ 17 | #define BOOT_API_A7_CORE1_MAGIC_NUMBER 0xca7face1 18 | 19 | /* Backup register #5: physical address of core1 entry at boot up */ 20 | #define BCKR_CORE1_BRANCH_ADDRESS 5 21 | 22 | #endif /* __BOOT_API_H__*/ 23 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/drivers/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_STPMIC1) += stm32mp1_pmic.c 2 | srcs-y += stm32mp1_pwr.c 3 | srcs-y += stm32mp1_syscfg.c 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/link_dummies_paged.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | const struct clk_ops stm32mp1_clk_ops __rodata_dummy; 10 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/nsec-service/bsec_svc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright (c) 2016-2020, STMicroelectronics 4 | */ 5 | 6 | #ifndef __STM32MP1_BSEC_SVC_H__ 7 | #define __STM32MP1_BSEC_SVC_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef CFG_STM32_BSEC_SIP 14 | void bsec_main(struct thread_smc_args *args); 15 | #else 16 | static inline void bsec_main(struct thread_smc_args *args) 17 | { 18 | args->a0 = STM32_SIP_SVC_UNKNOWN_FUNCTION; 19 | } 20 | #endif 21 | #endif /*__STM32MP1_BSEC_SVC_H__*/ 22 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/nsec-service/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += stm32mp1_svc_setup.c 4 | srcs-$(CFG_STM32_BSEC_SIP) += bsec_svc.c 5 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/pm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_PSCI_ARM32) += psci.c 2 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/reset.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright (c) 2018, STMicroelectronics 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | .section .text 11 | .balign 4 12 | .code 32 13 | 14 | #define STM32MP1_NSACR_PRESERVE_MASK (0xfff << 20) 15 | 16 | FUNC plat_cpu_reset_early , : 17 | ldr r0, =SCR_SIF 18 | write_scr r0 19 | 20 | read_nsacr r0 21 | mov_imm r1, STM32MP1_NSACR_PRESERVE_MASK 22 | and r0, r0, r1 23 | write_nsacr r0 24 | 25 | isb 26 | bx lr 27 | END_FUNC plat_cpu_reset_early 28 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp1/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += main.c 4 | srcs-y += reset.S 5 | srcs-$(CFG_SCMI_MSG_DRIVERS) += scmi_server.c 6 | srcs-$(CFG_STM32MP1_SHARED_RESOURCES) += shared_resources.c 7 | srcs-$(CFG_TZC400) += plat_tzc400.c 8 | srcs-$(CFG_WITH_PAGER) += link_dummies_paged.c 9 | 10 | subdirs-y += drivers 11 | subdirs-y += nsec-service 12 | subdirs-y += pm 13 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp2/drivers/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += stm32mp25_syscfg.c 2 | -------------------------------------------------------------------------------- /core/arch/arm/plat-stm32mp2/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += main.c 4 | srcs-y += stm32mp_pm.c 5 | subdirs-y += drivers 6 | -------------------------------------------------------------------------------- /core/arch/arm/plat-sunxi/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-$(CFG_ARM32_core) += plat_init.S 4 | srcs-$(CFG_ARM32_core) += psci.c 5 | -------------------------------------------------------------------------------- /core/arch/arm/plat-synquacer/conf.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_FLAVOR ?= developerbox 2 | 3 | $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) 4 | $(call force,CFG_GIC,y) 5 | $(call force,CFG_PL011,y) 6 | 7 | include core/arch/arm/cpu/cortex-armv8-0.mk 8 | $(call force,CFG_TEE_CORE_NB_CORE,24) 9 | CFG_NUM_THREADS ?= 8 10 | CFG_TZDRAM_START ?= 0xfc000000 11 | CFG_TZDRAM_SIZE ?= 0x03c00000 12 | CFG_SHMEM_START ?= 0xffc00000 13 | CFG_SHMEM_SIZE ?= 0x00400000 14 | 15 | $(call force,CFG_WITH_ARM_TRUSTED_FW,y) 16 | 17 | $(call force,CFG_ARM64_core,y) 18 | supported-ta-targets = ta_arm64 19 | 20 | CFG_CRYPTO_SIZE_OPTIMIZATION ?= n 21 | $(call force,CFG_ARM_GICV3,y) 22 | $(call force,CFG_CORE_CLUSTER_SHIFT,1) 23 | -------------------------------------------------------------------------------- /core/arch/arm/plat-synquacer/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += rng_pta.c 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-synquacer/synquacer_rng_pta.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2018-2022, Linaro Limited 4 | */ 5 | 6 | #ifndef __SYNQUACER_RNG_PTA_H 7 | #define __SYNQUACER_RNG_PTA_H 8 | 9 | void rng_collect_entropy(void); 10 | 11 | #endif /* __SYNQUACER_RNG_PTA_H */ 12 | -------------------------------------------------------------------------------- /core/arch/arm/plat-ti/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-$(CFG_PL310) += ti_pl310.c 4 | srcs-$(PLATFORM_FLAVOR_dra7xx) += sm_platform_handler_a15.c 5 | srcs-$(PLATFORM_FLAVOR_am57xx) += sm_platform_handler_a15.c 6 | srcs-$(PLATFORM_FLAVOR_am43xx) += sm_platform_handler_a9.c a9_plat_init.S 7 | -------------------------------------------------------------------------------- /core/arch/arm/plat-totalcompute/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-uniphier/kern.ld.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: (BSD-2-Clause AND MIT) */ 2 | #include "../kernel/kern.ld.S" 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-uniphier/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-versal/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/plat-vexpress/juno_core_pos_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* For Juno number the two A57s as 4 to 5 and A53s as 0 to 3 */ 11 | FUNC get_core_pos_mpidr , : 12 | /* Calculate CorePos = ((ClusterId ^ 1) * 4) + CoreId */ 13 | and r1, r0, #MPIDR_CPU_MASK 14 | and r0, r0, #MPIDR_CLUSTER_MASK 15 | eor r0, r0, #(1 << MPIDR_CLUSTER_SHIFT) 16 | add r0, r1, r0, LSR #6 17 | bx lr 18 | END_FUNC get_core_pos_mpidr 19 | 20 | -------------------------------------------------------------------------------- /core/arch/arm/plat-vexpress/juno_core_pos_a64.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* For Juno number the two A57s as 4 to 5 and A53s as 0 to 3 */ 10 | FUNC get_core_pos_mpidr , : 11 | /* Calculate CorePos = ((ClusterId ^ 1) * 4) + CoreId */ 12 | and x1, x0, #MPIDR_CPU_MASK 13 | and x0, x0, #MPIDR_CLUSTER_MASK 14 | eor x0, x0, #(1 << MPIDR_CLUSTER_SHIFT) 15 | add x0, x1, x0, LSR #6 16 | ret 17 | END_FUNC get_core_pos_mpidr 18 | -------------------------------------------------------------------------------- /core/arch/arm/plat-vexpress/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | ifeq ($(PLATFORM_FLAVOR_juno),y) 4 | srcs-$(CFG_ARM32_core) += juno_core_pos_a32.S 5 | srcs-$(CFG_ARM64_core) += juno_core_pos_a64.S 6 | endif 7 | srcs-$(CFG_WITH_USER_TA) += vendor_props.c 8 | -------------------------------------------------------------------------------- /core/arch/arm/plat-zynq7k/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | srcs-y += plat_init.S 4 | -------------------------------------------------------------------------------- /core/arch/arm/plat-zynqmp/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/arm/sm/sm_private.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016, Linaro Limited 4 | * Copyright (c) 2014, STMicroelectronics International N.V. 5 | */ 6 | #ifndef SM_PRIVATE_H 7 | #define SM_PRIVATE_H 8 | 9 | /* Returns one of SM_EXIT_TO_* exit monitor in secure or non-secure world */ 10 | uint32_t sm_from_nsec(struct sm_ctx *ctx); 11 | #endif /*SM_PRIVATE_H*/ 12 | 13 | -------------------------------------------------------------------------------- /core/arch/arm/sm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += sm_a32.S 2 | srcs-y += sm.c 3 | srcs-$(CFG_PM_ARM32) += pm.c pm_a32.S 4 | srcs-$(CFG_PSCI_ARM32) += std_smc.c psci.c psci-helper.S 5 | -------------------------------------------------------------------------------- /core/arch/arm/tee/sub.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(CFG_WITH_USER_TA),y) 2 | srcs-$(CFG_CACHE_API) += svc_cache.c 3 | endif 4 | ifneq ($(CFG_CORE_FFA),y) 5 | srcs-y += entry_fast.c 6 | cppflags-entry_fast.c-y += -DTEE_IMPL_GIT_SHA1=$(TEE_IMPL_GIT_SHA1) 7 | endif 8 | srcs-y += cache.c 9 | -------------------------------------------------------------------------------- /core/arch/riscv/include/kernel/cache_helpers_arch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #ifndef __KERNEL_CACHE_HELPERS_ARCH_H 7 | #define __KERNEL_CACHE_HELPERS_ARCH_H 8 | 9 | #endif /*__KERNEL_CACHE_HELPERS_ARCH_H*/ 10 | -------------------------------------------------------------------------------- /core/arch/riscv/include/kernel/delay_arch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022-2023 NXP 4 | */ 5 | 6 | #ifndef __KERNEL_DELAY_ARCH_H 7 | #define __KERNEL_DELAY_ARCH_H 8 | 9 | #include 10 | #include 11 | 12 | static inline unsigned int delay_cnt_freq(void) 13 | { 14 | return read_cntfrq(); 15 | } 16 | 17 | static inline uint64_t delay_cnt_read(void) 18 | { 19 | return read_time(); 20 | } 21 | #endif /*__KERNEL_DELAY_ARCH_H*/ 22 | -------------------------------------------------------------------------------- /core/arch/riscv/include/kernel/misc_arch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #ifndef __KERNEL_MISC_ARCH_H 7 | #define __KERNEL_MISC_ARCH_H 8 | 9 | #endif /*__KERNEL_MISC_ARCH_H*/ 10 | -------------------------------------------------------------------------------- /core/arch/riscv/include/kernel/tee_l2cc_mutex.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | #ifndef __KERNEL_TEE_L2CC_MUTEX_H 6 | #define __KERNEL_TEE_L2CC_MUTEX_H 7 | 8 | #endif /* __KERNEL_TEE_L2CC_MUTEX_H */ 9 | -------------------------------------------------------------------------------- /core/arch/riscv/include/kernel/tlb_helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #ifndef __KERNEL_TLB_HELPERS_H 7 | #define __KERNEL_TLB_HELPERS_H 8 | 9 | #ifndef __ASSEMBLER__ 10 | 11 | void tlbi_all(void); 12 | void tlbi_va_allasid(vaddr_t va); 13 | void tlbi_asid(unsigned long asid); 14 | void tlbi_va_asid(vaddr_t va, uint32_t asid); 15 | 16 | #endif /*!__ASSEMBLER__*/ 17 | 18 | #endif /* __KERNEL_TLB_HELPERS_H */ 19 | -------------------------------------------------------------------------------- /core/arch/riscv/include/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | -------------------------------------------------------------------------------- /core/arch/riscv/include/tee/teeabi_opteed_macros.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2023 NXP 4 | * Copyright (c) 2014, Linaro Limited 5 | */ 6 | 7 | #ifndef __TEE_TEEABI_OPTEED_MACROS_H 8 | #define __TEE_TEEABI_OPTEED_MACROS_H 9 | 10 | #define TEEABI_OPTEED_RV(func_num) \ 11 | OPTEE_ABI_CALL_VAL(OPTEE_ABI_32, OPTEE_ABI_FAST_CALL, \ 12 | OPTEE_ABI_OWNER_TRUSTED_OS_OPTEED, (func_num)) 13 | 14 | #endif /*__TEE_TEEABI_OPTEED_MACROS_H*/ 15 | -------------------------------------------------------------------------------- /core/arch/riscv/kernel/idle.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | void cpu_idle(void) 10 | { 11 | /* ensure memory operations were complete */ 12 | mb(); 13 | /* stall the hart */ 14 | wfi(); 15 | } 16 | -------------------------------------------------------------------------------- /core/arch/riscv/kernel/semihosting_rv.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2024 Andes Technology Corporation 4 | */ 5 | 6 | #include 7 | 8 | /* 9 | * uintptr_t __do_semihosting(uintptr_t op, uintptr_t arg) 10 | * 11 | * Refer to RISC-V Semihosting Binary Interface: 12 | * https://github.com/riscv-non-isa/riscv-semihosting/blob/main/binary-interface.adoc 13 | */ 14 | FUNC __do_semihosting , : , .identity_map 15 | .option push 16 | .option norvc 17 | slli x0, x0, 0x1f 18 | ebreak 19 | srai x0, x0, 0x7 20 | .option pop 21 | ret 22 | END_FUNC __do_semihosting 23 | -------------------------------------------------------------------------------- /core/arch/riscv/mm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += core_mmu_arch.c 2 | srcs-y += tlb_helpers_rv.S 3 | 4 | ifeq ($(CFG_SYSCALL_FTRACE),y) 5 | # We would not like to profile MMU APIs as these are used to switch TA 6 | # context which may cause undesired behaviour as ftrace requires TA context 7 | # to be active. Moreover profiling code uses some of MMU APIs to check 8 | # if TA context is active or not. 9 | cflags-remove-core_mmu_arch.c-y += -pg 10 | endif 11 | -------------------------------------------------------------------------------- /core/arch/riscv/mm/tlb_helpers_rv.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2023 Andes Technology Corporation 4 | * Copyright 2022 NXP 5 | */ 6 | 7 | #include 8 | 9 | /* void tlbi_all(void); */ 10 | FUNC tlbi_all , : 11 | sfence.vma zero, zero 12 | ret 13 | END_FUNC tlbi_all 14 | 15 | /* void tlbi_va_allasid(vaddr_t va); */ 16 | FUNC tlbi_va_allasid , : 17 | sfence.vma a0, zero 18 | ret 19 | END_FUNC tlbi_va_allasid 20 | 21 | /* void tlbi_asid(unsigned int asid); */ 22 | FUNC tlbi_asid , : 23 | sfence.vma zero, a0 24 | ret 25 | END_FUNC tlbi_asid 26 | 27 | /* void tlbi_va_asid(vaddr_t va, uint32_t asid); */ 28 | FUNC tlbi_va_asid , : 29 | sfence.vma a0, a1 30 | ret 31 | END_FUNC tlbi_va_asid 32 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-spike/drivers/htif.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #ifndef __DRIVERS_HTIF_H__ 7 | #define __DRIVERS_HTIF_H__ 8 | 9 | #include 10 | #include 11 | 12 | #define HTIF_CMD_WRITE 1 13 | #define HTIF_DEV_CONSOLE 1 14 | #define HTIF_REG_SIZE (2 * RISCV_XLEN_BYTES) 15 | 16 | struct htif_console_data { 17 | struct io_pa_va base; 18 | struct serial_chip chip; 19 | }; 20 | 21 | void htif_lock_global(void); 22 | void htif_unlock_global(void); 23 | void htif_console_init(struct htif_console_data *pd, paddr_t pbase); 24 | 25 | #endif /*__DRIVERS_HTIF_H__*/ 26 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-spike/drivers/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_RISCV_M_MODE) += htif.c 2 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-spike/kern.ld.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: (BSD-2-Clause) */ 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | #include "../kernel/kern.ld.S" 7 | 8 | SECTIONS 9 | { 10 | .htif HTIF_BASE: 11 | { 12 | tohost = .; 13 | fromhost = tohost + 8; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-spike/platform_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022 NXP 4 | * 5 | * Brief Spike platform configuration. 6 | */ 7 | 8 | #ifndef PLATFORM_CONFIG_H 9 | #define PLATFORM_CONFIG_H 10 | 11 | #include 12 | #include 13 | 14 | #ifndef HTIF_BASE 15 | #define HTIF_BASE 0x40008000 16 | #endif 17 | 18 | /* CLINT */ 19 | #ifndef CLINT_BASE 20 | #define CLINT_BASE 0x02000000 21 | #endif 22 | 23 | #define PLAT_THREAD_EXCP_FOREIGN_INTR (CSR_XIE_EIE) 24 | #define PLAT_THREAD_EXCP_NATIVE_INTR (CSR_XIE_SIE | CSR_XIE_TIE) 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-spike/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | subdirs-y += drivers 3 | srcs-y += main.c 4 | -------------------------------------------------------------------------------- /core/arch/riscv/plat-virt/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += main.c 3 | -------------------------------------------------------------------------------- /core/arch/riscv/tee/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += entry_fast.c 2 | cppflags-entry_fast.c-y += -DTEE_IMPL_GIT_SHA1=$(TEE_IMPL_GIT_SHA1) 3 | -------------------------------------------------------------------------------- /core/drivers/bnxt/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += bnxt.c 2 | srcs-y += bnxt_fw.c 3 | srcs-y += bnxt_images.c 4 | -------------------------------------------------------------------------------- /core/drivers/clk/sam/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | 3 | srcs-y += at91_sckc.c at91_main.c at91_pmc.c 4 | srcs-y += at91_utmi.c at91_master.c 5 | srcs-y += at91_programmable.c at91_system.c at91_peripheral.c 6 | srcs-y += at91_generated.c 7 | srcs-y += at91_cpu_opp.c 8 | 9 | srcs-$(CFG_SAMA5D2) += at91_pll.c at91_plldiv.c 10 | srcs-$(CFG_SAMA5D2) += at91_h32mx.c at91_usb.c 11 | srcs-$(CFG_SAMA5D2) += at91_i2s_mux.c at91_audio_pll.c 12 | srcs-$(CFG_SAMA5D2) += sama5d2_clk.c 13 | 14 | srcs-$(CFG_SAMA7G5) += clk-sam9x60-pll.c phy-sama7-utmi-clk.c sama7g5_clk.c 15 | -------------------------------------------------------------------------------- /core/drivers/clk/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += clk.c 2 | srcs-$(CFG_DRIVERS_CLK_DT) += clk_dt.c 3 | srcs-$(CFG_DRIVERS_CLK_FIXED) += fixed_clk.c 4 | srcs-$(CFG_STM32MP_CLK_CORE) += clk-stm32-core.c 5 | srcs-$(CFG_STM32MP13_CLK) += clk-stm32mp13.c 6 | srcs-$(CFG_STM32MP15_CLK) += clk-stm32mp15.c 7 | srcs-$(CFG_STM32MP25_CLK) += clk-stm32mp25.c 8 | 9 | subdirs-$(CFG_DRIVERS_SAM_CLK) += sam -------------------------------------------------------------------------------- /core/drivers/crypto/aspeed/hace_ast2600.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2022, Aspeed Technology Inc. 4 | */ 5 | #ifndef __HACE_AST2600_H__ 6 | #define __HACE_AST2600_H__ 7 | 8 | #include 9 | 10 | #ifdef CFG_CRYPTO_DRV_HASH 11 | TEE_Result ast2600_drvcrypt_register_hash(void); 12 | #else 13 | static inline TEE_Result ast2600_drvcrypt_register_hash(void) 14 | { 15 | return TEE_ERROR_NOT_SUPPORTED; 16 | } 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /core/drivers/crypto/aspeed/sub.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(PLATFORM_FLAVOR),ast2600) 2 | srcs-y += crypto_ast2600.c 3 | srcs-$(CFG_CRYPTO_DRV_HASH) += hace_ast2600.c 4 | endif 5 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/acipher/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-$(CFG_NXP_CAAM_RSA_DRV) += caam_rsa.c caam_prime_rsa.c 4 | srcs-$(CFG_NXP_CAAM_DH_DRV) += caam_dh.c 5 | srcs-$(CFG_NXP_CAAM_ECC_DRV) += caam_ecc.c 6 | srcs-$(CFG_NXP_CAAM_DSA_DRV) += caam_dsa.c caam_prime_dsa.c 7 | srcs-$(CFG_NXP_CAAM_MATH_DRV) += caam_math.c -------------------------------------------------------------------------------- /core/drivers/crypto/caam/ae/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-y += caam_ae.c 4 | srcs-$(CFG_NXP_CAAM_AE_GCM_DRV) += caam_ae_gcm.c 5 | srcs-$(CFG_NXP_CAAM_AE_CCM_DRV) += caam_ae_ccm.c -------------------------------------------------------------------------------- /core/drivers/crypto/caam/blob/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_NXP_CAAM_BLOB_DRV) += caam_blob.c 2 | srcs-$(CFG_NXP_CAAM_DEK_DRV) += caam_dek.c 3 | 4 | incdirs-y += ../include 5 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/cipher/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-y += caam_cipher.c 4 | srcs-y += caam_cipher_xts.c 5 | srcs-$(CFG_NXP_CAAM_CMAC_DRV) += caam_cipher_mac.c 6 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/common/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../../include 2 | incdirs-y += ../$(CAAM_HAL_DIR) 3 | incdirs-y += . 4 | 5 | srcs-$(CFG_DT) += hal_cfg_dt.c hal_sm_dt.c 6 | srcs-y += hal_cfg.c 7 | srcs-y += hal_rng.c 8 | srcs-y += hal_jr.c 9 | srcs-y += hal_ctrl.c 10 | srcs-$(CFG_NXP_CAAM_SM_DRV) += hal_sm.c 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_6_7/hal_clk_mx7.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2018-2019 NXP 4 | * 5 | * Brief CAAM Clock functions. 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void caam_hal_clk_enable(bool enable) 13 | { 14 | vaddr_t ccm_base = (vaddr_t)phys_to_virt(CCM_BASE, MEM_AREA_IO_SEC, 1); 15 | 16 | if (enable) { 17 | io_write32(ccm_base + CCM_CCGRx_SET(CCM_CLOCK_DOMAIN_CAAM), 18 | CCM_CCGRx_ALWAYS_ON(0)); 19 | } else { 20 | io_write32(ccm_base + CCM_CCGRx_CLR(CCM_CLOCK_DOMAIN_CAAM), 21 | CCM_CCGRx_ALWAYS_ON(0)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_6_7/hal_clk_mx7ulp.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2018-2019 NXP 4 | * 5 | * Brief CAAM Clock functions. 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void caam_hal_clk_enable(bool enable) 13 | { 14 | vaddr_t pcc2_base = (vaddr_t)phys_to_virt(PCC2_BASE, MEM_AREA_IO_SEC, 15 | PCC_CAAM + sizeof(uint32_t)); 16 | 17 | if (enable) 18 | io_write32(pcc2_base + PCC_CAAM, PCC_ENABLE_CLOCK); 19 | else 20 | io_write32(pcc2_base + PCC_CAAM, PCC_DISABLE_CLOCK); 21 | } 22 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_6_7/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../common 2 | incdirs-y += ../../include 3 | incdirs-y += . 4 | 5 | srcs-$(CFG_MX6) += hal_clk_mx6.c 6 | srcs-$(CFG_MX7) += hal_clk_mx7.c 7 | srcs-$(CFG_MX7ULP) += hal_clk_mx7ulp.c 8 | srcs-y += hal_ctrl.c 9 | srcs-y += hal_jr.c 10 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8m/hal_clk.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2018 NXP 4 | * 5 | * Brief CAAM Clock functions. 6 | */ 7 | #include 8 | #include 9 | 10 | void caam_hal_clk_enable(bool enable __unused) 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8m/hal_ctrl.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2018-2019 NXP 4 | * 5 | * Brief CAAM Controller Hardware Abstration Layer. 6 | * Implementation of primitives to access HW. 7 | */ 8 | #include 9 | #include 10 | #include 11 | 12 | void caam_hal_ctrl_init(vaddr_t baseaddr) 13 | { 14 | /* Enable DECO watchdogs */ 15 | io_setbits32(baseaddr + MCFGR, MCFGR_WDE); 16 | } 17 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8m/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../common 2 | incdirs-y += ../../include 3 | incdirs-y += . 4 | 5 | srcs-y += hal_clk.c 6 | srcs-y += hal_ctrl.c 7 | srcs-y += hal_jr.c 8 | srcs-y += hal_cfg.c 9 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8q/hal_cfg.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2020-2021 NXP 4 | */ 5 | #include 6 | 7 | void caam_hal_cfg_setup_nsjobring(struct caam_jrcfg *jrcfg __unused) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8q/hal_clk.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2020-2021 NXP 4 | */ 5 | #include 6 | #include 7 | 8 | void caam_hal_clk_enable(bool enable __unused) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8q/hal_ctrl.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2020-2021 NXP 4 | */ 5 | #include 6 | #include 7 | 8 | void caam_hal_ctrl_init(vaddr_t baseaddr __unused) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8q/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../common 2 | incdirs-y += ../../include 3 | incdirs-y += . 4 | 5 | srcs-y += hal_clk.c 6 | srcs-y += hal_ctrl.c 7 | srcs-y += hal_jr.c 8 | srcs-y += hal_cfg.c 9 | srcs-y += hal_rng.c 10 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8ulp/hal_clk.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2021 NXP 4 | * 5 | * Brief CAAM Clock functions. 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void caam_hal_clk_enable(bool enable) 13 | { 14 | vaddr_t pcc3_base = (vaddr_t)phys_to_virt(PCC3_BASE, MEM_AREA_IO_SEC, 15 | PCC3_SIZE); 16 | 17 | if (enable) 18 | io_setbits32(pcc3_base + PCC_CAAM, PCC_ENABLE_CLOCK); 19 | else 20 | io_clrbits32(pcc3_base + PCC_CAAM, PCC_ENABLE_CLOCK); 21 | } 22 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8ulp/hal_ctrl.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2021 NXP 4 | * 5 | * Brief CAAM Controller Hardware Abstration Layer. 6 | * Implementation of primitives to access HW. 7 | */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | void caam_hal_ctrl_init(vaddr_t baseaddr) 14 | { 15 | /* Enable DECO watchdogs */ 16 | io_setbits32(baseaddr + MCFGR, MCFGR_WDE); 17 | } 18 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/imx_8ulp/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../common 2 | incdirs-y += ../../include 3 | incdirs-y += . 4 | 5 | srcs-y += hal_clk.c 6 | srcs-y += hal_ctrl.c 7 | srcs-y += hal_jr.c 8 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/ls/hal_clk.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2019 NXP 4 | * 5 | * Brief CAAM Clock functions. 6 | */ 7 | #include 8 | #include 9 | 10 | void caam_hal_clk_enable(bool enable __unused) 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/ls/hal_ctrl.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2019 NXP 4 | * 5 | * Brief CAAM Controller Hardware Abstration Layer. 6 | * Implementation of primitives to access HW. 7 | */ 8 | #include 9 | #include 10 | 11 | void caam_hal_ctrl_init(vaddr_t baseaddr __unused) 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/ls/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../common 2 | incdirs-y += ../../include 3 | incdirs-y += . 4 | 5 | srcs-y += hal_clk.c 6 | srcs-y += hal_ctrl.c 7 | srcs-y += hal_jr.c 8 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hal/sub.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(CFG_LS),y) 2 | CAAM_HAL_DIR = ls 3 | endif 4 | ifeq ($(filter y, $(CFG_MX6) $(CFG_MX7) $(CFG_MX7ULP)),y) 5 | CAAM_HAL_DIR = imx_6_7 6 | endif 7 | ifeq ($(filter y, $(CFG_MX8MQ) $(CFG_MX8MM) $(CFG_MX8MN) $(CFG_MX8MP)),y) 8 | CAAM_HAL_DIR = imx_8m 9 | endif 10 | ifeq ($(filter y, $(CFG_MX8QM) $(CFG_MX8QX) $(CFG_MX8DXL)),y) 11 | CAAM_HAL_DIR = imx_8q 12 | endif 13 | ifeq ($(filter y, $(CFG_MX8ULP)),y) 14 | CAAM_HAL_DIR = imx_8ulp 15 | endif 16 | 17 | 18 | subdirs-y += common 19 | subdirs-y += $(CAAM_HAL_DIR) 20 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/hash/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-y += caam_hash.c 4 | srcs-$(CFG_NXP_CAAM_HMAC_DRV) += caam_hash_mac.c 5 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/include/caam_ae.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2024 NXP 4 | */ 5 | #ifndef __CAAM_AE_H__ 6 | #define __CAAM_AE_H__ 7 | 8 | #include 9 | 10 | /* 11 | * Initialize the Authentication Encryption module 12 | * 13 | * @ctrl_addr Controller base address 14 | */ 15 | enum caam_status caam_ae_init(vaddr_t ctrl_addr __unused); 16 | 17 | #endif /* __CAAM_AE_H__ */ 18 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/include/caam_blob.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2020 Pengutronix, Rouven Czerwinski 4 | */ 5 | #ifndef __CAAM_BLOB_H__ 6 | #define __CAAM_BLOB_H__ 7 | 8 | #include 9 | 10 | #ifdef CFG_NXP_CAAM_BLOB_DRV 11 | /* 12 | * Initialize the BLOB module 13 | * 14 | * @ctrl_addr Controller base address 15 | */ 16 | enum caam_status caam_blob_mkvb_init(vaddr_t baseaddr); 17 | #else 18 | static inline enum caam_status caam_blob_mkvb_init(vaddr_t baseaddr __unused) 19 | { 20 | return CAAM_NO_ERROR; 21 | } 22 | #endif /* CFG_NXP_CAAM_BLOB_DRV */ 23 | 24 | #endif /* __CAAM_BLOB_H__ */ 25 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/include/caam_hal_clk.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2018-2019 NXP 4 | * 5 | * Brief CAAM Clock functions header. 6 | */ 7 | #ifndef __CAAM_HAL_CLK_H__ 8 | #define __CAAM_HAL_CLK_H__ 9 | 10 | #include 11 | 12 | /* 13 | * Enable/disable the CAAM clocks 14 | * 15 | * @enable Enable the clock if true 16 | */ 17 | void caam_hal_clk_enable(bool enable); 18 | 19 | #endif /* __CAAM_HAL_CLK_H__ */ 20 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/include/caam_rng.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2017-2019 NXP 4 | * 5 | * Brief CAAM Random Number Generator manager header. 6 | */ 7 | #ifndef __CAAM_RNG_H__ 8 | #define __CAAM_RNG_H__ 9 | 10 | /* 11 | * Initialize the RNG module to generate data 12 | * 13 | * @ctrl_addr Controller base address 14 | */ 15 | enum caam_status caam_rng_init(vaddr_t ctrl_addr); 16 | 17 | /* Instantiates the RNG State Handles if not already done */ 18 | enum caam_status caam_rng_instantiation(void); 19 | 20 | #endif /* __CAAM_RNG_H__ */ 21 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/include/caam_utils_delay.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2018-2019 NXP 4 | * 5 | * Brief Delay management utilities header. 6 | */ 7 | #ifndef __CAAM_UTILS_DELAY_H__ 8 | #define __CAAM_UTILS_DELAY_H__ 9 | 10 | /* 11 | * Wait given microsecond 12 | * 13 | * @time Time in microsecond 14 | */ 15 | void caam_udelay(uint32_t time); 16 | 17 | #endif /* __CAAM_UTILS_DELAY_H__ */ 18 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/mp/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-y += caam_mp.c 4 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += include 2 | 3 | subdirs-y += hal 4 | subdirs-y += utils 5 | 6 | srcs-y += caam_pwr.c 7 | srcs-y += caam_ctrl.c 8 | srcs-y += caam_jr.c 9 | srcs-y += caam_rng.c 10 | srcs-y += caam_desc.c 11 | srcs-$(CFG_NXP_CAAM_SM_DRV) += caam_sm.c 12 | srcs-y += caam_key.c 13 | subdirs-$(call cfg-one-enabled, CFG_NXP_CAAM_HASH_DRV CFG_NXP_CAAM_HMAC_DRV) += hash 14 | subdirs-$(call cfg-one-enabled, CFG_NXP_CAAM_CIPHER_DRV CFG_NXP_CAAM_CMAC_DRV) += cipher 15 | subdirs-$(call cfg-one-enabled, CFG_NXP_CAAM_AE_CCM_DRV CFG_NXP_CAAM_AE_GCM_DRV) += ae 16 | subdirs-y += acipher 17 | subdirs-y += blob 18 | subdirs-$(CFG_NXP_CAAM_MP_DRV) += mp 19 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/utils/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-y += utils_mem.c 4 | srcs-y += utils_delay.c 5 | srcs-y += utils_sgt.c 6 | srcs-$(CFG_NXP_CAAM_SGT_V1) += utils_sgt_v1.c 7 | srcs-$(CFG_NXP_CAAM_SGT_V2) += utils_sgt_v2.c 8 | srcs-y += utils_status.c 9 | srcs-y += utils_dmaobj.c 10 | -------------------------------------------------------------------------------- /core/drivers/crypto/caam/utils/utils_delay.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2018 NXP 4 | * 5 | * Brief Delay management utilities. 6 | * Primitive to delay a delay. 7 | */ 8 | #include 9 | #include 10 | 11 | void caam_udelay(uint32_t time) 12 | { 13 | uint32_t counter = time * 500; 14 | 15 | /* Implementation of a Software loop assuming CPU clock of 500MHz */ 16 | while (counter--) { 17 | isb(); 18 | dsb(); 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/acipher/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_CRYPTO_DRV_RSA) += rsa.c rsamgf.c rsassa.c 2 | srcs-$(CFG_CRYPTO_DRV_ECC) += ecc.c 3 | srcs-$(CFG_CRYPTO_DRV_DH) += dh.c 4 | srcs-$(CFG_CRYPTO_DRV_DSA) += dsa.c 5 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/authenc/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += authenc.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/cipher/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += cipher.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/hash/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += hash.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/mac/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += mac.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/math/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += modulus.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/oid/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += hash_oid.c 2 | -------------------------------------------------------------------------------- /core/drivers/crypto/crypto_api/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += drvcrypt.c 2 | 3 | subdirs-y += math 4 | 5 | subdirs-$(CFG_CRYPTO_DRV_HASH) += hash 6 | subdirs-$(CFG_CRYPTO_DRV_ACIPHER) += acipher 7 | subdirs-$(CFG_CRYPTO_DRV_ACIPHER) += oid 8 | subdirs-$(CFG_CRYPTO_DRV_CIPHER) += cipher 9 | subdirs-$(CFG_CRYPTO_DRV_MAC) += mac 10 | subdirs-$(CFG_CRYPTO_DRV_AUTHENC) += authenc 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/ele/acipher/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ../include 2 | 3 | srcs-$(CFG_IMX_ELE_ECC_DRV) += ecc.c 4 | -------------------------------------------------------------------------------- /core/drivers/crypto/ele/include/ecc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2023 NXP 4 | * 5 | * Brief ELE ECC driver TEE Crypto integration. 6 | */ 7 | #ifndef __ECC_H__ 8 | #define __ECC_H__ 9 | 10 | #include 11 | 12 | #ifdef CFG_IMX_ELE_ECC_DRV 13 | /* 14 | * Initialize the ECC module 15 | */ 16 | TEE_Result imx_ele_ecc_init(void); 17 | #else 18 | static inline TEE_Result imx_ele_ecc_init(void) 19 | { 20 | return TEE_SUCCESS; 21 | } 22 | #endif /* CFG_IMX_ELE_ECC_DRV */ 23 | 24 | #endif /* __ECC_H__ */ 25 | -------------------------------------------------------------------------------- /core/drivers/crypto/ele/include/utils_trace.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2023 NXP 4 | */ 5 | #ifndef __UTILS_TRACE_H_ 6 | #define __UTILS_TRACE_H_ 7 | 8 | #include 9 | #include 10 | 11 | /* 12 | * Dump ELE request/response message 13 | * 14 | * @msg ELE MU message 15 | */ 16 | void ele_trace_print_msg(struct imx_mu_msg msg); 17 | 18 | #endif /* __UTILS_TRACE_H_ */ 19 | -------------------------------------------------------------------------------- /core/drivers/crypto/ele/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += include 2 | 3 | srcs-y += ele.c 4 | srcs-y += utils_mem.c 5 | srcs-y += key_store.c 6 | srcs-y += key_mgmt.c 7 | srcs-y += fuse.c 8 | srcs-y += utils_trace.c 9 | srcs-y += sign_verify.c 10 | subdirs-$(CFG_IMX_ELE_ACIPHER_DRV) += acipher 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/hisilicon/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += hisi_qm.c 2 | srcs-y += sec_main.c 3 | srcs-y += sec_hash.c 4 | srcs-y += sec_hmac.c 5 | srcs-y += sec_cipher.c 6 | srcs-y += sec_authenc.c 7 | srcs-$(CFG_HISILICON_ACC_V3) += hpre_main.c 8 | srcs-$(CFG_HISILICON_ACC_V3) += hpre_dh.c 9 | srcs-$(CFG_HISILICON_ACC_V3) += hpre_ecc.c 10 | srcs-$(CFG_HISILICON_ACC_V3) += hpre_montgomery.c 11 | -------------------------------------------------------------------------------- /core/drivers/crypto/se050/adaptors/sub.mk: -------------------------------------------------------------------------------- 1 | cflags-y += -Wno-strict-aliasing 2 | include ${CFG_NXP_SE05X_PLUG_AND_TRUST}/cflags.mk 3 | 4 | incdirs_ext-y += ${CFG_NXP_SE05X_PLUG_AND_TRUST}/optee_lib/include 5 | incdirs-y += ./include 6 | 7 | srcs-y += utils/scp_config.c 8 | srcs-y += utils/utils.c 9 | srcs-y += utils/info.c 10 | srcs-y += apis/apdu.c 11 | srcs-y += apis/user.c 12 | srcs-y += apis/sss.c 13 | -------------------------------------------------------------------------------- /core/drivers/crypto/se050/core/include/se050_cipher_algorithms.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) Foundries Ltd. 2020 - All Rights Reserved 4 | * Author: Jorge Ramirez 5 | */ 6 | 7 | #ifndef SE050_CIPHER_ALGORITHMS_H_ 8 | #define SE050_CIPHER_ALGORITHMS_H_ 9 | 10 | #include 11 | 12 | #if defined(CFG_NXP_SE05X_CTR_DRV) 13 | TEE_Result se050_aes_ctr_allocate(void **ctx); 14 | #else 15 | static inline TEE_Result se050_aes_ctr_allocate(void **ctx __unused) 16 | { 17 | return TEE_ERROR_NOT_IMPLEMENTED; 18 | } 19 | #endif 20 | 21 | #endif /* SE050_CIPHER_ALGORITHMS_H_ */ 22 | -------------------------------------------------------------------------------- /core/drivers/crypto/se050/core/sub.mk: -------------------------------------------------------------------------------- 1 | include ${CFG_NXP_SE05X_PLUG_AND_TRUST}/cflags.mk 2 | 3 | incdirs_ext-y += ${CFG_NXP_SE05X_PLUG_AND_TRUST}/optee_lib/include 4 | incdirs-y += ../adaptors/include 5 | incdirs-y += include 6 | 7 | srcs-y += storage.c 8 | srcs-$(CFG_NXP_SE05X_RSA_DRV) += rsa.c 9 | srcs-$(CFG_NXP_SE05X_ECC_DRV) += ecc.c 10 | srcs-$(CFG_NXP_SE05X_CTR_DRV) += ctr.c 11 | srcs-$(CFG_NXP_SE05X_DIEID_DRV) += die_id.c 12 | srcs-$(CFG_NXP_SE05X_RNG_DRV) += rng.c 13 | srcs-$(CFG_NXP_SE05X_CIPHER_DRV) += cipher.c 14 | srcs-$(CFG_NXP_SE05X_SCP03_DRV) += scp03.c 15 | srcs-$(CFG_NXP_SE05X_APDU_DRV) += apdu.c 16 | -------------------------------------------------------------------------------- /core/drivers/crypto/se050/glue/include/i2c_native.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) Foundries Ltd. 2022 - All Rights Reserved 4 | * Author: Jorge Ramirez 5 | */ 6 | 7 | #ifndef I2C_NATIVE_H_ 8 | #define I2C_NATIVE_H_ 9 | 10 | #include 11 | 12 | TEE_Result native_i2c_transfer(struct rpc_i2c_request *req, 13 | size_t *bytes); 14 | int native_i2c_init(void); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /core/drivers/crypto/se050/sub.mk: -------------------------------------------------------------------------------- 1 | include ${CFG_NXP_SE05X_PLUG_AND_TRUST}/cflags.mk 2 | 3 | incdirs_ext-y += ${CFG_NXP_SE05X_PLUG_AND_TRUST}/optee_lib/include 4 | incdirs-y += adaptors/include 5 | incdirs-y += glue/include 6 | 7 | subdirs-y += adaptors 8 | subdirs-y += core 9 | subdirs_ext-y += ${CFG_NXP_SE05X_PLUG_AND_TRUST} 10 | 11 | srcs-y += session.c 12 | srcs-$(CFG_IMX_I2C) += glue/i2c_imx.c 13 | srcs-$(CFG_STM32_I2C) += glue/i2c_stm32.c 14 | srcs-y += glue/i2c.c 15 | srcs-y += glue/user.c 16 | -------------------------------------------------------------------------------- /core/drivers/crypto/stm32/crypto.mk: -------------------------------------------------------------------------------- 1 | # CFG_STM32_CRYPTO_DRIVER, when enabled, embeds 2 | # STM32 HW cryptographic support and OP-TEE Crypto Driver. 3 | # CFG_STM32_CRYP, when enabled, embeds 4 | # STM32 CRYP module support, 5 | # CIPHER Crypto Driver, 6 | # AUTHENC Crypto Driver. 7 | 8 | ifeq ($(CFG_STM32_CRYPTO_DRIVER),y) 9 | 10 | $(call force,CFG_CRYPTO_DRIVER,y) 11 | CFG_CRYPTO_DRIVER_DEBUG ?= 0 12 | 13 | ifeq ($(call cfg-one-enabled, CFG_STM32_CRYP CFG_STM32_SAES),y) 14 | $(call force,CFG_CRYPTO_DRV_CIPHER,y,Mandated by CFG_STM32_CRYP) 15 | endif 16 | 17 | ifeq ($(CFG_STM32_CRYP),y) 18 | $(call force,CFG_CRYPTO_DRV_AUTHENC,y,Mandated by CFG_STM32_CRYP) 19 | endif 20 | 21 | endif # CFG_STM32_CRYPTO_DRIVER 22 | -------------------------------------------------------------------------------- /core/drivers/crypto/stm32/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_STM32_CRYP) += stm32_cryp.c 2 | srcs-$(CFG_STM32_SAES) += stm32_saes.c 3 | srcs-$(CFG_CRYPTO_DRV_CIPHER) += cipher.c 4 | srcs-$(CFG_CRYPTO_DRV_AUTHENC) += authenc.c 5 | -------------------------------------------------------------------------------- /core/drivers/crypto/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-$(CFG_CRYPTO_DRIVER) += crypto_api/include 2 | 3 | subdirs-$(CFG_CRYPTO_DRIVER) += crypto_api 4 | 5 | subdirs-$(CFG_NXP_CAAM) += caam 6 | 7 | subdirs-$(CFG_NXP_SE05X) += se050 8 | 9 | subdirs-$(CFG_STM32_CRYPTO_DRIVER) += stm32 10 | 11 | subdirs-$(CFG_ASPEED_CRYPTO_DRIVER) += aspeed 12 | 13 | subdirs-$(CFG_VERSAL_CRYPTO_DRIVER) += versal 14 | 15 | subdirs-$(CFG_HISILICON_CRYPTO_DRIVER) += hisilicon 16 | 17 | subdirs-$(CFG_IMX_ELE) += ele 18 | -------------------------------------------------------------------------------- /core/drivers/crypto/versal/crypto.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(CFG_VERSAL_CRYPTO_DRIVER),y) 2 | # Enable the crypto driver 3 | $(call force,CFG_CRYPTO_DRIVER,y) 4 | 5 | CFG_CRYPTO_DRIVER_DEBUG ?= 0 6 | $(call force,CFG_CRYPTO_DRV_ACIPHER,y) 7 | $(call force,CFG_CRYPTO_DRV_ECC,y) 8 | $(call force,CFG_CRYPTO_DRV_RSA,y) 9 | $(call force,CFG_CRYPTO_DRV_AUTHENC,y) 10 | 11 | endif 12 | -------------------------------------------------------------------------------- /core/drivers/crypto/versal/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += include 2 | 3 | srcs-y += ipi.c 4 | srcs-y += authenc.c 5 | srcs-y += ecc.c 6 | srcs-y += rsa.c 7 | -------------------------------------------------------------------------------- /core/drivers/firewall/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_STM32_IAC) += stm32_iac.c 2 | srcs-$(CFG_STM32_RIF) += stm32_rif.c 3 | srcs-$(CFG_STM32_RIFSC) += stm32_rifsc.c 4 | srcs-$(CFG_STM32_SERC) += stm32_serc.c 5 | srcs-$(CFG_STM32_RISAF) += stm32_risaf.c 6 | 7 | srcs-$(CFG_DRIVERS_FIREWALL) += firewall.c 8 | -------------------------------------------------------------------------------- /core/drivers/gpio/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += gpio.c 2 | -------------------------------------------------------------------------------- /core/drivers/i2c/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += i2c.c 2 | srcs-$(CFG_ATMEL_I2C) += atmel_i2c.c -------------------------------------------------------------------------------- /core/drivers/imx/dcp/include/local.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2020 NXP 4 | */ 5 | #ifndef __LOCAL_H__ 6 | #define __LOCAL_H__ 7 | 8 | #define DCP_CONTEXT_BUFFER_SIZE 208 9 | #define DCP_MAX_TIMEOUT 10 10 | #define DCP_SRAM_KEY_NB_SUBWORD 4 11 | #define DCP_CLK_ENABLE_MASK GENMASK_32(11, 10) 12 | 13 | #endif /* __LOCAL_H__ */ 14 | -------------------------------------------------------------------------------- /core/drivers/imx/dcp/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += dcp_huk.c 2 | srcs-y += dcp.c 3 | srcs-y += dcp_utils.c 4 | 5 | incdirs-y += include 6 | -------------------------------------------------------------------------------- /core/drivers/imx/mu/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += imx_mu.c 2 | srcs-$(call cfg-one-enabled,CFG_MX8ULP CFG_MX93 CFG_MX91 CFG_MX95) += imx_mu_8ulp.c 3 | ifeq ($(filter y, $(CFG_MX8QM) $(CFG_MX8QX) $(CFG_MX8DXL)),y) 4 | srcs-y += imx_mu_8q.c 5 | endif 6 | -------------------------------------------------------------------------------- /core/drivers/imx/sub.mk: -------------------------------------------------------------------------------- 1 | subdirs-$(CFG_IMX_DCP) += dcp 2 | subdirs-$(CFG_IMX_MU) += mu -------------------------------------------------------------------------------- /core/drivers/nvmem/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += nvmem.c 2 | srcs-$(CFG_ATMEL_SFC) += atmel_sfc.c 3 | srcs-$(CFG_NVMEM_DIE_ID) += nvmem_die_id.c 4 | srcs-$(CFG_NVMEM_HUK) += nvmem_huk.c 5 | -------------------------------------------------------------------------------- /core/drivers/pinctrl/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_DRIVERS_PINCTRL) += pinctrl.c 2 | srcs-$(CFG_ATMEL_PIO) += atmel_pio.c 3 | -------------------------------------------------------------------------------- /core/drivers/pm/imx/busfreq/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ./.. 2 | 3 | srcs-y += busfreq.c utils.S 4 | 5 | srcs-$(CFG_MX6) += busfreq_imx6.c busfreq_ddr3_imx6.S busfreq_lpddr2_imx6.S 6 | asm-defines-$(CFG_MX6) += busfreq_imx6_defines.c 7 | 8 | srcs-$(CFG_MX7) += busfreq_imx7.c busfreq_asm_imx7.S 9 | asm-defines-$(CFG_MX7) += busfreq_imx7_defines.c 10 | -------------------------------------------------------------------------------- /core/drivers/pm/imx/busfreq/utils.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* void cpu_mmu_disable_dcache(void) - disable data cache */ 8 | FUNC cpu_mmu_disable_dcache , : 9 | push {r12, lr} 10 | UNWIND( .save {r12, lr}) 11 | 12 | mov r0, #DCACHE_OP_CLEAN_INV 13 | bl dcache_op_all 14 | 15 | /* Disable Cache */ 16 | read_sctlr r0 17 | bic r0, r0, #SCTLR_C 18 | write_sctlr r0 19 | isb 20 | dsb 21 | 22 | mov r0, #DCACHE_OP_CLEAN_INV 23 | bl dcache_op_all 24 | 25 | pop {r12, pc} 26 | END_FUNC cpu_mmu_disable_dcache 27 | DECLARE_KEEP_PAGER cpu_mmu_disable_dcache 28 | -------------------------------------------------------------------------------- /core/drivers/pm/imx/cpuidle/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ./.. 2 | srcs-$(CFG_MX7) += cpuidle-imx7d.c psci-cpuidle-imx7.S 3 | srcs-$(CFG_MX6UL) += psci-cpuidle-imx6ul.S cpuidle-imx6ul.c 4 | srcs-$(CFG_MX6ULL) += psci-cpuidle-imx6ull.S cpuidle-imx6ul.c 5 | srcs-$(CFG_MX6SX) += psci-cpuidle-imx6sx.S cpuidle-imx6sx.c 6 | srcs-$(CFG_MX6SL) += psci-cpuidle-imx6sl.S cpuidle-imx6sl.c 7 | srcs-$(CFG_MX6SLL) += psci-cpuidle-imx6sll.S cpuidle-imx6sll.c 8 | -------------------------------------------------------------------------------- /core/drivers/pm/imx/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += . 2 | 3 | subdirs-$(CFG_BUSFREQ) += busfreq 4 | subdirs-y += cpuidle 5 | subdirs-y += suspend 6 | 7 | srcs-$(CFG_PSCI_ARM32) += psci.c imx_ocram.c 8 | srcs-$(CFG_MX7) += pm-imx7.c gpcv2.c 9 | srcs-$(CFG_MX6) += pm-imx6.c 10 | srcs-$(CFG_MX6)$(CFG_MX7) += src.c mmdc.c 11 | srcs-$(CFG_MX7ULP) += pm-imx7ulp.c 12 | srcs-$(CFG_MX8M)$(CFG_MX8ULP) += pm-imx8.c 13 | 14 | asm-defines-y += imx_pm_asm_defines.c 15 | -------------------------------------------------------------------------------- /core/drivers/pm/imx/suspend/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-y += ./.. 2 | 3 | srcs-$(CFG_MX7) += psci-suspend-imx7.S imx7_suspend.c 4 | srcs-$(CFG_MX6) += imx6_suspend.c psci-suspend-imx6.S 5 | srcs-$(CFG_MX7ULP) += psci-suspend-imx7ulp.S imx7ulp_suspend.c 6 | -------------------------------------------------------------------------------- /core/drivers/pm/sam/pm-defines.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2021, Microchip 4 | */ 5 | 6 | #include "at91_pm.h" 7 | #include 8 | #include 9 | #include 10 | 11 | DEFINES 12 | { 13 | DEFINE(PM_DATA_PMC, offsetof(struct at91_pm_data, pmc)); 14 | DEFINE(PM_DATA_RAMC0, offsetof(struct at91_pm_data, ramc)); 15 | DEFINE(PM_DATA_RAMC_PHY, offsetof(struct at91_pm_data, 16 | ramc_phy)); 17 | DEFINE(PM_DATA_MODE, offsetof(struct at91_pm_data, mode)); 18 | DEFINE(PM_DATA_SHDWC, offsetof(struct at91_pm_data, shdwc)); 19 | DEFINE(PM_DATA_SFRBU, offsetof(struct at91_pm_data, sfrbu)); 20 | } 21 | -------------------------------------------------------------------------------- /core/drivers/pm/sam/pm_resume.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2021, Microchip 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | FUNC at91_pm_cpu_resume, : 11 | UNWIND( .cantunwind) 12 | cps #CPSR_MODE_MON 13 | 14 | blx plat_cpu_reset_early 15 | 16 | b sm_pm_cpu_resume 17 | END_FUNC at91_pm_cpu_resume 18 | -------------------------------------------------------------------------------- /core/drivers/pm/sam/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += at91_pm.c pm_suspend.S pm_resume.S 2 | asm-defines-y += pm-defines.c -------------------------------------------------------------------------------- /core/drivers/pm/sub.mk: -------------------------------------------------------------------------------- 1 | subdirs-$(CFG_ATMEL_PM) += sam 2 | subdirs-$(CFG_IMX_PM) += imx -------------------------------------------------------------------------------- /core/drivers/regulator/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += regulator.c 2 | srcs-$(CFG_DT) += regulator_dt.c 3 | srcs-$(CFG_REGULATOR_FIXED) += regulator_fixed.c 4 | srcs-$(CFG_REGULATOR_GPIO) += regulator_gpio.c 5 | srcs-$(CFG_STM32_VREFBUF) += stm32_vrefbuf.c 6 | srcs-$(CFG_STM32MP13_REGULATOR_IOD) += stm32mp13_regulator_iod.c 7 | -------------------------------------------------------------------------------- /core/drivers/remoteproc/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_STM32MP_REMOTEPROC) += stm32_remoteproc.c 2 | -------------------------------------------------------------------------------- /core/drivers/rstctrl/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += rstctrl.c 2 | srcs-$(CFG_STM32_RSTCTRL) += stm32_rstctrl.c 3 | srcs-$(CFG_STM32MP1_RSTCTRL) += stm32mp1_rstctrl.c 4 | srcs-$(CFG_STM32MP25_RSTCTRL) += stm32mp25_rstctrl.c 5 | -------------------------------------------------------------------------------- /core/drivers/rtc/rtc.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2022 Microchip 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | struct rtc *rtc_device; 11 | 12 | void rtc_register(struct rtc *rtc) 13 | { 14 | /* One RTC is supported only */ 15 | assert(!rtc_device); 16 | 17 | /* RTC should *at least* allow to get the time */ 18 | assert(rtc && rtc->ops && rtc->ops->get_time); 19 | 20 | rtc_device = rtc; 21 | } 22 | -------------------------------------------------------------------------------- /core/drivers/rtc/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_DRIVERS_RTC) += rtc.c 2 | -------------------------------------------------------------------------------- /core/drivers/scmi-msg/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += base.c 2 | srcs-$(CFG_SCMI_MSG_CLOCK) += clock.c 3 | srcs-$(CFG_SCMI_MSG_USE_CLK) += clock_generic.c 4 | srcs-y += entry.c 5 | srcs-$(CFG_SCMI_MSG_RESET_DOMAIN) += reset_domain.c 6 | srcs-$(CFG_SCMI_MSG_SHM_MSG) += shm_msg.c 7 | srcs-$(CFG_SCMI_MSG_SMT) += smt.c 8 | srcs-$(CFG_SCMI_MSG_VOLTAGE_DOMAIN) += voltage_domain.c 9 | -------------------------------------------------------------------------------- /core/drivers/wdt/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_WDT) += watchdog.c 2 | srcs-$(CFG_WDT_SM_HANDLER) += watchdog_sm.c 3 | -------------------------------------------------------------------------------- /core/drivers/wdt/watchdog.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright 2022 Microchip 4 | */ 5 | 6 | #include 7 | 8 | struct wdt_chip *wdt_chip; 9 | 10 | TEE_Result watchdog_register(struct wdt_chip *chip) 11 | { 12 | if (!chip->ops->start || !chip->ops->ping || !chip->ops->set_timeout) 13 | return TEE_ERROR_BAD_PARAMETERS; 14 | 15 | wdt_chip = chip; 16 | 17 | return TEE_SUCCESS; 18 | } 19 | -------------------------------------------------------------------------------- /core/include/crypto/sm2-kdf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020-2021, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #ifndef __CRYPTO_SM2_KDF_H 7 | #define __CRYPTO_SM2_KDF_H 8 | 9 | #include 10 | #include 11 | 12 | TEE_Result sm2_kdf(const uint8_t *Z, size_t Z_len, uint8_t *t, size_t tlen); 13 | #endif /* __CRYPTO_SM2_KDF_H */ 14 | -------------------------------------------------------------------------------- /core/include/drivers/amlogic_uart.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | #ifndef __DRIVERS_AMLOGIC_UART_H 4 | #define __DRIVERS_AMLOGIC_UART_H 5 | 6 | #include 7 | #include 8 | 9 | struct amlogic_uart_data { 10 | struct io_pa_va base; 11 | struct serial_chip chip; 12 | }; 13 | 14 | void amlogic_uart_init(struct amlogic_uart_data *pd, paddr_t base); 15 | 16 | #endif /* __DRIVERS_AMLOGIC_UART_H */ 17 | -------------------------------------------------------------------------------- /core/include/drivers/atmel_rstc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2021, Microchip 4 | */ 5 | #ifndef __DRIVERS_ATMEL_RSTC_H 6 | #define __DRIVERS_ATMEL_RSTC_H 7 | 8 | #include 9 | #include 10 | 11 | #if defined(CFG_ATMEL_RSTC) 12 | bool atmel_rstc_available(void); 13 | 14 | void __noreturn atmel_rstc_reset(void); 15 | void sam_rstc_usb_por(unsigned char id, bool enable); 16 | #else 17 | static inline bool atmel_rstc_available(void) 18 | { 19 | return false; 20 | } 21 | 22 | static inline void atmel_rstc_reset(void) {} 23 | static inline void sam_rstc_usb_por(unsigned char id __unused, 24 | bool enable __unused) {} 25 | #endif 26 | 27 | #endif /* __DRIVERS_ATMEL_RSTC_H */ 28 | -------------------------------------------------------------------------------- /core/include/drivers/atmel_rtc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2022, Microchip 4 | */ 5 | 6 | #ifndef __DRIVERS_ATMEL_RTC_H 7 | #define __DRIVERS_ATMEL_RTC_H 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CFG_ATMEL_RTC 13 | TEE_Result atmel_rtc_get_tamper_timestamp(struct optee_rtc_time *tm); 14 | #else 15 | static inline 16 | TEE_Result atmel_rtc_get_tamper_timestamp(struct optee_rtc_time *tm __unused) 17 | { 18 | return TEE_ERROR_NOT_SUPPORTED; 19 | } 20 | #endif 21 | 22 | #endif /* __DRIVERS_ATMEL_RTC_H */ 23 | -------------------------------------------------------------------------------- /core/include/drivers/bcm_hwrng.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2019 Broadcom. 4 | */ 5 | 6 | #ifndef __DRIVERS_BCM_HWRNG_H 7 | #define __DRIVERS_BCM_HWRNG_H 8 | 9 | #include 10 | 11 | uint32_t bcm_hwrng_read_rng(uint32_t *p_out, uint32_t words_to_read); 12 | 13 | #endif /* __DRIVERS_BCM_HWRNG_H */ 14 | -------------------------------------------------------------------------------- /core/include/drivers/cbmem_console.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2023, Google Limited 4 | */ 5 | #ifndef __DRIVERS_CBMEM_CONSOLE_H 6 | #define __DRIVERS_CBMEM_CONSOLE_H 7 | 8 | #include 9 | 10 | bool cbmem_console_init_from_dt(void *fdt); 11 | 12 | #endif /* __DRIVERS_CBMEM_CONSOLE_H */ 13 | 14 | -------------------------------------------------------------------------------- /core/include/drivers/ffa_console.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2024, NVIDIA CORPORATION 4 | */ 5 | 6 | #ifndef FFA_CONSOLE_H 7 | #define FFA_CONSOLE_H 8 | 9 | #ifdef CFG_FFA_CONSOLE 10 | /* 11 | * Initialize console which uses FFA_CONSOLE_LOG of hafnium. 12 | */ 13 | void ffa_console_init(void); 14 | #else 15 | static inline void ffa_console_init(void) 16 | { 17 | } 18 | #endif 19 | 20 | #endif /* FFA_CONSOLE_H */ 21 | -------------------------------------------------------------------------------- /core/include/drivers/hfic.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | 6 | #ifndef __DRIVERS_HFIC_H 7 | #define __DRIVERS_HFIC_H 8 | 9 | void hfic_init(void); 10 | 11 | #endif /*__DRIVERS_HFIC_H*/ 12 | -------------------------------------------------------------------------------- /core/include/drivers/hi16xx_uart.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016, Linaro Limited 4 | */ 5 | 6 | /* 7 | * UART driver for Hisilicon Hi16xx and Phosphor V660 (hip05) SoCs 8 | */ 9 | 10 | #ifndef __DRIVERS_HI16XX_UART_H 11 | #define __DRIVERS_HI16XX_UART_H 12 | 13 | #include 14 | #include 15 | 16 | #define HI16XX_UART_REG_SIZE 0xF8 17 | 18 | struct hi16xx_uart_data { 19 | struct io_pa_va base; 20 | struct serial_chip chip; 21 | }; 22 | 23 | void hi16xx_uart_init(struct hi16xx_uart_data *pd, paddr_t base, 24 | uint32_t uart_clk, uint32_t baud_rate); 25 | 26 | #endif /* __DRIVERS_HI16XX_UART_H */ 27 | -------------------------------------------------------------------------------- /core/include/drivers/imx_i2c.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2020 Foundries.io 4 | * Jorge Ramirez-Ortiz 5 | */ 6 | #ifndef __DRIVERS_IMX_I2C_H 7 | #define __DRIVERS_IMX_I2C_H 8 | 9 | #include 10 | #include 11 | 12 | TEE_Result imx_i2c_write(uint8_t bid, uint8_t chip, const uint8_t *p, int l); 13 | TEE_Result imx_i2c_read(uint8_t bid, uint8_t chip, uint8_t *p, int l); 14 | TEE_Result imx_i2c_probe(uint8_t bid, uint8_t chip); 15 | TEE_Result imx_i2c_init(uint8_t bid, int bps); 16 | 17 | #endif /*__DRIVERS_IMX_I2C_H*/ 18 | -------------------------------------------------------------------------------- /core/include/drivers/imx_ocotp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2021 NXP 4 | */ 5 | 6 | #ifndef __DRIVERS_IMX_OCOTP_H 7 | #define __DRIVERS_IMX_OCOTP_H 8 | 9 | #include 10 | 11 | /* The i.MX UID is 64 bits long */ 12 | #define IMX_UID_SIZE sizeof(uint64_t) 13 | 14 | /* 15 | * Read OCOTP shadow register 16 | * 17 | * @bank Fuse bank number 18 | * @word Fuse word number 19 | * @[out]val Shadow register value 20 | */ 21 | TEE_Result imx_ocotp_read(unsigned int bank, unsigned int word, uint32_t *val); 22 | #endif /* __DRIVERS_IMX_OCOTP_H */ 23 | -------------------------------------------------------------------------------- /core/include/drivers/imx_scu.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2023 NXP 4 | */ 5 | #ifndef __DRIVERS_IMX_SCU_H 6 | #define __DRIVERS_IMX_SCU_H 7 | 8 | #include 9 | 10 | TEE_Result scu_init(void); 11 | 12 | #endif /* __DRIVERS_IMX_SCU_H */ 13 | -------------------------------------------------------------------------------- /core/include/drivers/pl011.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | #ifndef __DRIVERS_PL011_H 6 | #define __DRIVERS_PL011_H 7 | 8 | #include 9 | #include 10 | 11 | #define PL011_REG_SIZE 0x1000 12 | 13 | struct pl011_data { 14 | struct io_pa_va base; 15 | struct serial_chip chip; 16 | }; 17 | 18 | void pl011_init(struct pl011_data *pd, paddr_t pbase, uint32_t uart_clk, 19 | uint32_t baud_rate); 20 | 21 | #endif /* __DRIVERS_PL011_H */ 22 | -------------------------------------------------------------------------------- /core/include/drivers/plic.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022-2023 NXP 4 | */ 5 | 6 | #ifndef __DRIVERS_PLIC_H 7 | #define __DRIVERS_PLIC_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void plic_init(paddr_t plic_base_pa); 14 | void plic_hart_init(void); 15 | void plic_it_handle(void); 16 | void plic_dump_state(void); 17 | 18 | #endif /*__DRIVERS_PLIC_H*/ 19 | -------------------------------------------------------------------------------- /core/include/drivers/pm/imx/busfreq.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /** 3 | * @copyright 2018 NXP 4 | * 5 | * @file imx_busfreq.h 6 | * 7 | * @brief Busfreq interface. 8 | */ 9 | #ifndef __BUSFREQ_H__ 10 | #define __BUSFREQ_H__ 11 | 12 | #include 13 | 14 | TEE_Result busfreq_change(uint32_t freq, uint32_t dll_off); 15 | 16 | #endif /* __BUSFREQ_H__ */ 17 | -------------------------------------------------------------------------------- /core/include/drivers/serial8250_uart.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #ifndef __DRIVERS_SERIAL8250_UART_H 6 | #define __DRIVERS_SERIAL8250_UART_H 7 | 8 | #include 9 | #include 10 | 11 | #define SERIAL8250_UART_REG_SIZE 0x20 12 | 13 | struct serial8250_uart_data { 14 | struct io_pa_va base; 15 | struct serial_chip chip; 16 | }; 17 | 18 | void serial8250_uart_init(struct serial8250_uart_data *pd, paddr_t base, 19 | uint32_t uart_clk, uint32_t baud_rate); 20 | 21 | #endif /* __DRIVERS_SERIAL8250_UART_H */ 22 | 23 | -------------------------------------------------------------------------------- /core/include/drivers/stih_asc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2017, Linaro Limited 4 | */ 5 | #ifndef __DRIVERS_STIH_ASC_H 6 | #define __DRIVERS_STIH_ASC_H 7 | 8 | #include 9 | #include 10 | 11 | #define STIH_ASC_REG_SIZE 0x1000 12 | 13 | struct stih_asc_pd { 14 | struct io_pa_va base; 15 | struct serial_chip chip; 16 | }; 17 | 18 | void stih_asc_init(struct stih_asc_pd *pb, vaddr_t base); 19 | 20 | #endif /* __DRIVERS_STIH_ASC_H */ 21 | 22 | -------------------------------------------------------------------------------- /core/include/drivers/stm32_vrefbuf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2023, STMicroelectronics 4 | */ 5 | #ifndef DRIVERS_STM32_VREFBUF_H 6 | #define DRIVERS_STM32_VREFBUF_H 7 | 8 | #include 9 | 10 | #ifdef CFG_STM32_VREFBUF 11 | /* Return VREFBUF regulator handler if registered */ 12 | struct regulator *stm32_vrefbuf_regulator(void); 13 | #else 14 | static inline struct regulator *stm32_vrefbuf_regulator(void) 15 | { 16 | return NULL; 17 | } 18 | #endif 19 | 20 | #endif /*DRIVERS_STM32_VREFBUF_H*/ 21 | -------------------------------------------------------------------------------- /core/include/drivers/stm32mp13_regulator_iod.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2021-2023, STMicroelectronics 4 | */ 5 | 6 | #ifndef __DRIVERS_STM32MP13_REGULATOR_IOD_H 7 | #define __DRIVERS_STM32MP13_REGULATOR_IOD_H 8 | 9 | #include 10 | 11 | enum iod_regulator_id { 12 | IOD_SDMMC1, 13 | IOD_SDMMC2, 14 | IOD_REGU_COUNT 15 | }; 16 | 17 | #ifdef CFG_STM32MP13_REGULATOR_IOD 18 | struct regulator *stm32mp1_get_iod_regulator(enum iod_regulator_id index); 19 | #else 20 | static inline struct regulator * 21 | stm32mp1_get_iod_regulator(enum iod_regulator_id id __unused) { return NULL; } 22 | #endif /* CFG_STM32MP13_REGULATOR_IOD */ 23 | #endif /* __DRIVERS_STM32MP13_REGULATOR_IOD_H */ 24 | -------------------------------------------------------------------------------- /core/include/drivers/versal_pm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2022 Foundries.io Ltd 4 | */ 5 | 6 | #ifndef __DRIVERS_VERSAL_PM_H__ 7 | #define __DRIVERS_VERSAL_PM_H__ 8 | 9 | #include 10 | #include 11 | 12 | TEE_Result versal_soc_version(uint8_t *version); 13 | TEE_Result versal_write_fpga(paddr_t pa); 14 | 15 | #endif /*__DRIVERS_VERSAL_PM_H__*/ 16 | -------------------------------------------------------------------------------- /core/include/drivers/versal_sha3_384.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2022 Foundries.io Ltd 4 | */ 5 | 6 | #ifndef __DRIVERS_VERSAL_SHA3_384_H__ 7 | #define __DRIVERS_VERSAL_SHA3_384_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | TEE_Result versal_sha3_384(const uint8_t *src, size_t src_len, 15 | uint8_t *dst, size_t dst_len); 16 | 17 | #endif /*__DRIVERS_VERSAL_SHA3_384_H__*/ 18 | -------------------------------------------------------------------------------- /core/include/drivers/zynqmp_csu_puf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) Foundries Ltd. 2021 4 | * Author: Jorge Ramirez 5 | */ 6 | 7 | #ifndef __DRIVERS_ZYNQMP_CSU_PUF_H_ 8 | #define __DRIVERS_ZYNQMP_CSU_PUF_H_ 9 | 10 | #include 11 | 12 | TEE_Result zynqmp_csu_puf_regenerate(void); 13 | void zynqmp_csu_puf_reset(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /core/include/dt-bindings/gpio/stm32mp_gpio.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) */ 2 | /* 3 | * Copyright (C) STMicroelectronics 2023 - All Rights Reserved 4 | */ 5 | 6 | #ifndef _DT_BINDINGS_GPIO_STM32MP_GPIO_H 7 | #define _DT_BINDINGS_GPIO_STM32MP_GPIO_H 8 | 9 | #include 10 | 11 | /* Macro to define the security for GPIO */ 12 | #ifdef __ASSEMBLER__ 13 | #define TZPROT(id) (1 << (id)) 14 | #else 15 | #define TZPROT(id) (UINT32_C(1) << (id)) 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /core/include/dt-bindings/iio/adc/at91-sama5d2_adc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 2 | /* 3 | * Copyright (C) 2021 Microchip 4 | * 5 | * This header provides constants for configuring the AT91 SAMA5D2 ADC 6 | */ 7 | 8 | #ifndef _DT_BINDINGS_IIO_ADC_AT91_SAMA5D2_ADC_H 9 | #define _DT_BINDINGS_IIO_ADC_AT91_SAMA5D2_ADC_H 10 | 11 | /* X relative position channel index */ 12 | #define AT91_SAMA5D2_ADC_X_CHANNEL 24 13 | /* Y relative position channel index */ 14 | #define AT91_SAMA5D2_ADC_Y_CHANNEL 25 15 | /* pressure channel index */ 16 | #define AT91_SAMA5D2_ADC_P_CHANNEL 26 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /core/include/dt-bindings/interrupt-controller/arm-gic.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 | /* 3 | * This header provides constants for the ARM GIC. 4 | */ 5 | 6 | #ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H 7 | #define _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H 8 | 9 | #include 10 | 11 | /* interrupt specifier cell 0 */ 12 | 13 | #define GIC_SPI 0 14 | #define GIC_PPI 1 15 | 16 | /* 17 | * Interrupt specifier cell 2. 18 | * The flags in irq.h are valid, plus those below. 19 | */ 20 | #define GIC_CPU_MASK_RAW(x) ((x) << 8) 21 | #define GIC_CPU_MASK_SIMPLE(num) GIC_CPU_MASK_RAW((1 << (num)) - 1) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /core/include/dt-bindings/interrupt-controller/irq.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 | /* 3 | * This header provides constants for most IRQ bindings. 4 | * 5 | * Most IRQ bindings include a flags cell as part of the IRQ specifier. 6 | * In most cases, the format of the flags cell uses the standard values 7 | * defined in this header. 8 | */ 9 | 10 | #ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_IRQ_H 11 | #define _DT_BINDINGS_INTERRUPT_CONTROLLER_IRQ_H 12 | 13 | #define IRQ_TYPE_NONE 0 14 | #define IRQ_TYPE_EDGE_RISING 1 15 | #define IRQ_TYPE_EDGE_FALLING 2 16 | #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) 17 | #define IRQ_TYPE_LEVEL_HIGH 4 18 | #define IRQ_TYPE_LEVEL_LOW 8 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /core/include/dt-bindings/mfd/atmel-flexcom.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 2 | /* 3 | * This header provides macros for Atmel Flexcom DT bindings. 4 | * 5 | * Copyright (C) 2015 Cyrille Pitchen 6 | */ 7 | 8 | #ifndef __DT_BINDINGS_MFD_ATMEL_FLEXCOM_H__ 9 | #define __DT_BINDINGS_MFD_ATMEL_FLEXCOM_H__ 10 | 11 | #define ATMEL_FLEXCOM_MODE_USART 1 12 | #define ATMEL_FLEXCOM_MODE_SPI 2 13 | #define ATMEL_FLEXCOM_MODE_TWI 3 14 | 15 | #endif /* __DT_BINDINGS_MFD_ATMEL_FLEXCOM_H__ */ 16 | -------------------------------------------------------------------------------- /core/include/dt-bindings/rtc/rtc-stm32.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 2 | /* 3 | * Copyright (C) STMicroelectronics 2022-2023 - All Rights Reserved 4 | * This header provides constants for STM32_RTC bindings. 5 | */ 6 | 7 | #ifndef _DT_BINDINGS_RTC_STM32_H 8 | #define _DT_BINDINGS_RTC_STM32_H 9 | 10 | #define RTC_OUT1 0 11 | #define RTC_OUT2 1 12 | #define RTC_OUT2_RMP 2 13 | 14 | #endif /*_DT_BINDINGS_RTC_STM32_H*/ 15 | -------------------------------------------------------------------------------- /core/include/gen-asm-defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* Copyright (c) 2018, Linaro Limited */ 3 | 4 | #ifndef __GEN_ASM_DEFINES_H 5 | #define __GEN_ASM_DEFINES_H 6 | 7 | #define DEFINES void __defines(void); void __defines(void) 8 | 9 | #define DEFINE(def, val) \ 10 | asm volatile("\n.ascii \"==>" #def " %c0 " #val "\"" : : "i" (val)); 11 | 12 | #endif /*__GEN_ASM_DEFINES_H*/ 13 | -------------------------------------------------------------------------------- /core/include/kernel/chip_services.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #ifndef __KERNEL_CHIP_SERVICES_H 7 | #define __KERNEL_CHIP_SERVICES_H 8 | 9 | /* Die ID */ 10 | #define FVR_DIE_ID_NUM_REGS 3 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /core/include/kernel/early_ta.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2017, 2020, Linaro Limited 4 | * Copyright (c) 2020, Arm Limited. 5 | */ 6 | #ifndef __KERNEL_EARLY_TA_H 7 | #define __KERNEL_EARLY_TA_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define for_each_early_ta(_ta) \ 15 | SCATTERED_ARRAY_FOREACH(_ta, early_tas, struct embedded_ts) 16 | 17 | #endif /* __KERNEL_EARLY_TA_H */ 18 | 19 | -------------------------------------------------------------------------------- /core/include/kernel/misc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #ifndef __KERNEL_MISC_H 7 | #define __KERNEL_MISC_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | size_t __get_core_pos(void); 15 | 16 | static inline size_t __noprof get_core_pos(void) 17 | { 18 | /* 19 | * Foreign interrupts must be disabled before playing with current 20 | * core since we otherwise may be rescheduled to a different core. 21 | */ 22 | assert(thread_get_exceptions() & THREAD_EXCP_FOREIGN_INTR); 23 | return __get_core_pos(); 24 | } 25 | 26 | #endif /*__KERNEL_MISC_H*/ 27 | -------------------------------------------------------------------------------- /core/include/kernel/nv_counter.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2023, Linaro Limited 4 | */ 5 | 6 | #ifndef __KERNEL_NV_COUNTER_H 7 | #define __KERNEL_NV_COUNTER_H 8 | 9 | #include 10 | #include 11 | 12 | TEE_Result nv_counter_get_ree_fs(uint32_t *value); 13 | TEE_Result nv_counter_incr_ree_fs_to(uint32_t value); 14 | 15 | #endif /*__KERNEL_NV_COUNTER_H*/ 16 | -------------------------------------------------------------------------------- /core/include/kernel/tee_common_otp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __KERNEL_TEE_COMMON_OTP_H 6 | #define __KERNEL_TEE_COMMON_OTP_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | struct tee_hw_unique_key { 15 | uint8_t data[HW_UNIQUE_KEY_LENGTH]; 16 | }; 17 | 18 | TEE_Result tee_otp_get_hw_unique_key(struct tee_hw_unique_key *hwkey); 19 | int tee_otp_get_die_id(uint8_t *buffer, size_t len); 20 | TEE_Result tee_otp_get_ta_enc_key(uint32_t key_type, uint8_t *buffer, 21 | size_t len); 22 | 23 | #endif /* __KERNEL_TEE_COMMON_OTP_H */ 24 | -------------------------------------------------------------------------------- /core/include/kernel/trace_ta.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | #ifndef __KERNEL_TRACE_TA_H 6 | #define __KERNEL_TRACE_TA_H 7 | 8 | #include 9 | 10 | /* Macros to trace TA related events, logs, TA crash info etc */ 11 | #ifdef CFG_TEE_CORE_TA_TRACE 12 | #define TAMSG(...) EMSG(__VA_ARGS__) 13 | #define TAMSG_RAW(...) EMSG_RAW(__VA_ARGS__) 14 | #else 15 | #define TAMSG(...) 16 | #define TAMSG_RAW(...) 17 | #endif 18 | 19 | #endif /*__KERNEL_TRACE_TA_H*/ 20 | 21 | -------------------------------------------------------------------------------- /core/include/rng_support.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __RNG_SUPPORT_H__ 6 | #define __RNG_SUPPORT_H__ 7 | 8 | #include 9 | 10 | TEE_Result hw_get_random_bytes(void *buf, size_t blen); 11 | 12 | #endif /* __RNG_SUPPORT_H__ */ 13 | -------------------------------------------------------------------------------- /core/include/ta_pub_key.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #ifndef __TA_PUB_KEY_H 6 | #define __TA_PUB_KEY_H 7 | 8 | #include 9 | 10 | extern const uint32_t ta_pub_key_exponent; 11 | extern const uint8_t ta_pub_key_modulus[]; 12 | extern const size_t ta_pub_key_modulus_size; 13 | 14 | #endif /*__TA_PUB_KEY_H*/ 15 | 16 | -------------------------------------------------------------------------------- /core/include/tee/cache.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #ifndef __TEE_CACHE_H 6 | #define __TEE_CACHE_H 7 | 8 | #include 9 | 10 | TEE_Result cache_operation(enum utee_cache_operation op, void *va, size_t len); 11 | 12 | #endif /* __TEE_CACHE_H */ 13 | -------------------------------------------------------------------------------- /core/include/tee/svc_cache.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #ifndef __TEE_SVC_CACHE_H 6 | #define __TEE_SVC_CACHE_H 7 | 8 | #include 9 | #include 10 | 11 | #ifdef CFG_CACHE_API 12 | TEE_Result syscall_cache_operation(void *va, size_t len, unsigned long op); 13 | #else 14 | #define syscall_cache_operation syscall_not_supported 15 | #endif 16 | 17 | #endif /*__TEE_SVC_CACHE_H*/ 18 | -------------------------------------------------------------------------------- /core/include/tee/tee_cryp_concat_kdf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_TEE_CRYP_CONCAT_KDF_H 7 | #define __TEE_TEE_CRYP_CONCAT_KDF_H 8 | 9 | #include 10 | 11 | TEE_Result tee_cryp_concat_kdf(uint32_t hash_id, const uint8_t *shared_secret, 12 | size_t shared_secret_len, 13 | const uint8_t *other_info, 14 | size_t other_info_len, uint8_t *derived_key, 15 | size_t derived_key_len); 16 | 17 | #endif /* __TEE_TEE_CRYP_CONCAT_KDF_H */ 18 | -------------------------------------------------------------------------------- /core/include/tee/tee_cryp_hkdf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_TEE_CRYP_HKDF_H 7 | #define __TEE_TEE_CRYP_HKDF_H 8 | 9 | #include 10 | 11 | TEE_Result tee_cryp_hkdf(uint32_t hash_id, const uint8_t *ikm, size_t ikm_len, 12 | const uint8_t *salt, size_t salt_len, 13 | const uint8_t *info, size_t info_len, uint8_t *okm, 14 | size_t okm_len); 15 | 16 | #endif /* __TEE_TEE_CRYP_HKDF_H */ 17 | -------------------------------------------------------------------------------- /core/include/tee/tee_cryp_pbkdf2.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_TEE_CRYP_PBKDF2_H 7 | #define __TEE_TEE_CRYP_PBKDF2_H 8 | 9 | #include 10 | 11 | TEE_Result tee_cryp_pbkdf2(uint32_t hash_id, const uint8_t *password, 12 | size_t password_len, const uint8_t *salt, 13 | size_t salt_len, uint32_t iteration_count, 14 | uint8_t *derived_key, size_t derived_key_len); 15 | 16 | #endif /* __TEE_TEE_CRYP_PBKDF2_H */ 17 | -------------------------------------------------------------------------------- /core/include/tee/tee_supp_plugin_rpc.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020, Open Mobile Platform LLC 4 | */ 5 | 6 | #ifndef __TEE_TEE_SUPP_PLUGIN_RPC_H 7 | #define __TEE_TEE_SUPP_PLUGIN_RPC_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | TEE_Result tee_invoke_supp_plugin_rpc(const TEE_UUID *uuid, uint32_t cmd, 14 | uint32_t sub_cmd, void *buf_core, 15 | void *buf_user, size_t len, 16 | size_t *outlen); 17 | 18 | #endif /* __TEE_TEE_SUPP_PLUGIN_RPC_H */ 19 | -------------------------------------------------------------------------------- /core/include/tee/tee_ta_enc_manager.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_TEE_TA_ENC_MANAGER_H 7 | #define __TEE_TEE_TA_ENC_MANAGER_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #define TEE_TA_ENC_KEY_SIZE TEE_SHA256_HASH_SIZE 14 | 15 | TEE_Result tee_ta_decrypt_init(void **enc_ctx, struct shdr_encrypted_ta *ehdr, 16 | size_t len); 17 | TEE_Result tee_ta_decrypt_update(void *enc_ctx, uint8_t *dst, uint8_t *src, 18 | size_t len); 19 | TEE_Result tee_ta_decrypt_final(void *enc_ctx, struct shdr_encrypted_ta *ehdr, 20 | uint8_t *dst, uint8_t *src, size_t len); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /core/include/tee/uuid.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_UUID 7 | #define __TEE_UUID 8 | 9 | #include 10 | #include 11 | 12 | /** 13 | * tee_uuid_to_octets() - serialize a TEE_UUID into an octet string 14 | * @dst: pointer to octet string 15 | * @src: pointer TEE_UUID 16 | */ 17 | void tee_uuid_to_octets(uint8_t *dst, const TEE_UUID *src); 18 | 19 | /** 20 | * tee_uuid_from_octets() - de-serialize an octet string into a TEE_UUID 21 | * @dst: pointer TEE_UUID 22 | * @src: pointer to octet string 23 | */ 24 | void tee_uuid_from_octets(TEE_UUID *dst, const uint8_t *src); 25 | 26 | #endif /*__TEE_UUID*/ 27 | -------------------------------------------------------------------------------- /core/kernel/nv_counter.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2023, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | TEE_Result __weak nv_counter_get_ree_fs(uint32_t *value __unused) 10 | { 11 | return TEE_ERROR_NOT_IMPLEMENTED; 12 | } 13 | 14 | TEE_Result __weak nv_counter_incr_ree_fs_to(uint32_t value __unused) 15 | { 16 | return TEE_ERROR_NOT_IMPLEMENTED; 17 | } 18 | -------------------------------------------------------------------------------- /core/kernel/scattered_array.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | 6 | #include 7 | 8 | const void *scattered_array_relax_ptr(const void *p) 9 | { 10 | return p; 11 | } 12 | -------------------------------------------------------------------------------- /core/kernel/show_conf.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 1019 Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | extern const char conf_str[]; 10 | 11 | static TEE_Result show_conf(void) 12 | { 13 | #if (TRACE_LEVEL >= TRACE_INFO) 14 | IMSG("Contents of conf.mk (decode with 'base64 -d | xz -d'):"); 15 | trace_ext_puts(conf_str); 16 | #endif 17 | return TEE_SUCCESS; 18 | } 19 | service_init(show_conf); 20 | -------------------------------------------------------------------------------- /core/lib/libfdt/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | cflags-y += -Wno-cast-align 3 | cflags-y += -Wno-sign-compare 4 | cflags-y += -Wno-switch-default 5 | srcs-y += fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c 6 | srcs-y += fdt_empty_tree.c fdt_addresses.c fdt_overlay.c 7 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/des2_key.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014-2019, Linaro Limited 4 | */ 5 | 6 | static inline void get_des2_key(const uint8_t **key, size_t *key_len, 7 | uint8_t *tmp) 8 | { 9 | if (*key_len == 16) { 10 | /* 11 | * This corresponds to a 2DES key. The 2DES encryption 12 | * algorithm is similar to 3DES. Both perform and 13 | * encryption step, then a decryption step, followed 14 | * by another encryption step (EDE). However 2DES uses 15 | * the same key for both of the encryption (E) steps. 16 | */ 17 | memcpy(tmp, *key, 16); 18 | memcpy(tmp + 16, *key, 8); 19 | *key = tmp; 20 | *key_len = 24; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/include/tomcrypt_init.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | 6 | #ifndef __TOMCRYPT_INIT_H 7 | #define __TOMCRYPT_INIT_H 8 | 9 | void tomcrypt_init(void); 10 | 11 | #endif /*__TOMCRYPT_INIT_H*/ 12 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/include/tomcrypt_mp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #ifndef TOMCRYPT_MP_H_ 7 | #define TOMCRYPT_MP_H_ 8 | 9 | #if defined(_CFG_CORE_LTC_ACIPHER) 10 | void init_mp_tomcrypt(void); 11 | #else 12 | static inline void init_mp_tomcrypt(void) { } 13 | #endif 14 | 15 | #endif /* TOMCRYPT_MP_H_ */ 16 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_init.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | #ifdef LTC_CHACHA20POLY1305_MODE 7 | 8 | /** 9 | Initialize an ChaCha20Poly1305 context (only the key) 10 | @param st [out] The destination of the ChaCha20Poly1305 state 11 | @param key The secret key 12 | @param keylen The length of the secret key (octets) 13 | @return CRYPT_OK if successful 14 | */ 15 | int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen) 16 | { 17 | return chacha_setup(&st->chacha, key, keylen, 20); 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/encauth/ocb/ocb_ntz.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | /** 5 | @file ocb_ntz.c 6 | OCB implementation, internal function, by Tom St Denis 7 | */ 8 | 9 | #include "tomcrypt_private.h" 10 | 11 | #ifdef LTC_OCB_MODE 12 | 13 | /** 14 | Returns the number of leading zero bits [from lsb up] 15 | @param x The 32-bit value to observe 16 | @return The number of bits [from the lsb up] that are zero 17 | */ 18 | int ocb_ntz(unsigned long x) 19 | { 20 | int c; 21 | x &= 0xFFFFFFFFUL; 22 | c = 0; 23 | while ((x & 1) == 0) { 24 | ++c; 25 | x >>= 1; 26 | } 27 | return c; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/headers/tomcrypt_arm_neon.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #ifndef TOMCRYPT_ARM_NEON_H 6 | #define TOMCRYPT_ARM_NEON_H 7 | 8 | #include 9 | 10 | struct tomcrypt_arm_neon_state { 11 | ulong32 state; 12 | }; 13 | 14 | /* Temporarily enables neon instructions */ 15 | void tomcrypt_arm_neon_enable(struct tomcrypt_arm_neon_state *state); 16 | /* Disables neon instructions after a call to tomcrypt_arm_neon_enable() */ 17 | void tomcrypt_arm_neon_disable(struct tomcrypt_arm_neon_state *state); 18 | 19 | #endif /*TOMCRYPT_ARM_NEON_H*/ 20 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/mac/pmac/pmac_ntz.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file pmac_ntz.c 7 | PMAC implementation, internal function, by Tom St Denis 8 | */ 9 | 10 | #ifdef LTC_PMAC 11 | 12 | /** 13 | Internal PMAC function 14 | */ 15 | int pmac_ntz(unsigned long x) 16 | { 17 | int c; 18 | x &= 0xFFFFFFFFUL; 19 | c = 0; 20 | while ((x & 1) == 0) { 21 | ++c; 22 | x >>= 1; 23 | } 24 | return c; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/burn_stack.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file burn_stack.c 7 | Burn stack, Tom St Denis 8 | */ 9 | 10 | /** 11 | Burn some stack memory 12 | @param len amount of stack to burn in bytes 13 | */ 14 | void burn_stack(unsigned long len) 15 | { 16 | unsigned char buf[32]; 17 | zeromem(buf, sizeof(buf)); 18 | if (len > (unsigned long)sizeof(buf)) { 19 | burn_stack(len - sizeof(buf)); 20 | } 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_argchk.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file crypt_argchk.c 7 | Perform argument checking, Tom St Denis 8 | */ 9 | 10 | #if (ARGTYPE == 0) 11 | void crypt_argchk(const char *v, const char *s, int d) 12 | { 13 | fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", 14 | v, d, s); 15 | abort(); 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_cipher_descriptor.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file crypt_cipher_descriptor.c 7 | Stores the cipher descriptor table, Tom St Denis 8 | */ 9 | 10 | const struct ltc_cipher_descriptor *cipher_descriptor[TAB_SIZE]; 11 | 12 | LTC_MUTEX_GLOBAL(ltc_cipher_mutex) 13 | 14 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_hash_descriptor.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file crypt_hash_descriptor.c 7 | Stores the hash descriptor table, Tom St Denis 8 | */ 9 | 10 | const struct ltc_hash_descriptor *hash_descriptor[TAB_SIZE]; 11 | 12 | LTC_MUTEX_GLOBAL(ltc_hash_mutex) 13 | 14 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_ltc_mp_descriptor.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /* Initialize ltc_mp to nulls, to force allocation on all platforms, including macOS. */ 6 | ltc_math_descriptor ltc_mp = { 0 }; 7 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_prng_descriptor.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file crypt_prng_descriptor.c 7 | Stores the PRNG descriptors, Tom St Denis 8 | */ 9 | const struct ltc_prng_descriptor *prng_descriptor[TAB_SIZE]; 10 | 11 | LTC_MUTEX_GLOBAL(ltc_prng_mutex) 12 | 13 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/crypt/crypt_prng_rng_descriptor.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | #ifdef LTC_PRNG_ENABLE_LTC_RNG 6 | unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); 7 | #endif 8 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/misc/zeromem.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | #include 5 | 6 | /** 7 | @file zeromem.c 8 | Zero a block of memory, Tom St Denis 9 | */ 10 | 11 | /** 12 | Zero a block of memory 13 | @param out The destination of the area to zero 14 | @param outlen The length of the area to zero (octets) 15 | */ 16 | void zeromem(volatile void *out, size_t outlen) 17 | { 18 | LTC_ARGCHKVD(out != NULL); 19 | memzero_explicit((void *)out, outlen); 20 | } 21 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/modes/cbc/cbc_done.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file cbc_done.c 7 | CBC implementation, finish chain, Tom St Denis 8 | */ 9 | 10 | #ifdef LTC_CBC_MODE 11 | 12 | /** Terminate the chain 13 | @param cbc The CBC chain to terminate 14 | @return CRYPT_OK on success 15 | */ 16 | int cbc_done(symmetric_CBC *cbc) 17 | { 18 | int err; 19 | LTC_ARGCHK(cbc != NULL); 20 | 21 | if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { 22 | return err; 23 | } 24 | cipher_descriptor[cbc->cipher]->done(&cbc->key); 25 | return CRYPT_OK; 26 | } 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/modes/f8/f8_done.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file f8_done.c 7 | F8 implementation, finish chain, Tom St Denis 8 | */ 9 | 10 | #ifdef LTC_F8_MODE 11 | 12 | /** Terminate the chain 13 | @param f8 The F8 chain to terminate 14 | @return CRYPT_OK on success 15 | */ 16 | int f8_done(symmetric_F8 *f8) 17 | { 18 | int err; 19 | LTC_ARGCHK(f8 != NULL); 20 | 21 | if ((err = cipher_is_valid(f8->cipher)) != CRYPT_OK) { 22 | return err; 23 | } 24 | cipher_descriptor[f8->cipher]->done(&f8->key); 25 | return CRYPT_OK; 26 | } 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/modes/xts/xts_done.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects 7 | */ 8 | 9 | #ifdef LTC_XTS_MODE 10 | 11 | /** Terminate XTS state 12 | @param xts The state to terminate 13 | */ 14 | void xts_done(symmetric_xts *xts) 15 | { 16 | LTC_ARGCHKVD(xts != NULL); 17 | cipher_descriptor[xts->cipher]->done(&xts->key1); 18 | cipher_descriptor[xts->cipher]->done(&xts->key2); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/modes/xts/xts_mult_x.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects 7 | */ 8 | 9 | #ifdef LTC_XTS_MODE 10 | 11 | /** multiply by x 12 | @param I The value to multiply by x (LFSR shift) 13 | */ 14 | void xts_mult_x(unsigned char *I) 15 | { 16 | int x; 17 | unsigned char t, tt; 18 | 19 | for (x = t = 0; x < 16; x++) { 20 | tt = I[x] >> 7; 21 | I[x] = ((I[x] << 1) | t) & 0xFF; 22 | t = tt; 23 | } 24 | if (tt) { 25 | I[0] ^= 0x87; 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/asn1/der/boolean/der_length_boolean.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file der_length_boolean.c 7 | ASN.1 DER, get length of a BOOLEAN, Tom St Denis 8 | */ 9 | 10 | #ifdef LTC_DER 11 | /** 12 | Gets length of DER encoding of a BOOLEAN 13 | @param outlen [out] The length of the DER encoding 14 | @return CRYPT_OK if successful 15 | */ 16 | int der_length_boolean(unsigned long *outlen) 17 | { 18 | LTC_ARGCHK(outlen != NULL); 19 | *outlen = 3; 20 | return CRYPT_OK; 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/dh/dh_free.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | #ifdef LTC_MDH 7 | 8 | /** 9 | Free the allocated ram for a DH key 10 | @param key The key which you wish to free 11 | */ 12 | void dh_free(dh_key *key) 13 | { 14 | LTC_ARGCHKVD(key != NULL); 15 | mp_cleanup_multi(&key->prime, &key->base, &key->y, &key->x, LTC_NULL); 16 | } 17 | 18 | #endif /* LTC_MDH */ 19 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/dsa/dsa_free.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file dsa_free.c 7 | DSA implementation, free a DSA key, Tom St Denis 8 | */ 9 | 10 | #ifdef LTC_MDSA 11 | 12 | /** 13 | Free a DSA key 14 | @param key The key to free from memory 15 | */ 16 | void dsa_free(dsa_key *key) 17 | { 18 | LTC_ARGCHKVD(key != NULL); 19 | mp_cleanup_multi(&key->y, &key->x, &key->q, &key->g, &key->p, LTC_NULL); 20 | key->type = key->qord = 0; 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/ecc/ecc_get_oid_str.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | #ifdef LTC_MECC 7 | 8 | /** Extract OID as a string from ECC key 9 | @param out [out] destination buffer 10 | @param outlen [in/out] Length of destination buffer and final output size (without terminating NUL byte) 11 | @param key The ECC key 12 | Return CRYPT_OK on success 13 | */ 14 | 15 | int ecc_get_oid_str(char *out, unsigned long *outlen, const ecc_key *key) 16 | { 17 | LTC_ARGCHK(key != NULL); 18 | 19 | return pk_oid_num_to_str(key->dp.oid, key->dp.oidlen, out, outlen); 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/ecc/ecc_get_size.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | /** 7 | @file ecc_get_size.c 8 | ECC Crypto, Tom St Denis 9 | */ 10 | 11 | #ifdef LTC_MECC 12 | 13 | /** 14 | Get the size of an ECC key 15 | @param key The key to get the size of 16 | @return The size (octets) of the key or INT_MAX on error 17 | */ 18 | int ecc_get_size(const ecc_key *key) 19 | { 20 | if (key == NULL) { 21 | return INT_MAX; 22 | } 23 | return key->dp.size; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/pkcs1/pkcs_1_os2ip.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file pkcs_1_os2ip.c 7 | Octet to Integer OS2IP, Tom St Denis 8 | */ 9 | #ifdef LTC_PKCS_1 10 | 11 | /** 12 | Read a binary string into an mp_int 13 | @param n [out] The mp_int destination 14 | @param in The binary string to read 15 | @param inlen The length of the binary string 16 | @return CRYPT_OK if successful 17 | */ 18 | int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen) 19 | { 20 | return mp_read_unsigned_bin(n, in, inlen); 21 | } 22 | 23 | #endif /* LTC_PKCS_1 */ 24 | 25 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/pk/rsa/rsa_get_size.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | #include "tomcrypt_private.h" 4 | 5 | /** 6 | @file rsa_get_size.c 7 | Retrieve the size of an RSA key, Steffen Jaeckel. 8 | */ 9 | 10 | #ifdef LTC_MRSA 11 | 12 | /** 13 | Retrieve the size in bytes of an RSA key. 14 | @param key The RSA key 15 | @return The size in bytes of the RSA key or INT_MAX on error. 16 | */ 17 | int rsa_get_size(const rsa_key *key) 18 | { 19 | int ret = INT_MAX; 20 | LTC_ARGCHK(key != NULL); 21 | 22 | if (key) 23 | { 24 | ret = mp_unsigned_bin_size(key->N); 25 | } /* if */ 26 | 27 | return ret; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/stream/chacha/chacha_done.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | #ifdef LTC_CHACHA 7 | 8 | /** 9 | Terminate and clear ChaCha state 10 | @param st The ChaCha state 11 | @return CRYPT_OK on success 12 | */ 13 | int chacha_done(chacha_state *st) 14 | { 15 | LTC_ARGCHK(st != NULL); 16 | zeromem(st, sizeof(chacha_state)); 17 | return CRYPT_OK; 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /core/lib/libtomcrypt/src/stream/salsa20/salsa20_done.c: -------------------------------------------------------------------------------- 1 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 | /* SPDX-License-Identifier: Unlicense */ 3 | 4 | #include "tomcrypt_private.h" 5 | 6 | #ifdef LTC_SALSA20 7 | 8 | /** 9 | Terminate and clear Salsa20 state 10 | @param st The Salsa20 state 11 | @return CRYPT_OK on success 12 | */ 13 | int salsa20_done(salsa20_state *st) 14 | { 15 | LTC_ARGCHK(st != NULL); 16 | zeromem(st, sizeof(salsa20_state)); 17 | return CRYPT_OK; 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /core/lib/scmi-server/include/optee_scmi.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019-2022, Linaro Limited 4 | */ 5 | #ifndef OPTEE_SCMI_H 6 | #define OPTEE_SCMI_H 7 | 8 | #include 9 | #include 10 | 11 | /* 12 | * Return virtual address mapped for target SMT IOMEM address range 13 | * 14 | * @pa: Target address range base physical address 15 | * @sz: Target address range byte size 16 | * @shmem_is_secure: True if memory is secure, false otherwise 17 | * Return a virtual address or 0 is memory is not mapped 18 | */ 19 | uintptr_t smt_phys_to_virt(uintptr_t pa, size_t sz, bool shmem_is_secure); 20 | 21 | #endif /* OPTEE_SCMI_H */ 22 | -------------------------------------------------------------------------------- /core/lib/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: Zlib */ 2 | /* inffast.h -- header to use inffast.c 3 | * Copyright (C) 1995-2003, 2010 Mark Adler 4 | * For conditions of distribution and use, see copyright notice in zlib.h 5 | */ 6 | 7 | /* WARNING: this file should *not* be used by applications. It is 8 | part of the implementation of the compression library and is 9 | subject to change. Applications should only use zlib.h. 10 | */ 11 | 12 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 13 | -------------------------------------------------------------------------------- /core/lib/zlib/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += . 2 | srcs-y += adler32.c 3 | srcs-y += inffast.c 4 | srcs-y += inflate.c 5 | srcs-y += inftrees.c 6 | srcs-y += zutil.c 7 | cflags-remove-y += -Wold-style-definition 8 | cflags-remove-y += -Wswitch-default 9 | cflags-remove-y += -Wstrict-prototypes 10 | cflags-y += $(call cc-option,-Wno-deprecated-non-prototype) 11 | -------------------------------------------------------------------------------- /core/mm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += mobj.c 2 | srcs-y += fobj.c 3 | cflags-fobj.c-$(CFG_CORE_PAGE_TAG_AND_IV) := -Wno-missing-noreturn 4 | srcs-y += file.c 5 | srcs-y += vm.c 6 | srcs-y += core_mmu.c 7 | srcs-y += pgt_cache.c 8 | srcs-y += tee_mm.c 9 | srcs-y += phys_mem.c 10 | ifneq ($(CFG_CORE_FFA),y) 11 | srcs-$(CFG_CORE_DYN_SHM) += mobj_dyn_shm.c 12 | endif 13 | -------------------------------------------------------------------------------- /core/pta/bcm/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_BNXT_FW) += bnxt.c 2 | srcs-$(CFG_SP805_WDT) += wdt.c 3 | srcs-$(CFG_BCM_HWRNG) += hwrng.c 4 | srcs-$(CFG_BCM_SOTP) += sotp.c 5 | srcs-$(CFG_BCM_GPIO) += gpio.c 6 | srcs-$(CFG_BCM_ELOG_DUMP) += elog.c 7 | -------------------------------------------------------------------------------- /core/pta/imx/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_IMX_DIGPROG) += digprog.c 2 | srcs-$(call cfg-one-enabled,CFG_IMX_OCOTP CFG_IMX_ELE) += ocotp.c 3 | srcs-$(CFG_NXP_CAAM_MP_DRV) += manufacturing_protection.c 4 | srcs-$(CFG_NXP_CAAM_DEK_DRV) += dek_blob.c 5 | srcs-$(CFG_IMX_TRUSTED_ARM_CE) += trusted_arm_ce.c 6 | srcs-$(CFG_IMX_ELE_TEST_PTA) += ele_test.c 7 | -------------------------------------------------------------------------------- /core/pta/k3/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_K3_OTP_KEYWRITING) += otp.c 2 | -------------------------------------------------------------------------------- /core/pta/stm32mp/rproc_pub_key.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2023, STMicroelectronics - All Rights Reserved 4 | */ 5 | 6 | #ifndef PTA_STM32MP_RPROC_PUB_KEY_H 7 | #define PTA_STM32MP_RPROC_PUB_KEY_H 8 | 9 | #include 10 | 11 | extern const uint32_t rproc_pub_key_exponent; 12 | extern const uint8_t rproc_pub_key_modulus[]; 13 | extern const size_t rproc_pub_key_modulus_size; 14 | 15 | #endif /* PTA_STM32MP_RPROC_PUB_KEY_H */ 16 | 17 | -------------------------------------------------------------------------------- /core/pta/stm32mp/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(CFG_STM32_BSEC_PTA) += bsec_pta.c 2 | srcs-$(CFG_REMOTEPROC_PTA) += remoteproc_pta.c 3 | -------------------------------------------------------------------------------- /core/pta/tests/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-$(call cfg-all-enabled,CFG_REE_FS CFG_WITH_USER_TA) += fs_htree.c 2 | srcs-y += invoke.c 3 | srcs-$(CFG_LOCKDEP) += lockdep.c 4 | srcs-y += misc.c 5 | cflags-misc.c-y += -fno-builtin 6 | srcs-y += mutex.c 7 | srcs-y += aes_perf.c 8 | srcs-$(CFG_DT_DRIVER_EMBEDDED_TEST) += dt_driver_test.c 9 | -------------------------------------------------------------------------------- /core/tests/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += ftmn_boot_tests.c 2 | srcs-$(CFG_NOTIF_TEST_WD) += notif_test_wd.c 3 | -------------------------------------------------------------------------------- /keys/default_ta.pem: -------------------------------------------------------------------------------- 1 | default.pem -------------------------------------------------------------------------------- /ldelf/dl.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | 6 | #ifndef LDELF_DL_H 7 | #define LDELF_DL_H 8 | 9 | #include 10 | #include 11 | 12 | TEE_Result dlopen_entry(struct dl_entry_arg *arg); 13 | TEE_Result dlsym_entry(struct dl_entry_arg *arg); 14 | 15 | #endif /*LDELF_DL_H*/ 16 | 17 | -------------------------------------------------------------------------------- /ldelf/ftrace.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | 6 | #ifndef FTRACE_H 7 | #define FTRACE_H 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CFG_FTRACE_SUPPORT 13 | bool ftrace_init(struct ftrace_buf **fbuf_ptr); 14 | void ftrace_copy_buf(void *pctx, void (*copy_func)(void *pctx, void *b, 15 | size_t bl)); 16 | void ftrace_map_lr(uint64_t *lr); 17 | #else 18 | static inline void ftrace_map_lr(uint64_t *lr __unused) 19 | { 20 | } 21 | #endif 22 | 23 | #endif /*FTRACE_H*/ 24 | 25 | -------------------------------------------------------------------------------- /ldelf/pauth.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | #include "pauth.h" 9 | 10 | void pauth_strip_pac(uint64_t *lr) 11 | { 12 | const uint64_t va_mask = GENMASK_64(CFG_LPAE_ADDR_SPACE_BITS - 1, 0); 13 | 14 | *lr = *lr & va_mask; 15 | } 16 | -------------------------------------------------------------------------------- /ldelf/pauth.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2022, Linaro Limited 4 | */ 5 | 6 | #ifndef PAUTH_H 7 | #define PAUTH_H 8 | 9 | #include 10 | #include 11 | 12 | void pauth_strip_pac(uint64_t *lr); 13 | 14 | #endif /*PAUTH_H*/ 15 | 16 | -------------------------------------------------------------------------------- /ldelf/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | srcs-$(CFG_ARM32_$(sm)) += start_a32.S 3 | srcs-$(CFG_ARM64_$(sm)) += start_a64.S 4 | srcs-$(CFG_ARM32_$(sm)) += syscalls_a32.S 5 | srcs-$(CFG_ARM64_$(sm)) += syscalls_a64.S 6 | srcs-$(CFG_ARM64_$(sm)) += tlsdesc_rel_a64.S 7 | srcs-$(CFG_RV64_$(sm)) += start_rv64.S 8 | srcs-$(call cfg-one-enabled,CFG_RV32_$(sm) CFG_RV64_$(sm)) += syscalls_rv.S 9 | srcs-y += dl.c 10 | srcs-y += main.c 11 | srcs-y += sys.c 12 | srcs-y += ta_elf.c 13 | srcs-y += ta_elf_rel.c 14 | srcs-$(CFG_FTRACE_SUPPORT) += ftrace.c 15 | srcs-$(CFG_TA_PAUTH) += pauth.c 16 | -------------------------------------------------------------------------------- /ldelf/syscalls_a64.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | * Copyright (c) 2020, Arm Limited 5 | */ 6 | 7 | #include 8 | 9 | .section .text 10 | 11 | .macro LDELF_SYSCALL name, scn, num_args 12 | FUNC \name , : 13 | 14 | .if \num_args > 8 15 | .error "Too many arguments for syscall" 16 | .endif 17 | 18 | mov x8, #(\scn) 19 | svc #0 20 | ret 21 | END_FUNC \name 22 | .endm 23 | 24 | FUNC _ldelf_panic, : 25 | stp x29, x30, [sp, #-16]! 26 | mov x1, sp 27 | bl __ldelf_panic 28 | /* Not reached */ 29 | END_FUNC _ldelf_panic 30 | 31 | #include "syscalls_asm.S" 32 | 33 | BTI(emit_aarch64_feature_1_and GNU_PROPERTY_AARCH64_FEATURE_1_BTI) 34 | -------------------------------------------------------------------------------- /ldelf/syscalls_rv.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2023 ESWIN Corp. or its affiliates. 4 | * Authors: 5 | * Liu Shiwei 6 | */ 7 | 8 | #include 9 | 10 | .section .text 11 | 12 | .macro LDELF_SYSCALL name, scn, num_args 13 | FUNC \name , : 14 | 15 | .if \num_args > 8 16 | .error "Too many arguments for syscall" 17 | .endif 18 | 19 | li t0, \scn 20 | li t1, \num_args 21 | ecall 22 | ret 23 | END_FUNC \name 24 | .endm 25 | 26 | FUNC _ldelf_panic, : 27 | j __ldelf_panic 28 | /* Not reached */ 29 | END_FUNC _ldelf_panic 30 | 31 | #include "syscalls_asm.S" 32 | -------------------------------------------------------------------------------- /ldelf/tlsdesc_rel_a64.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co. Ltd. 4 | */ 5 | 6 | #include 7 | 8 | /* 9 | * long tlsdesc_resolve(struct tlsdesc *); 10 | * 11 | * Must preserve all registers except x0, x1 and the processor flags. 12 | * See https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-ARM.txt section 13 | * "Resolvers' Calling Convention". The document applies to 32-bit Arm but other 14 | * sources mention similar constraints for other architectures. 15 | */ 16 | FUNC tlsdesc_resolve , : 17 | ldr x0, [x0, #8] 18 | ret 19 | END_FUNC tlsdesc_resolve 20 | 21 | BTI(emit_aarch64_feature_1_and GNU_PROPERTY_AARCH64_FEATURE_1_BTI) 22 | -------------------------------------------------------------------------------- /lib/libdl/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | srcs-y += dlfcn.c 3 | -------------------------------------------------------------------------------- /lib/libmbedtls/core/sm2-dsa.h: -------------------------------------------------------------------------------- 1 | 2 | // SPDX-License-Identifier: BSD-2-Clause 3 | /* 4 | * Copyright (c) 2021 Huawei Technologies Co., Ltd 5 | */ 6 | 7 | #ifndef _SM2_DSA_H_ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | TEE_Result sm2_mbedtls_dsa_sign(uint32_t algo, struct ecc_keypair *key, 14 | const uint8_t *msg, size_t msg_len, 15 | uint8_t *sig, size_t *sig_len); 16 | 17 | TEE_Result sm2_mbedtls_dsa_verify(uint32_t algo, struct ecc_public_key *key, 18 | const uint8_t *msg, size_t msg_len, 19 | const uint8_t *sig, size_t sig_len); 20 | #endif /* _SM2_DSA_H_ */ 21 | -------------------------------------------------------------------------------- /lib/libmbedtls/core/sm2-pke.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2021 Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #ifndef _SM2_PKE_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | TEE_Result sm2_mbedtls_pke_encrypt(struct ecc_public_key *key, 13 | const uint8_t *src, size_t src_len, 14 | uint8_t *dst, size_t *dst_len); 15 | 16 | TEE_Result sm2_mbedtls_pke_decrypt(struct ecc_keypair *key, const uint8_t *src, 17 | size_t src_len, uint8_t *dst, 18 | size_t *dst_len); 19 | #endif /* _SM2_PKE_H_ */ 20 | -------------------------------------------------------------------------------- /lib/libmbedtls/core/tomcrypt.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (C) 2018, ARM Limited 4 | * Copyright (C) 2019, Linaro Limited 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | TEE_Result crypto_init(void) 11 | { 12 | tomcrypt_init(); 13 | 14 | return TEE_SUCCESS; 15 | } 16 | -------------------------------------------------------------------------------- /lib/libmbedtls/include/aes_alt.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* Copyright (c) 2020, Linaro Limited */ 3 | 4 | #ifndef __MBEDTLS_AES_ALT_H 5 | #define __MBEDTLS_AES_ALT_H 6 | 7 | typedef struct mbedtls_aes_context { 8 | uint32_t key[60]; 9 | unsigned int round_count; 10 | } mbedtls_aes_context; 11 | 12 | #endif /*__MBEDTLS_AES_ALT_H*/ 13 | -------------------------------------------------------------------------------- /lib/libmbedtls/mbedtls/include/mbedtls/mbedtls_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* Copyright (c) 2018, Linaro Limited */ 3 | #ifdef __KERNEL__ 4 | #include 5 | #else 6 | #include 7 | #endif 8 | -------------------------------------------------------------------------------- /lib/libmbedtls/mbedtls/include/mbedtls/private_access.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file private_access.h 3 | * 4 | * \brief Macro wrapper for struct's members. 5 | */ 6 | /* 7 | * Copyright The Mbed TLS Contributors 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 9 | */ 10 | 11 | #ifndef MBEDTLS_PRIVATE_ACCESS_H 12 | #define MBEDTLS_PRIVATE_ACCESS_H 13 | 14 | #ifndef MBEDTLS_ALLOW_PRIVATE_ACCESS 15 | #define MBEDTLS_PRIVATE(member) private_##member 16 | #else 17 | #define MBEDTLS_PRIVATE(member) member 18 | #endif 19 | 20 | #endif /* MBEDTLS_PRIVATE_ACCESS_H */ 21 | -------------------------------------------------------------------------------- /lib/libmbedtls/mbedtls/include/psa/build_info.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file psa/build_info.h 3 | * 4 | * \brief Build-time PSA configuration info 5 | * 6 | * Include this file if you need to depend on the 7 | * configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE 8 | * in PSA cryptography core specific files. 9 | */ 10 | /* 11 | * Copyright The Mbed TLS Contributors 12 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 13 | */ 14 | 15 | #ifndef PSA_CRYPTO_BUILD_INFO_H 16 | #define PSA_CRYPTO_BUILD_INFO_H 17 | 18 | #include "mbedtls/build_info.h" 19 | 20 | #endif /* PSA_CRYPTO_BUILD_INFO_H */ 21 | -------------------------------------------------------------------------------- /lib/libmbedtls/mbedtls/library/psa_crypto_client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSA crypto client code 3 | */ 4 | /* 5 | * Copyright The Mbed TLS Contributors 6 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 7 | */ 8 | 9 | #include "common.h" 10 | #include "psa/crypto.h" 11 | 12 | #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) 13 | 14 | #include 15 | #include "mbedtls/platform.h" 16 | 17 | void psa_reset_key_attributes(psa_key_attributes_t *attributes) 18 | { 19 | memset(attributes, 0, sizeof(*attributes)); 20 | } 21 | 22 | #endif /* MBEDTLS_PSA_CRYPTO_CLIENT */ 23 | -------------------------------------------------------------------------------- /lib/libmbedtls/mbedtls/library/ssl_client.h: -------------------------------------------------------------------------------- 1 | /** 2 | * TLS 1.2 and 1.3 client-side functions 3 | * 4 | * Copyright The Mbed TLS Contributors 5 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef MBEDTLS_SSL_CLIENT_H 9 | #define MBEDTLS_SSL_CLIENT_H 10 | 11 | #include "common.h" 12 | 13 | #if defined(MBEDTLS_SSL_TLS_C) 14 | #include "ssl_misc.h" 15 | #endif 16 | 17 | #include 18 | 19 | MBEDTLS_CHECK_RETURN_CRITICAL 20 | int mbedtls_ssl_write_client_hello(mbedtls_ssl_context *ssl); 21 | 22 | #endif /* MBEDTLS_SSL_CLIENT_H */ 23 | -------------------------------------------------------------------------------- /lib/libunw/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | ifeq ($(CFG_UNWIND),y) 3 | ifeq (arm,$(ARCH)) 4 | srcs-y += unwind_arm32.c 5 | endif 6 | srcs-$(CFG_ARM64_$(sm)) += unwind_arm64.c 7 | ifeq (riscv,$(ARCH)) 8 | srcs-y += unwind_riscv.c 9 | endif 10 | endif 11 | -------------------------------------------------------------------------------- /lib/libutee/abort.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | void abort(void) 12 | { 13 | printf("Abort!\n"); 14 | _utee_panic(0); 15 | /* Not reached */ 16 | while (1) 17 | ; 18 | } 19 | -------------------------------------------------------------------------------- /lib/libutee/arch/arm/arm32_user_sysreg.txt: -------------------------------------------------------------------------------- 1 | # Format of file 2 | # 3 | # lines beginning with '@' will be printed as additional comments 4 | 5 | @ Based on register description in 6 | @ ARM Architecture Reference Manual 7 | @ ARMv7-A and ARMv7-R edition 8 | @ Issue C.c 9 | @ 10 | 11 | @ B8.2 Generic Timer registers summary 12 | CNTFRQ c14 0 c0 0 RW Counter Frequency register 13 | CNTPCT - 0 c14 - RO Physical Count register 14 | CNTVCT - 1 c14 - RO Virtual Count register 15 | -------------------------------------------------------------------------------- /lib/libutee/arch/arm/gprof/gprof_pta.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016, Linaro Limited 4 | */ 5 | 6 | #ifndef __GPROF_PTA_H 7 | #define __GPROF_PTA_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | TEE_Result __pta_gprof_send(void *buf, size_t len, uint32_t *id); 15 | TEE_Result __pta_gprof_pc_sampling_start(void *buf, size_t len, size_t offset, 16 | size_t scale); 17 | TEE_Result __pta_gprof_pc_sampling_stop(uint32_t *rate); 18 | void __pta_gprof_fini(void); 19 | #endif /* __GPROF_PTA_H */ 20 | -------------------------------------------------------------------------------- /lib/libutee/arch/arm/gprof/sub.mk: -------------------------------------------------------------------------------- 1 | cppflags-y += -I$(sub-dir)/../../.. 2 | 3 | srcs-$(CFG_TA_GPROF_SUPPORT) += gprof.c 4 | srcs-$(CFG_TA_GPROF_SUPPORT) += gprof_pta.c 5 | cflags-remove-gprof.c-y += -Wcast-align 6 | -------------------------------------------------------------------------------- /lib/libutee/arch/arm/sub.mk: -------------------------------------------------------------------------------- 1 | cppflags-y += -I$(sub-dir)/../.. 2 | 3 | srcs-$(CFG_ARM32_$(sm)) += utee_syscalls_a32.S 4 | srcs-$(CFG_ARM64_$(sm)) += utee_syscalls_a64.S 5 | 6 | ifneq ($(sm),ldelf) 7 | subdirs-y += gprof 8 | endif #$(sm-$(sm)-is-ld) 9 | 10 | -------------------------------------------------------------------------------- /lib/libutee/arch/riscv/sub.mk: -------------------------------------------------------------------------------- 1 | cppflags-y += -I$(sub-dir)/../.. 2 | 3 | srcs-y += utee_syscalls_rv.S 4 | -------------------------------------------------------------------------------- /lib/libutee/include/__tee_ipsocket.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef ____TEE_IPSOCKET_H 7 | #define ____TEE_IPSOCKET_H 8 | 9 | typedef enum TEE_ipSocket_ipVersion_e { 10 | TEE_IP_VERSION_DC = 0, /* don’t care */ 11 | TEE_IP_VERSION_4 = 1, 12 | TEE_IP_VERSION_6 = 2 13 | } TEE_ipSocket_ipVersion; 14 | 15 | #endif /*____TEE_IPSOCKET_H*/ 16 | -------------------------------------------------------------------------------- /lib/libutee/include/__tee_isocket_defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | #ifndef ____TEE_ISOCKET_DEFINES_H 6 | #define ____TEE_ISOCKET_DEFINES_H 7 | 8 | #define TEE_ISOCKET_VERSION 0x01000000 9 | 10 | #define TEE_ISOCKET_ERROR_PROTOCOL 0xF1007001 11 | #define TEE_ISOCKET_ERROR_REMOTE_CLOSED 0xF1007002 12 | #define TEE_ISOCKET_ERROR_TIMEOUT 0xF1007003 13 | #define TEE_ISOCKET_ERROR_OUT_OF_RESOURCES 0xF1007004 14 | #define TEE_ISOCKET_ERROR_LARGE_BUFFER 0xF1007005 15 | #define TEE_ISOCKET_WARNING_PROTOCOL 0xF1007006 16 | #define TEE_ISOCKET_ERROR_HOSTNAME 0xF1007007 17 | 18 | #endif /*____TEE_ISOCKET_DEFINES_H*/ 19 | -------------------------------------------------------------------------------- /lib/libutee/include/__tee_tcpsocket_defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef ____TEE_TCPSOCKET_DEFINES_H 7 | #define ____TEE_TCPSOCKET_DEFINES_H 8 | 9 | /* Protocol identifier */ 10 | #define TEE_ISOCKET_PROTOCOLID_TCP 0x65 11 | 12 | /* Instance specific errors */ 13 | #define TEE_ISOCKET_TCP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1010002 14 | 15 | #endif /*____TEE_TCPSOCKET_DEFINES_H*/ 16 | -------------------------------------------------------------------------------- /lib/libutee/include/__tee_tcpsocket_defines_extensions.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H 7 | #define ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H 8 | 9 | /* Instance and implementation specific ioctl functions */ 10 | #define TEE_TCP_SET_RECVBUF 0x65f00000 11 | #define TEE_TCP_SET_SENDBUF 0x65f00001 12 | 13 | #endif /*____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H*/ 14 | -------------------------------------------------------------------------------- /lib/libutee/include/__tee_udpsocket_defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef ____TEE_UDPSOCKET_DEFINES_H 7 | #define ____TEE_UDPSOCKET_DEFINES_H 8 | 9 | /* Protocol identifier */ 10 | #define TEE_ISOCKET_PROTOCOLID_UDP 0x66 11 | 12 | /* Instance specific errors */ 13 | #define TEE_ISOCKET_UDP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1020002 14 | 15 | /* Instance specific ioctl functions */ 16 | #define TEE_UDP_CHANGEADDR 0x66000001 17 | #define TEE_UDP_CHANGEPORT 0x66000002 18 | 19 | #endif /*____TEE_UDPSOCKET_DEFINES_H*/ 20 | -------------------------------------------------------------------------------- /lib/libutee/include/arm_user_sysreg.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | #ifndef ARM_USER_SYSREG_H 6 | #define ARM_USER_SYSREG_H 7 | 8 | #include 9 | 10 | #ifdef ARM32 11 | #include 12 | #endif 13 | 14 | #ifdef ARM64 15 | #include 16 | #endif 17 | 18 | #ifndef __ASSEMBLER__ 19 | static inline __noprof void isb(void) 20 | { 21 | asm volatile ("isb"); 22 | } 23 | 24 | static inline __noprof uint64_t barrier_read_counter_timer(void) 25 | { 26 | isb(); 27 | #ifdef CFG_CORE_SEL2_SPMC 28 | return read_cntvct(); 29 | #else 30 | return read_cntpct(); 31 | #endif 32 | } 33 | #endif 34 | 35 | #endif /*ARM_USER_SYSREG_H*/ 36 | -------------------------------------------------------------------------------- /lib/libutee/include/pta_i2c_rtc_test.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2021 NXP 4 | * 5 | * brief PTA I2C RTC Test interface identification. 6 | */ 7 | #ifndef __PTA_I2C_RTC_TEST_H__ 8 | #define __PTA_I2C_RTC_TEST_H__ 9 | 10 | /* PTA UUID generated at http://www.itu.int/ITU-T/asn1/uuid.html */ 11 | #define PTA_LS_I2C_RTC_TEST_SUITE_UUID \ 12 | { \ 13 | 0x4daa5ac7, 0xe9d2, 0x498f, \ 14 | { \ 15 | 0xa2, 0x4a, 0x4b, 0x2e, 0xab, 0x7b, 0x4b, 0x01 \ 16 | } \ 17 | } 18 | 19 | /* 20 | * Commands Definition 21 | */ 22 | /* Get RTC time connected to I2C */ 23 | #define PTA_CMD_I2C_RTC_RUN_TEST_SUITE 0 24 | 25 | #endif /* __PTA_I2C_RTC_TEST_H__ */ 26 | -------------------------------------------------------------------------------- /lib/libutee/include/pta_imx_dek_blob.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2019 NXP 4 | * 5 | * brief PTA DEK Blob interface identification. 6 | */ 7 | #ifndef __PTA_IMX_DEK_BLOB_H__ 8 | #define __PTA_IMX_DEK_BLOB_H__ 9 | 10 | #define PTA_DEK_BLOB_UUID {0xef477737, 0x0db1, 0x4a9d, \ 11 | {0x84, 0x37, 0xf2, 0xf5, 0x35, 0xc0, 0xbd, 0x92} } 12 | 13 | /* HAB DEK Blob encapsulation */ 14 | #define PTA_IMX_DEK_BLOB_CMD_GENERATE 0 15 | 16 | #endif /* __PTA_IMX_DEK_BLOB_H__ */ 17 | -------------------------------------------------------------------------------- /lib/libutee/include/pta_imx_digprog.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2021 NXP 4 | */ 5 | #ifndef __PTA_IMX_DIGPROG_H__ 6 | #define __PTA_IMX_DIGPROG_H__ 7 | 8 | #define PTA_DIGPROG_UUID { 0xbfdbe409, 0x3302, 0x4abf, \ 9 | { 0x99, 0xbc, 0x5f, 0x62, 0x32, 0x26, 0xa7, 0x39 } } 10 | 11 | #endif /* __PTA_IMX_DIGPROG_H__ */ 12 | -------------------------------------------------------------------------------- /lib/libutee/include/pta_secstor_ta_mgmt.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2017, Linaro Limited 4 | */ 5 | 6 | #ifndef __PTA_SECSTOR_TA_MGMT_H 7 | #define __PTA_SECSTOR_TA_MGMT_H 8 | 9 | /* 10 | * Bootstrap (install initial) Trusted Application or Secure Domain into 11 | * secure storage from a signed binary. 12 | * 13 | * [in] memref[0]: signed binary 14 | */ 15 | #define PTA_SECSTOR_TA_MGMT_BOOTSTRAP 0 16 | 17 | #define PTA_SECSTOR_TA_MGMT_UUID { 0x6e256cba, 0xfc4d, 0x4941, { \ 18 | 0xad, 0x09, 0x2c, 0xa1, 0x86, 0x03, 0x42, \ 19 | 0xdd } } 20 | 21 | #endif /*__PTA_SECSTOR_TA_MGMT_H*/ 22 | -------------------------------------------------------------------------------- /lib/libutee/include/rng_pta_client.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2018-2022, Linaro Limited 4 | * 5 | * This header file is deprecated and kept for backward compatibility. 6 | */ 7 | 8 | #ifndef __RNG_PTA_CLIENT_H 9 | #define __RNG_PTA_CLIENT_H 10 | 11 | #include 12 | 13 | #endif /* __RNG_PTA_CLIENT_H */ 14 | -------------------------------------------------------------------------------- /lib/libutee/include/tee_api.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #ifndef TEE_API_H 7 | #define TEE_API_H 8 | 9 | #include 10 | 11 | #endif /* TEE_API_H */ 12 | -------------------------------------------------------------------------------- /lib/libutee/include/tee_ta_api.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | /* Based on GP TEE Internal API Specification Version 0.22 */ 7 | #ifndef TEE_TA_API_H 8 | #define TEE_TA_API_H 9 | 10 | #include 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /lib/libutee/include/tee_tcpsocket.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_TCPSOCKET_H 7 | #define __TEE_TCPSOCKET_H 8 | 9 | #include 10 | #include <__tee_ipsocket.h> 11 | #include <__tee_tcpsocket_defines.h> 12 | 13 | typedef struct TEE_tcpSocket_Setup_s { 14 | TEE_ipSocket_ipVersion ipVersion; 15 | char *server_addr; 16 | uint16_t server_port; 17 | } TEE_tcpSocket_Setup; 18 | 19 | extern TEE_iSocket *const TEE_tcpSocket; 20 | 21 | #endif /*__TEE_TCPSOCKET_H*/ 22 | -------------------------------------------------------------------------------- /lib/libutee/include/tee_udpsocket.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2016-2017, Linaro Limited 4 | */ 5 | 6 | #ifndef __TEE_UDPSOCKET_H 7 | #define __TEE_UDPSOCKET_H 8 | 9 | #include 10 | #include <__tee_ipsocket.h> 11 | #include <__tee_udpsocket_defines.h> 12 | 13 | typedef struct TEE_udpSocket_Setup_s { 14 | TEE_ipSocket_ipVersion ipVersion; 15 | char *server_addr; 16 | uint16_t server_port; 17 | } TEE_udpSocket_Setup; 18 | 19 | extern TEE_iSocket *const TEE_udpSocket; 20 | 21 | #endif /*__TEE_UDPSOCKET_H*/ 22 | -------------------------------------------------------------------------------- /lib/libutee/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | 3 | srcs-y += abort.c 4 | srcs-y += assert.c 5 | srcs-y += tee_uuid_from_str.c 6 | srcs-y += trace_ext.c 7 | 8 | ifneq ($(sm),ldelf) 9 | srcs-y += tee_api.c 10 | srcs-y += tee_api_arith_mpi.c 11 | cppflags-tee_api_arith_mpi.c-y += -DMBEDTLS_ALLOW_PRIVATE_ACCESS 12 | srcs-y += tee_api_objects.c 13 | srcs-y += tee_api_operations.c 14 | srcs-y += tee_api_panic.c 15 | srcs-y += tee_api_property.c 16 | srcs-y += tee_socket_pta.c 17 | srcs-y += tee_system_pta.c 18 | srcs-y += tee_tcpudp_socket.c 19 | srcs-y += tcb.c 20 | srcs-y += user_ta_entry.c 21 | srcs-y += user_ta_entry_compat.c 22 | endif #ifneq ($(sm),ldelf) 23 | 24 | subdirs-y += arch/$(ARCH) 25 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/arm/aeabi_unwind.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2017, Linaro Limited 4 | */ 5 | 6 | void __aeabi_unwind_cpp_pr0(void); 7 | void __aeabi_unwind_cpp_pr0(void) 8 | { 9 | } 10 | 11 | void __aeabi_unwind_cpp_pr1(void); 12 | void __aeabi_unwind_cpp_pr1(void) 13 | { 14 | } 15 | 16 | void __aeabi_unwind_cpp_pr2(void); 17 | void __aeabi_unwind_cpp_pr2(void) 18 | { 19 | } 20 | 21 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/arm/atomic_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015-2016, Linaro Limited 4 | */ 5 | 6 | #include 7 | 8 | .section .note.GNU-stack,"",%progbits 9 | 10 | /* uint32_t atomic_inc32(uint32_t *v); */ 11 | FUNC atomic_inc32 , : 12 | ldrex r1, [r0] 13 | add r1, r1, #1 14 | strex r2, r1, [r0] 15 | cmp r2, #0 16 | bne atomic_inc32 17 | mov r0, r1 18 | bx lr 19 | END_FUNC atomic_inc32 20 | 21 | /* uint32_t atomic_dec32(uint32_t *v); */ 22 | FUNC atomic_dec32 , : 23 | ldrex r1, [r0] 24 | sub r1, r1, #1 25 | strex r2, r1, [r0] 26 | cmp r2, #0 27 | bne atomic_dec32 28 | mov r0, r1 29 | bx lr 30 | END_FUNC atomic_dec32 31 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/arm/atomic_a64.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2015-2016, Linaro Limited 4 | */ 5 | 6 | #include 7 | 8 | 9 | /* uint32_t atomic_inc32(uint32_t *v); */ 10 | FUNC atomic_inc32 , : 11 | ldaxr w1, [x0] 12 | add w1, w1, #1 13 | stxr w2, w1, [x0] 14 | cmp w2, #0 15 | bne atomic_inc32 16 | mov w0, w1 17 | ret 18 | END_FUNC atomic_inc32 19 | 20 | /* uint32_t atomic_dec32(uint32_t *v); */ 21 | FUNC atomic_dec32 , : 22 | ldaxr w1, [x0] 23 | sub w1, w1, #1 24 | stxr w2, w1, [x0] 25 | cmp w2, #0 26 | bne atomic_dec32 27 | mov w0, w1 28 | ret 29 | END_FUNC atomic_dec32 30 | 31 | BTI(emit_aarch64_feature_1_and GNU_PROPERTY_AARCH64_FEATURE_1_BTI) 32 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/arm/auxval.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, EPAM Systems 4 | */ 5 | 6 | #include 7 | 8 | unsigned long int __getauxval (unsigned long int type); 9 | unsigned long int __getauxval (unsigned long int type __unused) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/arm/sub.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(CFG_UNWIND),y) 2 | srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c 3 | endif 4 | srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S 5 | srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S 6 | srcs-y += auxval.c 7 | ifneq ($(sm),ldelf) # TA, core 8 | srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S 9 | srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S 10 | endif 11 | srcs-$(CFG_MEMTAG) += memtag.c 12 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/riscv/atomic_rv.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright 2022-2023 NXP 4 | */ 5 | 6 | #include 7 | 8 | /* uint32_t atomic_inc32(uint32_t *v); */ 9 | FUNC atomic_inc32 , : 10 | li a1, 1 11 | amoadd.w.aqrl a2, a1, (a0) 12 | add a0, a1, a2 13 | ret 14 | END_FUNC atomic_inc32 15 | 16 | /* uint32_t atomic_dec32(uint32_t *v); */ 17 | FUNC atomic_dec32 , : 18 | li a1, -1 19 | amoadd.w.aqrl a2, a1, (a0) 20 | add a0, a1, a2 21 | ret 22 | END_FUNC atomic_dec32 23 | -------------------------------------------------------------------------------- /lib/libutils/ext/arch/riscv/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y+= atomic_rv.S 2 | ifneq ($(sm),ldelf) # TA, core 3 | srcs-y += mcount_rv.S 4 | endif 5 | -------------------------------------------------------------------------------- /lib/libutils/ext/ftrace/ftrace.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (C) 2019, Linaro Limited 4 | */ 5 | 6 | #ifndef FTRACE_H 7 | #define FTRACE_H 8 | 9 | void ftrace_enter(unsigned long pc, unsigned long *lr); 10 | 11 | #endif /* FTRACE_H */ 12 | -------------------------------------------------------------------------------- /lib/libutils/ext/ftrace/sub.mk: -------------------------------------------------------------------------------- 1 | cppflags-y += -I$(sub-dir)/../../.. 2 | 3 | ifneq ($(sm),ldelf) # TA, core 4 | srcs-$(CFG_FTRACE_SUPPORT) += ftrace.c 5 | endif 6 | -------------------------------------------------------------------------------- /lib/libutils/ext/include/base64.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef BASE64_H 6 | #define BASE64_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | bool base64_enc(const void *data, size_t size, char *buf, size_t *blen); 13 | bool base64_dec(const char *data, size_t size, void *buf, size_t *blen); 14 | size_t base64_enc_len(size_t size); 15 | 16 | #endif /* BASE64_H */ 17 | -------------------------------------------------------------------------------- /lib/libutils/ext/include/riscv.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2023 Andes Technology Corporation 4 | */ 5 | 6 | #if __riscv_xlen == 32 7 | #define STR sw 8 | #define LDR lw 9 | #define REGOFF(x) ((x) * 4) 10 | #elif __riscv_xlen == 64 11 | #define STR sd 12 | #define LDR ld 13 | #define REGOFF(x) ((x) * 8) 14 | #endif 15 | -------------------------------------------------------------------------------- /lib/libutils/ext/include/stdlib_ext.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | 6 | /* 7 | * This file provides extensions to functions defined in 8 | */ 9 | 10 | #ifndef __STDLIB_EXT_H 11 | #define __STDLIB_EXT_H 12 | 13 | #include 14 | 15 | /* Overwrite buffer with a fixed pattern and free it. @ptr may be NULL. */ 16 | void free_wipe(void *ptr); 17 | 18 | #endif /* __STDLIB_EXT_H */ 19 | -------------------------------------------------------------------------------- /lib/libutils/ext/memzero_explicit.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (C) 2019 Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /* 10 | * This method prevents dead store elimination, which could happen in case 11 | * link-time optimization (LTO) is used. 12 | * See "Dead Store Elimination (Still) Considered Harmful" [1] section 3.3.3. 13 | * 14 | * [1] 15 | * http://www.usenix.org/system/files/conference/usenixsecurity17/sec17-yang.pdf 16 | */ 17 | static volatile void * (*memset_func)(void *, int, size_t) = 18 | (volatile void * (*)(void *, int, size_t))&memset; 19 | 20 | void memzero_explicit(void *s, size_t count) 21 | { 22 | memset_func(s, 0, count); 23 | } 24 | -------------------------------------------------------------------------------- /lib/libutils/ext/nex_strdup.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018 EPAM Systems 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | char *nex_strdup(const char *s) 10 | { 11 | size_t l = strlen(s) + 1; 12 | char *p = nex_malloc(l); 13 | 14 | if (p) 15 | memcpy(p, s, l); 16 | return p; 17 | } 18 | -------------------------------------------------------------------------------- /lib/libutils/ext/pthread_stubs.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2023, Linaro Limited 4 | */ 5 | 6 | #include 7 | 8 | #define pthread_mutex_t void 9 | 10 | int pthread_mutex_lock(pthread_mutex_t *mutex __unused); 11 | int pthread_mutex_unlock(pthread_mutex_t *mutex __unused); 12 | 13 | int __weak pthread_mutex_lock(pthread_mutex_t *mutex __unused) 14 | { 15 | return 0; 16 | } 17 | 18 | int __weak pthread_mutex_unlock(pthread_mutex_t *mutex __unused) 19 | { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /lib/libutils/ext/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | 3 | srcs-y += snprintk.c 4 | srcs-y += strlcat.c 5 | srcs-y += strlcpy.c 6 | srcs-y += trace.c 7 | srcs-y += mempool.c 8 | srcs-y += nex_strdup.c 9 | srcs-y += consttime_memcmp.c 10 | srcs-y += memzero_explicit.c 11 | srcs-y += fault_mitigation.c 12 | srcs-y += qsort_helpers.c 13 | srcs-y += array.c 14 | srcs-y += base64.c 15 | 16 | ifneq (,$(filter ta_%,$(sm))) 17 | srcs-y += pthread_stubs.c 18 | endif 19 | 20 | subdirs-y += arch/$(ARCH) 21 | subdirs-y += ftrace 22 | -------------------------------------------------------------------------------- /lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | 6 | #include 7 | 8 | .section .note.GNU-stack,"",%progbits 9 | 10 | /* 11 | * signed ret_idivmod_values(signed quot, signed rem); 12 | * return quotient and remaining the EABI way (regs r0,r1) 13 | */ 14 | FUNC ret_idivmod_values , : 15 | bx lr 16 | END_FUNC ret_idivmod_values 17 | 18 | /* 19 | * unsigned ret_uidivmod_values(unsigned quot, unsigned rem); 20 | * return quotient and remaining the EABI way (regs r0,r1) 21 | */ 22 | FUNC ret_uidivmod_values , : 23 | bx lr 24 | END_FUNC ret_uidivmod_values 25 | -------------------------------------------------------------------------------- /lib/libutils/isoc/arch/arm/softfloat/source/8086-SSE/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += softfloat_raiseFlags.c 2 | srcs-y += s_propagateNaNF32UI.c 3 | srcs-y += s_f32UIToCommonNaN.c 4 | srcs-y += s_commonNaNToF64UI.c 5 | srcs-y += s_f64UIToCommonNaN.c 6 | srcs-y += s_propagateNaNF64UI.c 7 | srcs-y += s_commonNaNToF32UI.c 8 | -------------------------------------------------------------------------------- /lib/libutils/isoc/arch/arm/softfloat/sub.mk: -------------------------------------------------------------------------------- 1 | incdirs-lib-y += arm32_include 2 | 3 | subdirs-y += source 4 | -------------------------------------------------------------------------------- /lib/libutils/isoc/arch/riscv/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += setjmp_rv.S 2 | -------------------------------------------------------------------------------- /lib/libutils/isoc/fp.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | 8 | struct _FILE { 9 | char dummy; 10 | }; 11 | 12 | static struct _FILE _fake_stdout; 13 | static struct _FILE _fake_stderr; 14 | 15 | FILE *stdout = &_fake_stdout; 16 | FILE *stderr = &_fake_stderr; 17 | -------------------------------------------------------------------------------- /lib/libutils/isoc/fputc.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int fputc(int c, FILE *stream) 10 | { 11 | if (stream != stdout && stream != stderr) 12 | abort(); 13 | 14 | return putchar(c); 15 | } 16 | -------------------------------------------------------------------------------- /lib/libutils/isoc/fputs.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | int fputs(const char *s, FILE *stream) 11 | { 12 | if (stream != stdout && stream != stderr) 13 | abort(); 14 | 15 | trace_ext_puts(s); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /lib/libutils/isoc/fwrite.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) 11 | { 12 | int fd = 0; 13 | 14 | if (stream == stdout) 15 | fd = 1; 16 | else if (stream == stderr) 17 | fd = 2; 18 | else 19 | abort(); 20 | 21 | return write(fd, ptr, size * nmemb); 22 | } 23 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/ctype.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #ifndef __CTYPE_H 6 | #define __CTYPE_H 7 | 8 | int isalnum(int c); 9 | int isalpha(int c); 10 | int iscntrl(int c); 11 | int isdigit(int c); 12 | int isgraph(int c); 13 | int islower(int c); 14 | int isprint(int c); 15 | int ispunct(int c); 16 | int isspace(int c); 17 | int isupper(int c); 18 | int isxdigit(int c); 19 | int tolower(int c); 20 | int toupper(int c); 21 | 22 | #endif /*__CTYPE_H*/ 23 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/memory.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __MEMORY_H 6 | #define __MEMORY_H 7 | #include 8 | 9 | #endif /*__MEMORY_H*/ 10 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/signal.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __SIGNAL_H 6 | #define __SIGNAL_H 7 | 8 | #endif /*__SIGNAL_H*/ 9 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/strings.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | #ifndef __STRINGS_H 6 | #define __STRINGS_H 7 | 8 | int bcmp(const void *s1, const void *s2, size_t n); 9 | 10 | #endif /*__STRINGS_H*/ 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright (c) 1994-2009 Red Hat, Inc. All rights reserved. 4 | */ 5 | 6 | #ifndef _SYS_FCNTL_H_ 7 | #define _SYS_FCNTL_H_ 8 | 9 | #define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ 10 | #define _FCREAT 0x0200 /* open with file create */ 11 | #define _FTRUNC 0x0400 /* open with truncation */ 12 | 13 | /* 14 | * Flag values for open(2) and fcntl(2) 15 | */ 16 | #define O_RDONLY 0 /* +1 == FREAD */ 17 | #define O_WRONLY 1 /* +1 == FWRITE */ 18 | #define O_RDWR 2 /* +1 == FREAD|FWRITE */ 19 | #define O_APPEND _FAPPEND 20 | #define O_CREAT _FCREAT 21 | #define O_TRUNC _FTRUNC 22 | 23 | #endif /* _SYS_FCNTL_H_ */ 24 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/sys/types.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef SYS_TYPES_H 6 | #define SYS_TYPES_H 7 | 8 | #include 9 | 10 | #endif /*SYS_TYPES_H*/ 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/time.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __TIME_H 6 | #define __TIME_H 7 | 8 | #include 9 | #include 10 | 11 | typedef int64_t time_t; 12 | 13 | #endif /*__TIME_H*/ 14 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/unistd.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __UNISTD_H 6 | #define __UNISTD_H 7 | 8 | #include 9 | #include 10 | 11 | #define __ssize_t_defined 12 | typedef intptr_t ssize_t; 13 | 14 | /* @fd must be 1 or 2. Writes to the secure console. */ 15 | ssize_t write(int fd, const void *buf, size_t count); 16 | 17 | #endif /* __UNISTD_H */ 18 | -------------------------------------------------------------------------------- /lib/libutils/isoc/include/wchar.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #ifndef __WCHAR_H 6 | #define __WCHAR_H 7 | 8 | #endif /*__WCHAR_H*/ 9 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isalnum.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int isalnum(int c) 8 | { 9 | return isalpha(c) || isdigit(c); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isalpha.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | 7 | int isalpha(int c) 8 | { 9 | if (c >= 'A' && c <= 'Z') 10 | return 1; 11 | if (c >= 'a' && c <= 'z') 12 | return 1; 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /lib/libutils/isoc/iscntrl.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int iscntrl(int c) 8 | { 9 | if (c < 0x20 || c == 0x7f) 10 | return 1; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isdigit.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | 7 | int isdigit(int c) 8 | { 9 | if (c >= '0' && c <= '9') 10 | return 1; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isgraph.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int isgraph(int c) 8 | { 9 | if (c >= 0x21 && c < 0x7f) 10 | return 1; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/islower.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int islower(int c) 8 | { 9 | return (c >= 'a' && c <= 'z'); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isprint.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int isprint(int c) 8 | { 9 | if (c >= 0x20 && c < 0x7f) 10 | return 1; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/ispunct.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int ispunct(int c) 8 | { 9 | return isgraph(c) && !isalnum(c); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isspace.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | 7 | int isspace(int c) 8 | { 9 | return (c == ' '); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isupper.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | 7 | int isupper(int c) 8 | { 9 | return (c >= 'A' && c <= 'Z'); 10 | } 11 | -------------------------------------------------------------------------------- /lib/libutils/isoc/isxdigit.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2018, Linaro Limited 4 | */ 5 | #include 6 | 7 | int isxdigit(int c) 8 | { 9 | if (isdigit(c)) 10 | return 1; 11 | if (c >= 'A' && c <= 'F') 12 | return 1; 13 | if (c >= 'a' && c <= 'f') 14 | return 1; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /lib/libutils/isoc/snprintf.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int snprintf(char *bf, size_t size, const char *fmt, ...) 10 | { 11 | int retval; 12 | va_list ap; 13 | 14 | va_start(ap, fmt); 15 | retval = __vsnprintf(bf, size, fmt, ap, false); 16 | va_end(ap); 17 | 18 | return retval; 19 | } 20 | 21 | int vsnprintf(char *bf, size_t size, const char *fmt, va_list ap) 22 | { 23 | return __vsnprintf(bf, size, fmt, ap, false); 24 | } 25 | -------------------------------------------------------------------------------- /lib/libutils/isoc/strdup.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #include 6 | #include 7 | 8 | char *strdup(const char *s) 9 | { 10 | size_t l = strlen(s) + 1; 11 | char *p = malloc(l); 12 | 13 | if (p) 14 | memcpy(p, s, l); 15 | return p; 16 | } 17 | -------------------------------------------------------------------------------- /lib/libutils/isoc/strndup.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2014, STMicroelectronics International N.V. 4 | */ 5 | #include 6 | #include 7 | 8 | char *strndup(const char *s, size_t n) 9 | { 10 | size_t l = strnlen(s, n) + 1; 11 | char *p = malloc(l); 12 | 13 | if (p) { 14 | memcpy(p, s, l - 1); 15 | p[l - 1] = '\0'; 16 | } 17 | return p; 18 | } 19 | -------------------------------------------------------------------------------- /lib/libutils/isoc/tolower.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2015, Linaro Limited 4 | */ 5 | #include 6 | 7 | int tolower(int c) 8 | { 9 | if (c >= 'A' && c <= 'Z') 10 | return c - 'A' + 'a'; 11 | return c; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/toupper.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2019, KAIST 4 | */ 5 | #include 6 | 7 | int toupper(int c) 8 | { 9 | if (c >= 'a' && c <= 'z') 10 | return c - 'a' + 'A'; 11 | return c; 12 | } 13 | -------------------------------------------------------------------------------- /lib/libutils/isoc/write.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * Copyright (c) 2020, Huawei Technologies Co., Ltd 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | ssize_t write(int fd, const void *buf, size_t count) 11 | { 12 | if (fd != 1 && fd != 2) 13 | abort(); 14 | 15 | return printf("%*s", (int)count, (char *)buf); 16 | } 17 | -------------------------------------------------------------------------------- /lib/libutils/sub.mk: -------------------------------------------------------------------------------- 1 | subdirs-$(CFG_LIBUTILS_WITH_ISOC) += isoc 2 | subdirs-y += ext 3 | -------------------------------------------------------------------------------- /mk/cleanvars.mk: -------------------------------------------------------------------------------- 1 | # Cleans all output variables from other make files to allow for a new start 2 | 3 | gen-srcs := 4 | spec-srcs := 5 | srcs := 6 | objs := 7 | libfiles := 8 | libdirs := 9 | libnames := 10 | libdeps := 11 | sm-$(sm) := 12 | incdirs := 13 | -------------------------------------------------------------------------------- /ta/arch/arm/ta_entry_a32.S: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2019, Linaro Limited 4 | */ 5 | 6 | #include 7 | 8 | .section .note.GNU-stack,"",%progbits 9 | 10 | /* 11 | * This function is the bottom of the user call stack. Mark it as such so that 12 | * the unwinding code won't try to go further down. 13 | * We need an assembly wrapper because Clang does not accept asm(".cantunwind") 14 | * in a C function: 15 | * 16 | * user_ta_header.c:44:6: error: .fnstart must precede .cantunwind directive 17 | * asm(".cantunwind"); 18 | * ^ 19 | */ 20 | FUNC __ta_entry, : 21 | UNWIND( .cantunwind) 22 | bl __ta_entry_c 23 | END_FUNC __ta_entry 24 | -------------------------------------------------------------------------------- /ta/avb/Makefile: -------------------------------------------------------------------------------- 1 | # The UUID for the Trusted Application 2 | BINARY=023f8f1a-292a-432b-8fc4-de8471358067 3 | 4 | ifdef TA_CROSS_COMPILE 5 | CROSS_COMPILE ?= $(TA_CROSS_COMPILE) 6 | endif 7 | export CROSS_COMPILE 8 | 9 | CFG_TEE_TA_LOG_LEVEL ?= 2 10 | CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL) 11 | 12 | -include $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk 13 | 14 | ifeq ($(wildcard $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk), ) 15 | clean: 16 | @echo 'Note: $$(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk not found, cannot clean TA' 17 | @echo 'Note: TA_DEV_KIT_DIR=$(TA_DEV_KIT_DIR)' 18 | endif 19 | -------------------------------------------------------------------------------- /ta/avb/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | global-incdirs-y += . 3 | srcs-y += entry.c 4 | -------------------------------------------------------------------------------- /ta/avb/user_ta.mk: -------------------------------------------------------------------------------- 1 | user-ta-uuid := 023f8f1a-292a-432b-8fc4-de8471358067 2 | user-ta-version := 0 3 | -------------------------------------------------------------------------------- /ta/avb/user_ta_header_defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* Copyright (c) 2018, Linaro Limited */ 3 | 4 | #ifndef __USER_TA_HEADER_DEFINES_H 5 | #define __USER_TA_HEADER_DEFINES_H 6 | 7 | #include 8 | 9 | #define TA_UUID TA_AVB_UUID 10 | 11 | #define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | \ 12 | TA_FLAG_MULTI_SESSION) 13 | 14 | #define TA_STACK_SIZE (16 * 1024) 15 | #define TA_DATA_SIZE (16 * 1024) 16 | 17 | #endif /*__USER_TA_HEADER_DEFINES_H*/ 18 | -------------------------------------------------------------------------------- /ta/pkcs11/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | local_module := fd02c9da-306c-48c7-a49c-bbd827ae86ee.ta 3 | include $(BUILD_OPTEE_MK) 4 | -------------------------------------------------------------------------------- /ta/pkcs11/Makefile: -------------------------------------------------------------------------------- 1 | # The UUID for the Trusted Application 2 | BINARY=fd02c9da-306c-48c7-a49c-bbd827ae86ee 3 | 4 | -include $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk 5 | 6 | ifeq ($(wildcard $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk), ) 7 | clean: 8 | @echo 'Note: $$(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk not found, cannot clean TA' 9 | endif 10 | -------------------------------------------------------------------------------- /ta/pkcs11/src/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += attributes.c 2 | srcs-y += entry.c 3 | srcs-y += handle.c 4 | srcs-y += object.c 5 | srcs-y += persistent_token.c 6 | srcs-y += pkcs11_attributes.c 7 | srcs-y += pkcs11_helpers.c 8 | srcs-y += pkcs11_token.c 9 | srcs-y += processing.c 10 | srcs-y += processing_aes.c 11 | srcs-y += processing_asymm.c 12 | srcs-y += processing_digest.c 13 | srcs-y += processing_ec.c 14 | srcs-y += processing_rsa.c 15 | srcs-y += processing_symm.c 16 | srcs-y += sanitize_object.c 17 | srcs-y += serializer.c 18 | srcs-y += token_capabilities.c 19 | -------------------------------------------------------------------------------- /ta/pkcs11/sub.mk: -------------------------------------------------------------------------------- 1 | # Enable PKCS#11 TA's C_DigestKey support 2 | CFG_PKCS11_TA_ALLOW_DIGEST_KEY ?= y 3 | 4 | # Enable PKCS#11 TA's TEE Identity based authentication support 5 | CFG_PKCS11_TA_AUTH_TEE_IDENTITY ?= y 6 | 7 | # PKCS#11 TA heap size can be customized if 32kB is not enough 8 | CFG_PKCS11_TA_HEAP_SIZE ?= (32 * 1024) 9 | 10 | # Defines the number of PKCS11 token implemented by the PKCS11 TA 11 | CFG_PKCS11_TA_TOKEN_COUNT ?= 3 12 | 13 | # When enabled, embed support for object checksum value computation 14 | CFG_PKCS11_TA_CHECK_VALUE_ATTRIBUTE ?= y 15 | 16 | global-incdirs-y += include 17 | global-incdirs-y += src 18 | subdirs-y += src 19 | -------------------------------------------------------------------------------- /ta/pkcs11/user_ta.mk: -------------------------------------------------------------------------------- 1 | user-ta-uuid := fd02c9da-306c-48c7-a49c-bbd827ae86ee 2 | 3 | all: pkcs11-ta-verify-helpers 4 | 5 | .PHONY: pkcs11-ta-verify-helpers 6 | pkcs11-ta-verify-helpers: 7 | @$(cmd-echo-silent) ' CHK ' $@ 8 | ${q}ta/pkcs11/scripts/verify-helpers.sh --quiet 9 | -------------------------------------------------------------------------------- /ta/remoteproc/Makefile: -------------------------------------------------------------------------------- 1 | # The UUID for the Trusted Application 2 | BINARY=80a4c275-0a47-4905-8285-1486a9771a08 3 | 4 | ifdef TA_CROSS_COMPILE 5 | CROSS_COMPILE ?= $(TA_CROSS_COMPILE) 6 | endif 7 | export CROSS_COMPILE 8 | 9 | CFG_TEE_TA_LOG_LEVEL ?= 2 10 | CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL) 11 | 12 | -include $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk 13 | 14 | ifeq ($(wildcard $(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk), ) 15 | clean: 16 | @echo 'Note: $$(TA_DEV_KIT_DIR)/mk/ta_dev_kit.mk not found, cannot clean TA' 17 | @echo 'Note: TA_DEV_KIT_DIR=$(TA_DEV_KIT_DIR)' 18 | endif 19 | -------------------------------------------------------------------------------- /ta/remoteproc/src/sub.mk: -------------------------------------------------------------------------------- 1 | srcs-y += remoteproc_core.c 2 | srcs-y += elf_parser.c 3 | -------------------------------------------------------------------------------- /ta/remoteproc/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | global-incdirs-y += src 3 | subdirs-y += src 4 | -------------------------------------------------------------------------------- /ta/remoteproc/user_ta.mk: -------------------------------------------------------------------------------- 1 | user-ta-uuid := 80a4c275-0a47-4905-8285-1486a9771a08 2 | 3 | # REMOTEPROC TA heap size can be customized if 4kB is not enough 4 | CFG_REMOTEPROC_TA_HEAP_SIZE ?= (4 * 1024) 5 | -------------------------------------------------------------------------------- /ta/trusted_keys/sub.mk: -------------------------------------------------------------------------------- 1 | global-incdirs-y += include 2 | global-incdirs-y += . 3 | srcs-y += entry.c 4 | -------------------------------------------------------------------------------- /ta/trusted_keys/user_ta.mk: -------------------------------------------------------------------------------- 1 | user-ta-uuid := f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c 2 | -------------------------------------------------------------------------------- /ta/trusted_keys/user_ta_header_defines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | /* 3 | * Copyright (c) 2020, Linaro Limited 4 | */ 5 | 6 | #ifndef USER_TA_HEADER_DEFINES_H 7 | #define USER_TA_HEADER_DEFINES_H 8 | 9 | #include 10 | 11 | #define TA_UUID TRUSTED_KEYS_UUID 12 | 13 | #define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | \ 14 | TA_FLAG_MULTI_SESSION | \ 15 | TA_FLAG_DEVICE_ENUM) 16 | 17 | #define TA_STACK_SIZE (4 * 1024) 18 | #define TA_DATA_SIZE (16 * 1024) 19 | 20 | #endif /*USER_TA_HEADER_DEFINES_H*/ 21 | --------------------------------------------------------------------------------