| 1 |
|
| 2 |
|
| 3 |
#ifndef SOC_INTEL_COMMON_BLOCK_SA_SERVER_H |
| 4 |
#define SOC_INTEL_COMMON_BLOCK_SA_SERVER_H |
| 5 |
|
| 6 |
#include <device/device.h> |
| 7 |
#include <device/pci_type.h> |
| 8 |
#include <stdbool.h> |
| 9 |
#include <stdint.h> |
| 10 |
|
| 11 |
enum sa_server_reg { |
| 12 |
MMCFG_BASE_REG, |
| 13 |
MMCFG_LIMIT_REG, |
| 14 |
TSEG_BASE_REG, |
| 15 |
TSEG_LIMIT_REG, |
| 16 |
TOCM_REG, |
| 17 |
TOUUD_REG, |
| 18 |
TOLUD_REG, |
| 19 |
MMIO_L_REG, |
| 20 |
VT_BAR_REG, |
| 21 |
DPR_REG, |
| 22 |
NUM_MAP_ENTRIES, |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
uint32_t sa_server_soc_reg_to_pci_offset(enum sa_server_reg reg); |
| 30 |
|
| 31 |
struct sa_server_mem_map_descriptor { |
| 32 |
uint32_t reg_offset; |
| 33 |
bool is_64_bit; |
| 34 |
bool is_limit; |
| 35 |
uint32_t alignment; |
| 36 |
}; |
| 37 |
|
| 38 |
uint64_t sa_server_read_map_entry(pci_devfn_t dev, |
| 39 |
const struct sa_server_mem_map_descriptor *entry); |
| 40 |
|
| 41 |
struct sa_server_mmio_descriptor { |
| 42 |
uint64_t base; |
| 43 |
uint64_t size; |
| 44 |
bool (*get_resource)(struct device *dev, uint64_t *base, uint64_t *size); |
| 45 |
const char *description; |
| 46 |
}; |
| 47 |
|
| 48 |
uintptr_t sa_server_get_tseg_base(void); |
| 49 |
|
| 50 |
size_t sa_server_get_tseg_size(void); |
| 51 |
|
| 52 |
uint64_t sa_server_get_touud(void); |
| 53 |
|
| 54 |
uintptr_t sa_server_get_tolud(void); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
bool sa_server_is_on_pch_domain(const struct device *dev); |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
void sa_server_add_mmio_resources( |
| 65 |
struct device *dev, int *resource_cnt, |
| 66 |
const struct sa_server_mmio_descriptor *sa_server_fixed_resources, size_t count); |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
void sa_server_soc_add_fixed_mmio_resources(struct device *dev, int *resource_cnt); |
| 75 |
|
| 76 |
#endif |