From: Jan Kiszka <[email protected]> This register does not belong to the LPC PCI device. Thus, accessing it directly is not only appropriate: Some BIOSes refuse the access via the PCI protocol and EFI_PCI_IO_PASS_THROUGH_BAR, causing the no reboot flag update to fail. See with QEMU and TianoCore e.g.
Signed-off-by: Jan Kiszka <[email protected]> --- drivers/watchdog/itco.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/watchdog/itco.c b/drivers/watchdog/itco.c index 7114978..007da60 100644 --- a/drivers/watchdog/itco.c +++ b/drivers/watchdog/itco.c @@ -199,7 +199,8 @@ static EFI_STATUS update_no_reboot_flag_mem(EFI_PCI_IO *pci_io, { const iTCO_regs* regs = &iTCO_version_regs[itco->itco_version]; EFI_STATUS status; - UINT32 pmc_base, value; + UINT32 pmc_base; + UINTN pmc_reg; status = uefi_call_wrapper(pci_io->Pci.Read, 5, pci_io, EfiPciIoWidthUint32, @@ -209,21 +210,9 @@ static EFI_STATUS update_no_reboot_flag_mem(EFI_PCI_IO *pci_io, } pmc_base &= regs->pmc_base_addr_mask; - status = uefi_call_wrapper(pci_io->Mem.Read, 6, pci_io, - EfiPciIoWidthUint32, - EFI_PCI_IO_PASS_THROUGH_BAR, - pmc_base + regs->pmc_reg, 1, &value); - if (EFI_ERROR(status)) { - return status; - } - value &= ~regs->pmc_no_reboot_mask; - status = uefi_call_wrapper(pci_io->Mem.Write, 6, pci_io, - EfiPciIoWidthUint32, - EFI_PCI_IO_PASS_THROUGH_BAR, - pmc_base + regs->pmc_reg, 1, &value); - if (EFI_ERROR(status)) { - return status; - } + pmc_reg = pmc_base + regs->pmc_reg; + *(volatile UINT32 *)pmc_reg &= ~regs->pmc_no_reboot_mask; + return status; } -- 2.26.2 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/97212836d2ec2c7ec5aa385c28248751061df46d.1622447849.git.jan.kiszka%40siemens.com.
