summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/p2sb.h3
-rw-r--r--src/soc/intel/common/block/p2sb/p2sb.c19
2 files changed, 22 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/p2sb.h b/src/soc/intel/common/block/include/intelblocks/p2sb.h
index 819b9403a3..436861c924 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 {
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 fd54a08dda..05bef2bc4e 100644
--- a/src/soc/intel/common/block/p2sb/p2sb.c
+++ b/src/soc/intel/common/block/p2sb/p2sb.c
@@ -73,6 +73,25 @@ void p2sb_set_hpet_bdf(union p2sb_bdf bdf)
pci_write_config16(PCH_DEV_P2SB, PCH_P2SB_HBDF, bdf.raw);
}
+union p2sb_bdf p2sb_get_ioapic_bdf(void)
+{
+ const bool was_hidden = p2sb_is_hidden();
+ if (was_hidden)
+ p2sb_unhide();
+
+ union p2sb_bdf bdf = { .raw = pci_read_config16(PCH_DEV_P2SB, PCH_P2SB_IBDF) };
+
+ if (was_hidden)
+ 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;