| 1 |
|
| 2 |
|
| 3 |
#define __SIMPLE_DEVICE__ |
| 4 |
|
| 5 |
#include <commonlib/bsd/helpers.h> |
| 6 |
#include <device/pci_ops.h> |
| 7 |
#include <intelblocks/systemagent_server.h> |
| 8 |
#include <soc/pci_devs.h> |
| 9 |
#include <soc/systemagent.h> |
| 10 |
|
| 11 |
uintptr_t sa_server_get_tseg_base(void) |
| 12 |
{ |
| 13 |
struct sa_server_mem_map_descriptor tseg_descriptor = { |
| 14 |
.reg_offset = sa_server_soc_reg_to_pci_offset(TSEG_BASE_REG), |
| 15 |
}; |
| 16 |
|
| 17 |
return sa_server_read_map_entry(SA_DEV_ROOT, &tseg_descriptor); |
| 18 |
} |
| 19 |
|
| 20 |
size_t sa_server_get_tseg_size(void) |
| 21 |
{ |
| 22 |
struct sa_server_mem_map_descriptor tseg_descriptor = { |
| 23 |
.reg_offset = sa_server_soc_reg_to_pci_offset(TSEG_LIMIT_REG), |
| 24 |
.is_limit = true, |
| 25 |
}; |
| 26 |
|
| 27 |
return sa_server_read_map_entry(SA_DEV_ROOT, &tseg_descriptor) - |
| 28 |
sa_server_get_tseg_base(); |
| 29 |
} |