From 4d010d0dc0793d2ea1545c1671a2fc2d151e6af5 Mon Sep 17 00:00:00 2001 From: Daniel Boulby Date: Tue, 18 Sep 2018 13:26:03 +0100 Subject: [PATCH] plat/arm: Mark arm platform initialization functions Mark the initialization functions found in the BL31 boot sequence as __init so they can be reclaimed when no longer needed. Change-Id: I687a89346419c7710ef5097feaa325d83c527697 Signed-off-by: Daniel Boulby --- plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c | 4 ++-- plat/arm/board/fvp/fvp_bl31_setup.c | 4 ++-- plat/arm/board/fvp/fvp_common.c | 4 ++-- plat/arm/common/arm_bl31_setup.c | 8 ++++---- plat/arm/common/arm_common.c | 2 +- plat/arm/common/arm_console.c | 2 +- plat/arm/common/arm_pm.c | 2 +- plat/arm/css/drivers/mhu/css_mhu.c | 4 ++-- plat/arm/css/drivers/scp/css_pm_scmi.c | 2 +- plat/arm/css/sgi/sgi_interconnect.c | 2 +- plat/arm/css/sgm/sgm_interconnect.c | 4 +++- 11 files changed, 20 insertions(+), 18 deletions(-) diff --git a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c index 5948e149f..b17446c10 100644 --- a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c +++ b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -70,7 +70,7 @@ void fvp_pwrc_write_pcoffr(u_register_t mpidr) } /* Nothing else to do here apart from initializing the lock */ -void plat_arm_pwrc_setup(void) +void __init plat_arm_pwrc_setup(void) { arm_lock_init(); } diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c index ea1170859..1c8804f10 100644 --- a/plat/arm/board/fvp/fvp_bl31_setup.c +++ b/plat/arm/board/fvp/fvp_bl31_setup.c @@ -10,8 +10,8 @@ #include #include "fvp_private.h" -void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, - u_register_t arg2, u_register_t arg3) +void __init bl31_early_platform_setup2(u_register_t arg0, + u_register_t arg1, u_register_t arg2, u_register_t arg3) { arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3); diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c index 3f7857eb8..aa4f8398d 100644 --- a/plat/arm/board/fvp/fvp_common.c +++ b/plat/arm/board/fvp/fvp_common.c @@ -241,7 +241,7 @@ const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( * these platforms. This information is stored in a per-BL array to allow the * code to take the correct path.Per BL platform configuration. ******************************************************************************/ -void fvp_config_setup(void) +void __init fvp_config_setup(void) { unsigned int rev, hbi, bld, arch, sys_id; @@ -331,7 +331,7 @@ void fvp_config_setup(void) } -void fvp_interconnect_init(void) +void __init fvp_interconnect_init(void) { #if FVP_INTERCONNECT_DRIVER == FVP_CCN if (ccn_get_part0_id(PLAT_ARM_CCN_BASE) != CCN_502_PART0_ID) { diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c index ce799b0ff..c54566390 100644 --- a/plat/arm/common/arm_bl31_setup.c +++ b/plat/arm/common/arm_bl31_setup.c @@ -71,7 +71,7 @@ struct entry_point_info *bl31_plat_get_next_image_ep_info(uint32_t type) * while creating page tables. BL2 has flushed this information to memory, so * we are guaranteed to pick up good data. ******************************************************************************/ -void arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config, +void __init arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config, uintptr_t hw_config, void *plat_params_from_bl2) { /* Initialize the console to provide early debug support */ @@ -235,7 +235,7 @@ void arm_bl31_plat_runtime_setup(void) arm_console_runtime_init(); } -void bl31_platform_setup(void) +void __init bl31_platform_setup(void) { arm_bl31_platform_setup(); } @@ -251,7 +251,7 @@ void bl31_plat_runtime_setup(void) * architectural setup (bl31_arch_setup()) does not do anything platform * specific. ******************************************************************************/ -void arm_bl31_plat_arch_setup(void) +void __init arm_bl31_plat_arch_setup(void) { const mmap_region_t bl_regions[] = { MAP_BL31_TOTAL, @@ -273,7 +273,7 @@ void arm_bl31_plat_arch_setup(void) arm_setup_romlib(); } -void bl31_plat_arch_setup(void) +void __init bl31_plat_arch_setup(void) { arm_bl31_plat_arch_setup(); } diff --git a/plat/arm/common/arm_common.c b/plat/arm/common/arm_common.c index 28ff5d9b9..ae06ef280 100644 --- a/plat/arm/common/arm_common.c +++ b/plat/arm/common/arm_common.c @@ -41,7 +41,7 @@ void arm_setup_romlib(void) * - Coherent memory region, if applicable. */ -void arm_setup_page_tables(const mmap_region_t bl_regions[], +void __init arm_setup_page_tables(const mmap_region_t bl_regions[], const mmap_region_t plat_regions[]) { #if LOG_LEVEL >= LOG_LEVEL_VERBOSE diff --git a/plat/arm/common/arm_console.c b/plat/arm/common/arm_console.c index 6c8587fc4..bd3dca17f 100644 --- a/plat/arm/common/arm_console.c +++ b/plat/arm/common/arm_console.c @@ -19,7 +19,7 @@ static console_pl011_t arm_runtime_console; #endif /* Initialize the console to provide early debug support */ -void arm_console_boot_init(void) +void __init arm_console_boot_init(void) { #if MULTI_CONSOLE_API int rc = console_pl011_register(PLAT_ARM_BOOT_UART_BASE, diff --git a/plat/arm/common/arm_pm.c b/plat/arm/common/arm_pm.c index bf548c10c..85efc7dd2 100644 --- a/plat/arm/common/arm_pm.c +++ b/plat/arm/common/arm_pm.c @@ -208,7 +208,7 @@ void plat_arm_program_trusted_mailbox(uintptr_t address) * The ARM Standard platform definition of platform porting API * `plat_setup_psci_ops`. ******************************************************************************/ -int plat_setup_psci_ops(uintptr_t sec_entrypoint, +int __init plat_setup_psci_ops(uintptr_t sec_entrypoint, const plat_psci_ops_t **psci_ops) { *psci_ops = plat_arm_psci_override_pm_ops(&plat_arm_psci_pm_ops); diff --git a/plat/arm/css/drivers/mhu/css_mhu.c b/plat/arm/css/drivers/mhu/css_mhu.c index 30492a695..7b3331756 100644 --- a/plat/arm/css/drivers/mhu/css_mhu.c +++ b/plat/arm/css/drivers/mhu/css_mhu.c @@ -81,7 +81,7 @@ void mhu_secure_message_end(unsigned int slot_id) arm_lock_release(); } -void mhu_secure_init(void) +void __init mhu_secure_init(void) { arm_lock_init(); @@ -93,7 +93,7 @@ void mhu_secure_init(void) assert(mmio_read_32(PLAT_CSS_MHU_BASE + CPU_INTR_S_STAT) == 0); } -void plat_arm_pwrc_setup(void) +void __init plat_arm_pwrc_setup(void) { mhu_secure_init(); } diff --git a/plat/arm/css/drivers/scp/css_pm_scmi.c b/plat/arm/css/drivers/scp/css_pm_scmi.c index 258c1c29c..d280101d6 100644 --- a/plat/arm/css/drivers/scp/css_pm_scmi.c +++ b/plat/arm/css/drivers/scp/css_pm_scmi.c @@ -328,7 +328,7 @@ static int scmi_ap_core_init(scmi_channel_t *ch) return 0; } -void plat_arm_pwrc_setup(void) +void __init plat_arm_pwrc_setup(void) { channel.info = &plat_css_scmi_plat_info; channel.lock = ARM_LOCK_GET_INSTANCE; diff --git a/plat/arm/css/sgi/sgi_interconnect.c b/plat/arm/css/sgi/sgi_interconnect.c index f4e7676a4..325b5b152 100644 --- a/plat/arm/css/sgi/sgi_interconnect.c +++ b/plat/arm/css/sgi/sgi_interconnect.c @@ -17,7 +17,7 @@ /****************************************************************************** * Helper function to initialize ARM interconnect driver. *****************************************************************************/ -void plat_arm_interconnect_init(void) +void __init plat_arm_interconnect_init(void) { } diff --git a/plat/arm/css/sgm/sgm_interconnect.c b/plat/arm/css/sgm/sgm_interconnect.c index 301ea84f0..5b45341b9 100644 --- a/plat/arm/css/sgm/sgm_interconnect.c +++ b/plat/arm/css/sgm/sgm_interconnect.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include + /* * As the SGM platform supports FCM (with automatic interconnect * enter/exit), we should not do anything in these interface functions. @@ -13,7 +15,7 @@ /****************************************************************************** * Helper function to initialize ARM interconnect driver. *****************************************************************************/ -void plat_arm_interconnect_init(void) +void __init plat_arm_interconnect_init(void) { }