Merge "fix(ti): fix UNUSED_VALUE in AM62L PSCI Driver" into integration
diff --git a/docs/design/firmware-design.rst b/docs/design/firmware-design.rst
index cf8cbc7..1306ecb 100644
--- a/docs/design/firmware-design.rst
+++ b/docs/design/firmware-design.rst
@@ -2599,6 +2599,9 @@
section section can be reclaimed for any data which is accessed after cold
boot initialization and it is upto the platform to make the decision.
+Please note that this will disable inlining for any functions with the __init
+attribute.
+
.. _firmware_design_pmf:
Performance Measurement Framework
diff --git a/include/lib/libc/cdefs.h b/include/lib/libc/cdefs.h
index 97b7824..5febe9d 100644
--- a/include/lib/libc/cdefs.h
+++ b/include/lib/libc/cdefs.h
@@ -16,12 +16,19 @@
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
#define __fallthrough __attribute__((__fallthrough__))
+#define __noinline __attribute__((__noinline__))
#if RECLAIM_INIT_CODE
/*
* Add each function to a section that is unique so the functions can still
- * be garbage collected
+ * be garbage collected.
+ *
+ * NOTICE: for this to work, these functions will NOT be inlined.
+ * TODO: the noinline attribute can be removed if RECLAIM_INIT_CODE is made
+ * platform agnostic and called after bl31_main(). Then, top-level functions
+ * (those that can't be inlined like bl31_main()) can be annotated with __init
+ * and noinline can be removed.
*/
-#define __init __section(".text.init." __FILE__ "." __XSTRING(__LINE__))
+#define __init __section(".text.init." __FILE__ "." __XSTRING(__LINE__)) __noinline
#else
#define __init
#endif
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index faccf31..e10770c 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -465,13 +465,6 @@
void plat_flush_next_bl_params(void);
/*
- * The below function enable Trusted Firmware components like SPDs which
- * haven't migrated to the new platform API to compile on platforms which
- * have the compatibility layer disabled.
- */
-unsigned int platform_core_pos_helper(unsigned long mpidr);
-
-/*
* Optional function to get SOC version
*/
int32_t plat_get_soc_version(void);
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index ba47b30..4423863 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -45,18 +45,6 @@
{
}
-/*
- * Helper function for platform_get_pos() when platform compatibility is
- * disabled. This is to enable SPDs using the older platform API to continue
- * to work.
- */
-unsigned int platform_core_pos_helper(unsigned long mpidr)
-{
- int idx = plat_core_pos_by_mpidr(mpidr);
- assert(idx >= 0);
- return idx;
-}
-
#if SDEI_SUPPORT
/*
* Function that handles spurious SDEI interrupts while events are masked.