diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-10-01 00:36:02 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-10-21 07:46:25 -0600 |
commit | bbbcb5262839e19fa4c327e1797db08468fc6743 (patch) | |
tree | 496efda53b1c41eda2eb30741cb6acf30fa24962 /drivers | |
parent | 069155cbb44c1e9e45676ac64e3c95f76a8d5820 (diff) | |
download | u-boot-imx-bbbcb5262839e19fa4c327e1797db08468fc6743.zip u-boot-imx-bbbcb5262839e19fa4c327e1797db08468fc6743.tar.gz u-boot-imx-bbbcb5262839e19fa4c327e1797db08468fc6743.tar.bz2 |
dm: pci: Enable VGA address forwarding on bridges
To support graphics card behind a PCI bridge, the bridge control
register (offset 0x3e) in the configuration space must turn on
VGA address forwarding.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci-uclass.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index d15de5a..1d93194 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -364,9 +364,23 @@ int dm_pci_read_config32(struct udevice *dev, int offset, u32 *valuep) return 0; } +static void set_vga_bridge_bits(struct udevice *dev) +{ + struct udevice *parent = dev->parent; + u16 bc; + + while (parent->seq != 0) { + dm_pci_read_config16(parent, PCI_BRIDGE_CONTROL, &bc); + bc |= PCI_BRIDGE_CTL_VGA; + dm_pci_write_config16(parent, PCI_BRIDGE_CONTROL, bc); + parent = parent->parent; + } +} + int pci_auto_config_devices(struct udevice *bus) { struct pci_controller *hose = bus->uclass_priv; + struct pci_child_platdata *pplat; unsigned int sub_bus; struct udevice *dev; int ret; @@ -386,6 +400,10 @@ int pci_auto_config_devices(struct udevice *bus) return ret; max_bus = ret; sub_bus = max(sub_bus, max_bus); + + pplat = dev_get_parent_platdata(dev); + if (pplat->class == (PCI_CLASS_DISPLAY_VGA << 8)) + set_vga_bridge_bits(dev); } debug("%s: done\n", __func__); |