Skip to content

Commit 744021c

Browse files
committed
mediatek: apsoc: move platform_mem_init into assembly helpers
This function is called before the C stack is set up, which was resulted in hangs when TF‐A is compiled with `-fno-omit-frame-pointer`, as is now the default on several major Linux distributions. Fixes: a36715b ("mediatek: add common files for APSoC platform") Signed-off-by: Emily <hello@emily.moe>
1 parent e090770 commit 744021c

File tree

7 files changed

+73
-5
lines changed

7 files changed

+73
-5
lines changed

plat/mediatek/apsoc_common/bl2/bl2_plat_setup.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,6 @@ void plat_flush_next_bl_params(void)
395395
flush_bl_params_desc();
396396
}
397397

398-
void platform_mem_init(void)
399-
{
400-
}
401-
402398
void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg1,
403399
u_register_t arg2, u_register_t arg3)
404400
{

plat/mediatek/mt7622/aarch64/plat_helpers.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm_macros.S>
99
#include <mt7622_def.h>
1010

11+
.globl platform_mem_init
1112
.globl plat_secondary_cold_boot_setup
1213
.globl plat_report_exception
1314
.globl platform_is_primary_cpu
@@ -18,6 +19,17 @@
1819
.globl read_cpuectlr
1920
.globl write_cpuectlr
2021

22+
/* --------------------------------------------------------
23+
* void platform_mem_init (void);
24+
*
25+
* Any memory init, relocation to be done before the
26+
* platform boots. Called very early in the boot process.
27+
* --------------------------------------------------------
28+
*/
29+
func platform_mem_init
30+
ret
31+
endfunc platform_mem_init
32+
2133
/* -----------------------------------------------------
2234
* void plat_secondary_cold_boot_setup (void);
2335
*

plat/mediatek/mt7629/aarch32/plat_helpers.S

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <mt7629_def.h>
1111
#include <pll.h>
1212

13+
.globl platform_mem_init
1314
.globl plat_secondary_cold_boot_setup
1415
.globl plat_report_exception
1516
.globl plat_is_my_cpu_primary
@@ -19,6 +20,17 @@
1920
.globl plat_crash_console_flush
2021
.globl plat_reset_handler
2122

23+
/* --------------------------------------------------------
24+
* void platform_mem_init (void);
25+
*
26+
* Any memory init, relocation to be done before the
27+
* platform boots. Called very early in the boot process.
28+
* --------------------------------------------------------
29+
*/
30+
func platform_mem_init
31+
bx lr
32+
endfunc platform_mem_init
33+
2234
/* -----------------------------------------------------
2335
* void plat_secondary_cold_boot_setup (void);
2436
*
@@ -118,4 +130,4 @@ endfunc plat_crash_console_putc
118130
func plat_crash_console_flush
119131
mov_imm r0, UART_BASE
120132
b console_hsuart_core_flush
121-
endfunc plat_crash_console_flush
133+
endfunc plat_crash_console_flush

plat/mediatek/mt7981/aarch64/plat_helpers.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm_macros.S>
99
#include <mt7981_def.h>
1010

11+
.globl platform_mem_init
1112
.globl plat_secondary_cold_boot_setup
1213
.globl plat_report_exception
1314
.globl platform_is_primary_cpu
@@ -18,6 +19,17 @@
1819
.globl read_cpuectlr
1920
.globl write_cpuectlr
2021

22+
/* --------------------------------------------------------
23+
* void platform_mem_init (void);
24+
*
25+
* Any memory init, relocation to be done before the
26+
* platform boots. Called very early in the boot process.
27+
* --------------------------------------------------------
28+
*/
29+
func platform_mem_init
30+
ret
31+
endfunc platform_mem_init
32+
2133
/* -----------------------------------------------------
2234
* void plat_secondary_cold_boot_setup (void);
2335
*

plat/mediatek/mt7986/aarch64/plat_helpers.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm_macros.S>
99
#include <mt7986_def.h>
1010

11+
.globl platform_mem_init
1112
.globl plat_secondary_cold_boot_setup
1213
.globl plat_report_exception
1314
.globl platform_is_primary_cpu
@@ -18,6 +19,17 @@
1819
.globl read_cpuectlr
1920
.globl write_cpuectlr
2021

22+
/* --------------------------------------------------------
23+
* void platform_mem_init (void);
24+
*
25+
* Any memory init, relocation to be done before the
26+
* platform boots. Called very early in the boot process.
27+
* --------------------------------------------------------
28+
*/
29+
func platform_mem_init
30+
ret
31+
endfunc platform_mem_init
32+
2133
/* -----------------------------------------------------
2234
* void plat_secondary_cold_boot_setup (void);
2335
*

plat/mediatek/mt7987/aarch64/plat_helpers.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm_macros.S>
99
#include <mt7987_def.h>
1010

11+
.globl platform_mem_init
1112
.globl plat_secondary_cold_boot_setup
1213
.globl plat_report_exception
1314
.globl platform_is_primary_cpu
@@ -18,6 +19,17 @@
1819
.globl read_cpuectlr
1920
.globl write_cpuectlr
2021

22+
/* --------------------------------------------------------
23+
* void platform_mem_init (void);
24+
*
25+
* Any memory init, relocation to be done before the
26+
* platform boots. Called very early in the boot process.
27+
* --------------------------------------------------------
28+
*/
29+
func platform_mem_init
30+
ret
31+
endfunc platform_mem_init
32+
2133
/* -----------------------------------------------------
2234
* void plat_secondary_cold_boot_setup (void);
2335
*

plat/mediatek/mt7988/aarch64/plat_helpers.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm_macros.S>
99
#include <mt7988_def.h>
1010

11+
.globl platform_mem_init
1112
.globl plat_secondary_cold_boot_setup
1213
.globl plat_report_exception
1314
.globl platform_is_primary_cpu
@@ -18,6 +19,17 @@
1819
.globl read_cpuectlr
1920
.globl write_cpuectlr
2021

22+
/* --------------------------------------------------------
23+
* void platform_mem_init (void);
24+
*
25+
* Any memory init, relocation to be done before the
26+
* platform boots. Called very early in the boot process.
27+
* --------------------------------------------------------
28+
*/
29+
func platform_mem_init
30+
ret
31+
endfunc platform_mem_init
32+
2133
/* -----------------------------------------------------
2234
* void plat_secondary_cold_boot_setup (void);
2335
*

0 commit comments

Comments
 (0)