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
4dfc278
Documentation
arch
alpha
arc
arm
arm64
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
nios2
openrisc
parisc
powerpc
s390
appldata
boot
configs
crypto
hypfs
include
asm
fpu
trace
Kbuild
airq.h
appldata.h
archrandom.h
asm-prototypes.h
atomic.h
atomic_ops.h
barrier.h
bitops.h
bug.h
bugs.h
cache.h
ccwdev.h
ccwgroup.h
checksum.h
chpid.h
cio.h
clp.h
cmb.h
cmpxchg.h
compat.h
cpacf.h
cpcmd.h
cpu.h
cpu_mf.h
cpufeature.h
cputime.h
crw.h
css_chars.h
ctl_reg.h
current.h
debug.h
delay.h
diag.h
dis.h
dma-mapping.h
dma.h
eadm.h
ebcdic.h
elf.h
exec.h
extable.h
extmem.h
facility.h
fcx.h
ftrace.h
futex.h
gmap.h
hardirq.h
hugetlb.h
hw_irq.h
idals.h
idle.h
io.h
ipl.h
irq.h
irqflags.h
isc.h
itcw.h
jump_label.h
kdebug.h
kexec.h
kprobes.h
kvm_host.h
kvm_para.h
linkage.h
livepatch.h
lowcore.h
mmu.h
mmu_context.h
mmzone.h
module.h
nmi.h
numa.h
os_info.h
page-states.h
page.h
pci.h
pci_clp.h
pci_debug.h
pci_dma.h
pci_insn.h
pci_io.h
percpu.h
perf_event.h
pgalloc.h
pgtable.h
pkey.h
preempt.h
processor.h
ptrace.h
qdio.h
reset.h
runtime_instr.h
rwsem.h
schid.h
sclp.h
scsw.h
seccomp.h
sections.h
segment.h
serial.h
set_memory.h
setup.h
shmparam.h
signal.h
sigp.h
smp.h
sparsemem.h
spinlock.h
spinlock_types.h
stp.h
string.h
switch_to.h
syscall.h
sysinfo.h
termios.h
thread_info.h
timex.h
tlb.h
tlbflush.h
topology.h
uaccess.h
unistd.h
uprobes.h
user.h
vdso.h
vga.h
vtime.h
vtimer.h
vx-insn.h
xor.h
uapi
kernel
kvm
lib
mm
net
numa
oprofile
pci
tools
Kbuild
Kconfig
Kconfig.debug
Makefile
defconfig
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
s390
/
include
/
asm
/
pci.h
Copy path
Blame
Blame
Latest commit
History
History
249 lines (203 loc) · 6.22 KB
Breadcrumbs
linux
/
arch
/
s390
/
include
/
asm
/
pci.h
Top
File metadata and controls
Code
Blame
249 lines (203 loc) · 6.22 KB
Raw
#ifndef __ASM_S390_PCI_H #define __ASM_S390_PCI_H /* must be set before including asm-generic/pci.h */ #define PCI_DMA_BUS_IS_PHYS (0) /* must be set before including pci_clp.h */ #define PCI_BAR_COUNT 6 #include <linux/pci.h> #include <linux/mutex.h> #include <linux/iommu.h> #include <asm-generic/pci.h> #include <asm/pci_clp.h> #include <asm/pci_debug.h> #include <asm/sclp.h> #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 #define pcibios_assign_all_busses() (0) void __iomem *pci_iomap(struct pci_dev *, int, unsigned long); void pci_iounmap(struct pci_dev *, void __iomem *); int pci_domain_nr(struct pci_bus *); int pci_proc_domain(struct pci_bus *); #define ZPCI_BUS_NR 0 /* default bus number */ #define ZPCI_DEVFN 0 /* default device number */ /* PCI Function Controls */ #define ZPCI_FC_FN_ENABLED 0x80 #define ZPCI_FC_ERROR 0x40 #define ZPCI_FC_BLOCKED 0x20 #define ZPCI_FC_DMA_ENABLED 0x10 #define ZPCI_FMB_DMA_COUNTER_VALID (1 << 23) struct zpci_fmb_fmt0 { u64 dma_rbytes; u64 dma_wbytes; }; struct zpci_fmb_fmt1 { u64 rx_bytes; u64 rx_packets; u64 tx_bytes; u64 tx_packets; }; struct zpci_fmb_fmt2 { u64 consumed_work_units; u64 max_work_units; }; struct zpci_fmb { u32 format : 8; u32 fmt_ind : 24; u32 samples; u64 last_update; /* common counters */ u64 ld_ops; u64 st_ops; u64 stb_ops; u64 rpcit_ops; /* format specific counters */ union { struct zpci_fmb_fmt0 fmt0; struct zpci_fmb_fmt1 fmt1; struct zpci_fmb_fmt2 fmt2; }; } __packed __aligned(128); enum zpci_state { ZPCI_FN_STATE_STANDBY = 0, ZPCI_FN_STATE_CONFIGURED = 1, ZPCI_FN_STATE_RESERVED = 2, ZPCI_FN_STATE_ONLINE = 3, }; struct zpci_bar_struct { struct resource *res; /* bus resource */ u32 val; /* bar start & 3 flag bits */ u16 map_idx; /* index into bar mapping array */ u8 size; /* order 2 exponent */ }; struct s390_domain; /* Private data per function */ struct zpci_dev { struct pci_bus *bus; struct list_head entry; /* list of all zpci_devices, needed for hotplug, etc. */ enum zpci_state state; u32 fid; /* function ID, used by sclp */ u32 fh; /* function handle, used by insn's */ u16 vfn; /* virtual function number */ u16 pchid; /* physical channel ID */ u8 pfgid; /* function group ID */ u8 pft; /* pci function type */ u16 domain; struct mutex lock; u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */ u32 uid; /* user defined id */ u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */ /* IRQ stuff */ u64 msi_addr; /* MSI address */ unsigned int max_msi; /* maximum number of MSI's */ struct airq_iv *aibv; /* adapter interrupt bit vector */ unsigned long aisb; /* number of the summary bit */ /* DMA stuff */ unsigned long *dma_table; spinlock_t dma_table_lock; int tlb_refresh; spinlock_t iommu_bitmap_lock; unsigned long *iommu_bitmap; unsigned long *lazy_bitmap; unsigned long iommu_size; unsigned long iommu_pages; unsigned int next_bit; struct iommu_device iommu_dev; /* IOMMU core handle */ char res_name[16]; struct zpci_bar_struct bars[PCI_BAR_COUNT]; u64 start_dma; /* Start of available DMA addresses */ u64 end_dma; /* End of available DMA addresses */ u64 dma_mask; /* DMA address space mask */ /* Function measurement block */ struct zpci_fmb *fmb; u16 fmb_update; /* update interval */ u16 fmb_length; /* software counters */ atomic64_t allocated_pages; atomic64_t mapped_pages; atomic64_t unmapped_pages; enum pci_bus_speed max_bus_speed; struct dentry *debugfs_dev; struct dentry *debugfs_perf; struct s390_domain *s390_domain; /* s390 IOMMU domain data */ }; static inline bool zdev_enabled(struct zpci_dev *zdev) { return (zdev->fh & (1UL << 31)) ? true : false; } extern const struct attribute_group *zpci_attr_groups[]; /* ----------------------------------------------------------------------------- Prototypes ----------------------------------------------------------------------------- */ /* Base stuff */ int zpci_create_device(struct zpci_dev *); void zpci_remove_device(struct zpci_dev *zdev); int zpci_enable_device(struct zpci_dev *); int zpci_disable_device(struct zpci_dev *); int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); int zpci_unregister_ioat(struct zpci_dev *, u8); void zpci_remove_reserved_devices(void); /* CLP */ int clp_scan_pci_devices(void); int clp_rescan_pci_devices(void); int clp_rescan_pci_devices_simple(void); int clp_add_pci_device(u32, u32, int); int clp_enable_fh(struct zpci_dev *, u8); int clp_disable_fh(struct zpci_dev *); int clp_get_state(u32 fid, enum zpci_state *state); /* IOMMU Interface */ int zpci_init_iommu(struct zpci_dev *zdev); void zpci_destroy_iommu(struct zpci_dev *zdev); #ifdef CONFIG_PCI /* Error handling and recovery */ void zpci_event_error(void *); void zpci_event_availability(void *); void zpci_rescan(void); bool zpci_is_enabled(void); #else /* CONFIG_PCI */ static inline void zpci_event_error(void *e) {} static inline void zpci_event_availability(void *e) {} static inline void zpci_rescan(void) {} #endif /* CONFIG_PCI */ #ifdef CONFIG_HOTPLUG_PCI_S390 int zpci_init_slot(struct zpci_dev *); void zpci_exit_slot(struct zpci_dev *); #else /* CONFIG_HOTPLUG_PCI_S390 */ static inline int zpci_init_slot(struct zpci_dev *zdev) { return 0; } static inline void zpci_exit_slot(struct zpci_dev *zdev) {} #endif /* CONFIG_HOTPLUG_PCI_S390 */ /* Helpers */ static inline struct zpci_dev *to_zpci(struct pci_dev *pdev) { return pdev->sysdata; } struct zpci_dev *get_zdev_by_fid(u32); /* DMA */ int zpci_dma_init(void); void zpci_dma_exit(void); /* FMB */ int zpci_fmb_enable_device(struct zpci_dev *); int zpci_fmb_disable_device(struct zpci_dev *); /* Debug */ int zpci_debug_init(void); void zpci_debug_exit(void); void zpci_debug_init_device(struct zpci_dev *, const char *); void zpci_debug_exit_device(struct zpci_dev *); void zpci_debug_info(struct zpci_dev *, struct seq_file *); /* Error reporting */ int zpci_report_error(struct pci_dev *, struct zpci_report_error_header *); #ifdef CONFIG_NUMA /* Returns the node based on PCI bus */ static inline int __pcibus_to_node(const struct pci_bus *bus) { return NUMA_NO_NODE; } static inline const struct cpumask * cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } #endif /* CONFIG_NUMA */ #endif
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
You can’t perform that action at this time.