xref: /rk3399_ARM-atf/plat/socionext/uniphier/tsp/uniphier_tsp_setup.c (revision 06f3c7058c42a9f1a9f7df75ea2de71a000855e8)
1 /*
2  * Copyright (c) 2017-2025, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <errno.h>
8 
9 #include <platform_def.h>
10 
11 #include <common/bl_common.h>
12 #include <plat/common/platform.h>
13 
14 #include "../uniphier.h"
15 
16 static unsigned int uniphier_soc = UNIPHIER_SOC_UNKNOWN;
17 
18 void tsp_early_platform_setup(u_register_t arg0, u_register_t arg1,
19 			      u_register_t arg2, u_register_t arg3)
20 {
21 	uniphier_soc = uniphier_get_soc_id();
22 	if (uniphier_soc == UNIPHIER_SOC_UNKNOWN)
23 		plat_error_handler(-ENOTSUP);
24 
25 	uniphier_console_setup(uniphier_soc);
26 }
27 
28 void tsp_platform_setup(void)
29 {
30 }
31 
32 void tsp_plat_arch_setup(void)
33 {
34 	uniphier_mmap_setup(uniphier_soc);
35 }
36