Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * c 2001 PPC 64 Team, IBM Corp
0004  */
0005 #ifndef _ASM_POWERPC_PPC_PCI_H
0006 #define _ASM_POWERPC_PPC_PCI_H
0007 #ifdef __KERNEL__
0008 
0009 #ifdef CONFIG_PCI
0010 
0011 #include <linux/pci.h>
0012 #include <asm/pci-bridge.h>
0013 
0014 extern unsigned long isa_io_base;
0015 
0016 extern struct list_head hose_list;
0017 
0018 extern struct pci_dev *isa_bridge_pcidev;   /* may be NULL if no ISA bus */
0019 
0020 /** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */
0021 #define BUID_HI(buid) upper_32_bits(buid)
0022 #define BUID_LO(buid) lower_32_bits(buid)
0023 
0024 /* PCI device_node operations */
0025 struct device_node;
0026 struct pci_dn;
0027 
0028 void *pci_traverse_device_nodes(struct device_node *start,
0029                 void *(*fn)(struct device_node *, void *),
0030                 void *data);
0031 extern void pci_devs_phb_init_dynamic(struct pci_controller *phb);
0032 
0033 /* From rtas_pci.h */
0034 extern void init_pci_config_tokens (void);
0035 extern unsigned long get_phb_buid (struct device_node *);
0036 extern int rtas_setup_phb(struct pci_controller *phb);
0037 
0038 #ifdef CONFIG_EEH
0039 
0040 void eeh_addr_cache_insert_dev(struct pci_dev *dev);
0041 void eeh_addr_cache_rmv_dev(struct pci_dev *dev);
0042 struct eeh_dev *eeh_addr_cache_get_dev(unsigned long addr);
0043 void eeh_slot_error_detail(struct eeh_pe *pe, int severity);
0044 int eeh_pci_enable(struct eeh_pe *pe, int function);
0045 int eeh_pe_reset_full(struct eeh_pe *pe, bool include_passed);
0046 void eeh_save_bars(struct eeh_dev *edev);
0047 int rtas_write_config(struct pci_dn *, int where, int size, u32 val);
0048 int rtas_read_config(struct pci_dn *, int where, int size, u32 *val);
0049 void eeh_pe_state_mark(struct eeh_pe *pe, int state);
0050 void eeh_pe_mark_isolated(struct eeh_pe *pe);
0051 void eeh_pe_state_clear(struct eeh_pe *pe, int state, bool include_passed);
0052 void eeh_pe_state_mark_with_cfg(struct eeh_pe *pe, int state);
0053 void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode);
0054 
0055 void eeh_sysfs_add_device(struct pci_dev *pdev);
0056 void eeh_sysfs_remove_device(struct pci_dev *pdev);
0057 
0058 #endif /* CONFIG_EEH */
0059 
0060 #define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff)
0061 
0062 #else /* CONFIG_PCI */
0063 static inline void init_pci_config_tokens(void) { }
0064 #endif /* !CONFIG_PCI */
0065 
0066 #endif /* __KERNEL__ */
0067 #endif /* _ASM_POWERPC_PPC_PCI_H */