Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 1 | /* |
Jimmy Brisson | 39f9eee | 2020-08-05 13:44:05 -0500 | [diff] [blame] | 2 | * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | #include <assert_macros.S> |
| 10 | #include <platform_def.h> |
| 11 | |
| 12 | .globl plat_crash_console_flush |
| 13 | .globl plat_crash_console_init |
| 14 | .globl plat_crash_console_putc |
| 15 | .globl platform_mem_init |
| 16 | .globl plat_is_my_cpu_primary |
| 17 | .globl plat_my_core_pos |
| 18 | .globl plat_reset_handler |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 19 | .globl plat_calc_core_pos |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 20 | |
| 21 | /* ----------------------------------------------------- |
| 22 | * unsigned int plat_my_core_pos(void); |
| 23 | * ----------------------------------------------------- |
| 24 | */ |
| 25 | func plat_my_core_pos |
| 26 | mrs x0, mpidr_el1 |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 27 | b plat_calc_core_pos |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 28 | endfunc plat_my_core_pos |
| 29 | |
| 30 | /* ----------------------------------------------------- |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 31 | * unsigned int plat_calc_core_pos(u_register_t mpidr); |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 32 | * ----------------------------------------------------- |
| 33 | */ |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 34 | func plat_calc_core_pos |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 35 | and x0, x0, #MPIDR_CPU_MASK |
| 36 | ret |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 37 | endfunc plat_calc_core_pos |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 38 | |
| 39 | /* ----------------------------------------------------- |
| 40 | * unsigned int plat_is_my_cpu_primary(void); |
| 41 | * ----------------------------------------------------- |
| 42 | */ |
| 43 | func plat_is_my_cpu_primary |
| 44 | mrs x0, mpidr_el1 |
| 45 | and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK) |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 46 | cmp x0, #AML_PRIMARY_CPU |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 47 | cset w0, eq |
| 48 | ret |
| 49 | endfunc plat_is_my_cpu_primary |
| 50 | |
| 51 | /* --------------------------------------------- |
| 52 | * void platform_mem_init(void); |
| 53 | * --------------------------------------------- |
| 54 | */ |
| 55 | func platform_mem_init |
| 56 | ret |
| 57 | endfunc platform_mem_init |
| 58 | |
| 59 | /* --------------------------------------------- |
| 60 | * int plat_crash_console_init(void) |
| 61 | * --------------------------------------------- |
| 62 | */ |
| 63 | func plat_crash_console_init |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 64 | mov_imm x0, AML_UART0_AO_BASE |
| 65 | mov_imm x1, AML_UART0_AO_CLK_IN_HZ |
| 66 | mov_imm x2, AML_UART_BAUDRATE |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 67 | b console_meson_init |
| 68 | endfunc plat_crash_console_init |
| 69 | |
| 70 | /* --------------------------------------------- |
| 71 | * int plat_crash_console_putc(int c) |
| 72 | * Clobber list : x1, x2 |
| 73 | * --------------------------------------------- |
| 74 | */ |
| 75 | func plat_crash_console_putc |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 76 | mov_imm x1, AML_UART0_AO_BASE |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 77 | b console_meson_core_putc |
| 78 | endfunc plat_crash_console_putc |
| 79 | |
| 80 | /* --------------------------------------------- |
Jimmy Brisson | 39f9eee | 2020-08-05 13:44:05 -0500 | [diff] [blame] | 81 | * void plat_crash_console_flush() |
| 82 | * Out : void. |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 83 | * Clobber list : x0, x1 |
| 84 | * --------------------------------------------- |
| 85 | */ |
| 86 | func plat_crash_console_flush |
Carlo Caione | 1afdfb0 | 2019-08-24 18:47:06 +0100 | [diff] [blame] | 87 | mov_imm x0, AML_UART0_AO_BASE |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 88 | b console_meson_core_flush |
| 89 | endfunc plat_crash_console_flush |
| 90 | |
| 91 | /* --------------------------------------------- |
| 92 | * void plat_reset_handler(void); |
| 93 | * --------------------------------------------- |
| 94 | */ |
| 95 | func plat_reset_handler |
| 96 | ret |
| 97 | endfunc plat_reset_handler |