xref: /rk3399_ARM-atf/plat/xilinx/versal/pm_service/pm_client.c (revision c73a90e571e763e3afc1d9cbef09e7d134b25af8)
1 /*
2  * Copyright (c) 2019, Xilinx, Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /*
8  * APU specific definition of processors in the subsystem as well as functions
9  * for getting information about and changing state of the APU.
10  */
11 
12 #include <plat_ipi.h>
13 #include <platform_def.h>
14 #include <versal_def.h>
15 #include <lib/bakery_lock.h>
16 #include "pm_client.h"
17 
18 DEFINE_BAKERY_LOCK(pm_client_secure_lock);
19 
20 static const struct pm_ipi apu_ipi = {
21 	.local_ipi_id = IPI_ID_APU,
22 	.remote_ipi_id = IPI_ID_PMC,
23 	.buffer_base = IPI_BUFFER_APU_BASE,
24 };
25 
26 /* Order in pm_procs_all array must match cpu ids */
27 static const struct pm_proc pm_procs_all[] = {
28 	{
29 		.node_id = XPM_DEVID_ACPU_0,
30 		.ipi = &apu_ipi,
31 	},
32 	{
33 		.node_id = XPM_DEVID_ACPU_1,
34 		.ipi = &apu_ipi,
35 	}
36 };
37 
38 const struct pm_proc *primary_proc = &pm_procs_all[0];
39