Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47534 )
Change subject: soc/intel/common/block/p2sb: Add ioapic BDF functions ......................................................................
soc/intel/common/block/p2sb: Add ioapic BDF functions
This allows to get/set the IOAPIC bus device function.
Change-Id: Ib5bb409efbcbc5729cf0e996655c7ac3f6a78223 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/common/block/include/intelblocks/p2sb.h M src/soc/intel/common/block/p2sb/p2sb.c 2 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/47534/1
diff --git a/src/soc/intel/common/block/include/intelblocks/p2sb.h b/src/soc/intel/common/block/include/intelblocks/p2sb.h index 7cf0c48..33102db 100644 --- a/src/soc/intel/common/block/include/intelblocks/p2sb.h +++ b/src/soc/intel/common/block/include/intelblocks/p2sb.h @@ -40,6 +40,9 @@
union p2sb_bdf p2sb_get_hpet_bdf(void); void p2sb_set_hpet_bdf(union p2sb_bdf bdf); +union p2sb_bdf p2sb_get_ioapic_bdf(void); +void p2sb_set_ioapic_bdf(union p2sb_bdf bdf); +
/* SOC overrides */ /* diff --git a/src/soc/intel/common/block/p2sb/p2sb.c b/src/soc/intel/common/block/p2sb/p2sb.c index 93f711f..716b4ee 100644 --- a/src/soc/intel/common/block/p2sb/p2sb.c +++ b/src/soc/intel/common/block/p2sb/p2sb.c @@ -72,6 +72,22 @@ pci_write_config16(PCH_DEV_P2SB, PCH_P2SB_HBDF, bdf.raw); }
+union p2sb_bdf p2sb_get_ioapic_bdf(void) +{ + union p2sb_bdf bdf; + bool p2sb_state = p2sb_is_hiden(); + p2sb_unhide(); + bdf.raw = pci_read_config16(PCH_DEV_P2SB, PCH_P2SB_IBDF); + if (p2sb_state) + p2sb_hide(); + return bdf; +} + +void p2sb_set_ioapic_bdf(union p2sb_bdf bdf) +{ + pci_write_config16(PCH_DEV_P2SB, PCH_P2SB_IBDF, bdf.raw); +} + static void p2sb_set_hide_bit(int hide) { const uint16_t reg = PCH_P2SB_E0 + 1;