Skip to content

Commit c34e378

Browse files
authored
Merge pull request #14 from emilazy/push-prwswnutwzyv
mediatek: apsoc: move early functions into assembly helpers
2 parents 4c422f0 + 9f5f90d commit c34e378

File tree

12 files changed

+94
-46
lines changed

12 files changed

+94
-46
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: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,28 @@
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
13-
.globl platform_is_primary_cpu
14+
.globl plat_is_my_cpu_primary
1415
.globl plat_my_core_pos
1516
.globl plat_crash_console_init
1617
.globl plat_crash_console_putc
1718
.globl plat_crash_console_flush
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
*
@@ -43,12 +55,13 @@ func write_cpuectlr
4355
ret
4456
endfunc write_cpuectlr
4557

46-
func platform_is_primary_cpu
58+
func plat_is_my_cpu_primary
59+
mrs x0, mpidr_el1
4760
and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
4861
cmp x0, #MT7622_PRIMARY_CPU
4962
cset x0, eq
5063
ret
51-
endfunc platform_is_primary_cpu
64+
endfunc plat_is_my_cpu_primary
5265

5366
/* -----------------------------------------------------
5467
* unsigned int plat_my_core_pos(void);
@@ -102,4 +115,4 @@ endfunc plat_crash_console_putc
102115
func plat_crash_console_flush
103116
mov_imm x0, UART_BASE
104117
b console_hsuart_core_flush
105-
endfunc plat_crash_console_flush
118+
endfunc plat_crash_console_flush

plat/mediatek/mt7622/bl2/bl2_plat_init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ void bl2_el3_plat_arch_setup(void)
3131
{
3232
}
3333

34-
bool plat_is_my_cpu_primary(void)
35-
{
36-
return true;
37-
}
38-
3934
const struct initcall bl2_initcalls[] = {
4035
INITCALL(plat_mt_cpuxgpt_init),
4136
INITCALL(generic_delay_timer_init),

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: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,28 @@
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
13-
.globl platform_is_primary_cpu
14+
.globl plat_is_my_cpu_primary
1415
.globl plat_my_core_pos
1516
.globl plat_crash_console_init
1617
.globl plat_crash_console_putc
1718
.globl plat_crash_console_flush
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
*
@@ -43,12 +55,13 @@ func write_cpuectlr
4355
ret
4456
endfunc write_cpuectlr
4557

46-
func platform_is_primary_cpu
58+
func plat_is_my_cpu_primary
59+
mrs x0, mpidr_el1
4760
and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
4861
cmp x0, #PRIMARY_CPU
4962
cset x0, eq
5063
ret
51-
endfunc platform_is_primary_cpu
64+
endfunc plat_is_my_cpu_primary
5265

5366
/* -----------------------------------------------------
5467
* unsigned int plat_my_core_pos(void);

plat/mediatek/mt7981/bl2/bl2_plat_init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ void bl2_el3_plat_arch_setup(void)
5959
{
6060
}
6161

62-
bool plat_is_my_cpu_primary(void)
63-
{
64-
return true;
65-
}
66-
6762
const struct initcall bl2_initcalls[] = {
6863
INITCALL(mtk_timer_init),
6964
INITCALL(generic_delay_timer_init),

plat/mediatek/mt7986/aarch64/plat_helpers.S

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,28 @@
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
13-
.globl platform_is_primary_cpu
14+
.globl plat_is_my_cpu_primary
1415
.globl plat_my_core_pos
1516
.globl plat_crash_console_init
1617
.globl plat_crash_console_putc
1718
.globl plat_crash_console_flush
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
*
@@ -43,12 +55,13 @@ func write_cpuectlr
4355
ret
4456
endfunc write_cpuectlr
4557

46-
func platform_is_primary_cpu
58+
func plat_is_my_cpu_primary
59+
mrs x0, mpidr_el1
4760
and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
4861
cmp x0, #PRIMARY_CPU
4962
cset x0, eq
5063
ret
51-
endfunc platform_is_primary_cpu
64+
endfunc plat_is_my_cpu_primary
5265

5366
/* -----------------------------------------------------
5467
* unsigned int plat_my_core_pos(void);

plat/mediatek/mt7986/bl2/bl2_plat_init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ void bl2_el3_plat_arch_setup(void)
8383
{
8484
}
8585

86-
bool plat_is_my_cpu_primary(void)
87-
{
88-
return true;
89-
}
90-
9186
const struct initcall bl2_initcalls[] = {
9287
INITCALL(mtk_timer_init),
9388
INITCALL(generic_delay_timer_init),

plat/mediatek/mt7987/aarch64/plat_helpers.S

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,28 @@
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
13-
.globl platform_is_primary_cpu
14+
.globl plat_is_my_cpu_primary
1415
.globl plat_my_core_pos
1516
.globl plat_crash_console_init
1617
.globl plat_crash_console_putc
1718
.globl plat_crash_console_flush
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
*
@@ -42,12 +54,13 @@ func write_cpuectlr
4254
ret
4355
endfunc write_cpuectlr
4456

45-
func platform_is_primary_cpu
57+
func plat_is_my_cpu_primary
58+
mrs x0, mpidr_el1
4659
and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
4760
cmp x0, #PRIMARY_CPU
4861
cset x0, eq
4962
ret
50-
endfunc platform_is_primary_cpu
63+
endfunc plat_is_my_cpu_primary
5164

5265
/* -----------------------------------------------------
5366
* unsigned int plat_my_core_pos(void);

plat/mediatek/mt7987/bl2/bl2_plat_init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ void bl2_el3_plat_arch_setup(void)
188188
generic_delay_timer_init();
189189
}
190190

191-
bool plat_is_my_cpu_primary(void)
192-
{
193-
return true;
194-
}
195-
196191
const struct initcall bl2_initcalls[] = {
197192
INITCALL(mtk_wdt_init),
198193
INITCALL(mtk_disable_PGD),

0 commit comments

Comments
 (0)