From 0e47ff1ce65bbd0b12a9421a2756b26987ea5083 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 12 Jul 2011 09:25:51 -0500 Subject: powerpc: rename ppc_pci_*_flags to pci_*_flags This renames pci flags functions and enums in preparation for creating generic version in asm-generic/pci-bridge.h. The following search and replace is done: s/ppc_pci_/pci_/ s/PPC_PCI_/PCI_/ Direct accesses to ppc_pci_flag variable are replaced with helper functions. Signed-off-by: Rob Herring Acked-by: Benjamin Herrenschmidt Cc: Paul Mackerras --- arch/powerpc/include/asm/pci-bridge.h | 32 ++++++++++++++++---------------- arch/powerpc/include/asm/pci.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'arch/powerpc/include') diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index b90dbf8e5cd..b3a40c3d500 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -17,45 +17,45 @@ enum { /* Force re-assigning all resources (ignore firmware * setup completely) */ - PPC_PCI_REASSIGN_ALL_RSRC = 0x00000001, + PCI_REASSIGN_ALL_RSRC = 0x00000001, /* Re-assign all bus numbers */ - PPC_PCI_REASSIGN_ALL_BUS = 0x00000002, + PCI_REASSIGN_ALL_BUS = 0x00000002, /* Do not try to assign, just use existing setup */ - PPC_PCI_PROBE_ONLY = 0x00000004, + PCI_PROBE_ONLY = 0x00000004, /* Don't bother with ISA alignment unless the bridge has * ISA forwarding enabled */ - PPC_PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, + PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, /* Enable domain numbers in /proc */ - PPC_PCI_ENABLE_PROC_DOMAINS = 0x00000010, + PCI_ENABLE_PROC_DOMAINS = 0x00000010, /* ... except for domain 0 */ - PPC_PCI_COMPAT_DOMAIN_0 = 0x00000020, + PCI_COMPAT_DOMAIN_0 = 0x00000020, }; #ifdef CONFIG_PCI -extern unsigned int ppc_pci_flags; +extern unsigned int pci_flags; -static inline void ppc_pci_set_flags(int flags) +static inline void pci_set_flags(int flags) { - ppc_pci_flags = flags; + pci_flags = flags; } -static inline void ppc_pci_add_flags(int flags) +static inline void pci_add_flags(int flags) { - ppc_pci_flags |= flags; + pci_flags |= flags; } -static inline int ppc_pci_has_flag(int flag) +static inline int pci_has_flag(int flag) { - return (ppc_pci_flags & flag); + return (pci_flags & flag); } #else -static inline void ppc_pci_set_flags(int flags) { } -static inline void ppc_pci_add_flags(int flags) { } -static inline int ppc_pci_has_flag(int flag) +static inline void pci_set_flags(int flags) { } +static inline void pci_add_flags(int flags) { } +static inline int pci_has_flag(int flag) { return 0; } diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index 7d7790954e0..b9a40faca93 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h @@ -44,7 +44,7 @@ struct pci_dev; * bus numbers (don't do that on ppc64 yet !) */ #define pcibios_assign_all_busses() \ - (ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS)) + (pci_has_flag(PCI_REASSIGN_ALL_BUS)) static inline void pcibios_set_master(struct pci_dev *dev) { -- cgit v1.2.3-70-g09d2 From f4ffd5e5dfdae561e3ea449eb2160a8d155cdec4 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 29 Jun 2011 11:46:54 -0500 Subject: pci: move microblaze and powerpc pci flag functions into asm-generic Move separate microblaze and powerpc pci flag functions pci_set_flags, pci_add_flags, and pci_has_flag into asm-generic/pci-bridge.h so other archs can use them. Signed-off-by: Rob Herring Acked-by: Nicolas Pitre Acked-by: Benjamin Herrenschmidt Cc: Jesse Barnes Signed-off-by: Michal Simek --- arch/microblaze/include/asm/pci-bridge.h | 67 +++++--------------------------- arch/powerpc/include/asm/pci-bridge.h | 50 +----------------------- include/asm-generic/pci-bridge.h | 62 +++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 106 deletions(-) create mode 100644 include/asm-generic/pci-bridge.h (limited to 'arch/powerpc/include') diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 746df91e579..4cae1d59013 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -10,31 +10,19 @@ #include #include #include +#include struct device_node; -enum { - /* Force re-assigning all resources (ignore firmware - * setup completely) - */ - PCI_REASSIGN_ALL_RSRC = 0x00000001, - - /* Re-assign all bus numbers */ - PCI_REASSIGN_ALL_BUS = 0x00000002, - - /* Do not try to assign, just use existing setup */ - PCI_PROBE_ONLY = 0x00000004, - - /* Don't bother with ISA alignment unless the bridge has - * ISA forwarding enabled - */ - PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, - - /* Enable domain numbers in /proc */ - PCI_ENABLE_PROC_DOMAINS = 0x00000010, - /* ... except for domain 0 */ - PCI_COMPAT_DOMAIN_0 = 0x00000020, -}; +#ifdef CONFIG_PCI +extern struct list_head hose_list; +extern int pcibios_vaddr_is_ioport(void __iomem *address); +#else +static inline int pcibios_vaddr_is_ioport(void __iomem *address) +{ + return 0; +} +#endif /* * Structure of a PCI controller (host bridge) @@ -164,40 +152,5 @@ extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); extern void pcibios_free_controller(struct pci_controller *phb); extern void pcibios_setup_phb_resources(struct pci_controller *hose); -#ifdef CONFIG_PCI -extern unsigned int pci_flags; - -static inline void pci_set_flags(int flags) -{ - pci_flags = flags; -} - -static inline void pci_add_flags(int flags) -{ - pci_flags |= flags; -} - -static inline int pci_has_flag(int flag) -{ - return pci_flags & flag; -} - -extern struct list_head hose_list; - -extern int pcibios_vaddr_is_ioport(void __iomem *address); -#else -static inline int pcibios_vaddr_is_ioport(void __iomem *address) -{ - return 0; -} - -static inline void pci_set_flags(int flags) { } -static inline void pci_add_flags(int flags) { } -static inline int pci_has_flag(int flag) -{ - return 0; -} -#endif /* CONFIG_PCI */ - #endif /* __KERNEL__ */ #endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */ diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index b3a40c3d500..8a9cb9f3ed0 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -10,58 +10,10 @@ #include #include #include +#include struct device_node; -enum { - /* Force re-assigning all resources (ignore firmware - * setup completely) - */ - PCI_REASSIGN_ALL_RSRC = 0x00000001, - - /* Re-assign all bus numbers */ - PCI_REASSIGN_ALL_BUS = 0x00000002, - - /* Do not try to assign, just use existing setup */ - PCI_PROBE_ONLY = 0x00000004, - - /* Don't bother with ISA alignment unless the bridge has - * ISA forwarding enabled - */ - PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, - - /* Enable domain numbers in /proc */ - PCI_ENABLE_PROC_DOMAINS = 0x00000010, - /* ... except for domain 0 */ - PCI_COMPAT_DOMAIN_0 = 0x00000020, -}; -#ifdef CONFIG_PCI -extern unsigned int pci_flags; - -static inline void pci_set_flags(int flags) -{ - pci_flags = flags; -} - -static inline void pci_add_flags(int flags) -{ - pci_flags |= flags; -} - -static inline int pci_has_flag(int flag) -{ - return (pci_flags & flag); -} -#else -static inline void pci_set_flags(int flags) { } -static inline void pci_add_flags(int flags) { } -static inline int pci_has_flag(int flag) -{ - return 0; -} -#endif - - /* * Structure of a PCI controller (host bridge) */ diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h new file mode 100644 index 00000000000..4a5aca2a2c9 --- /dev/null +++ b/include/asm-generic/pci-bridge.h @@ -0,0 +1,62 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _ASM_GENERIC_PCI_BRIDGE_H +#define _ASM_GENERIC_PCI_BRIDGE_H + +#ifdef __KERNEL__ + +enum { + /* Force re-assigning all resources (ignore firmware + * setup completely) + */ + PCI_REASSIGN_ALL_RSRC = 0x00000001, + + /* Re-assign all bus numbers */ + PCI_REASSIGN_ALL_BUS = 0x00000002, + + /* Do not try to assign, just use existing setup */ + PCI_PROBE_ONLY = 0x00000004, + + /* Don't bother with ISA alignment unless the bridge has + * ISA forwarding enabled + */ + PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, + + /* Enable domain numbers in /proc */ + PCI_ENABLE_PROC_DOMAINS = 0x00000010, + /* ... except for domain 0 */ + PCI_COMPAT_DOMAIN_0 = 0x00000020, +}; + +#ifdef CONFIG_PCI +extern unsigned int pci_flags; + +static inline void pci_set_flags(int flags) +{ + pci_flags = flags; +} + +static inline void pci_add_flags(int flags) +{ + pci_flags |= flags; +} + +static inline int pci_has_flag(int flag) +{ + return pci_flags & flag; +} +#else +static inline void pci_set_flags(int flags) { } +static inline void pci_add_flags(int flags) { } +static inline int pci_has_flag(int flag) +{ + return 0; +} +#endif /* CONFIG_PCI */ + +#endif /* __KERNEL__ */ +#endif /* _ASM_GENERIC_PCI_BRIDGE_H */ -- cgit v1.2.3-70-g09d2