Skip to content

Commit f4ffd5e

Browse files
author
Rob Herring
committed
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 <rob.herring@calxeda.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Michal Simek <monstr@monstr.eu>
1 parent 0e47ff1 commit f4ffd5e

3 files changed

Lines changed: 73 additions & 106 deletions

File tree

‎arch/microblaze/include/asm/pci-bridge.h‎

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,19 @@
1010
#include <linux/pci.h>
1111
#include <linux/list.h>
1212
#include <linux/ioport.h>
13+
#include <asm-generic/pci-bridge.h>
1314

1415
struct device_node;
1516

16-
enum {
17-
/* Force re-assigning all resources (ignore firmware
18-
* setup completely)
19-
*/
20-
PCI_REASSIGN_ALL_RSRC = 0x00000001,
21-
22-
/* Re-assign all bus numbers */
23-
PCI_REASSIGN_ALL_BUS = 0x00000002,
24-
25-
/* Do not try to assign, just use existing setup */
26-
PCI_PROBE_ONLY = 0x00000004,
27-
28-
/* Don't bother with ISA alignment unless the bridge has
29-
* ISA forwarding enabled
30-
*/
31-
PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
32-
33-
/* Enable domain numbers in /proc */
34-
PCI_ENABLE_PROC_DOMAINS = 0x00000010,
35-
/* ... except for domain 0 */
36-
PCI_COMPAT_DOMAIN_0 = 0x00000020,
37-
};
17+
#ifdef CONFIG_PCI
18+
extern struct list_head hose_list;
19+
extern int pcibios_vaddr_is_ioport(void __iomem *address);
20+
#else
21+
static inline int pcibios_vaddr_is_ioport(void __iomem *address)
22+
{
23+
return 0;
24+
}
25+
#endif
3826

3927
/*
4028
* Structure of a PCI controller (host bridge)
@@ -164,40 +152,5 @@ extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
164152
extern void pcibios_free_controller(struct pci_controller *phb);
165153
extern void pcibios_setup_phb_resources(struct pci_controller *hose);
166154

167-
#ifdef CONFIG_PCI
168-
extern unsigned int pci_flags;
169-
170-
static inline void pci_set_flags(int flags)
171-
{
172-
pci_flags = flags;
173-
}
174-
175-
static inline void pci_add_flags(int flags)
176-
{
177-
pci_flags |= flags;
178-
}
179-
180-
static inline int pci_has_flag(int flag)
181-
{
182-
return pci_flags & flag;
183-
}
184-
185-
extern struct list_head hose_list;
186-
187-
extern int pcibios_vaddr_is_ioport(void __iomem *address);
188-
#else
189-
static inline int pcibios_vaddr_is_ioport(void __iomem *address)
190-
{
191-
return 0;
192-
}
193-
194-
static inline void pci_set_flags(int flags) { }
195-
static inline void pci_add_flags(int flags) { }
196-
static inline int pci_has_flag(int flag)
197-
{
198-
return 0;
199-
}
200-
#endif /* CONFIG_PCI */
201-
202155
#endif /* __KERNEL__ */
203156
#endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */

‎arch/powerpc/include/asm/pci-bridge.h‎

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,10 @@
1010
#include <linux/pci.h>
1111
#include <linux/list.h>
1212
#include <linux/ioport.h>
13+
#include <asm-generic/pci-bridge.h>
1314

1415
struct device_node;
1516

16-
enum {
17-
/* Force re-assigning all resources (ignore firmware
18-
* setup completely)
19-
*/
20-
PCI_REASSIGN_ALL_RSRC = 0x00000001,
21-
22-
/* Re-assign all bus numbers */
23-
PCI_REASSIGN_ALL_BUS = 0x00000002,
24-
25-
/* Do not try to assign, just use existing setup */
26-
PCI_PROBE_ONLY = 0x00000004,
27-
28-
/* Don't bother with ISA alignment unless the bridge has
29-
* ISA forwarding enabled
30-
*/
31-
PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
32-
33-
/* Enable domain numbers in /proc */
34-
PCI_ENABLE_PROC_DOMAINS = 0x00000010,
35-
/* ... except for domain 0 */
36-
PCI_COMPAT_DOMAIN_0 = 0x00000020,
37-
};
38-
#ifdef CONFIG_PCI
39-
extern unsigned int pci_flags;
40-
41-
static inline void pci_set_flags(int flags)
42-
{
43-
pci_flags = flags;
44-
}
45-
46-
static inline void pci_add_flags(int flags)
47-
{
48-
pci_flags |= flags;
49-
}
50-
51-
static inline int pci_has_flag(int flag)
52-
{
53-
return (pci_flags & flag);
54-
}
55-
#else
56-
static inline void pci_set_flags(int flags) { }
57-
static inline void pci_add_flags(int flags) { }
58-
static inline int pci_has_flag(int flag)
59-
{
60-
return 0;
61-
}
62-
#endif
63-
64-
6517
/*
6618
* Structure of a PCI controller (host bridge)
6719
*/

‎include/asm-generic/pci-bridge.h‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* This program is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU General Public License
4+
* as published by the Free Software Foundation; either version
5+
* 2 of the License, or (at your option) any later version.
6+
*/
7+
#ifndef _ASM_GENERIC_PCI_BRIDGE_H
8+
#define _ASM_GENERIC_PCI_BRIDGE_H
9+
10+
#ifdef __KERNEL__
11+
12+
enum {
13+
/* Force re-assigning all resources (ignore firmware
14+
* setup completely)
15+
*/
16+
PCI_REASSIGN_ALL_RSRC = 0x00000001,
17+
18+
/* Re-assign all bus numbers */
19+
PCI_REASSIGN_ALL_BUS = 0x00000002,
20+
21+
/* Do not try to assign, just use existing setup */
22+
PCI_PROBE_ONLY = 0x00000004,
23+
24+
/* Don't bother with ISA alignment unless the bridge has
25+
* ISA forwarding enabled
26+
*/
27+
PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
28+
29+
/* Enable domain numbers in /proc */
30+
PCI_ENABLE_PROC_DOMAINS = 0x00000010,
31+
/* ... except for domain 0 */
32+
PCI_COMPAT_DOMAIN_0 = 0x00000020,
33+
};
34+
35+
#ifdef CONFIG_PCI
36+
extern unsigned int pci_flags;
37+
38+
static inline void pci_set_flags(int flags)
39+
{
40+
pci_flags = flags;
41+
}
42+
43+
static inline void pci_add_flags(int flags)
44+
{
45+
pci_flags |= flags;
46+
}
47+
48+
static inline int pci_has_flag(int flag)
49+
{
50+
return pci_flags & flag;
51+
}
52+
#else
53+
static inline void pci_set_flags(int flags) { }
54+
static inline void pci_add_flags(int flags) { }
55+
static inline int pci_has_flag(int flag)
56+
{
57+
return 0;
58+
}
59+
#endif /* CONFIG_PCI */
60+
61+
#endif /* __KERNEL__ */
62+
#endif /* _ASM_GENERIC_PCI_BRIDGE_H */

0 commit comments

Comments
 (0)