summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/aarch64/misc_helpers.S10
-rw-r--r--lib/aarch64/xlat_tables.c14
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c2
-rw-r--r--lib/extensions/ras/ras_common.c2
-rw-r--r--lib/libc/printf.c1
-rw-r--r--lib/libc/snprintf.c2
-rw-r--r--lib/locks/exclusive/spinlock.S9
-rw-r--r--lib/psci/aarch64/psci_helpers.S12
-rw-r--r--lib/psci/psci_common.c80
-rw-r--r--lib/psci/psci_setup.c8
-rw-r--r--lib/xlat_tables/aarch32/xlat_tables.c16
-rw-r--r--lib/xlat_tables/xlat_tables_common.c2
-rw-r--r--lib/xlat_tables/xlat_tables_private.h17
-rw-r--r--lib/xlat_tables_v2/xlat_tables_context.c32
-rw-r--r--lib/xlat_tables_v2/xlat_tables_core.c4
15 files changed, 14 insertions, 197 deletions
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S
index 3c64d3ca..1a075aa5 100644
--- a/lib/aarch64/misc_helpers.S
+++ b/lib/aarch64/misc_helpers.S
@@ -56,16 +56,6 @@ func smc
endfunc smc
/* -----------------------------------------------------------------------
- * void zeromem16(void *mem, unsigned int length);
- *
- * Initialise a memory region to 0.
- * The memory address must be 16-byte aligned.
- * NOTE: This function is deprecated and zeromem should be used instead.
- * -----------------------------------------------------------------------
- */
-.equ zeromem16, zeromem
-
-/* -----------------------------------------------------------------------
* void zero_normalmem(void *mem, unsigned int length);
*
* Initialise a region in normal memory to 0. This functions complies with the
diff --git a/lib/aarch64/xlat_tables.c b/lib/aarch64/xlat_tables.c
deleted file mode 100644
index 04cbf3c2..00000000
--- a/lib/aarch64/xlat_tables.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/*
- * This file is deprecated and is retained here only for compatibility.
- * The xlat_tables library can be found in `lib/xlat_tables` directory.
- */
-#if !ERROR_DEPRECATED
-#include "../xlat_tables/xlat_tables_common.c"
-#include "../xlat_tables/aarch64/xlat_tables.c"
-#endif
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index ee5fe4f9..acc8d6d2 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -36,7 +36,7 @@
* which will used for programming an entry into a lower EL. The same context
* will used to save state upon exception entry from that EL.
******************************************************************************/
-void cm_init(void)
+void __init cm_init(void)
{
/*
* The context management library has only global data to intialize, but
diff --git a/lib/extensions/ras/ras_common.c b/lib/extensions/ras/ras_common.c
index 2e65eebb..f39e5f5f 100644
--- a/lib/extensions/ras/ras_common.c
+++ b/lib/extensions/ras/ras_common.c
@@ -128,7 +128,7 @@ static int ras_interrupt_handler(uint32_t intr_raw, uint32_t flags,
return 0;
}
-void ras_init(void)
+void __init ras_init(void)
{
#if ENABLE_ASSERTIONS
/* Check RAS interrupts are sorted */
diff --git a/lib/libc/printf.c b/lib/libc/printf.c
index 4480e94d..d50876d7 100644
--- a/lib/libc/printf.c
+++ b/lib/libc/printf.c
@@ -166,6 +166,7 @@ loop:
padn = (padn * 10) + (ch - '0');
fmt++;
}
+ assert(0); /* Unreachable */
default:
/* Exit on any other format specifier */
return -1;
diff --git a/lib/libc/snprintf.c b/lib/libc/snprintf.c
index 9bc07b2c..66a2fa2f 100644
--- a/lib/libc/snprintf.c
+++ b/lib/libc/snprintf.c
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
#include <debug.h>
#include <platform.h>
#include <stdarg.h>
@@ -117,6 +118,7 @@ int snprintf(char *s, size_t n, const char *fmt, ...)
ERROR("snprintf: specifier with ASCII code '%d' not supported.",
*fmt);
plat_panic_handler();
+ assert(0); /* Unreachable */
}
fmt++;
continue;
diff --git a/lib/locks/exclusive/spinlock.S b/lib/locks/exclusive/spinlock.S
deleted file mode 100644
index 2141f988..00000000
--- a/lib/locks/exclusive/spinlock.S
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#if !ERROR_DEPRECATED
-#include "./aarch64/spinlock.S"
-#endif
diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S
index 06d6636e..88db1c96 100644
--- a/lib/psci/aarch64/psci_helpers.S
+++ b/lib/psci/aarch64/psci_helpers.S
@@ -12,9 +12,6 @@
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
.globl psci_power_down_wfi
-#if !ERROR_DEPRECATED
- .globl psci_entrypoint
-#endif
/* -----------------------------------------------------------------------
* void psci_do_pwrdown_cache_maintenance(unsigned int power level);
@@ -131,12 +128,3 @@ func psci_power_down_wfi
wfi
no_ret plat_panic_handler
endfunc psci_power_down_wfi
-
-/* -----------------------------------------------------------------------
- * void psci_entrypoint(void);
- * The deprecated entry point for PSCI on warm boot for AArch64.
- * -----------------------------------------------------------------------
- */
-func_deprecated psci_entrypoint
- b bl31_warm_entrypoint
-endfunc_deprecated psci_entrypoint
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index ec74a8cd..adce843a 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -216,7 +216,7 @@ static void psci_set_req_local_pwr_state(unsigned int pwrlvl,
/******************************************************************************
* This function initializes the psci_req_local_pwr_states.
*****************************************************************************/
-void psci_init_req_local_pwr_states(void)
+void __init psci_init_req_local_pwr_states(void)
{
/* Initialize the requested state of all non CPU power domains as OFF */
unsigned int pwrlvl;
@@ -938,84 +938,6 @@ int psci_secondaries_brought_up(void)
return (n_valid > 1U) ? 1 : 0;
}
-#if ENABLE_PLAT_COMPAT
-/*******************************************************************************
- * PSCI Compatibility helper function to return the 'power_state' parameter of
- * the PSCI CPU SUSPEND request for the current CPU. Returns PSCI_INVALID_DATA
- * if not invoked within CPU_SUSPEND for the current CPU.
- ******************************************************************************/
-int psci_get_suspend_powerstate(void)
-{
- /* Sanity check to verify that CPU is within CPU_SUSPEND */
- if (psci_get_aff_info_state() == AFF_STATE_ON &&
- !is_local_state_run(psci_get_cpu_local_state()))
- return psci_power_state_compat[plat_my_core_pos()];
-
- return PSCI_INVALID_DATA;
-}
-
-/*******************************************************************************
- * PSCI Compatibility helper function to return the state id of the current
- * cpu encoded in the 'power_state' parameter. Returns PSCI_INVALID_DATA
- * if not invoked within CPU_SUSPEND for the current CPU.
- ******************************************************************************/
-int psci_get_suspend_stateid(void)
-{
- unsigned int power_state;
- power_state = psci_get_suspend_powerstate();
- if (power_state != PSCI_INVALID_DATA)
- return psci_get_pstate_id(power_state);
-
- return PSCI_INVALID_DATA;
-}
-
-/*******************************************************************************
- * PSCI Compatibility helper function to return the state id encoded in the
- * 'power_state' parameter of the CPU specified by 'mpidr'. Returns
- * PSCI_INVALID_DATA if the CPU is not in CPU_SUSPEND.
- ******************************************************************************/
-int psci_get_suspend_stateid_by_mpidr(unsigned long mpidr)
-{
- int cpu_idx = plat_core_pos_by_mpidr(mpidr);
-
- if (cpu_idx == -1)
- return PSCI_INVALID_DATA;
-
- /* Sanity check to verify that the CPU is in CPU_SUSPEND */
- if ((psci_get_aff_info_state_by_idx(cpu_idx) == AFF_STATE_ON) &&
- (!is_local_state_run(psci_get_cpu_local_state_by_idx(cpu_idx))))
- return psci_get_pstate_id(psci_power_state_compat[cpu_idx]);
-
- return PSCI_INVALID_DATA;
-}
-
-/*******************************************************************************
- * This function returns highest affinity level which is in OFF
- * state. The affinity instance with which the level is associated is
- * determined by the caller.
- ******************************************************************************/
-unsigned int psci_get_max_phys_off_afflvl(void)
-{
- psci_power_state_t state_info;
-
- zeromem(&state_info, sizeof(state_info));
- psci_get_target_local_pwr_states(PLAT_MAX_PWR_LVL, &state_info);
-
- return psci_find_target_suspend_lvl(&state_info);
-}
-
-/*******************************************************************************
- * PSCI Compatibility helper function to return target affinity level requested
- * for the CPU_SUSPEND. This function assumes affinity levels correspond to
- * power domain levels on the platform.
- ******************************************************************************/
-int psci_get_suspend_afflvl(void)
-{
- return psci_get_suspend_pwrlvl();
-}
-
-#endif
-
/*******************************************************************************
* Initiate power down sequence, by calling power down operations registered for
* this CPU.
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index e59e163e..6b3081eb 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -32,7 +32,7 @@ unsigned int psci_caps;
* Function which initializes the 'psci_non_cpu_pd_nodes' or the
* 'psci_cpu_pd_nodes' corresponding to the power level.
******************************************************************************/
-static void psci_init_pwr_domain_node(unsigned char node_idx,
+static void __init psci_init_pwr_domain_node(unsigned char node_idx,
unsigned int parent_idx,
unsigned char level)
{
@@ -80,7 +80,7 @@ static void psci_init_pwr_domain_node(unsigned char node_idx,
* mapping of the CPUs to indices via plat_core_pos_by_mpidr() and
* plat_my_core_pos() APIs.
*******************************************************************************/
-static void psci_update_pwrlvl_limits(void)
+static void __init psci_update_pwrlvl_limits(void)
{
int j, cpu_idx;
unsigned int nodes_idx[PLAT_MAX_PWR_LVL] = {0};
@@ -107,7 +107,7 @@ static void psci_update_pwrlvl_limits(void)
* informs the number of root power domains. The parent nodes of the root nodes
* will point to an invalid entry(-1).
******************************************************************************/
-static void populate_power_domain_tree(const unsigned char *topology)
+static void __init populate_power_domain_tree(const unsigned char *topology)
{
unsigned int i, j = 0U, num_nodes_at_lvl = 1U, num_nodes_at_next_lvl;
unsigned int node_index = 0U, num_children;
@@ -184,7 +184,7 @@ static void populate_power_domain_tree(const unsigned char *topology)
* | CPU 0 | CPU 1 | CPU 2 | CPU 3 |
* ------------------------------------------------
******************************************************************************/
-int psci_setup(const psci_lib_args_t *lib_args)
+int __init psci_setup(const psci_lib_args_t *lib_args)
{
const unsigned char *topology_tree;
diff --git a/lib/xlat_tables/aarch32/xlat_tables.c b/lib/xlat_tables/aarch32/xlat_tables.c
index 033e2375..55957031 100644
--- a/lib/xlat_tables/aarch32/xlat_tables.c
+++ b/lib/xlat_tables/aarch32/xlat_tables.c
@@ -61,22 +61,6 @@ void init_xlat_tables(void)
assert((PLAT_PHY_ADDR_SPACE_SIZE - 1U) <= get_max_supported_pa());
}
-/*******************************************************************************
- * Function for enabling the MMU in Secure PL1, assuming that the
- * page-tables have already been created.
- ******************************************************************************/
-#if !ERROR_DEPRECATED
-void enable_mmu_secure(unsigned int flags)
-{
- enable_mmu_svc_mon(flags);
-}
-
-void enable_mmu_direct(unsigned int flags)
-{
- enable_mmu_direct_svc_mon(flags);
-}
-#endif
-
void enable_mmu_svc_mon(unsigned int flags)
{
unsigned int mair0, ttbcr, sctlr;
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c
index ca67f2a0..a9aaeee8 100644
--- a/lib/xlat_tables/xlat_tables_common.c
+++ b/lib/xlat_tables/xlat_tables_common.c
@@ -176,7 +176,7 @@ void mmap_add(const mmap_region_t *mm)
{
const mmap_region_t *mm_cursor = mm;
- while (mm_cursor->size != 0U) {
+ while (mm_cursor->attr != 0U) {
mmap_add_region(mm_cursor->base_pa, mm_cursor->base_va,
mm_cursor->size, mm_cursor->attr);
mm_cursor++;
diff --git a/lib/xlat_tables/xlat_tables_private.h b/lib/xlat_tables/xlat_tables_private.h
index f882f7ef..fad967eb 100644
--- a/lib/xlat_tables/xlat_tables_private.h
+++ b/lib/xlat_tables/xlat_tables_private.h
@@ -15,23 +15,6 @@
#error xlat tables v2 must be used with HW_ASSISTED_COHERENCY
#endif
-/*
- * If the platform hasn't defined a physical and a virtual address space size
- * default to ADDR_SPACE_SIZE.
- */
-#if ERROR_DEPRECATED
-# ifdef ADDR_SPACE_SIZE
-# error "ADDR_SPACE_SIZE is deprecated. Use PLAT_xxx_ADDR_SPACE_SIZE instead."
-# endif
-#elif defined(ADDR_SPACE_SIZE)
-# ifndef PLAT_PHY_ADDR_SPACE_SIZE
-# define PLAT_PHY_ADDR_SPACE_SIZE ADDR_SPACE_SIZE
-# endif
-# ifndef PLAT_VIRT_ADDR_SPACE_SIZE
-# define PLAT_VIRT_ADDR_SPACE_SIZE ADDR_SPACE_SIZE
-# endif
-#endif
-
CASSERT(CHECK_VIRT_ADDR_SPACE_SIZE(PLAT_VIRT_ADDR_SPACE_SIZE),
assert_valid_virt_addr_space_size);
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c
index bf0cc9f5..f1807745 100644
--- a/lib/xlat_tables_v2/xlat_tables_context.c
+++ b/lib/xlat_tables_v2/xlat_tables_context.c
@@ -19,24 +19,6 @@
uint64_t mmu_cfg_params[MMU_CFG_PARAM_MAX];
/*
- * Each platform can define the size of its physical and virtual address spaces.
- * If the platform hasn't defined one or both of them, default to
- * ADDR_SPACE_SIZE. The latter is deprecated, though.
- */
-#if ERROR_DEPRECATED
-# ifdef ADDR_SPACE_SIZE
-# error "ADDR_SPACE_SIZE is deprecated. Use PLAT_xxx_ADDR_SPACE_SIZE instead."
-# endif
-#elif defined(ADDR_SPACE_SIZE)
-# ifndef PLAT_PHY_ADDR_SPACE_SIZE
-# define PLAT_PHY_ADDR_SPACE_SIZE ADDR_SPACE_SIZE
-# endif
-# ifndef PLAT_VIRT_ADDR_SPACE_SIZE
-# define PLAT_VIRT_ADDR_SPACE_SIZE ADDR_SPACE_SIZE
-# endif
-#endif
-
-/*
* Allocate and initialise the default translation context for the BL image
* currently executing.
*/
@@ -74,7 +56,7 @@ int mmap_remove_dynamic_region(uintptr_t base_va, size_t size)
#endif /* PLAT_XLAT_TABLES_DYNAMIC */
-void init_xlat_tables(void)
+void __init init_xlat_tables(void)
{
assert(tf_xlat_ctx.xlat_regime == EL_REGIME_INVALID);
@@ -121,18 +103,6 @@ int xlat_change_mem_attributes(uintptr_t base_va, size_t size, uint32_t attr)
#ifdef AARCH32
-#if !ERROR_DEPRECATED
-void enable_mmu_secure(unsigned int flags)
-{
- enable_mmu_svc_mon(flags);
-}
-
-void enable_mmu_direct(unsigned int flags)
-{
- enable_mmu_direct_svc_mon(flags);
-}
-#endif
-
void enable_mmu_svc_mon(unsigned int flags)
{
setup_mmu_cfg((uint64_t *)&mmu_cfg_params, flags,
diff --git a/lib/xlat_tables_v2/xlat_tables_core.c b/lib/xlat_tables_v2/xlat_tables_core.c
index 003718e7..3b6c6bcb 100644
--- a/lib/xlat_tables_v2/xlat_tables_core.c
+++ b/lib/xlat_tables_v2/xlat_tables_core.c
@@ -815,7 +815,7 @@ void mmap_add_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm)
{
const mmap_region_t *mm_cursor = mm;
- while (mm_cursor->size != 0U) {
+ while (mm_cursor->attr != 0U) {
mmap_add_region_ctx(ctx, mm_cursor);
mm_cursor++;
}
@@ -1012,7 +1012,7 @@ int mmap_remove_dynamic_region_ctx(xlat_ctx_t *ctx, uintptr_t base_va,
#endif /* PLAT_XLAT_TABLES_DYNAMIC */
-void init_xlat_tables_ctx(xlat_ctx_t *ctx)
+void __init init_xlat_tables_ctx(xlat_ctx_t *ctx)
{
assert(ctx != NULL);
assert(!ctx->initialized);