x86/mrst/pci: assign d3_delay to 0 for
PATCH 1/2 x86/mrst/pci: assign d3_delay to 0 for
From: Jacob Pan <[email protected]>
Langwell devices are not true pci devices, they are not subject to the 10 ms d3 to d0 delay required by pci spec. This patch assigns d3_delay to 0 for all langwell pci devices.
We can also power off devices that are not really used by the OS
---
arch/x86/pci/mrst.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
arch/x86/pci/mrst.c +24 -0
@@ -239,6 +239,30 @@ int __init pci_mrst_init(void)return 1 ; } +/* Langwell devices are not true pci devices, they are not subject to 10 ms +* d3 to d0 delay required by pci spec. +*/ +static void __devinit pci_d3delay_fixup (struct pci_dev *dev) +{ +/* true pci devices in lincroft should allow type 1 access, the rest +* are langwell fake pci devices. +*/ +if (type1_access_ok (dev->bus->number, dev->devfn,PCI_DEVICE_ID )) +return ; + dev->d3_delay =0 ; +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_ANY_ID , pci_d3delay_fixup); + +static void __devinit mrst_power_off_unused_dev (struct pci_dev *dev) +{ +pci_set_power_state (dev, PCI_D3cold); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0801 , mrst_power_off_unused_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0809 , mrst_power_off_unused_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x080C , mrst_power_off_unused_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0812 , mrst_power_off_unused_dev); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0815 , mrst_power_off_unused_dev); +/* * Langwell devices reside at fixed offsets, don't try to move them. */
PATCH 2/2 commit 203b4da511d52cc98c720cab67745f23e42232e4
From: Jacob Pan <[email protected]>
v4l/atomisp: treat atomisp as real pci device
ATOMISP on Medfield is a real PCI device which should be handled differently than the fake PCI devices on south complex. PCI type 1 access is used for accessing config space this also has other impact such as PM D3 delay. There shouldn't be any need for reading base address from IUNIT via msg bus.
---
arch/x86/pci/mrst.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/pci/mrst.c +3 -1
@@ -148,7 +148,9 @@ static bool type1_access_ok(unsigned int bus, unsigned int devfn, int reg)*/ if (reg >=0x100 || reg ==PCI_STATUS || reg ==PCI_HEADER_TYPE )return 0 ; -if (bus ==0 && (devfn ==PCI_DEVFN (2 ,0 ) || devfn ==PCI_DEVFN (0 ,0 ))) +if (bus ==0 && (devfn ==PCI_DEVFN (2 ,0 ) + || devfn ==PCI_DEVFN (0 ,0 ) + || devfn ==PCI_DEVFN (3 ,0 )))return 1 ;return 0 ;/* langwell on others */ }