2 * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
8 #include <asm_macros.S>
9 #include <assert_macros.S>
10 #include <platform_def.h>
12 .globl plat_my_core_pos
13 .globl plat_get_my_entrypoint
14 .globl platform_mem_init
15 .globl plat_bcm_calc_core_pos
16 .globl plat_crash_console_init
17 .globl plat_crash_console_putc
18 .globl plat_secondary_cold_boot_setup
19 .globl plat_get_my_entrypoint
20 .globl plat_is_my_cpu_primary
21 .globl plat_crash_console_flush
24 func console_core_init
26 endfunc console_core_init
28 func console_core_putc
30 endfunc console_core_putc
32 func plat_crash_console_flush
34 endfunc plat_crash_console_flush
39 b plat_bcm_calc_core_pos
40 endfunc plat_my_core_pos
43 * unsigned int plat_bcm_calc_core_pos(u_register_t mpidr);
44 * With this function: CorePos = (ClusterId * 4) + CoreId
46 func plat_bcm_calc_core_pos
47 and x1, x0, #MPIDR_CPU_MASK
48 and x0, x0, #MPIDR_CLUSTER_MASK
49 add x0, x1, x0, LSR #6
51 endfunc plat_bcm_calc_core_pos
53 /* -----------------------------------------------------
54 * unsigned int plat_is_my_cpu_primary (void);
56 * Find out whether the current cpu is the primary
58 * -----------------------------------------------------
60 func plat_is_my_cpu_primary
62 and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
63 cmp x0, #BRCM_PRIMARY_CPU
66 endfunc plat_is_my_cpu_primary
68 /* -----------------------------------------------------
69 * void plat_secondary_cold_boot_setup (void);
71 * This function performs any platform specific actions
72 * needed for a secondary cpu after a cold reset e.g
73 * mark the cpu's presence, mechanism to place it in a
75 * -----------------------------------------------------
77 func plat_secondary_cold_boot_setup
79 endfunc plat_secondary_cold_boot_setup
81 func plat_get_my_entrypoint
82 /* TODO support warm boot */
85 endfunc plat_get_my_entrypoint
87 func platform_mem_init
89 endfunc platform_mem_init
91 /* ---------------------------------------------
92 * int plat_crash_console_init(void)
93 * Function to initialize the crash console
94 * without a C Runtime to print crash report.
95 * Clobber list : x0, x1, x2
96 * ---------------------------------------------
98 func plat_crash_console_init
99 mov_imm x0, PLAT_BCM_CRASH_UART_BASE
100 mov_imm x1, PLAT_BCM_CRASH_UART_CLK_IN_HZ
101 mov_imm x2, PLAT_BCM_CONSOLE_BAUDRATE
103 endfunc plat_crash_console_init
105 /* ---------------------------------------------
106 * int plat_crash_console_putc(int c)
107 * Function to print a character on the crash
108 * console without a C Runtime.
109 * Clobber list : x1, x2
110 * ---------------------------------------------
112 func plat_crash_console_putc
113 mov_imm x1, PLAT_BCM_CRASH_UART_BASE
115 endfunc plat_crash_console_putc