blob: fcdc31f8b20329812c4dd427e6ec817c60e3ca8b [file] [log] [blame]
Mikael Olsson7da66192021-02-12 17:30:22 +01001/*
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); \
Laurent Carlier5205df22021-09-16 15:10:35 +010017 ethosn_config.core[idx].addr; \
Mikael Olsson7da66192021-02-12 17:30:22 +010018})
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
Laurent Carlier5205df22021-09-16 15:10:35 +010025struct ethosn_core_t {
26 uint64_t addr;
27};
28
Mikael Olsson7da66192021-02-12 17:30:22 +010029struct ethosn_config_t {
Mikael Olsson7da66192021-02-12 17:30:22 +010030 uint32_t num_cores;
Laurent Carlier5205df22021-09-16 15:10:35 +010031 struct ethosn_core_t core[ETHOSN_CORE_NUM_MAX];
Mikael Olsson7da66192021-02-12 17:30:22 +010032};
33
34int fconf_populate_arm_ethosn(uintptr_t config);
35
36extern struct ethosn_config_t ethosn_config;
37
38#endif /* FCONF_ETHOSN_GETTER_H */