nb/intel/gm45/iommu.c: Fix regression when updating PCI command

Commit 5ac723e (nb/intel: Fix 16-bit read/write PCI_COMMAND register)
uses `pci_read_config8` to read the PCI command register, which does not
correspond with what has been stated in the commit message. Moreover, it
potentially breaks things, as the upper byte of the PCI command register
is now being cleared.

So, restore the original behaviour of the code, using 16-bit accesses.

Fixes: 5ac723e (nb/intel: Fix 16-bit read/write PCI_COMMAND register)
Change-Id: Id2c42ea8551a2fa2fa5c64e8fff8940d8304fbe0
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42148
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Angel Pons 2020-06-07 18:41:33 +02:00 committed by Felix Held
parent 2f3456a873
commit 8ad0a4c0b8
1 changed files with 1 additions and 3 deletions

View File

@ -43,9 +43,7 @@ void init_iommu()
memset(bar, 0, 2<<20); memset(bar, 0, 2<<20);
/* and now disable again */ /* and now disable again */
u16 cmd = pci_read_config8(igd, PCI_COMMAND); pci_and_config16(igd, PCI_COMMAND, ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY));
cmd &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
pci_write_config16(igd, PCI_COMMAND, cmd);
pci_write_config32(igd, PCI_BASE_ADDRESS_0, 0); pci_write_config32(igd, PCI_BASE_ADDRESS_0, 0);
} }