Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 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); \ |
Laurent Carlier | 5205df2 | 2021-09-16 15:10:35 +0100 | [diff] [blame] | 17 | ethosn_config.core[idx].addr; \ |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 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 | |
Laurent Carlier | 5205df2 | 2021-09-16 15:10:35 +0100 | [diff] [blame] | 25 | struct ethosn_core_t { |
| 26 | uint64_t addr; |
| 27 | }; |
| 28 | |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 29 | struct ethosn_config_t { |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 30 | uint32_t num_cores; |
Laurent Carlier | 5205df2 | 2021-09-16 15:10:35 +0100 | [diff] [blame] | 31 | struct ethosn_core_t core[ETHOSN_CORE_NUM_MAX]; |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 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 */ |