[U-Boot] [PATCH 4/6] dm: pci: Enable VGA address forwarding on bridges

2015-10-01 Thread Bin Meng
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 
---

 drivers/pci/pci-uclass.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 0035ac7..7b01a13 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;
@@ -382,6 +396,10 @@ int pci_auto_config_devices(struct udevice *bus)
debug("%s: device %s\n", __func__, dev->name);
max_bus = pciauto_config_device(hose, pci_get_bdf(dev));
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__);
 
-- 
1.8.2.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] dm: pci: Enable VGA address forwarding on bridges

2015-10-03 Thread Simon Glass
On 1 October 2015 at 08:36, Bin Meng  wrote:
> 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 
> ---
>
>  drivers/pci/pci-uclass.c | 18 ++
>  1 file changed, 18 insertions(+)

Acked-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] dm: pci: Enable VGA address forwarding on bridges

2015-10-18 Thread Simon Glass
On 3 October 2015 at 08:29, Simon Glass  wrote:
> On 1 October 2015 at 08:36, Bin Meng  wrote:
>> 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 
>> ---
>>
>>  drivers/pci/pci-uclass.c | 18 ++
>>  1 file changed, 18 insertions(+)
>
> Acked-by: Simon Glass 

Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot