libdmx: Add fso-specs to DEPENDS
[openembedded.git] / recipes / linux / linux-2.6.24 / hipox / hipox-pci-config-delay.patch
blob6b7fd9e0b23843643b4c2c29015c2647ce81b263
1 --- linux-2.6.24.org/arch/arm/mach-hipox/pci.c 2009-03-09 14:26:43.000000000 +0100
2 +++ linux-2.6.24/arch/arm/mach-hipox/pci.c 2009-03-09 14:31:12.000000000 +0100
3 @@ -25,6 +25,7 @@
4 #include <linux/interrupt.h>
5 #include <linux/init.h>
6 #include <linux/delay.h>
7 +#include <linux/jiffies.h>
9 #include <asm/io.h>
10 #include <asm/hardware.h>
11 @@ -71,6 +72,12 @@
13 extern spinlock_t hipox_gpio_spinlock;
15 +#ifdef CONFIG_HIPOX_PCI_RESET
16 +static unsigned long pci_trhfa_startwait = 0;
17 +static unsigned long pci_trhfa_msec = 0;
18 +static unsigned long pci_trhfa_timeout = 0;
19 +#endif // CONFIG_HIPOX_PCI_RESET
21 #define PCI_BUS_NONMEM_START 0x00000000
22 #define PCI_BUS_NONMEM_SIZE 0x00080000
24 @@ -505,6 +512,15 @@
25 struct pci_bus *hipox_pci_scan_bus(int nr, struct pci_sys_data *sys)
27 // printk(KERN_DEBUG "PCI: hipox_pci_scan_bus\n");
29 +#ifdef CONFIG_HIPOX_PCI_RESET
30 + printk(KERN_DEBUG "PCI: hipox_pci_scan_bus now it's %lu, still waiting till %lu to become ready for config\n", jiffies, pci_trhfa_timeout);
31 + if (time_after_eq(jiffies + msecs_to_jiffies(pci_trhfa_msec), pci_trhfa_timeout)) /* ensure not wrap */
32 + while(time_before(jiffies, pci_trhfa_timeout))
33 + udelay(100);
34 + printk(KERN_DEBUG "PCI: hipox_pci_scan_bus waited from %lu to %lu to become ready for config\n", pci_trhfa_startwait, jiffies);
35 +#endif // CONFIG_HIPOX_PCI_RESET
37 return pci_scan_bus(sys->busnr, &hipox_pci_ops, sys);
40 @@ -651,6 +667,16 @@
42 static int __init hipox_pci_init(void)
44 +#ifdef CONFIG_HIPOX_PCI_RESET
45 + // CPU has reset PCI bus via GPIO.
46 + // According to PCI spec, we have to wait for 2^25 PCI clocks to meet
47 + // the PCI timing parameter Trhfa (RST# high to first access).
48 + pci_trhfa_startwait = jiffies;
49 + pci_trhfa_msec = 1000; // 1 sec should be fine for 33MHz
50 + pci_trhfa_timeout = jiffies + msecs_to_jiffies(pci_trhfa_msec);
51 + printk(KERN_DEBUG "PCI: hipox_pci_init now it's %lu, will wait till %lu to become ready for config\n", pci_trhfa_startwait, pci_trhfa_timeout);
52 +#endif // CONFIG_HIPOX_PCI_RESET
54 pci_common_init(&hipox_pci);
55 return 0;