Drtm payload 25.12#926
Conversation
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
…r IOMMU Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Move the GNB IOAPIC enabling to northbridge init where the IOAPIC is initialized. Remove the comment about IoapicSbFeatureEn, this bit is not touched here. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
… register Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Introduce PCI_DEVID macro which allows to construct PCI device addresses or range with bus numbers. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
…e area Use the IORESOURCE_SOFT_RESERVE attribute to reserve CC6 save state DRAM. Using regualr reserved memory makes it hard on EDK2 to detect if it is MMIO or reserved DRAM, as TOM2 is equal to the base of the CC6 save state area, not its limit. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Per family 16h models 30h-3fh BKDG the IoapicSbFeatureEn must be configured according to the interrupt routing mode selecte by OS. If OS chose APIC mode, the IoapicSbFeatureEn must be cleared. Otherwise, it must be set, meaning PIC mode is used. Add a hook to _PIC method to call SoC/northbridge specific code to set/clear the bit to configure GNB IOAPIC properly. ACPI specification says that _PIC method is optional and can be called by OSPM to provide the interrupt routing mode information to the firmware. However, if the method is not called, the firmware must assume PIC mode is used. AGESA sets the IoapicSbFeatureEn already to be compliant with ACPI. Previously, coreboot cleared the bit unconditionally and left a comment to move that part to DSDT. The hook allows to clear the IoapicSbFeatureEn bit if OS chooses APIC mode for interrupt routing. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Needed early in build to use sklt.h header Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Modeled after BL31's code from arm64 Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
8abdcd7 to
a2678b4
Compare
SergiiDmytruk
left a comment
There was a problem hiding this comment.
Reviewed the changes in more detail.
| #endif | ||
|
|
||
| External (\_SB.NAPE, MethodObj) | ||
| External (\_SB.PCI0.NAPE, MethodObj) |
There was a problem hiding this comment.
Can't simply rename this, the change is in upstream and will break AMD Turin (see soc/amd/turin_poc/acpi/ioapic_routing.asl).
Getting rid of PCI0 will affect other methods, so maybe permit both names and pick one via CondRefOf.
There was a problem hiding this comment.
I pulled it from apu2_fix_iommu and rebased it as-is, in fact everything before the drtm stuff is from that branch. if its not needed at all I could just drop those commits.
| If (CondRefOf (\_SB.PCI0.NAPE)) | ||
| { | ||
| \_SB.NAPE() | ||
| \_SB.PCI0.NAPE(Arg0 & 1) |
There was a problem hiding this comment.
For compatibility, the parameter should be dropped in favour of using PICM.
| #define CAP_OFFSET_10_MSI_NUM_PPR_SHIFT 27 | ||
| #define CAP_OFFSET_10_MSI_NUM_PPR (0x1f << CAP_OFFSET_10_MSI_NUM_PPR_SHIFT) | ||
|
|
||
| #define PCI_DEVID(BUS, DEV, FN) ( \ |
There was a problem hiding this comment.
src/include/device/pci_def.h seems like a better place for this macro, that's where PCI_DEVFN is defined.
There was a problem hiding this comment.
honestly unsure if I even need the stuff before the drtm commits at this point. I should give that a test, try to focus effort in one area.
| slrt->magic = 0x4452544d; | ||
| slrt->revision = 0x1; | ||
| slrt->architecture = 0x2; |
There was a problem hiding this comment.
Better to use constants like in https://github.com/TrenchBoot/grub/blob/tb-dev/include/grub/slr_table.h.
There was a problem hiding this comment.
Yeah definitely, was mostly just 'banging it out' to get it to actually start talking to me.
| slrt->size = 16; | ||
| slrt->max_size = 0; |
There was a problem hiding this comment.
slrt->size is sizeof(*slrt) and slrt->max_size should be 64*KiB - bootloader_data_offset (64*KiB - (skl - (void *)slrt) above is a more complicated way of computing the same).
| */ | ||
| _Static_assert(sizeof(skl) == 4); | ||
|
|
||
| hexdump(prog, sizeof(*prog)); |
There was a problem hiding this comment.
Don't see a need to keep this.
There was a problem hiding this comment.
the assert or the hexdump?
There was a problem hiding this comment.
The hexdump() invocation. The lines above it are shown by GitHub as a context.
| skl = memalign(64*KiB, 64*KiB); | ||
|
|
||
| cbfs_load(CONFIG_CBFS_PREFIX "/drtm_payload", skl, 64*KiB); |
There was a problem hiding this comment.
Both functions can fail. This function should die() in such cases, because simply returning will apparently result in repeated invocation with possibly weird side-effects.
| [submodule "3rdparty/secure-kernel-loader"] | ||
| path = 3rdparty/secure-kernel-loader | ||
| url = https://github.com/hanetzer/trenchboot-secure-kernel-loader |
There was a problem hiding this comment.
If we don't need to have SKL as a submodule, I think it's worth avoiding adding one. Adding submodules results in them being checked out for no use and also require setting up a mirror in upstream coreboot.
There was a problem hiding this comment.
yeah I can probably drop this and some related bits, this was when I was trying for explicitly using slrt.h from skl itself; when its done via payloads/external it doesn't exist early enough for compiling the ramstage.
Replacement of #916, can't change my branch, just the target. Hoping to avoid losing the comments there. Sorry for the noise.