Debian Codegraph @

src/soc/amd/genoa_poc/root_complex.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <amdblocks/ioapic.h>
4 #include <amdblocks/root_complex.h>
5 #include <types.h>
6
7 /*
8 * The order of IOHCs here is not random. They are sorted so that:
9 * 1. The First IOHC is the one with primary FCH. We want the LPC/SMBUS
10 * devices be on bus 0.
11 * 2. The rest of IOHCs are listed in an order so that ECAM MMIO region is one
12 * continuous block for all domains.
13 *
14 * AGESA/OpenSIL sets up the PCI configuration decoding ranges in line with
15 * this.
16 */
17 static const struct domain_iohc_info iohc_info[] = {
18 [0] = {
19 .fabric_id = 0x22,
20 .misc_smn_base = SMN_IOHC_MISC_BASE_13C1,
21 },
22 [1] = {
23 .fabric_id = 0x23,
24 .misc_smn_base = SMN_IOHC_MISC_BASE_13B1,
25 },
26 [2] = {
27 .fabric_id = 0x21,
28 .misc_smn_base = SMN_IOHC_MISC_BASE_13E1,
29 },
30 [3] = {
31 .fabric_id = 0x20,
32 .misc_smn_base = SMN_IOHC_MISC_BASE_13D1,
33 },
34 };
35
36 const struct domain_iohc_info *get_iohc_info(size_t *count)
37 {
38 *count = ARRAY_SIZE(iohc_info);
39 return iohc_info;
40 }
41
42 static const struct non_pci_mmio_reg non_pci_mmio[] = {
43 { 0x2d8, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
44 { 0x2e0, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
45 { 0x2e8, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
46 /* The hardware has a 256 byte alignment requirement for the IOAPIC MMIO base, but we
47 tell the FSP to configure a 4k-aligned base address and this is reported as 4 KiB
48 resource. */
49 { 0x2f0, 0xffffffffff00ull, 4 * KiB, IOMMU_IOAPIC_IDX },
50 { 0x2f8, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
51 { 0x300, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
52 { 0x308, 0xfffffffff000ull, 4 * KiB, NON_PCI_RES_IDX_AUTO },
53 { 0x310, 0xfffffff00000ull, 1 * MiB, NON_PCI_RES_IDX_AUTO },
54 { 0x318, 0xfffffff80000ull, 512 * KiB, NON_PCI_RES_IDX_AUTO },
55 };
56
57 const struct non_pci_mmio_reg *get_iohc_non_pci_mmio_regs(size_t *count)
58 {
59 *count = ARRAY_SIZE(non_pci_mmio);
60 return non_pci_mmio;
61 }