├── .checkpatch.conf ├── .gitignore ├── Makefile ├── acknowledgements.md ├── bl1 ├── aarch32 │ ├── bl1_arch_setup.c │ ├── bl1_context_mgmt.c │ ├── bl1_entrypoint.S │ └── bl1_exceptions.S ├── aarch64 │ ├── bl1_arch_setup.c │ ├── bl1_context_mgmt.c │ ├── bl1_entrypoint.S │ └── bl1_exceptions.S ├── bl1.ld.S ├── bl1.mk ├── bl1_fwu.c ├── bl1_main.c ├── bl1_private.h └── tbbr │ └── tbbr_img_desc.c ├── bl2 ├── aarch32 │ ├── bl2_arch_setup.c │ └── bl2_entrypoint.S ├── aarch64 │ ├── bl2_arch_setup.c │ └── bl2_entrypoint.S ├── bl2.ld.S ├── bl2.mk ├── bl2_image_load.c ├── bl2_image_load_v2.c ├── bl2_main.c └── bl2_private.h ├── bl2u ├── aarch64 │ └── bl2u_entrypoint.S ├── bl2u.ld.S ├── bl2u.mk └── bl2u_main.c ├── bl31 ├── aarch64 │ ├── bl31_entrypoint.S │ ├── crash_reporting.S │ └── runtime_exceptions.S ├── bl31.ld.S ├── bl31.mk ├── bl31_context_mgmt.c ├── bl31_main.c └── interrupt_mgmt.c ├── bl32 ├── sp_min │ ├── aarch32 │ │ └── entrypoint.S │ ├── sp_min.ld.S │ ├── sp_min.mk │ ├── sp_min_main.c │ └── sp_min_private.h └── tsp │ ├── aarch64 │ ├── tsp_entrypoint.S │ ├── tsp_exceptions.S │ └── tsp_request.S │ ├── tsp.ld.S │ ├── tsp.mk │ ├── tsp_interrupt.c │ ├── tsp_main.c │ ├── tsp_private.h │ └── tsp_timer.c ├── common ├── aarch32 │ └── debug.S ├── aarch64 │ ├── debug.S │ └── early_exceptions.S ├── bl_common.c ├── desc_image_load.c ├── runtime_svc.c └── tf_printf.c ├── contributing.md ├── dco.txt ├── docs ├── auth-framework.md ├── change-log.md ├── cpu-specific-build-macros.md ├── diagrams │ ├── default_reset_code.png │ ├── fwu_flow.png │ ├── fwu_states.png │ ├── generate_reset_images.sh │ ├── non-sec-int-handling.png │ ├── psci-suspend-sequence.png │ ├── reset_code_flow.dia │ ├── reset_code_no_boot_type_check.png │ ├── reset_code_no_checks.png │ ├── reset_code_no_cpu_check.png │ ├── rt-svc-descs-layout.png │ └── sec-int-handling.png ├── firmware-design.md ├── firmware-update.md ├── interrupt-framework-design.md ├── plat │ ├── nvidia-tegra.md │ ├── qemu.md │ └── xilinx-zynqmp.md ├── platform-migration-guide.md ├── porting-guide.md ├── psci-lib-integration-guide.md ├── psci-pd-tree.md ├── reset-design.md ├── rt-svc-writers-guide.md ├── spd │ ├── optee-dispatcher.md │ └── tlk-dispatcher.md ├── trusted-board-boot.md └── user-guide.md ├── drivers ├── arm │ ├── cci │ │ └── cci.c │ ├── cci400 │ │ └── cci400.c │ ├── ccn │ │ ├── ccn.c │ │ └── ccn_private.h │ ├── gic │ │ ├── arm_gic.c │ │ ├── common │ │ │ ├── gic_common.c │ │ │ └── gic_common_private.h │ │ ├── gic_v2.c │ │ ├── gic_v3.c │ │ ├── v2 │ │ │ ├── gicv2_helpers.c │ │ │ ├── gicv2_main.c │ │ │ └── gicv2_private.h │ │ └── v3 │ │ │ ├── gicv3_helpers.c │ │ │ ├── gicv3_main.c │ │ │ └── gicv3_private.h │ ├── pl011 │ │ ├── aarch32 │ │ │ └── pl011_console.S │ │ ├── aarch64 │ │ │ └── pl011_console.S │ │ └── pl011_console.S │ ├── pl061 │ │ └── pl061_gpio.c │ ├── sp804 │ │ └── sp804_delay_timer.c │ ├── sp805 │ │ └── sp805.c │ ├── tzc │ │ ├── tzc400.c │ │ ├── tzc_common_private.c │ │ └── tzc_dmc500.c │ └── tzc400 │ │ └── tzc400.c ├── auth │ ├── auth_mod.c │ ├── crypto_mod.c │ ├── img_parser_mod.c │ ├── mbedtls │ │ ├── mbedtls_common.c │ │ ├── mbedtls_common.mk │ │ ├── mbedtls_crypto.c │ │ ├── mbedtls_crypto.mk │ │ ├── mbedtls_x509.mk │ │ └── mbedtls_x509_parser.c │ └── tbbr │ │ └── tbbr_cot.c ├── cadence │ └── uart │ │ ├── aarch64 │ │ └── cdns_console.S │ │ └── cdns_console.S ├── console │ ├── aarch32 │ │ ├── console.S │ │ └── skeleton_console.S │ ├── aarch64 │ │ ├── console.S │ │ └── skeleton_console.S │ ├── console.S │ └── skeleton_console.S ├── delay_timer │ ├── delay_timer.c │ └── generic_delay_timer.c ├── emmc │ └── emmc.c ├── gpio │ └── gpio.c ├── io │ ├── io_block.c │ ├── io_dummy.c │ ├── io_fip.c │ ├── io_memmap.c │ ├── io_semihosting.c │ └── io_storage.c └── ti │ └── uart │ ├── 16550_console.S │ └── aarch64 │ └── 16550_console.S ├── fdts ├── fvp-base-gicv2-psci-aarch32.dtb ├── fvp-base-gicv2-psci-aarch32.dts ├── fvp-base-gicv2-psci.dtb ├── fvp-base-gicv2-psci.dts ├── fvp-base-gicv3-psci-aarch32.dtb ├── fvp-base-gicv3-psci-aarch32.dts ├── fvp-base-gicv3-psci.dtb ├── fvp-base-gicv3-psci.dts ├── fvp-foundation-gicv2-psci.dtb ├── fvp-foundation-gicv2-psci.dts ├── fvp-foundation-gicv3-psci.dtb ├── fvp-foundation-gicv3-psci.dts ├── fvp-foundation-motherboard.dtsi └── rtsm_ve-motherboard.dtsi ├── include ├── bl1 │ ├── bl1.h │ └── tbbr │ │ └── tbbr_img_desc.h ├── bl31 │ ├── bl31.h │ └── interrupt_mgmt.h ├── bl32 │ ├── payloads │ │ └── tlk.h │ ├── sp_min │ │ └── platform_sp_min.h │ └── tsp │ │ ├── platform_tsp.h │ │ └── tsp.h ├── common │ ├── aarch32 │ │ ├── asm_macros.S │ │ ├── assert_macros.S │ │ └── el3_common_macros.S │ ├── aarch64 │ │ ├── asm_macros.S │ │ ├── assert_macros.S │ │ └── el3_common_macros.S │ ├── asm_macros_common.S │ ├── bl_common.h │ ├── debug.h │ ├── desc_image_load.h │ ├── firmware_image_package.h │ ├── runtime_svc.h │ └── tbbr │ │ ├── cot_def.h │ │ └── tbbr_img_def.h ├── drivers │ ├── arm │ │ ├── arm_gic.h │ │ ├── cci.h │ │ ├── cci400.h │ │ ├── ccn.h │ │ ├── gic_common.h │ │ ├── gic_v2.h │ │ ├── gic_v3.h │ │ ├── gicv2.h │ │ ├── gicv3.h │ │ ├── nic_400.h │ │ ├── pl011.h │ │ ├── pl061_gpio.h │ │ ├── sp804_delay_timer.h │ │ ├── sp805.h │ │ ├── tzc400.h │ │ ├── tzc_common.h │ │ └── tzc_dmc500.h │ ├── auth │ │ ├── auth_common.h │ │ ├── auth_mod.h │ │ ├── crypto_mod.h │ │ ├── img_parser_mod.h │ │ └── mbedtls │ │ │ ├── mbedtls_common.h │ │ │ └── mbedtls_config.h │ ├── cadence │ │ └── cdns_uart.h │ ├── console.h │ ├── delay_timer.h │ ├── emmc.h │ ├── generic_delay_timer.h │ ├── gpio.h │ ├── io │ │ ├── io_block.h │ │ ├── io_driver.h │ │ ├── io_dummy.h │ │ ├── io_fip.h │ │ ├── io_memmap.h │ │ ├── io_semihosting.h │ │ └── io_storage.h │ └── ti │ │ └── uart │ │ └── uart_16550.h ├── lib │ ├── aarch32 │ │ ├── arch.h │ │ ├── arch_helpers.h │ │ ├── smcc_helpers.h │ │ └── smcc_macros.S │ ├── aarch64 │ │ ├── arch.h │ │ ├── arch_helpers.h │ │ └── smcc_helpers.h │ ├── bakery_lock.h │ ├── cassert.h │ ├── cpus │ │ ├── aarch32 │ │ │ ├── aem_generic.h │ │ │ ├── cortex_a32.h │ │ │ └── cpu_macros.S │ │ └── aarch64 │ │ │ ├── aem_generic.h │ │ │ ├── cortex_a35.h │ │ │ ├── cortex_a53.h │ │ │ ├── cortex_a57.h │ │ │ ├── cortex_a72.h │ │ │ ├── cortex_a73.h │ │ │ ├── cpu_macros.S │ │ │ └── denver.h │ ├── el3_runtime │ │ ├── aarch32 │ │ │ └── context.h │ │ ├── aarch64 │ │ │ └── context.h │ │ ├── context_mgmt.h │ │ └── cpu_data.h │ ├── libfdt │ │ ├── fdt.h │ │ ├── libfdt.h │ │ └── libfdt_env.h │ ├── mmio.h │ ├── pmf │ │ ├── pmf.h │ │ ├── pmf_asm_macros.S │ │ └── pmf_helpers.h │ ├── psci │ │ ├── psci.h │ │ └── psci_compat.h │ ├── semihosting.h │ ├── smcc.h │ ├── spinlock.h │ ├── stdlib │ │ ├── assert.h │ │ ├── inttypes.h │ │ ├── machine │ │ │ ├── _inttypes.h │ │ │ ├── _limits.h │ │ │ ├── _stdint.h │ │ │ └── _types.h │ │ ├── stddef.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── strings.h │ │ ├── sys │ │ │ ├── _null.h │ │ │ ├── _stdint.h │ │ │ ├── _timespec.h │ │ │ ├── _types.h │ │ │ ├── cdefs.h │ │ │ ├── ctype.h │ │ │ ├── errno.h │ │ │ ├── limits.h │ │ │ ├── stdarg.h │ │ │ ├── stdint.h │ │ │ ├── timespec.h │ │ │ ├── types.h │ │ │ └── uuid.h │ │ ├── time.h │ │ └── xlocale │ │ │ ├── _strings.h │ │ │ └── _time.h │ ├── utils.h │ └── xlat_tables.h ├── plat │ ├── arm │ │ ├── board │ │ │ └── common │ │ │ │ ├── board_arm_def.h │ │ │ │ ├── board_arm_oid.h │ │ │ │ ├── board_css_def.h │ │ │ │ ├── drivers │ │ │ │ └── norflash.h │ │ │ │ └── v2m_def.h │ │ ├── common │ │ │ ├── aarch64 │ │ │ │ ├── arm_macros.S │ │ │ │ └── cci_macros.S │ │ │ ├── arm_config.h │ │ │ ├── arm_def.h │ │ │ └── plat_arm.h │ │ ├── css │ │ │ └── common │ │ │ │ ├── aarch64 │ │ │ │ └── css_macros.S │ │ │ │ ├── css_def.h │ │ │ │ └── css_pm.h │ │ └── soc │ │ │ └── common │ │ │ ├── soc_css.h │ │ │ └── soc_css_def.h │ └── common │ │ ├── common_def.h │ │ └── platform.h └── services │ └── std_svc.h ├── lib ├── aarch32 │ ├── cache_helpers.S │ └── misc_helpers.S ├── aarch64 │ ├── cache_helpers.S │ ├── misc_helpers.S │ └── xlat_tables.c ├── cpus │ ├── aarch32 │ │ ├── aem_generic.S │ │ ├── cortex_a32.S │ │ └── cpu_helpers.S │ ├── aarch64 │ │ ├── aem_generic.S │ │ ├── cortex_a35.S │ │ ├── cortex_a53.S │ │ ├── cortex_a57.S │ │ ├── cortex_a72.S │ │ ├── cortex_a73.S │ │ ├── cpu_helpers.S │ │ └── denver.S │ └── cpu-ops.mk ├── el3_runtime │ ├── aarch32 │ │ ├── context_mgmt.c │ │ └── cpu_data.S │ ├── aarch64 │ │ ├── context.S │ │ ├── context_mgmt.c │ │ └── cpu_data.S │ └── cpu_data_array.c ├── libfdt │ ├── fdt.c │ ├── fdt_addresses.c │ ├── fdt_empty_tree.c │ ├── fdt_ro.c │ ├── fdt_rw.c │ ├── fdt_strerror.c │ ├── fdt_sw.c │ ├── fdt_wip.c │ ├── libfdt.mk │ └── libfdt_internal.h ├── locks │ ├── bakery │ │ ├── bakery_lock_coherent.c │ │ └── bakery_lock_normal.c │ └── exclusive │ │ ├── aarch32 │ │ └── spinlock.S │ │ ├── aarch64 │ │ └── spinlock.S │ │ └── spinlock.S ├── pmf │ ├── pmf_main.c │ └── pmf_smc.c ├── psci │ ├── aarch32 │ │ └── psci_helpers.S │ ├── aarch64 │ │ └── psci_helpers.S │ ├── psci_common.c │ ├── psci_lib.mk │ ├── psci_main.c │ ├── psci_off.c │ ├── psci_on.c │ ├── psci_private.h │ ├── psci_setup.c │ ├── psci_stat.c │ ├── psci_suspend.c │ └── psci_system_off.c ├── semihosting │ ├── aarch32 │ │ └── semihosting_call.S │ ├── aarch64 │ │ └── semihosting_call.S │ └── semihosting.c ├── stdlib │ ├── abort.c │ ├── assert.c │ ├── exit.c │ ├── mem.c │ ├── printf.c │ ├── putchar.c │ ├── puts.c │ ├── sscanf.c │ ├── stdlib.mk │ ├── strchr.c │ ├── strcmp.c │ ├── strlen.c │ ├── strncmp.c │ └── subr_prf.c └── xlat_tables │ ├── aarch32 │ └── xlat_tables.c │ ├── aarch64 │ └── xlat_tables.c │ ├── xlat_tables_common.c │ └── xlat_tables_private.h ├── license.md ├── make_helpers ├── build_env.mk ├── build_macros.mk ├── cygwin.mk ├── msys.mk ├── plat_helpers.mk ├── tbbr │ └── tbbr_tools.mk ├── unix.mk └── windows.mk ├── plat ├── arm │ ├── board │ │ ├── common │ │ │ ├── aarch32 │ │ │ │ └── board_arm_helpers.S │ │ │ ├── aarch64 │ │ │ │ └── board_arm_helpers.S │ │ │ ├── board_arm_trusted_boot.c │ │ │ ├── board_common.mk │ │ │ ├── board_css.mk │ │ │ ├── board_css_common.c │ │ │ ├── drivers │ │ │ │ └── norflash │ │ │ │ │ └── norflash.c │ │ │ └── rotpk │ │ │ │ ├── arm_rotpk_rsa.der │ │ │ │ ├── arm_rotpk_rsa_sha256.bin │ │ │ │ └── arm_rotprivk_rsa.pem │ │ ├── fvp │ │ │ ├── aarch32 │ │ │ │ └── fvp_helpers.S │ │ │ ├── aarch64 │ │ │ │ └── fvp_helpers.S │ │ │ ├── drivers │ │ │ │ └── pwrc │ │ │ │ │ ├── fvp_pwrc.c │ │ │ │ │ └── fvp_pwrc.h │ │ │ ├── fvp_bl1_setup.c │ │ │ ├── fvp_bl2_setup.c │ │ │ ├── fvp_bl2u_setup.c │ │ │ ├── fvp_bl31_setup.c │ │ │ ├── fvp_common.c │ │ │ ├── fvp_def.h │ │ │ ├── fvp_err.c │ │ │ ├── fvp_io_storage.c │ │ │ ├── fvp_pm.c │ │ │ ├── fvp_private.h │ │ │ ├── fvp_security.c │ │ │ ├── fvp_topology.c │ │ │ ├── fvp_trusted_boot.c │ │ │ ├── include │ │ │ │ ├── plat_macros.S │ │ │ │ ├── platform_def.h │ │ │ │ └── platform_oid.h │ │ │ ├── platform.mk │ │ │ ├── sp_min │ │ │ │ ├── fvp_sp_min_setup.c │ │ │ │ └── sp_min-fvp.mk │ │ │ └── tsp │ │ │ │ ├── fvp_tsp_setup.c │ │ │ │ └── tsp-fvp.mk │ │ └── juno │ │ │ ├── aarch64 │ │ │ └── juno_helpers.S │ │ │ ├── include │ │ │ ├── plat_macros.S │ │ │ ├── platform_def.h │ │ │ └── platform_oid.h │ │ │ ├── juno_bl1_setup.c │ │ │ ├── juno_def.h │ │ │ ├── juno_err.c │ │ │ ├── juno_pm.c │ │ │ ├── juno_security.c │ │ │ ├── juno_topology.c │ │ │ ├── platform.mk │ │ │ └── tsp │ │ │ └── tsp-juno.mk │ ├── common │ │ ├── aarch32 │ │ │ ├── arm_bl2_mem_params_desc.c │ │ │ └── arm_helpers.S │ │ ├── aarch64 │ │ │ ├── arm_bl2_mem_params_desc.c │ │ │ └── arm_helpers.S │ │ ├── arm_bl1_fwu.c │ │ ├── arm_bl1_setup.c │ │ ├── arm_bl2_setup.c │ │ ├── arm_bl2u_setup.c │ │ ├── arm_bl31_setup.c │ │ ├── arm_cci.c │ │ ├── arm_ccn.c │ │ ├── arm_common.c │ │ ├── arm_common.mk │ │ ├── arm_gicv2.c │ │ ├── arm_gicv3.c │ │ ├── arm_gicv3_legacy.c │ │ ├── arm_image_load.c │ │ ├── arm_io_storage.c │ │ ├── arm_pm.c │ │ ├── arm_topology.c │ │ ├── arm_tzc400.c │ │ ├── arm_tzc_dmc500.c │ │ ├── sp_min │ │ │ ├── arm_sp_min.mk │ │ │ └── arm_sp_min_setup.c │ │ └── tsp │ │ │ ├── arm_tsp.mk │ │ │ └── arm_tsp_setup.c │ ├── css │ │ └── common │ │ │ ├── aarch64 │ │ │ └── css_helpers.S │ │ │ ├── css_bl1_setup.c │ │ │ ├── css_bl2_setup.c │ │ │ ├── css_bl2u_setup.c │ │ │ ├── css_common.mk │ │ │ ├── css_mhu.c │ │ │ ├── css_mhu.h │ │ │ ├── css_pm.c │ │ │ ├── css_scp_bootloader.c │ │ │ ├── css_scp_bootloader.h │ │ │ ├── css_scpi.c │ │ │ ├── css_scpi.h │ │ │ └── css_topology.c │ └── soc │ │ └── common │ │ ├── soc_css.mk │ │ └── soc_css_security.c ├── common │ ├── aarch32 │ │ ├── plat_common.c │ │ ├── platform_helpers.S │ │ ├── platform_mp_stack.S │ │ └── platform_up_stack.S │ ├── aarch64 │ │ ├── plat_common.c │ │ ├── plat_psci_common.c │ │ ├── platform_helpers.S │ │ ├── platform_mp_stack.S │ │ └── platform_up_stack.S │ ├── plat_bl1_common.c │ ├── plat_gic.c │ ├── plat_gicv2.c │ ├── plat_gicv3.c │ └── plat_psci_common.c ├── compat │ ├── aarch64 │ │ └── plat_helpers_compat.S │ ├── plat_compat.mk │ ├── plat_pm_compat.c │ └── plat_topology_compat.c ├── mediatek │ ├── common │ │ ├── custom │ │ │ ├── oem_svc.c │ │ │ └── oem_svc.h │ │ ├── drivers │ │ │ └── uart │ │ │ │ ├── 8250_console.S │ │ │ │ └── uart8250.h │ │ ├── mtk_plat_common.c │ │ ├── mtk_plat_common.h │ │ ├── mtk_sip_svc.c │ │ └── mtk_sip_svc.h │ ├── mt6795 │ │ ├── aarch64 │ │ │ └── plat_helpers.S │ │ ├── bl31.ld.S │ │ ├── bl31_plat_setup.c │ │ ├── drivers │ │ │ └── timer │ │ │ │ ├── mt_cpuxgpt.c │ │ │ │ └── mt_cpuxgpt.h │ │ ├── include │ │ │ ├── mcucfg.h │ │ │ ├── plat_macros.S │ │ │ ├── plat_private.h │ │ │ ├── plat_sip_calls.h │ │ │ ├── platform_def.h │ │ │ ├── power_tracer.h │ │ │ ├── scu.h │ │ │ └── spm.h │ │ ├── plat_delay_timer.c │ │ ├── plat_mt_gic.c │ │ ├── plat_pm.c │ │ ├── plat_topology.c │ │ ├── platform.mk │ │ ├── power_tracer.c │ │ └── scu.c │ └── mt8173 │ │ ├── aarch64 │ │ ├── plat_helpers.S │ │ └── platform_common.c │ │ ├── bl31_plat_setup.c │ │ ├── drivers │ │ ├── crypt │ │ │ ├── crypt.c │ │ │ └── crypt.h │ │ ├── mtcmos │ │ │ ├── mtcmos.c │ │ │ └── mtcmos.h │ │ ├── pmic │ │ │ ├── pmic_wrap_init.c │ │ │ └── pmic_wrap_init.h │ │ ├── rtc │ │ │ ├── rtc.c │ │ │ └── rtc.h │ │ ├── spm │ │ │ ├── spm.c │ │ │ ├── spm.h │ │ │ ├── spm_hotplug.c │ │ │ ├── spm_hotplug.h │ │ │ ├── spm_mcdi.c │ │ │ ├── spm_mcdi.h │ │ │ ├── spm_suspend.c │ │ │ └── spm_suspend.h │ │ └── timer │ │ │ ├── mt_cpuxgpt.c │ │ │ └── mt_cpuxgpt.h │ │ ├── include │ │ ├── mcucfg.h │ │ ├── mt8173_def.h │ │ ├── plat_macros.S │ │ ├── plat_private.h │ │ ├── plat_sip_calls.h │ │ ├── platform_def.h │ │ ├── power_tracer.h │ │ └── scu.h │ │ ├── plat_mt_gic.c │ │ ├── plat_pm.c │ │ ├── plat_sip_calls.c │ │ ├── plat_topology.c │ │ ├── platform.mk │ │ ├── power_tracer.c │ │ └── scu.c ├── nvidia │ └── tegra │ │ ├── common │ │ ├── aarch64 │ │ │ └── tegra_helpers.S │ │ ├── drivers │ │ │ ├── flowctrl │ │ │ │ └── flowctrl.c │ │ │ ├── memctrl │ │ │ │ └── memctrl.c │ │ │ └── pmc │ │ │ │ └── pmc.c │ │ ├── tegra_bl31_setup.c │ │ ├── tegra_common.mk │ │ ├── tegra_delay_timer.c │ │ ├── tegra_gic.c │ │ ├── tegra_pm.c │ │ ├── tegra_sip_calls.c │ │ └── tegra_topology.c │ │ ├── include │ │ ├── drivers │ │ │ ├── flowctrl.h │ │ │ ├── memctrl.h │ │ │ └── pmc.h │ │ ├── plat_macros.S │ │ ├── platform_def.h │ │ ├── t132 │ │ │ └── tegra_def.h │ │ ├── t210 │ │ │ └── tegra_def.h │ │ └── tegra_private.h │ │ ├── platform.mk │ │ └── soc │ │ ├── t132 │ │ ├── plat_psci_handlers.c │ │ ├── plat_secondary.c │ │ ├── plat_setup.c │ │ └── platform_t132.mk │ │ └── t210 │ │ ├── plat_psci_handlers.c │ │ ├── plat_secondary.c │ │ ├── plat_setup.c │ │ └── platform_t210.mk ├── qemu │ ├── aarch64 │ │ └── plat_helpers.S │ ├── dt.c │ ├── include │ │ ├── plat_macros.S │ │ └── platform_def.h │ ├── platform.mk │ ├── qemu_bl1_setup.c │ ├── qemu_bl2_setup.c │ ├── qemu_bl31_setup.c │ ├── qemu_common.c │ ├── qemu_gic.c │ ├── qemu_io_storage.c │ ├── qemu_pm.c │ ├── qemu_private.h │ └── topology.c ├── rockchip │ ├── common │ │ ├── aarch64 │ │ │ ├── plat_helpers.S │ │ │ └── platform_common.c │ │ ├── bl31_plat_setup.c │ │ ├── drivers │ │ │ └── pmu │ │ │ │ └── pmu_com.h │ │ ├── include │ │ │ ├── plat_macros.S │ │ │ ├── plat_params.h │ │ │ ├── plat_private.h │ │ │ └── rockchip_sip_svc.h │ │ ├── params_setup.c │ │ ├── plat_pm.c │ │ ├── plat_topology.c │ │ ├── pmusram │ │ │ ├── pmu_sram.c │ │ │ ├── pmu_sram.h │ │ │ └── pmu_sram_cpus_on.S │ │ ├── rockchip_gicv2.c │ │ ├── rockchip_gicv3.c │ │ └── rockchip_sip_svc.c │ ├── rk3368 │ │ ├── drivers │ │ │ ├── ddr │ │ │ │ ├── ddr_rk3368.c │ │ │ │ ├── ddr_rk3368.h │ │ │ │ └── rk3368_ddr_reg_resume_V1.05.bin │ │ │ ├── pmu │ │ │ │ ├── plat_pmu_macros.S │ │ │ │ ├── pmu.c │ │ │ │ └── pmu.h │ │ │ └── soc │ │ │ │ ├── soc.c │ │ │ │ └── soc.h │ │ ├── include │ │ │ ├── plat_sip_calls.h │ │ │ └── platform_def.h │ │ ├── plat_sip_calls.c │ │ ├── platform.mk │ │ └── rk3368_def.h │ └── rk3399 │ │ ├── drivers │ │ ├── dram │ │ │ ├── dcf_code.inc │ │ │ ├── dram.c │ │ │ ├── dram.h │ │ │ ├── dram_spec_timing.c │ │ │ └── dram_spec_timing.h │ │ ├── gpio │ │ │ └── rk3399_gpio.c │ │ ├── pmu │ │ │ ├── plat_pmu_macros.S │ │ │ ├── pmu.c │ │ │ └── pmu.h │ │ ├── pwm │ │ │ ├── pwm.c │ │ │ └── pwm.h │ │ └── soc │ │ │ ├── soc.c │ │ │ └── soc.h │ │ ├── include │ │ ├── plat_sip_calls.h │ │ └── platform_def.h │ │ ├── plat_sip_calls.c │ │ ├── platform.mk │ │ └── rk3399_def.h ├── rpi3 │ ├── aarch64 │ │ └── plat_helpers.S │ ├── include │ │ ├── plat_macros.S │ │ ├── platform_def.h │ │ └── rpi3_hw.h │ ├── platform.mk │ ├── rpi3_bl1_setup.c │ ├── rpi3_bl2_setup.c │ ├── rpi3_bl31_setup.c │ ├── rpi3_common.c │ ├── rpi3_io_storage.c │ ├── rpi3_pm.c │ ├── rpi3_private.h │ └── topology.c └── xilinx │ └── zynqmp │ ├── aarch64 │ ├── zynqmp_common.c │ └── zynqmp_helpers.S │ ├── bl31_zynqmp_setup.c │ ├── include │ ├── plat_macros.S │ └── platform_def.h │ ├── plat_psci.c │ ├── plat_startup.c │ ├── plat_topology.c │ ├── plat_zynqmp.c │ ├── platform.mk │ ├── pm_service │ ├── pm_api_sys.c │ ├── pm_api_sys.h │ ├── pm_client.c │ ├── pm_client.h │ ├── pm_common.h │ ├── pm_defs.h │ ├── pm_ipi.c │ ├── pm_ipi.h │ ├── pm_svc_main.c │ └── pm_svc_main.h │ ├── sip_svc_setup.c │ ├── tsp │ ├── tsp-zynqmp.mk │ └── tsp_plat_setup.c │ ├── zynqmp_def.h │ └── zynqmp_private.h ├── readme.md ├── readme_atf.md ├── services ├── spd │ ├── opteed │ │ ├── opteed.mk │ │ ├── opteed_common.c │ │ ├── opteed_helpers.S │ │ ├── opteed_main.c │ │ ├── opteed_pm.c │ │ ├── opteed_private.h │ │ ├── teesmc_opteed.h │ │ └── teesmc_opteed_macros.h │ ├── tlkd │ │ ├── tlkd.mk │ │ ├── tlkd_common.c │ │ ├── tlkd_helpers.S │ │ ├── tlkd_main.c │ │ ├── tlkd_pm.c │ │ └── tlkd_private.h │ └── tspd │ │ ├── tspd.mk │ │ ├── tspd_common.c │ │ ├── tspd_helpers.S │ │ ├── tspd_main.c │ │ ├── tspd_pm.c │ │ └── tspd_private.h └── std_svc │ └── std_svc_setup.c └── tools ├── cert_create ├── Makefile ├── include │ ├── cert.h │ ├── cmd_opt.h │ ├── debug.h │ ├── ext.h │ ├── key.h │ ├── sha.h │ └── tbbr │ │ ├── tbb_cert.h │ │ ├── tbb_ext.h │ │ └── tbb_key.h └── src │ ├── cert.c │ ├── cmd_opt.c │ ├── ext.c │ ├── key.c │ ├── main.c │ ├── sha.c │ └── tbbr │ ├── tbb_cert.c │ ├── tbb_ext.c │ └── tbb_key.c └── fiptool ├── Makefile ├── fip_create.sh ├── fiptool.c ├── fiptool.h ├── tbbr_config.c └── tbbr_config.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore miscellaneous files 2 | cscope.* 3 | *.swp 4 | *.patch 5 | .project 6 | .cproject 7 | 8 | # Ignore build directory 9 | build/ 10 | 11 | # Ignore build products from tools 12 | tools/**/*.o 13 | tools/fip_create/ 14 | tools/fiptool/fiptool 15 | tools/fiptool/fiptool.exe 16 | tools/cert_create/src/*.o 17 | tools/cert_create/src/**/*.o 18 | tools/cert_create/cert_create 19 | tools/cert_create/cert_create.exe 20 | 21 | # Ignore header files copied. 22 | tools/fiptool/firmware_image_package.h 23 | tools/fiptool/uuid.h 24 | -------------------------------------------------------------------------------- /acknowledgements.md: -------------------------------------------------------------------------------- 1 | Contributor Acknowledgements 2 | ============================ 3 | 4 | Companies 5 | --------- 6 | Linaro Limited 7 | 8 | NVIDIA Corporation 9 | 10 | Xilinx, Inc. 11 | 12 | Individuals 13 | ----------- 14 | -------------------------------------------------------------------------------- /bl1/aarch32/bl1_arch_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | /******************************************************************************* 33 | * TODO: Function that does the first bit of architectural setup. 34 | ******************************************************************************/ 35 | void bl1_arch_setup(void) 36 | { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /bl1/bl1.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | BL1_SOURCES += bl1/bl1_main.c \ 32 | bl1/${ARCH}/bl1_arch_setup.c \ 33 | bl1/${ARCH}/bl1_context_mgmt.c \ 34 | bl1/${ARCH}/bl1_entrypoint.S \ 35 | bl1/${ARCH}/bl1_exceptions.S \ 36 | lib/cpus/${ARCH}/cpu_helpers.S \ 37 | lib/el3_runtime/${ARCH}/context_mgmt.c \ 38 | plat/common/plat_bl1_common.c 39 | 40 | 41 | ifeq (${ARCH},aarch64) 42 | BL1_SOURCES += lib/el3_runtime/aarch64/context.S 43 | endif 44 | 45 | ifeq (${TRUSTED_BOARD_BOOT},1) 46 | BL1_SOURCES += bl1/bl1_fwu.c 47 | endif 48 | 49 | BL1_LINKERFILE := bl1/bl1.ld.S 50 | -------------------------------------------------------------------------------- /bl2/aarch32/bl2_arch_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | /******************************************************************************* 33 | * Place holder function to perform any Secure SVC specific architectural 34 | * setup. At the moment there is nothing to do. 35 | ******************************************************************************/ 36 | void bl2_arch_setup(void) 37 | { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /bl2/aarch64/bl2_arch_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | /******************************************************************************* 35 | * Place holder function to perform any S-EL1 specific architectural setup. At 36 | * the moment there is nothing to do. 37 | ******************************************************************************/ 38 | void bl2_arch_setup(void) 39 | { 40 | /* Give access to FP/SIMD registers */ 41 | write_cpacr(CPACR_EL1_FPEN(CPACR_EL1_FP_TRAP_NONE)); 42 | } 43 | -------------------------------------------------------------------------------- /bl2/bl2.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | BL2_SOURCES += bl2/bl2_main.c \ 32 | bl2/${ARCH}/bl2_entrypoint.S \ 33 | bl2/${ARCH}/bl2_arch_setup.c \ 34 | lib/locks/exclusive/${ARCH}/spinlock.S 35 | 36 | ifeq (${ARCH},aarch64) 37 | BL2_SOURCES += common/aarch64/early_exceptions.S 38 | endif 39 | 40 | ifeq (${LOAD_IMAGE_V2},1) 41 | BL2_SOURCES += bl2/bl2_image_load_v2.c 42 | else 43 | BL2_SOURCES += bl2/bl2_image_load.c 44 | endif 45 | 46 | BL2_LINKERFILE := bl2/bl2.ld.S 47 | -------------------------------------------------------------------------------- /bl2/bl2_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __BL2_PRIVATE_H__ 32 | #define __BL2_PRIVATE_H__ 33 | 34 | /****************************************** 35 | * Forward declarations 36 | *****************************************/ 37 | struct entry_point_info; 38 | 39 | /****************************************** 40 | * Function prototypes 41 | *****************************************/ 42 | void bl2_arch_setup(void); 43 | struct entry_point_info *bl2_load_images(void); 44 | 45 | #endif /* __BL2_PRIVATE_H__ */ 46 | -------------------------------------------------------------------------------- /bl2u/bl2u.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | BL2U_SOURCES += bl2u/bl2u_main.c \ 32 | bl2u/aarch64/bl2u_entrypoint.S \ 33 | common/aarch64/early_exceptions.S 34 | 35 | BL2U_LINKERFILE := bl2u/bl2u.ld.S 36 | -------------------------------------------------------------------------------- /bl32/sp_min/sp_min_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __SP_MIN_H__ 32 | #define __SP_MIN_H__ 33 | 34 | void sp_min_warm_entrypoint(void); 35 | void sp_min_main(void); 36 | void sp_min_warm_boot(void); 37 | 38 | #endif /* __SP_MIN_H__ */ 39 | -------------------------------------------------------------------------------- /dco.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /docs/diagrams/default_reset_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/default_reset_code.png -------------------------------------------------------------------------------- /docs/diagrams/fwu_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/fwu_flow.png -------------------------------------------------------------------------------- /docs/diagrams/fwu_states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/fwu_states.png -------------------------------------------------------------------------------- /docs/diagrams/generate_reset_images.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # 4 | # This script generates the image files used in the ARM Trusted Firmware Reset 5 | # Design document from the 'reset_code_flow.dia' file. 6 | # 7 | # The PNG files in the present directory have been generated using Dia version 8 | # 0.97.2, which can be obtained from https://wiki.gnome.org/Apps/Dia/Download 9 | # 10 | 11 | set -e 12 | 13 | # Usage: generate_image 14 | function generate_image 15 | { 16 | dia \ 17 | --show-layers=$1 \ 18 | --filter=png \ 19 | --export=$2 \ 20 | reset_code_flow.dia 21 | 22 | } 23 | 24 | # The 'reset_code_flow.dia' file is organized in several layers. 25 | # Each image is generated by combining and exporting the appropriate set of 26 | # layers. 27 | generate_image \ 28 | Frontground,Background,cpu_type_check,boot_type_check \ 29 | default_reset_code.png 30 | 31 | generate_image \ 32 | Frontground,Background,no_cpu_type_check,boot_type_check \ 33 | reset_code_no_cpu_check.png 34 | 35 | generate_image \ 36 | Frontground,Background,cpu_type_check,no_boot_type_check \ 37 | reset_code_no_boot_type_check.png 38 | 39 | generate_image \ 40 | Frontground,Background,no_cpu_type_check,no_boot_type_check \ 41 | reset_code_no_checks.png 42 | -------------------------------------------------------------------------------- /docs/diagrams/non-sec-int-handling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/non-sec-int-handling.png -------------------------------------------------------------------------------- /docs/diagrams/psci-suspend-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/psci-suspend-sequence.png -------------------------------------------------------------------------------- /docs/diagrams/reset_code_flow.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/reset_code_flow.dia -------------------------------------------------------------------------------- /docs/diagrams/reset_code_no_boot_type_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/reset_code_no_boot_type_check.png -------------------------------------------------------------------------------- /docs/diagrams/reset_code_no_checks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/reset_code_no_checks.png -------------------------------------------------------------------------------- /docs/diagrams/reset_code_no_cpu_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/reset_code_no_cpu_check.png -------------------------------------------------------------------------------- /docs/diagrams/rt-svc-descs-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/rt-svc-descs-layout.png -------------------------------------------------------------------------------- /docs/diagrams/sec-int-handling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/docs/diagrams/sec-int-handling.png -------------------------------------------------------------------------------- /docs/plat/qemu.md: -------------------------------------------------------------------------------- 1 | ARM Trusted Firmware for QEMU virt ARMv8-A 2 | ========================================== 3 | 4 | ARM Trusted Firmware implements the EL3 firmware layer for QEMU virt 5 | ARMv8-A. BL1 is used as the BootROM, supplied with the -bios argument. 6 | When QEMU starts all CPUs are released simultaneously, BL1 selects a 7 | primary CPU to handle the boot and the secondaries are placed in a polling 8 | loop to be released by normal world via PSCI. 9 | 10 | BL2 edits the Flattened Device Tree, FDT, generated by QEMU at run-time to 11 | add a node describing PSCI and also enable methods for the CPUs. 12 | 13 | An ARM64 defonfig v4.5 Linux kernel is known to boot, FTD doesn't need to be 14 | provided as it's generated by QEMU. 15 | 16 | Current limitations: 17 | * Only cold boot is supported 18 | * No build instructions for QEMU_EFI.fd and rootfs-arm64.cpio.gz 19 | * No instructions for how to load a BL32 (Secure Payload) 20 | 21 | `QEMU_EFI.fd` can be dowloaded from 22 | http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-KERNEL-AARCH64/RELEASE_GCC49/QEMU_EFI.fd 23 | 24 | Boot binaries, except BL1, are primarily loaded via semi-hosting so all 25 | binaries has to reside in the same directory as QEMU is started from. This 26 | is conveniently achieved with symlinks the local names as: 27 | * `bl2.bin` -> BL2 28 | * `bl31.bin` -> BL31 29 | * `bl33.bin` -> BL33 (`QEMU_EFI.fd`) 30 | * `Image` -> linux/Image 31 | 32 | To build: 33 | ``` 34 | make CROSS_COMPILE=aarch64-none-elf- PLAT=qemu 35 | ``` 36 | 37 | To start (QEMU v2.6.0): 38 | ``` 39 | qemu-system-aarch64 -nographic -machine virt,secure=on -cpu cortex-a57 \ 40 | -kernel Image \ 41 | -append console=ttyAMA0,38400 keep_bootcon root=/dev/vda2 \ 42 | -initrd rootfs-arm64.cpio.gz -smp 2 -m 1024 -bios bl1.bin \ 43 | -d unimp -semihosting-config enable,target=native 44 | ``` 45 | -------------------------------------------------------------------------------- /docs/spd/optee-dispatcher.md: -------------------------------------------------------------------------------- 1 | OP-TEE Dispatcher 2 | ================= 3 | 4 | [OP-TEE OS] is a Trusted OS running as Secure EL1. 5 | 6 | To build and execute [OP-TEE OS] follow the instructions at 7 | [ARM Trusted Firmware with OP-TEE] [OP-TEE OS] 8 | 9 | - - - - - - - - - - - - - - - - - - - - - - - - - - 10 | 11 | _Copyright (c) 2014, ARM Limited and Contributors. All rights reserved._ 12 | 13 | [OP-TEE OS]: http://github.com/OP-TEE/optee_os/tree/master/documentation/arm_trusted_firmware.md 14 | -------------------------------------------------------------------------------- /drivers/arm/pl011/pl011_console.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/pl011_console.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/arm/tzc400/tzc400.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if ERROR_DEPRECATED 32 | #error "Using deprecated TZC-400 source file" 33 | #else 34 | #include "../tzc/tzc400.c" 35 | #endif /* ERROR_DEPRECATED */ 36 | -------------------------------------------------------------------------------- /drivers/auth/mbedtls/mbedtls_x509.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | include drivers/auth/mbedtls/mbedtls_common.mk 32 | 33 | MBEDTLS_X509_SOURCES := drivers/auth/mbedtls/mbedtls_x509_parser.c \ 34 | $(addprefix ${MBEDTLS_DIR}/library/, \ 35 | x509.c \ 36 | x509_crt.c \ 37 | ) 38 | 39 | BL1_SOURCES += ${MBEDTLS_X509_SOURCES} 40 | BL2_SOURCES += ${MBEDTLS_X509_SOURCES} 41 | -------------------------------------------------------------------------------- /drivers/cadence/uart/cdns_console.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/cdns_console.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/console/console.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/console.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/console/skeleton_console.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/skeleton_console.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/ti/uart/16550_console.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/16550_console.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /fdts/fvp-base-gicv2-psci-aarch32.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-base-gicv2-psci-aarch32.dtb -------------------------------------------------------------------------------- /fdts/fvp-base-gicv2-psci.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-base-gicv2-psci.dtb -------------------------------------------------------------------------------- /fdts/fvp-base-gicv3-psci-aarch32.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-base-gicv3-psci-aarch32.dtb -------------------------------------------------------------------------------- /fdts/fvp-base-gicv3-psci.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-base-gicv3-psci.dtb -------------------------------------------------------------------------------- /fdts/fvp-foundation-gicv2-psci.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-foundation-gicv2-psci.dtb -------------------------------------------------------------------------------- /fdts/fvp-foundation-gicv3-psci.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/fdts/fvp-foundation-gicv3-psci.dtb -------------------------------------------------------------------------------- /include/bl1/tbbr/tbbr_img_desc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __TBBR_IMG_DESC_H__ 32 | #define __TBBR_IMG_DESC_H__ 33 | 34 | #include 35 | 36 | extern image_desc_t bl1_tbbr_image_descs[]; 37 | 38 | #endif /* __TBBR_IMG_DESC_H__ */ 39 | -------------------------------------------------------------------------------- /include/bl32/tsp/platform_tsp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __PLATFORM_TSP_H__ 32 | 33 | 34 | /******************************************************************************* 35 | * Mandatory TSP functions (only if platform contains a TSP) 36 | ******************************************************************************/ 37 | void tsp_early_platform_setup(void); 38 | void tsp_plat_arch_setup(void); 39 | void tsp_platform_setup(void); 40 | 41 | 42 | #define __PLATFORM_H__ 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/common/tbbr/cot_def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __COT_DEF_H__ 32 | #define __COT_DEF_H__ 33 | 34 | /* TBBR CoT definitions */ 35 | 36 | #define COT_MAX_VERIFIED_PARAMS 4 37 | 38 | #endif /* __COT_DEF_H__ */ 39 | -------------------------------------------------------------------------------- /include/drivers/arm/nic_400.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __NIC_400_H__ 32 | #define __NIC_400_H__ 33 | 34 | /* 35 | * Address of slave 'n' security setting in the NIC-400 address region 36 | * control 37 | */ 38 | #define NIC400_ADDR_CTRL_SECURITY_REG(n) (0x8 + (n) * 4) 39 | 40 | #endif /* __NIC_400_H__ */ 41 | -------------------------------------------------------------------------------- /include/drivers/arm/pl061_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __PL061_GPIO_H__ 32 | #define __PL061_GPIO_H__ 33 | 34 | #include 35 | 36 | void pl061_gpio_register(uintptr_t base_addr, int gpio_dev); 37 | void pl061_gpio_init(void); 38 | 39 | #endif /* __PL061_GPIO_H__ */ 40 | -------------------------------------------------------------------------------- /include/drivers/auth/mbedtls/mbedtls_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __MBEDTLS_COMMON_H__ 32 | #define __MBEDTLS_COMMON_H__ 33 | 34 | void mbedtls_init(void); 35 | 36 | #endif /* __MBEDTLS_COMMON_H__ */ 37 | -------------------------------------------------------------------------------- /include/drivers/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __CONSOLE_H__ 32 | #define __CONSOLE_H__ 33 | 34 | #include 35 | 36 | int console_init(uintptr_t base_addr, 37 | unsigned int uart_clk, unsigned int baud_rate); 38 | void console_uninit(void); 39 | int console_putc(int c); 40 | int console_getc(void); 41 | 42 | #endif /* __CONSOLE_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /include/drivers/generic_delay_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __GENERIC_DELAY_TIMER_H__ 32 | #define __GENERIC_DELAY_TIMER_H__ 33 | 34 | #include 35 | 36 | void generic_delay_timer_init_args(uint32_t mult, uint32_t div); 37 | 38 | void generic_delay_timer_init(void); 39 | 40 | #endif /* __GENERIC_DELAY_TIMER_H__ */ 41 | -------------------------------------------------------------------------------- /include/drivers/io/io_dummy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __IO_DUMMY_H__ 32 | #define __IO_DUMMY_H__ 33 | 34 | int register_io_dev_dummy(const struct io_dev_connector **dev_con); 35 | 36 | #endif /* __IO_DUMMY_H__ */ 37 | -------------------------------------------------------------------------------- /include/drivers/io/io_fip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __IO_FIP_H__ 32 | #define __IO_FIP_H__ 33 | 34 | struct io_dev_connector; 35 | 36 | int register_io_dev_fip(const struct io_dev_connector **dev_con); 37 | 38 | #endif /* __IO_FIP_H__ */ 39 | -------------------------------------------------------------------------------- /include/drivers/io/io_memmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __IO_MEMMAP_H__ 32 | #define __IO_MEMMAP_H__ 33 | 34 | struct io_dev_connector; 35 | 36 | int register_io_dev_memmap(const struct io_dev_connector **dev_con); 37 | 38 | #endif /* __IO_MEMMAP_H__ */ 39 | -------------------------------------------------------------------------------- /include/drivers/io/io_semihosting.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __IO_SH_H__ 32 | #define __IO_SH_H__ 33 | 34 | struct io_dev_connector; 35 | 36 | int register_io_dev_sh(const struct io_dev_connector **dev_con); 37 | 38 | #endif /* __IO_SH_H__ */ 39 | -------------------------------------------------------------------------------- /include/lib/cpus/aarch32/aem_generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __AEM_GENERIC_H__ 32 | #define __AEM_GENERIC_H__ 33 | 34 | /* BASE AEM midr for revision 0 */ 35 | #define BASE_AEM_MIDR 0x410FD0F0 36 | 37 | #endif /* __AEM_GENERIC_H__ */ 38 | -------------------------------------------------------------------------------- /include/lib/cpus/aarch64/aem_generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __AEM_GENERIC_H__ 32 | #define __AEM_GENERIC_H__ 33 | 34 | /* BASE AEM midr for revision 0 */ 35 | #define BASE_AEM_MIDR 0x410FD0F0 36 | 37 | /* Foundation AEM midr for revision 0 */ 38 | #define FOUNDATION_AEM_MIDR 0x410FD000 39 | 40 | 41 | #endif /* __AEM_GENERIC_H__ */ 42 | -------------------------------------------------------------------------------- /include/lib/cpus/aarch64/denver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __DENVER_H__ 32 | #define __DENVER_H__ 33 | 34 | /* MIDR for Denver v1.0 */ 35 | #define DENVER_1_0_MIDR 0x4E0F0000 36 | 37 | /* CPU state ids - implementation defined */ 38 | #define DENVER_CPU_STATE_POWER_DOWN 0x3 39 | 40 | #endif /* __DENVER_H__ */ 41 | -------------------------------------------------------------------------------- /include/lib/spinlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __SPINLOCK_H__ 32 | #define __SPINLOCK_H__ 33 | 34 | typedef struct spinlock { 35 | volatile unsigned int lock; 36 | } spinlock_t; 37 | 38 | void spin_lock(spinlock_t *lock); 39 | void spin_unlock(spinlock_t *lock); 40 | 41 | #endif /* __SPINLOCK_H__ */ 42 | -------------------------------------------------------------------------------- /include/lib/stdlib/inttypes.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD$ 27 | */ 28 | 29 | #ifndef _INTTYPES_H_ 30 | #define _INTTYPES_H_ 31 | 32 | #include 33 | #include 34 | 35 | typedef struct { 36 | intmax_t quot; /* Quotient. */ 37 | intmax_t rem; /* Remainder. */ 38 | } imaxdiv_t; 39 | 40 | __BEGIN_DECLS 41 | #ifdef _XLOCALE_H_ 42 | #include 43 | #endif 44 | intmax_t imaxabs(intmax_t) __pure2; 45 | imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; 46 | 47 | intmax_t strtoimax(const char *__restrict, char **__restrict, int); 48 | uintmax_t strtoumax(const char *__restrict, char **__restrict, int); 49 | 50 | __END_DECLS 51 | 52 | #endif /* !_INTTYPES_H_ */ 53 | -------------------------------------------------------------------------------- /include/lib/stdlib/machine/_inttypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _MACHINE_INTTYPES_H_ 32 | #define _MACHINE_INTTYPES_H_ 33 | 34 | /* 35 | * Trusted Firmware does not depend on any definitions in this file. Content 36 | * will be added as needed. 37 | */ 38 | 39 | #endif /* !_MACHINE_INTTYPES_H_ */ 40 | -------------------------------------------------------------------------------- /include/lib/stdlib/sys/_null.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Marcel Moolenaar 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * $FreeBSD$ 27 | */ 28 | 29 | #ifndef NULL 30 | 31 | #if !defined(__cplusplus) 32 | #define NULL ((void *)0) 33 | #else 34 | #if __cplusplus >= 201103L 35 | #define NULL nullptr 36 | #elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 37 | #define NULL __null 38 | #else 39 | #if defined(__LP64__) 40 | #define NULL (0L) 41 | #else 42 | #define NULL 0 43 | #endif /* __LP64__ */ 44 | #endif /* __GNUG__ */ 45 | #endif /* !__cplusplus */ 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/lib/stdlib/xlocale/_strings.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011, 2012 The FreeBSD Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD$ 27 | */ 28 | 29 | #ifndef _LOCALE_T_DEFINED 30 | #define _LOCALE_T_DEFINED 31 | typedef struct _xlocale *locale_t; 32 | #endif 33 | 34 | /* 35 | * This file is included from both strings.h and xlocale.h. We need to expose 36 | * the declarations unconditionally if we are included from xlocale.h, but only 37 | * if we are in POSIX2008 mode if included from string.h. 38 | */ 39 | 40 | #ifndef _XLOCALE_STRINGS1_H 41 | #define _XLOCALE_STRINGS1_H 42 | 43 | /* 44 | * POSIX2008 functions 45 | */ 46 | int strcasecmp_l(const char *, const char *, locale_t); 47 | int strncasecmp_l(const char *, const char *, size_t, locale_t); 48 | #endif /* _XLOCALE_STRINGS1_H */ 49 | -------------------------------------------------------------------------------- /include/plat/arm/soc/common/soc_css.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __SOC_CSS_H__ 32 | #define __SOC_CSS_H__ 33 | 34 | /* 35 | * Utility functions for ARM CSS SoCs 36 | */ 37 | void soc_css_init_nic400(void); 38 | void soc_css_init_pcie(void); 39 | 40 | static inline void soc_css_security_setup(void) 41 | { 42 | soc_css_init_nic400(); 43 | soc_css_init_pcie(); 44 | } 45 | 46 | 47 | #endif /* __SOC_CSS_H__ */ 48 | -------------------------------------------------------------------------------- /lib/aarch64/xlat_tables.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | /* 32 | * This file is deprecated and is retained here only for compatibility. 33 | * The xlat_tables library can be found in `lib/xlat_tables` directory. 34 | */ 35 | #if !ERROR_DEPRECATED 36 | #include "../xlat_tables/xlat_tables_common.c" 37 | #include "../xlat_tables/aarch64/xlat_tables.c" 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/el3_runtime/cpu_data_array.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | /* The per_cpu_ptr_cache_t space allocation */ 36 | cpu_data_t percpu_data[PLATFORM_CORE_COUNT]; 37 | -------------------------------------------------------------------------------- /lib/libfdt/libfdt.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | LIBFDT_SRCS := $(addprefix lib/libfdt/, \ 32 | fdt.c \ 33 | fdt_addresses.c \ 34 | fdt_empty_tree.c \ 35 | fdt_ro.c \ 36 | fdt_rw.c \ 37 | fdt_strerror.c \ 38 | fdt_sw.c \ 39 | fdt_wip.c) \ 40 | 41 | INCLUDES += -Iinclude/lib/libfdt 42 | -------------------------------------------------------------------------------- /lib/locks/exclusive/aarch32/spinlock.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | .globl spin_lock 34 | .globl spin_unlock 35 | 36 | 37 | func spin_lock 38 | mov r2, #1 39 | 1: 40 | ldrex r1, [r0] 41 | cmp r1, #0 42 | wfene 43 | strexeq r1, r2, [r0] 44 | cmpeq r1, #0 45 | bne 1b 46 | dmb 47 | bx lr 48 | endfunc spin_lock 49 | 50 | 51 | func spin_unlock 52 | mov r1, #0 53 | stl r1, [r0] 54 | bx lr 55 | endfunc spin_unlock 56 | -------------------------------------------------------------------------------- /lib/locks/exclusive/aarch64/spinlock.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | .globl spin_lock 34 | .globl spin_unlock 35 | 36 | 37 | func spin_lock 38 | mov w2, #1 39 | sevl 40 | l1: wfe 41 | l2: ldaxr w1, [x0] 42 | cbnz w1, l1 43 | stxr w1, w2, [x0] 44 | cbnz w1, l2 45 | ret 46 | endfunc spin_lock 47 | 48 | 49 | func spin_unlock 50 | stlr wzr, [x0] 51 | ret 52 | endfunc spin_unlock 53 | -------------------------------------------------------------------------------- /lib/locks/exclusive/spinlock.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "./aarch64/spinlock.S" 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/semihosting/aarch32/semihosting_call.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | .globl semihosting_call 34 | 35 | func semihosting_call 36 | svc #0x123456 37 | bx lr 38 | endfunc semihosting_call 39 | -------------------------------------------------------------------------------- /lib/semihosting/aarch64/semihosting_call.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | .globl semihosting_call 34 | 35 | func semihosting_call 36 | hlt #0xf000 37 | ret 38 | endfunc semihosting_call 39 | -------------------------------------------------------------------------------- /lib/stdlib/abort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | /* 34 | * This is a basic implementation. This could be improved. 35 | */ 36 | void abort (void) 37 | { 38 | ERROR("ABORT\n"); 39 | panic(); 40 | } 41 | -------------------------------------------------------------------------------- /lib/stdlib/assert.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | /* 34 | * This is a basic implementation. This could be improved. 35 | */ 36 | void __assert (const char *function, const char *file, unsigned int line, 37 | const char *assertion) 38 | { 39 | tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion); 40 | while(1); 41 | } 42 | -------------------------------------------------------------------------------- /lib/stdlib/exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | void exit(int v) 34 | { 35 | ERROR("EXIT\n"); 36 | panic(); 37 | } 38 | -------------------------------------------------------------------------------- /lib/stdlib/putchar.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | /* Putchar() should either return the character printed or EOF in case of error. 35 | * Our current console_putc() function assumes success and returns the 36 | * character. Write all other printing functions in terms of putchar(), if 37 | * possible, so they all benefit when this is improved. 38 | */ 39 | int putchar(int c) 40 | { 41 | int res; 42 | if (console_putc((unsigned char)c) >= 0) 43 | res = c; 44 | else 45 | res = EOF; 46 | 47 | return res; 48 | } 49 | -------------------------------------------------------------------------------- /lib/stdlib/puts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | int puts(const char *s) 34 | { 35 | int count = 0; 36 | while(*s) 37 | { 38 | if (putchar(*s++) != EOF) { 39 | count++; 40 | } else { 41 | count = EOF; 42 | break; 43 | } 44 | } 45 | 46 | /* According to the puts(3) manpage, the function should write a 47 | * trailing newline. 48 | */ 49 | if ((count != EOF) && (putchar('\n') != EOF)) 50 | count++; 51 | else 52 | count = EOF; 53 | 54 | return count; 55 | } 56 | -------------------------------------------------------------------------------- /lib/stdlib/sscanf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | /* 34 | * TODO: This is not a real implementation of the sscanf() function. It just 35 | * returns the number of expected arguments based on the number of '%' found 36 | * in the format string. 37 | */ 38 | int 39 | sscanf(const char *__restrict str, char const *__restrict fmt, ...) 40 | { 41 | int ret = 0; 42 | 43 | while (*fmt != '\0') { 44 | if (*fmt++ == '%') { 45 | ret++; 46 | } 47 | } 48 | 49 | return ret; 50 | } 51 | -------------------------------------------------------------------------------- /lib/stdlib/stdlib.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | STDLIB_SRCS := $(addprefix lib/stdlib/, \ 32 | abort.c \ 33 | assert.c \ 34 | exit.c \ 35 | mem.c \ 36 | printf.c \ 37 | putchar.c \ 38 | puts.c \ 39 | sscanf.c \ 40 | strchr.c \ 41 | strcmp.c \ 42 | strlen.c \ 43 | strncmp.c \ 44 | subr_prf.c) 45 | 46 | INCLUDES += -Iinclude/lib/stdlib \ 47 | -Iinclude/lib/stdlib/sys 48 | -------------------------------------------------------------------------------- /lib/stdlib/strchr.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | 30 | /* 31 | * Portions copyright (c) 2013-2014, ARM Limited and Contributors. 32 | * All rights reserved. 33 | */ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | char * 40 | strchr(const char *p, int ch) 41 | { 42 | char c; 43 | 44 | c = ch; 45 | for (;; ++p) { 46 | if (*p == c) 47 | return ((char *)p); 48 | if (*p == '\0') 49 | return (NULL); 50 | } 51 | /* NOTREACHED */ 52 | } 53 | -------------------------------------------------------------------------------- /lib/stdlib/strlen.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | 30 | /* 31 | * Portions copyright (c) 2009-2014, ARM Limited and Contributors. All rights reserved. 32 | */ 33 | 34 | #include 35 | 36 | size_t 37 | strlen(str) 38 | const char *str; 39 | { 40 | register const char *s; 41 | 42 | for (s = str; *s; ++s); 43 | return(s - str); 44 | } 45 | -------------------------------------------------------------------------------- /lib/stdlib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | 30 | /* 31 | * Portions copyright (c) 2014, ARM Limited and Contributors. 32 | * All rights reserved. 33 | */ 34 | 35 | #include 36 | #include 37 | 38 | int 39 | strncmp(const char *s1, const char *s2, size_t n) 40 | { 41 | 42 | if (n == 0) 43 | return 0; 44 | do { 45 | if (*s1 != *s2++) 46 | return (*(const unsigned char *)s1 - 47 | *(const unsigned char *)(s2 - 1)); 48 | if (*s1++ == '\0') 49 | break; 50 | } while (--n != 0); 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /lib/xlat_tables/xlat_tables_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __XLAT_TABLES_PRIVATE_H__ 32 | #define __XLAT_TABLES_PRIVATE_H__ 33 | 34 | #include 35 | #include 36 | 37 | /* The virtual address space size must be a power of two. */ 38 | CASSERT(IS_POWER_OF_TWO(ADDR_SPACE_SIZE), assert_valid_addr_space_size); 39 | 40 | void print_mmap(void); 41 | void init_xlation_table(uintptr_t base_va, uint64_t *table, 42 | int level, uintptr_t *max_va, 43 | unsigned long long *max_pa); 44 | 45 | #endif /* __XLAT_TABLES_PRIVATE_H__ */ 46 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above copyright notice, this 10 | list of conditions and the following disclaimer in the documentation and/or 11 | other materials provided with the distribution. 12 | 13 | * Neither the name of ARM nor the names of its contributors may be used to 14 | endorse or promote products derived from this software without specific prior 15 | written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /make_helpers/cygwin.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | # 31 | 32 | # OS specific definitions for builds in a Cygwin environment. 33 | # Cygwin allows us to use unix style commands on a windows platform. 34 | 35 | ifndef CYGWIN_MK 36 | CYGWIN_MK := $(lastword $(MAKEFILE_LIST)) 37 | 38 | include ${MAKE_HELPERS_DIRECTORY}unix.mk 39 | 40 | # In cygwin executable files have the Windows .exe extension type. 41 | BIN_EXT := .exe 42 | 43 | endif 44 | -------------------------------------------------------------------------------- /make_helpers/msys.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | # 31 | 32 | # OS specific definitions for builds in a Mingw32 MSYS environment. 33 | # Mingw32 allows us to use some unix style commands on a windows platform. 34 | 35 | ifndef MSYS_MK 36 | MSYS_MK := $(lastword $(MAKEFILE_LIST)) 37 | 38 | include ${MAKE_HELPERS_DIRECTORY}unix.mk 39 | 40 | # In MSYS executable files have the Windows .exe extension type. 41 | BIN_EXT := .exe 42 | 43 | endif 44 | 45 | -------------------------------------------------------------------------------- /plat/arm/board/common/board_css.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | PLAT_BL_COMMON_SOURCES += plat/arm/board/common/board_css_common.c 32 | 33 | include plat/arm/board/common/board_common.mk 34 | -------------------------------------------------------------------------------- /plat/arm/board/common/rotpk/arm_rotpk_rsa.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/plat/arm/board/common/rotpk/arm_rotpk_rsa.der -------------------------------------------------------------------------------- /plat/arm/board/common/rotpk/arm_rotpk_rsa_sha256.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreiw/raspberry-pi3-atf/8e83d96b19d75cd19d683fc01cd0d538da90629d/plat/arm/board/common/rotpk/arm_rotpk_rsa_sha256.bin -------------------------------------------------------------------------------- /plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDLLGDVjWPUB3l+ 3 | xxaWvU0kTqyG5rdx48VUC+cUHL0pGsE/erYCqqs2xNk2aWziZcObsb89qFYmy/0E 4 | AbqsPlQyynleu7IF6gZY8nS64fSHwBkKH2YHd4SDoRzv/yhZ58NofSYgQ+tWY/M5 5 | MdgrUam8T9D23pXcX1vB7ZBv7CiRfhfteJD0YKfEx09Q7V0TOiErcMVhewghZTrN 6 | glaMekesieilSEgx2R1G5YWGmKDlwKZqvQfkkldhB499Wk3Krja5VgQQ8my+9jts 7 | gD6+DqNNx9R+p0nU8tK8zzCo53SPZN+8XEdozEBM+IPMy0A1BGDKs6QXnwPKHVr6 8 | 0a8hVxDTAgMBAAECggEAfwsc8ewbhDW4TwIGqfNtDUr0rtYN13VpqohW0ki2L8G/ 9 | HQaKUViO/wxQFqoNn/OqQO0AfHmKhXAAokTCiXngBHJ/OjF7vB7+IRhazZEE6u2/ 10 | uoivr/OYNQbFpXyTqsQ1eFzpPju6KKcPK7BzT4Mc89ek/vloFAi8w6LdMl8lbvOg 11 | LBWqX+5A+UQoenPUTvYM4U22YNcEAWubkpsYAmViiWiac+a+uPRk39aKyfOedDNu 12 | +ty9MtCwekivoUTfP/1+O+jFlDnPMJUOEkBmcBqxseYYAHu7blBpdHxYpAItC2pv 13 | YwJJSvsE+HLBLPk177Jahg7sOUqcP0F/X+T65yuvIQKBgQDxdjXdJT5K8j7rG2fv 14 | 2bvF2H1GPaHaTYRk0EGI2Ql6Nn+ddfeCE6gaT7aPPgg87wAhNu93coFuYHw0p/sc 15 | ZkXMJ+BmlstPV555cWXmwcxZLsni0fOXrt4YxwWkZwmh74m0NVM/cSFw56PU0oj1 16 | yDNeq3fgmsJocmuNTe1eG9qA7QKBgQDXaAGrNA5Xel5mqqMYTHHQWI6l2uzdNtt7 17 | eDn3K9+Eh3ywTqrwP845MAjKDU2Lq61I6t2H89dEifHq823VIcLCHd9BF04MrAH7 18 | qDPzrmPP2iB9g+YFmGBKe+K0HFE1t1KrTlo9VV6ZAC6RJNLAgwD4kvfIVYNkCGwe 19 | +hoZBdhgvwKBgBrOsPQ4ak4PzwRzKnrqhXpVqrLdrNZ7vLMkm+IBlpfG7SwiKLR8 20 | UjF5oB8PGAML1cvaOYPdZplGhQOjkrF4eU9NLhC1tSS96Y46FMIlyfYsx6UzAgRZ 21 | GbdOgUXbWqpr2bH0KaXlfXz3eqzqIuKGs41TJB//jo3iBibN/AhytzORAoGAeGov 22 | 5KDpE4XYl9Pz8HVremjG9Xh4yQENmOwQm1fvT4rd7UFM1ZkVk2qCv1DIdLe32vdQ 23 | d9ucDzh+ADWsxGRnF1TTpPN+Mh9FzISu5h4qtdreJsxBHgecbIbsqHrb+wdMM29N 24 | itPaWfV8Eq9fETcqp8qgsWD8XkNHDdoKFMrrtskCgYAoSt/Je1D3ZE/3HEjez7bq 25 | fenS3J6KG2SEn2PNFn+R0R5vBo4DaV/cQysKh44GD2+sh0QDyh6nuWJufyhPzROP 26 | DU6DCLbwNePj/yaGuzi36oLt6bBgfPWCiJY7jIdK8DmTLW25m7fRtCC5pxZlSzgl 27 | KBf7R6cbaTvaFe05Y2FJXA== 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /plat/arm/board/fvp/fvp_bl2u_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include "fvp_def.h" 33 | #include "fvp_private.h" 34 | 35 | void bl2u_early_platform_setup(meminfo_t *mem_layout, void *plat_info) 36 | { 37 | arm_bl2u_early_platform_setup(mem_layout, plat_info); 38 | 39 | /* Initialize the platform config for future decision making */ 40 | fvp_config_setup(); 41 | } 42 | -------------------------------------------------------------------------------- /plat/arm/board/fvp/fvp_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __FVP_PRIVATE_H__ 32 | #define __FVP_PRIVATE_H__ 33 | 34 | #include 35 | 36 | /******************************************************************************* 37 | * Function and variable prototypes 38 | ******************************************************************************/ 39 | 40 | void fvp_config_setup(void); 41 | 42 | void fvp_interconnect_init(void); 43 | void fvp_interconnect_enable(void); 44 | void fvp_interconnect_disable(void); 45 | 46 | 47 | #endif /* __FVP_PRIVATE_H__ */ 48 | -------------------------------------------------------------------------------- /plat/arm/board/fvp/include/platform_oid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #include "../../../../../include/plat/arm/board/common/board_arm_oid.h" 31 | 32 | /* 33 | * Required platform OIDs 34 | * (Provided by included header) 35 | */ 36 | -------------------------------------------------------------------------------- /plat/arm/board/fvp/sp_min/sp_min-fvp.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | # SP_MIN source files specific to FVP platform 32 | BL32_SOURCES += plat/arm/board/fvp/aarch32/fvp_helpers.S \ 33 | plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \ 34 | plat/arm/board/fvp/fvp_pm.c \ 35 | plat/arm/board/fvp/fvp_topology.c \ 36 | plat/arm/board/fvp/sp_min/fvp_sp_min_setup.c \ 37 | ${FVP_CPU_LIBS} \ 38 | ${FVP_GIC_SOURCES} \ 39 | ${FVP_INTERCONNECT_SOURCES} \ 40 | ${FVP_SECURITY_SOURCES} 41 | 42 | include plat/arm/common/sp_min/arm_sp_min.mk -------------------------------------------------------------------------------- /plat/arm/board/fvp/tsp/fvp_tsp_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include "../fvp_private.h" 33 | 34 | void tsp_early_platform_setup(void) 35 | { 36 | arm_tsp_early_platform_setup(); 37 | 38 | /* Initialize the platform config for future decision making */ 39 | fvp_config_setup(); 40 | } 41 | -------------------------------------------------------------------------------- /plat/arm/board/fvp/tsp/tsp-fvp.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | # TSP source files specific to FVP platform 32 | BL32_SOURCES += plat/arm/board/fvp/fvp_topology.c \ 33 | plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \ 34 | plat/arm/board/fvp/tsp/fvp_tsp_setup.c \ 35 | ${FVP_GIC_SOURCES} 36 | 37 | include plat/arm/common/tsp/arm_tsp.mk 38 | -------------------------------------------------------------------------------- /plat/arm/board/juno/include/platform_oid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #include "../../../../../include/plat/arm/board/common/board_arm_oid.h" 31 | 32 | /* 33 | * Required platform OIDs 34 | * (Provided by included header) 35 | */ 36 | -------------------------------------------------------------------------------- /plat/arm/board/juno/juno_err.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #define V2M_SYS_NVFLAGS_ADDR (V2M_SYSREGS_BASE + V2M_SYS_NVFLAGS) 36 | 37 | /* 38 | * Juno error handler 39 | */ 40 | void plat_error_handler(int err) 41 | { 42 | uint32_t *flags_ptr = (uint32_t *)V2M_SYS_NVFLAGS_ADDR; 43 | 44 | /* Propagate the err code in the NV-flags register */ 45 | *flags_ptr = err; 46 | 47 | /* Loop until the watchdog resets the system */ 48 | for (;;) 49 | wfi(); 50 | } 51 | -------------------------------------------------------------------------------- /plat/arm/board/juno/tsp/tsp-juno.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | BL32_SOURCES += plat/arm/board/juno/juno_topology.c \ 32 | plat/arm/css/common/css_topology.c \ 33 | ${JUNO_GIC_SOURCES} 34 | 35 | include plat/arm/common/tsp/arm_tsp.mk 36 | -------------------------------------------------------------------------------- /plat/arm/common/sp_min/arm_sp_min.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | # SP MIN source files common to ARM standard platforms 32 | BL32_SOURCES += plat/arm/common/arm_pm.c \ 33 | plat/arm/common/arm_topology.c \ 34 | plat/arm/common/sp_min/arm_sp_min_setup.c \ 35 | plat/common/aarch32/platform_mp_stack.S \ 36 | plat/common/plat_psci_common.c 37 | 38 | -------------------------------------------------------------------------------- /plat/arm/common/tsp/arm_tsp.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | # TSP source files common to ARM standard platforms 32 | BL32_SOURCES += plat/arm/common/arm_topology.c \ 33 | plat/arm/common/tsp/arm_tsp_setup.c \ 34 | plat/common/aarch64/platform_mp_stack.S 35 | -------------------------------------------------------------------------------- /plat/arm/css/common/css_bl1_setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | void bl1_platform_setup(void) 37 | { 38 | arm_bl1_platform_setup(); 39 | /* 40 | * Do ARM CSS SoC security setup. 41 | * BL1 needs to enable normal world access to memory. 42 | */ 43 | soc_css_security_setup(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /plat/arm/css/common/css_mhu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __CSS_MHU_H__ 32 | #define __CSS_MHU_H__ 33 | 34 | #include 35 | 36 | void mhu_secure_message_start(unsigned int slot_id); 37 | void mhu_secure_message_send(unsigned int slot_id); 38 | uint32_t mhu_secure_message_wait(void); 39 | void mhu_secure_message_end(unsigned int slot_id); 40 | 41 | void mhu_secure_init(void); 42 | 43 | #endif /* __CSS_MHU_H__ */ 44 | -------------------------------------------------------------------------------- /plat/arm/css/common/css_scp_bootloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __CSS_SCP_BOOTLOADER_H__ 32 | #define __CSS_SCP_BOOTLOADER_H__ 33 | 34 | int scp_bootloader_transfer(void *image, unsigned int image_size); 35 | 36 | #endif /* __CSS_SCP_BOOTLOADER_H__ */ 37 | -------------------------------------------------------------------------------- /plat/arm/soc/common/soc_css.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | PLAT_INCLUDES += -Iinclude/plat/arm/soc/common/ 32 | 33 | #PLAT_BL_COMMON_SOURCES += 34 | 35 | BL1_SOURCES += plat/arm/soc/common/soc_css_security.c 36 | 37 | BL2_SOURCES += plat/arm/soc/common/soc_css_security.c 38 | 39 | BL2U_SOURCES += plat/arm/soc/common/soc_css_security.c 40 | 41 | BL31_SOURCES += plat/arm/soc/common/soc_css_security.c 42 | -------------------------------------------------------------------------------- /plat/common/aarch32/plat_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | /* 35 | * The following platform setup functions are weakly defined. They 36 | * provide typical implementations that may be re-used by multiple 37 | * platforms but may also be overridden by a platform if required. 38 | */ 39 | #pragma weak bl32_plat_enable_mmu 40 | 41 | void bl32_plat_enable_mmu(uint32_t flags) 42 | { 43 | enable_mmu_secure(flags); 44 | } 45 | -------------------------------------------------------------------------------- /plat/common/aarch64/plat_psci_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if !ERROR_DEPRECATED 32 | #include "../plat_psci_common.c" 33 | #endif 34 | -------------------------------------------------------------------------------- /plat/compat/plat_compat.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | ifeq (${PSCI_EXTENDED_STATE_ID}, 1) 32 | $(error "PSCI Compatibility mode can be enabled only if \ 33 | PSCI_EXTENDED_STATE_ID is not set") 34 | endif 35 | 36 | ifneq (${ARCH}, aarch64) 37 | $(error "PSCI Compatibility mode is only supported for AArch64 platforms") 38 | endif 39 | 40 | PLAT_BL_COMMON_SOURCES += plat/compat/aarch64/plat_helpers_compat.S 41 | 42 | BL31_SOURCES += plat/common/plat_psci_common.c \ 43 | plat/compat/plat_pm_compat.c \ 44 | plat/compat/plat_topology_compat.c 45 | -------------------------------------------------------------------------------- /plat/mediatek/mt6795/include/plat_sip_calls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __PLAT_SIP_CALLS_H__ 32 | #define __PLAT_SIP_CALLS_H__ 33 | 34 | /******************************************************************************* 35 | * Plat SiP function constants 36 | ******************************************************************************/ 37 | #define MTK_PLAT_SIP_NUM_CALLS 0 38 | 39 | #endif /* __PLAT_SIP_CALLS_H__ */ 40 | -------------------------------------------------------------------------------- /plat/mediatek/mt6795/include/power_tracer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __POWER_TRACER_H__ 32 | #define __POWER_TRACER_H__ 33 | 34 | #define CPU_UP 0 35 | #define CPU_DOWN 1 36 | #define CPU_SUSPEND 2 37 | #define CLUSTER_UP 3 38 | #define CLUSTER_DOWN 4 39 | #define CLUSTER_SUSPEND 5 40 | 41 | void trace_power_flow(unsigned long mpidr, unsigned char mode); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plat/mediatek/mt6795/include/scu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __SCU_H__ 32 | #define __SCU_H__ 33 | 34 | void disable_scu(unsigned long mpidr); 35 | void enable_scu(unsigned long mpidr); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/crypt/crypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __CRYPT_H__ 31 | #define __CRYPT_H__ 32 | 33 | #include 34 | 35 | /* crypt function prototype */ 36 | uint64_t crypt_set_hdcp_key_ex(uint64_t x1, uint64_t x2, uint64_t x3); 37 | uint64_t crypt_set_hdcp_key_num(uint32_t num); 38 | uint64_t crypt_clear_hdcp_key(void); 39 | 40 | #endif /* __CRYPT_H__ */ 41 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/mtcmos/mtcmos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __MTCMOS_H__ 31 | #define __MTCMOS_H__ 32 | 33 | /* 34 | * This function will turn off all the little core's power except cpu 0. The 35 | * cores in cluster 0 are all powered when the system power on. The System 36 | * Power Manager (SPM) will do nothing if it found the core's power was on 37 | * during CPU_ON psci call. 38 | */ 39 | void mtcmos_little_cpu_off(void); 40 | uint32_t mtcmos_non_cpu_ctrl(uint32_t on, uint32_t mtcmos_num); 41 | 42 | #endif /* __MTCMOS_H__ */ 43 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/spm/spm_hotplug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __SPM_HOTPLUG_H__ 31 | #define __SPM_HOTPLUG_H__ 32 | 33 | void spm_clear_hotplug(void); 34 | void spm_hotplug_off(unsigned long mpidr); 35 | void spm_hotplug_on(unsigned long mpidr); 36 | 37 | #endif /* __SPM_HOTPLUG_H__ */ 38 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/spm/spm_mcdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __SPM_MCDI_H__ 31 | #define __SPM_MCDI_H__ 32 | 33 | void spm_mcdi_wakeup_all_cores(void); 34 | void spm_mcdi_prepare_for_mtcmos(void); 35 | void spm_mcdi_prepare_for_off_state(unsigned long mpidr, unsigned int afflvl); 36 | void spm_mcdi_finish_for_on_state(unsigned long mpidr, unsigned int afflvl); 37 | 38 | #endif /* __SPM_MCDI_H__ */ 39 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/spm/spm_suspend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __SPM_SUSPEND_H__ 31 | #define __SPM_SUSPEND_H__ 32 | 33 | /* cpu dormant return code */ 34 | #define CPU_DORMANT_RESET 0 35 | #define CPU_DORMANT_ABORT 1 36 | 37 | void spm_system_suspend(void); 38 | void spm_system_suspend_finish(void); 39 | 40 | #endif /* __SPM_SUSPEND_H__*/ 41 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __MT_CPUXGPT_H__ 32 | #define __MT_CPUXGPT_H__ 33 | 34 | /* REG */ 35 | #define INDEX_CNT_L_INIT 0x008 36 | #define INDEX_CNT_H_INIT 0x00C 37 | 38 | void generic_timer_backup(void); 39 | 40 | #endif /* __MT_CPUXGPT_H__ */ 41 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/include/power_tracer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __POWER_TRACER_H__ 32 | #define __POWER_TRACER_H__ 33 | 34 | #define CPU_UP 0 35 | #define CPU_DOWN 1 36 | #define CPU_SUSPEND 2 37 | #define CLUSTER_UP 3 38 | #define CLUSTER_DOWN 4 39 | #define CLUSTER_SUSPEND 5 40 | 41 | void trace_power_flow(unsigned long mpidr, unsigned char mode); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plat/mediatek/mt8173/include/scu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __SCU_H__ 32 | #define __SCU_H__ 33 | 34 | void disable_scu(unsigned long mpidr); 35 | void enable_scu(unsigned long mpidr); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plat/nvidia/tegra/platform.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | SOC_DIR := plat/nvidia/tegra/soc/${TARGET_SOC} 32 | 33 | # Disable the PSCI platform compatibility layer 34 | ENABLE_PLAT_COMPAT := 0 35 | 36 | include plat/nvidia/tegra/common/tegra_common.mk 37 | include ${SOC_DIR}/platform_${TARGET_SOC}.mk 38 | 39 | # modify BUILD_PLAT to point to SoC specific build directory 40 | BUILD_PLAT := ${BUILD_BASE}/${PLAT}/${TARGET_SOC}/${BUILD_TYPE} 41 | -------------------------------------------------------------------------------- /plat/rockchip/common/include/rockchip_sip_svc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef __ROCKCHIP_SIP_SVC_H__ 28 | #define __ROCKCHIP_SIP_SVC_H__ 29 | 30 | /* SMC function IDs for SiP Service queries */ 31 | #define SIP_SVC_CALL_COUNT 0x8200ff00 32 | #define SIP_SVC_UID 0x8200ff01 33 | #define SIP_SVC_VERSION 0x8200ff03 34 | 35 | /* rockchip SiP Service Calls version numbers */ 36 | #define RK_SIP_SVC_VERSION_MAJOR 0x0 37 | #define RK_SIP_SVC_VERSION_MINOR 0x1 38 | 39 | /* Number of ROCKCHIP SiP Calls implemented */ 40 | #define RK_COMMON_SIP_NUM_CALLS 0x3 41 | 42 | enum { 43 | RK_SIP_E_SUCCESS = 0, 44 | RK_SIP_E_INVALID_PARAM = -1 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /plat/rockchip/common/pmusram/pmu_sram.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | 29 | /***************************************************************************** 30 | * sram only surpport 32-bits access 31 | ******************************************************************************/ 32 | void u32_align_cpy(uint32_t *dst, const uint32_t *src, size_t bytes) 33 | { 34 | uint32_t i; 35 | 36 | for (i = 0; i < bytes; i++) 37 | dst[i] = src[i]; 38 | } 39 | -------------------------------------------------------------------------------- /plat/rockchip/rk3368/drivers/pmu/plat_pmu_macros.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | .macro func_rockchip_clst_warmboot 32 | /* Nothing to do for rk3368 */ 33 | .endm 34 | 35 | .macro rockchip_clst_warmboot_data 36 | /* Nothing to do for rk3368 */ 37 | .endm 38 | -------------------------------------------------------------------------------- /plat/rockchip/rk3368/include/plat_sip_calls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef __PLAT_SIP_CALLS_H__ 28 | #define __PLAT_SIP_CALLS_H__ 29 | 30 | #define RK_PLAT_SIP_NUM_CALLS 0 31 | 32 | #endif /* __PLAT_SIP_CALLS_H__ */ 33 | -------------------------------------------------------------------------------- /plat/rockchip/rk3368/plat_sip_calls.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | uint64_t rockchip_plat_sip_handler(uint32_t smc_fid, 34 | uint64_t x1, 35 | uint64_t x2, 36 | uint64_t x3, 37 | uint64_t x4, 38 | void *cookie, 39 | void *handle, 40 | uint64_t flags) 41 | { 42 | switch (smc_fid) { 43 | default: 44 | ERROR("%s: unhandled SMC (0x%x)\n", __func__, smc_fid); 45 | SMC_RET1(handle, SMC_UNK); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /plat/rockchip/rk3399/drivers/pwm/pwm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef __PWM_H__ 32 | #define __PWM_H__ 33 | 34 | void disable_pwms(void); 35 | void enable_pwms(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plat/rockchip/rk3399/include/plat_sip_calls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef __PLAT_SIP_CALLS_H__ 28 | #define __PLAT_SIP_CALLS_H__ 29 | 30 | #define RK_PLAT_SIP_NUM_CALLS 0 31 | 32 | #endif /* __PLAT_SIP_CALLS_H__ */ 33 | -------------------------------------------------------------------------------- /plat/xilinx/zynqmp/plat_topology.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | static const unsigned char plat_power_domain_tree_desc[] = {1, 4}; 32 | 33 | const unsigned char *plat_get_power_domain_tree_desc(void) 34 | { 35 | return plat_power_domain_tree_desc; 36 | } 37 | -------------------------------------------------------------------------------- /plat/xilinx/zynqmp/plat_zynqmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | int plat_core_pos_by_mpidr(u_register_t mpidr) 34 | { 35 | if (mpidr & MPIDR_CLUSTER_MASK) 36 | return -1; 37 | 38 | if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) 39 | return -1; 40 | 41 | return plat_arm_calc_core_pos(mpidr); 42 | } 43 | -------------------------------------------------------------------------------- /plat/xilinx/zynqmp/pm_service/pm_ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _PM_IPI_H_ 32 | #define _PM_IPI_H_ 33 | 34 | #include "pm_common.h" 35 | 36 | int pm_ipi_init(void); 37 | 38 | enum pm_ret_status pm_ipi_send(const struct pm_proc *proc, 39 | uint32_t payload[PAYLOAD_ARG_CNT]); 40 | enum pm_ret_status pm_ipi_send_sync(const struct pm_proc *proc, 41 | uint32_t payload[PAYLOAD_ARG_CNT], 42 | unsigned int *value); 43 | 44 | #endif /* _PM_IPI_H_ */ 45 | -------------------------------------------------------------------------------- /plat/xilinx/zynqmp/pm_service/pm_svc_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _PM_SVC_MAIN_H_ 32 | #define _PM_SVC_MAIN_H_ 33 | 34 | #include "pm_common.h" 35 | 36 | int pm_setup(void); 37 | uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, 38 | uint64_t x4, void *cookie, void *handle, 39 | uint64_t flags); 40 | 41 | #endif /* _PM_SVC_MAIN_H_ */ 42 | -------------------------------------------------------------------------------- /plat/xilinx/zynqmp/tsp/tsp-zynqmp.mk: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # Redistributions of source code must retain the above copyright notice, this 7 | # list of conditions and the following disclaimer. 8 | # 9 | # Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # 13 | # Neither the name of ARM nor the names of its contributors may be used 14 | # to endorse or promote products derived from this software without specific 15 | # prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | # TSP source files specific to ZynqMP platform 30 | BL32_SOURCES += plat/common/aarch64/platform_mp_stack.S \ 31 | plat/xilinx/zynqmp/tsp/tsp_plat_setup.c 32 | -------------------------------------------------------------------------------- /services/spd/opteed/opteed.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | OPTEED_DIR := services/spd/opteed 32 | SPD_INCLUDES := 33 | 34 | SPD_SOURCES := services/spd/opteed/opteed_common.c \ 35 | services/spd/opteed/opteed_helpers.S \ 36 | services/spd/opteed/opteed_main.c \ 37 | services/spd/opteed/opteed_pm.c 38 | 39 | NEED_BL32 := yes 40 | -------------------------------------------------------------------------------- /services/spd/opteed/teesmc_opteed_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef __TEESMC_OPTEED_MACROS_H__ 31 | #define __TEESMC_OPTEED_MACROS_H__ 32 | 33 | #include 34 | 35 | #define TEESMC_OPTEED_RV(func_num) \ 36 | ((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \ 37 | ((SMC_32) << FUNCID_CC_SHIFT) | \ 38 | (62 << FUNCID_OEN_SHIFT) | \ 39 | ((func_num) & FUNCID_NUM_MASK)) 40 | 41 | #endif /*__TEESMC_OPTEED_MACROS_H__*/ 42 | -------------------------------------------------------------------------------- /services/spd/tlkd/tlkd.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of ARM nor the names of its contributors may be used 15 | # to endorse or promote products derived from this software without specific 16 | # prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | SPD_INCLUDES := -Iinclude/bl32/payloads 32 | 33 | SPD_SOURCES := services/spd/tlkd/tlkd_common.c \ 34 | services/spd/tlkd/tlkd_helpers.S \ 35 | services/spd/tlkd/tlkd_main.c \ 36 | services/spd/tlkd/tlkd_pm.c 37 | -------------------------------------------------------------------------------- /tools/cert_create/include/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SHA_H_ 32 | #define SHA_H_ 33 | 34 | int sha_file(const char *filename, unsigned char *md); 35 | 36 | #endif /* SHA_H_ */ 37 | -------------------------------------------------------------------------------- /tools/cert_create/include/tbbr/tbb_key.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this 8 | * list of conditions and the following disclaimer. 9 | * 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * Neither the name of ARM nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without specific 16 | * prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef TBB_KEY_H_ 32 | #define TBB_KEY_H_ 33 | 34 | #include "key.h" 35 | 36 | /* 37 | * Enumerate the keys that are used to establish the chain of trust 38 | */ 39 | enum { 40 | ROT_KEY, 41 | TRUSTED_WORLD_KEY, 42 | NON_TRUSTED_WORLD_KEY, 43 | SCP_FW_CONTENT_CERT_KEY, 44 | SOC_FW_CONTENT_CERT_KEY, 45 | TRUSTED_OS_FW_CONTENT_CERT_KEY, 46 | NON_TRUSTED_FW_CONTENT_CERT_KEY 47 | }; 48 | 49 | #endif /* TBB_KEY_H_ */ 50 | --------------------------------------------------------------------------------