| 1 |
|
| 2 |
|
| 3 |
#include <soc/acpi.h> |
| 4 |
#include <soc/numa.h> |
| 5 |
#include <soc/util.h> |
| 6 |
|
| 7 |
unsigned long cxl_fill_srat(unsigned long current) |
| 8 |
{ |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
uint32_t base, size; |
| 16 |
for (uint8_t i = 0; i < pds.num_pds; i++) { |
| 17 |
if (pds.pds[i].pd_type != PD_TYPE_GENERIC_INITIATOR) |
| 18 |
continue; |
| 19 |
if (!pds.pds[i].dev) |
| 20 |
continue; |
| 21 |
|
| 22 |
printk(BIOS_DEBUG, "adding srat GIA ID: %d, dev: %s\n", i, dev_path(pds.pds[i].dev)); |
| 23 |
|
| 24 |
current += acpi_create_srat_gia_pci((acpi_srat_gia_t *)current, i, pds.pds[i].dev, 1); |
| 25 |
base = pds.pds[i].base << 16; |
| 26 |
size = pds.pds[i].size << 16; |
| 27 |
printk(BIOS_DEBUG, |
| 28 |
"adding srat MEM affinity domain: %d, base: 0x%x, size: 0x%x\n", i, base, |
| 29 |
size); |
| 30 |
current += |
| 31 |
acpi_create_srat_mem((acpi_srat_mem_t *)current, i, |
| 32 |
pds.pds[i].base << 16, pds.pds[i].size << 16, 1); |
| 33 |
} |
| 34 |
|
| 35 |
return current; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
unsigned long acpi_fill_hmat(unsigned long current) |
| 42 |
{ |
| 43 |
uint32_t pd_initiator = 0; |
| 44 |
uint32_t pd_memory = 0; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
uint8_t j; |
| 52 |
for (uint8_t i = soc_get_num_cpus(); i < pds.num_pds; i++) { |
| 53 |
pd_memory = i; |
| 54 |
|
| 55 |
for (j = 0; j < 8; j++) |
| 56 |
if ((pds.pds[i].socket_bitmap >> j) == 0) |
| 57 |
break; |
| 58 |
pd_initiator = j - 1; |
| 59 |
printk(BIOS_DEBUG, "HMAT: pd_initiator = %d, pd_memory = %d\n", pd_initiator, |
| 60 |
pd_memory); |
| 61 |
current += acpi_create_hmat_mpda((acpi_hmat_mpda_t *)current, pd_initiator, |
| 62 |
pd_memory); |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
return current; |
| 72 |
} |