]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-parisc/pci.h
Merge with git+ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2...
[linux-2.6-omap-h63xx.git] / include / asm-parisc / pci.h
index d0b761f690b53233fc22dea146d7ffc8e4efe798..fe7f6a2f5aa765b50c04323f14605c7bc36f25da 100644 (file)
 */
 #define PCI_MAX_BUSSES 256
 
+
+/* To be used as: mdelay(pci_post_reset_delay);
+ *
+ * post_reset is the time the kernel should stall to prevent anyone from
+ * accessing the PCI bus once #RESET is de-asserted. 
+ * PCI spec somewhere says 1 second but with multi-PCI bus systems,
+ * this makes the boot time much longer than necessary.
+ * 20ms seems to work for all the HP PCI implementations to date.
+ */
+#define pci_post_reset_delay 50
+
+
 /*
 ** pci_hba_data (aka H2P_OBJECT in HP/UX)
 **
@@ -69,7 +81,7 @@ struct pci_hba_data {
 #define PCI_PORT_HBA(a)                ((a) >> HBA_PORT_SPACE_BITS)
 #define PCI_PORT_ADDR(a)       ((a) & (HBA_PORT_SPACE_SIZE - 1))
 
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
 #define PCI_F_EXTEND           0xffffffff00000000UL
 #define PCI_IS_LMMIO(hba,a)    pci_is_lmmio(hba,a)
 
@@ -83,12 +95,18 @@ static __inline__  int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a)
 
 /*
 ** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses.
-** See pcibios.c for more conversions used by Generic PCI code.
+** See pci.c for more conversions used by Generic PCI code.
+**
+** Platform characteristics/firmware guarantee that
+**     (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO
+**     (2) PA_VIEW == IO_VIEW for GMMIO
 */
 #define PCI_BUS_ADDR(hba,a)    (PCI_IS_LMMIO(hba,a)    \
                ?  ((a) - hba->lmmio_space_offset)      /* mangle LMMIO */ \
                : (a))                                  /* GMMIO */
-#define PCI_HOST_ADDR(hba,a)   ((a) + hba->lmmio_space_offset)
+#define PCI_HOST_ADDR(hba,a)   (((a) & PCI_F_EXTEND) == 0 \
+               ? (a) + hba->lmmio_space_offset \
+               : (a))
 
 #else  /* !CONFIG_64BIT */
 
@@ -185,9 +203,6 @@ struct pci_bios_ops {
 */
 extern struct pci_port_ops *pci_port;
 extern struct pci_bios_ops *pci_bios;
-extern int pci_post_reset_delay;       /* delay after de-asserting #RESET */
-extern int pci_hba_count;
-extern struct pci_hba_data *parisc_pci_hba[];
 
 #ifdef CONFIG_PCI
 extern void pcibios_register_hba(struct pci_hba_data *);