Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
4c5811b
Documentation
arch
alpha
arm
avr32
blackfin
cris
frv
h8300
ia64
m32r
m68k
m68knommu
microblaze
mips
mn10300
parisc
powerpc
boot
configs
include/asm
iseries
8253pit.h
8xx_immap.h
Kbuild
abs_addr.h
agp.h
asm-compat.h
asm-offsets.h
async_tx.h
atomic.h
auxvec.h
backlight.h
bitops.h
bitsperlong.h
bootx.h
btext.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
cell-pmu.h
cell-regs.h
checksum.h
clk_interface.h
code-patching.h
compat.h
cpm.h
cpm1.h
cpm2.h
cputable.h
cputhreads.h
cputime.h
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h
dcr.h
delay.h
device.h
disassemble.h
div64.h
dma-mapping.h
dma.h
edac.h
eeh.h
eeh_event.h
elf.h
emergency-restart.h
emulated_ops.h
errno.h
exception-64e.h
exception-64s.h
fb.h
fcntl.h
feature-fixups.h
firmware.h
fixmap.h
floppy.h
fs_pd.h
fsl_85xx_cache_sram.h
fsl_gtm.h
fsl_guts.h
fsl_lbc.h
ftrace.h
futex.h
gpio.h
grackle.h
hardirq.h
heathrow.h
highmem.h
hugetlb.h
hvcall.h
hvconsole.h
hvcserver.h
hw_breakpoint.h
hw_irq.h
hydra.h
i8259.h
ibmebus.h
ide.h
immap_cpm2.h
immap_qe.h
io-defs.h
io.h
ioctl.h
ioctls.h
iommu.h
ipcbuf.h
ipic.h
irq.h
irq_regs.h
irqflags.h
kdebug.h
kdump.h
kexec.h
keylargo.h
kgdb.h
kmap_types.h
kprobes.h
kvm.h
kvm_44x.h
kvm_asm.h
kvm_book3s.h
kvm_book3s_32.h
kvm_book3s_64.h
kvm_book3s_asm.h
kvm_booke.h
kvm_e500.h
kvm_fpu.h
kvm_host.h
kvm_para.h
kvm_ppc.h
libata-portmap.h
linkage.h
local.h
local64.h
lppaca.h
lv1call.h
machdep.h
macio.h
mc146818rtc.h
mediabay.h
memblock.h
mman.h
mmu-40x.h
mmu-44x.h
mmu-8xx.h
mmu-book3e.h
mmu-hash32.h
mmu-hash64.h
mmu.h
mmu_context.h
mmzone.h
module.h
mpc5121.h
mpc52xx.h
mpc52xx_psc.h
mpc5xxx.h
mpc6xx.h
mpc8260.h
mpc8xx.h
mpic.h
msgbuf.h
msi_bitmap.h
mutex.h
nvram.h
ohare.h
oprofile_impl.h
pSeries_reconfig.h
paca.h
page.h
page_32.h
page_64.h
param.h
parport.h
pasemi_dma.h
pci-bridge.h
pci.h
percpu.h
perf_event.h
perf_event_fsl_emb.h
perf_event_server.h
pgalloc-32.h
pgalloc-64.h
pgalloc.h
pgtable-ppc32.h
pgtable-ppc64-4k.h
pgtable-ppc64-64k.h
pgtable-ppc64.h
pgtable.h
phyp_dump.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
pmi.h
poll.h
posix_types.h
ppc-opcode.h
ppc-pci.h
ppc4xx.h
ppc_asm.h
processor.h
prom.h
ps3.h
ps3av.h
ps3fb.h
ps3gpu.h
ps3stor.h
pte-40x.h
pte-44x.h
pte-8xx.h
pte-book3e.h
pte-common.h
pte-fsl-booke.h
pte-hash32.h
pte-hash64-4k.h
pte-hash64-64k.h
pte-hash64.h
ptrace.h
qe.h
qe_ic.h
reg.h
reg_8xx.h
reg_booke.h
reg_fsl_emb.h
resource.h
rheap.h
rio.h
rtas.h
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
sembuf.h
serial.h
setjmp.h
setup.h
sfp-machine.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h
smu.h
socket.h
sockios.h
sparsemem.h
spinlock.h
spinlock_types.h
spu.h
spu_csa.h
spu_info.h
spu_priv1.h
sstep.h
stat.h
statfs.h
string.h
suspend.h
swab.h
swiotlb.h
synch.h
syscall.h
syscalls.h
systbl.h
system.h
tce.h
termbits.h
termios.h
thread_info.h
time.h
timex.h
tlb.h
tlbflush.h
topology.h
trace.h
tsi108.h
tsi108_irq.h
tsi108_pci.h
types.h
uaccess.h
ucc.h
ucc_fast.h
ucc_slow.h
ucontext.h
udbg.h
uic.h
unaligned.h
uninorth.h
unistd.h
user.h
vdso.h
vdso_datapage.h
vga.h
vio.h
xilinx_intc.h
xilinx_pci.h
xmon.h
xor.h
kernel
kvm
lib
math-emu
mm
oprofile
platforms
sysdev
xmon
Kconfig
Kconfig.debug
Makefile
relocs_check.pl
s390
score
sh
sparc
tile
um
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
powerpc
/
include
/
asm
/
pci-bridge.h
Copy path
Blame
Blame
Latest commit
Grant Likely
powerpc/pci: Make both ppc32 and ppc64 use sysdata for pci_controller
Feb 4, 2011
b5d937d
·
Feb 4, 2011
History
History
308 lines (255 loc) · 8.9 KB
Breadcrumbs
linux
/
arch
/
powerpc
/
include
/
asm
/
pci-bridge.h
Top
File metadata and controls
Code
Blame
308 lines (255 loc) · 8.9 KB
Raw
#ifndef _ASM_POWERPC_PCI_BRIDGE_H #define _ASM_POWERPC_PCI_BRIDGE_H #ifdef __KERNEL__ /* * 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. */ #include <linux/pci.h> #include <linux/list.h> #include <linux/ioport.h> struct device_node; enum { /* Force re-assigning all resources (ignore firmware * setup completely) */ PPC_PCI_REASSIGN_ALL_RSRC = 0x00000001, /* Re-assign all bus numbers */ PPC_PCI_REASSIGN_ALL_BUS = 0x00000002, /* Do not try to assign, just use existing setup */ PPC_PCI_PROBE_ONLY = 0x00000004, /* Don't bother with ISA alignment unless the bridge has * ISA forwarding enabled */ PPC_PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, /* Enable domain numbers in /proc */ PPC_PCI_ENABLE_PROC_DOMAINS = 0x00000010, /* ... except for domain 0 */ PPC_PCI_COMPAT_DOMAIN_0 = 0x00000020, }; #ifdef CONFIG_PCI extern unsigned int ppc_pci_flags; static inline void ppc_pci_set_flags(int flags) { ppc_pci_flags = flags; } static inline void ppc_pci_add_flags(int flags) { ppc_pci_flags |= flags; } static inline int ppc_pci_has_flag(int flag) { return (ppc_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) { return 0; } #endif /* * Structure of a PCI controller (host bridge) */ struct pci_controller { struct pci_bus *bus; char is_dynamic; #ifdef CONFIG_PPC64 int node; #endif struct device_node *dn; struct list_head list_node; struct device *parent; int first_busno; int last_busno; int self_busno; void __iomem *io_base_virt; #ifdef CONFIG_PPC64 void *io_base_alloc; #endif resource_size_t io_base_phys; resource_size_t pci_io_size; /* Some machines (PReP) have a non 1:1 mapping of * the PCI memory space in the CPU bus space */ resource_size_t pci_mem_offset; /* Some machines have a special region to forward the ISA * "memory" cycles such as VGA memory regions. Left to 0 * if unsupported */ resource_size_t isa_mem_phys; resource_size_t isa_mem_size; struct pci_ops *ops; unsigned int __iomem *cfg_addr; void __iomem *cfg_data; /* * Used for variants of PCI indirect handling and possible quirks: * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1 * EXT_REG - provides access to PCI-e extended registers * SURPRESS_PRIMARY_BUS - we surpress the setting of PCI_PRIMARY_BUS * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS * to determine which bus number to match on when generating type0 * config cycles * NO_PCIE_LINK - the Freescale PCI-e controllers have issues with * hanging if we don't have link and try to do config cycles to * anything but the PHB. Only allow talking to the PHB if this is * set. * BIG_ENDIAN - cfg_addr is a big endian register * BROKEN_MRM - the 440EPx/GRx chips have an errata that causes hangs on * the PLB4. Effectively disable MRM commands by setting this. */ #define PPC_INDIRECT_TYPE_SET_CFG_TYPE 0x00000001 #define PPC_INDIRECT_TYPE_EXT_REG 0x00000002 #define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004 #define PPC_INDIRECT_TYPE_NO_PCIE_LINK 0x00000008 #define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010 #define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020 u32 indirect_type; /* Currently, we limit ourselves to 1 IO range and 3 mem * ranges since the common pci_bus structure can't handle more */ struct resource io_resource; struct resource mem_resources[3]; int global_number; /* PCI domain number */ resource_size_t dma_window_base_cur; resource_size_t dma_window_size; #ifdef CONFIG_PPC64 unsigned long buid; void *private_data; #endif /* CONFIG_PPC64 */ }; /* These are used for config access before all the PCI probing has been done. */ extern int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, int where, u8 *val); extern int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn, int where, u16 *val); extern int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn, int where, u32 *val); extern int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn, int where, u8 val); extern int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn, int where, u16 val); extern int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn, int where, u32 val); extern int early_find_capability(struct pci_controller *hose, int bus, int dev_fn, int cap); extern void setup_indirect_pci(struct pci_controller* hose, resource_size_t cfg_addr, resource_size_t cfg_data, u32 flags); static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) { return bus->sysdata; } #ifndef CONFIG_PPC64 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) { struct pci_controller *host; if (bus->self) return pci_device_to_OF_node(bus->self); host = pci_bus_to_host(bus); return host ? host->dn : NULL; } static inline int isa_vaddr_is_ioport(void __iomem *address) { /* No specific ISA handling on ppc32 at this stage, it * all goes through PCI */ return 0; } #else /* CONFIG_PPC64 */ /* * PCI stuff, for nodes representing PCI devices, pointed to * by device_node->data. */ struct iommu_table; struct pci_dn { int busno; /* pci bus number */ int devfn; /* pci device and function number */ struct pci_controller *phb; /* for pci devices */ struct iommu_table *iommu_table; /* for phb's or bridges */ struct device_node *node; /* back-pointer to the device_node */ int pci_ext_config_space; /* for pci devices */ #ifdef CONFIG_EEH struct pci_dev *pcidev; /* back-pointer to the pci device */ int class_code; /* pci device class */ int eeh_mode; /* See eeh.h for possible EEH_MODEs */ int eeh_config_addr; int eeh_pe_config_addr; /* new-style partition endpoint address */ int eeh_check_count; /* # times driver ignored error */ int eeh_freeze_count; /* # times this device froze up. */ int eeh_false_positives; /* # times this device reported #ff's */ u32 config_space[16]; /* saved PCI config space */ #endif }; /* Get the pointer to a device_node's pci_dn */ #define PCI_DN(dn) ((struct pci_dn *) (dn)->data) extern struct device_node *fetch_dev_dn(struct pci_dev *dev); extern void * update_dn_pci_info(struct device_node *dn, void *data); /* Get a device_node from a pci_dev. This code must be fast except * in the case where the sysdata is incorrect and needs to be fixed * up (this will only happen once). */ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) { return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev); } static inline int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) { if (!PCI_DN(np)) return -ENODEV; *bus = PCI_DN(np)->busno; *devfn = PCI_DN(np)->devfn; return 0; } static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) { if (bus->self) return pci_device_to_OF_node(bus->self); else return bus->dev.of_node; /* Must be root bus (PHB) */ } /** Find the bus corresponding to the indicated device node */ extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn); /** Remove all of the PCI devices under this bus */ extern void pcibios_remove_pci_devices(struct pci_bus *bus); /** Discover new pci devices under this bus, and add them */ extern void pcibios_add_pci_devices(struct pci_bus *bus); extern void isa_bridge_find_early(struct pci_controller *hose); static inline int isa_vaddr_is_ioport(void __iomem *address) { /* Check if address hits the reserved legacy IO range */ unsigned long ea = (unsigned long)address; return ea >= ISA_IO_BASE && ea < ISA_IO_END; } extern int pcibios_unmap_io_space(struct pci_bus *bus); extern int pcibios_map_io_space(struct pci_bus *bus); #ifdef CONFIG_NUMA #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) #else #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1) #endif #endif /* CONFIG_PPC64 */ /* Get the PCI host controller for an OF device */ extern struct pci_controller *pci_find_hose_for_OF_device( struct device_node* node); /* Fill up host controller resources from the OF node */ extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, struct device_node *dev, int primary); /* Allocate & free a PCI host bridge structure */ 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 int pcibios_vaddr_is_ioport(void __iomem *address); #else static inline int pcibios_vaddr_is_ioport(void __iomem *address) { return 0; } #endif /* CONFIG_PCI */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PCI_BRIDGE_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
You can’t perform that action at this time.