1 /*
2  * Copyright (c) 2021, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef FCONF_ETHOSN_GETTER_H
8 #define FCONF_ETHOSN_GETTER_H
9 
10 #include <assert.h>
11 
12 #include <lib/fconf/fconf.h>
13 
14 #define hw_config__ethosn_config_getter(prop) ethosn_config.prop
15 #define hw_config__ethosn_core_addr_getter(idx) __extension__ ({	\
16 	assert(idx < ethosn_config.num_cores);				\
17 	ethosn_config.core[idx].addr;					\
18 })
19 
20 #define ETHOSN_STATUS_DISABLED U(0)
21 #define ETHOSN_STATUS_ENABLED  U(1)
22 
23 #define ETHOSN_CORE_NUM_MAX U(64)
24 
25 struct ethosn_core_t {
26 	uint64_t addr;
27 };
28 
29 struct ethosn_config_t {
30 	uint32_t num_cores;
31 	struct ethosn_core_t core[ETHOSN_CORE_NUM_MAX];
32 };
33 
34 int fconf_populate_arm_ethosn(uintptr_t config);
35 
36 extern struct ethosn_config_t ethosn_config;
37 
38 #endif /* FCONF_ETHOSN_GETTER_H */
39