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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47534 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
695dd2977b
commit
a1f65bed10
@ -40,6 +40,9 @@ union p2sb_bdf {
|
|||||||
|
|
||||||
union p2sb_bdf p2sb_get_hpet_bdf(void);
|
union p2sb_bdf p2sb_get_hpet_bdf(void);
|
||||||
void p2sb_set_hpet_bdf(union p2sb_bdf bdf);
|
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 */
|
/* SOC overrides */
|
||||||
/*
|
/*
|
||||||
|
@ -73,6 +73,25 @@ void p2sb_set_hpet_bdf(union p2sb_bdf bdf)
|
|||||||
pci_write_config16(PCH_DEV_P2SB, PCH_P2SB_HBDF, bdf.raw);
|
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)
|
static void p2sb_set_hide_bit(int hide)
|
||||||
{
|
{
|
||||||
const uint16_t reg = PCH_P2SB_E0 + 1;
|
const uint16_t reg = PCH_P2SB_E0 + 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user