Shelley Chen has submitted this change. ( https://review.coreboot.org/c/coreboot/+/79672?usp=email )
Change subject: soc/amd/common/pi/agesawrapper: use is_dev_enabled(DEV_PTR()) ......................................................................
soc/amd/common/pi/agesawrapper: use is_dev_enabled(DEV_PTR())
Since we have chipset devicetrees for all SoCs that include this code in the build, we can use the DEV_PTR macro instead of using pcidev_path_on_root to get the device struct pointer. We can also use the is_dev_enabled function instead of checking the value of the enabled element of the device struct directly.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I5dcd92399e2d3f304352f2170dd3ef8761e86541 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79672 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/pi/agesawrapper.c 1 file changed, 1 insertion(+), 2 deletions(-)
Approvals: Felix Singer: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/soc/amd/common/pi/agesawrapper.c b/src/soc/amd/common/pi/agesawrapper.c index 2539a1d..beae4ba 100644 --- a/src/soc/amd/common/pi/agesawrapper.c +++ b/src/soc/amd/common/pi/agesawrapper.c @@ -260,8 +260,7 @@ { AGESA_STATUS Status;
- const struct device *dev = pcidev_path_on_root(IOMMU_DEVFN); - if (dev && dev->enabled) { + if (is_dev_enabled(DEV_PTR(iommu))) { LateParams->GnbLateConfiguration.GnbIoapicId = GNB_IOAPIC_ID; LateParams->GnbLateConfiguration.FchIoapicId = FCH_IOAPIC_ID; }