Raul E Rangel | 0f3bc81 | 2021-02-10 16:36:33 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <acpi/acpi.h> |
| 4 | #include <amdblocks/acpi.h> |
Raul E Rangel | ffab5e6 | 2021-02-11 11:07:11 -0700 | [diff] [blame^] | 5 | #include <amdblocks/chip.h> |
Raul E Rangel | 0f3bc81 | 2021-02-10 16:36:33 -0700 | [diff] [blame] | 6 | #include <device/device.h> |
| 7 | #include <types.h> |
| 8 | |
| 9 | unsigned long southbridge_write_acpi_tables(const struct device *device, |
| 10 | unsigned long current, |
| 11 | struct acpi_rsdp *rsdp) |
| 12 | { |
| 13 | return acpi_write_hpet(device, current, rsdp); |
| 14 | } |
Raul E Rangel | 0e560e7 | 2021-02-11 10:10:57 -0700 | [diff] [blame] | 15 | |
| 16 | unsigned long acpi_fill_mcfg(unsigned long current) |
| 17 | { |
| 18 | |
| 19 | current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *)current, |
| 20 | CONFIG_MMCONF_BASE_ADDRESS, |
| 21 | 0, |
| 22 | 0, |
| 23 | CONFIG_MMCONF_BUS_NUMBER - 1); |
| 24 | |
| 25 | return current; |
| 26 | } |
Raul E Rangel | ffab5e6 | 2021-02-11 11:07:11 -0700 | [diff] [blame^] | 27 | |
| 28 | unsigned long acpi_fill_madt_irqoverride(unsigned long current) |
| 29 | { |
| 30 | const struct soc_amd_common_config *cfg = soc_get_common_config(); |
| 31 | unsigned int i; |
| 32 | uint8_t irq; |
| 33 | uint8_t flags; |
| 34 | |
| 35 | for (i = 0; i < ARRAY_SIZE(cfg->irq_override); ++i) { |
| 36 | irq = cfg->irq_override[i].irq; |
| 37 | flags = cfg->irq_override[i].flags; |
| 38 | |
| 39 | if (!flags) |
| 40 | continue; |
| 41 | |
| 42 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)current, 0, |
| 43 | irq, irq, flags); |
| 44 | } |
| 45 | |
| 46 | return current; |
| 47 | } |