From: Bin Meng Date: Thu, 1 Oct 2015 07:35:59 +0000 (-0700) Subject: pci: Set PCI_COMMAND_IO bit for VGA device X-Git-Tag: v2016.01-rc1~298^2~55 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cdf9f085f209ba214178fe749133096721a208a6;p=u-boot pci: Set PCI_COMMAND_IO bit for VGA device PCI_COMMAND_IO bit must be set for VGA device as it needs to respond to legacy VGA IO address. Signed-off-by: Bin Meng Acked-by: Simon Glass --- diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index 79f27c744b..0412bf3515 100644 --- a/drivers/pci/pci_auto.c +++ b/drivers/pci/pci_auto.c @@ -89,6 +89,7 @@ void pciauto_setup_device(struct pci_controller *hose, struct pci_region *bar_res; int found_mem64 = 0; #endif + u16 class; pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat); cmdstat = (cmdstat & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) | PCI_COMMAND_MASTER; @@ -206,6 +207,11 @@ void pciauto_setup_device(struct pci_controller *hose, } #endif + /* PCI_COMMAND_IO must be set for VGA device */ + pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class); + if (class == PCI_CLASS_DISPLAY_VGA) + cmdstat |= PCI_COMMAND_IO; + pci_hose_write_config_word(hose, dev, PCI_COMMAND, cmdstat); pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE, CONFIG_SYS_PCI_CACHE_LINE_SIZE);