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
4565927
Documentation
LICENSES
arch
block
certs
crypto
drivers
accel
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cache
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma-buf
dma
dpll
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
controller
cadence
dwc
mobiveil
plda
Kconfig
Makefile
pci-aardvark.c
pci-ftpci100.c
pci-host-common.c
pci-host-generic.c
pci-hyperv-intf.c
pci-hyperv.c
pci-ixp4xx.c
pci-loongson.c
pci-mvebu.c
pci-rcar-gen2.c
pci-tegra.c
pci-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c
pci-versatile.c
pci-xgene-msi.c
pci-xgene.c
pcie-altera-msi.c
pcie-altera.c
pcie-apple.c
pcie-brcmstb.c
pcie-hisi-error.c
pcie-iproc-bcma.c
pcie-iproc-msi.c
pcie-iproc-platform.c
pcie-iproc.c
pcie-iproc.h
pcie-mediatek-gen3.c
pcie-mediatek.c
pcie-mt7621.c
pcie-rcar-ep.c
pcie-rcar-host.c
pcie-rcar.c
pcie-rcar.h
pcie-rockchip-ep.c
pcie-rockchip-host.c
pcie-rockchip.c
pcie-rockchip.h
pcie-xilinx-common.h
pcie-xilinx-cpm.c
pcie-xilinx-dma-pl.c
pcie-xilinx-nwl.c
pcie-xilinx.c
vmd.c
endpoint
hotplug
msi
pcie
switch
Kconfig
Makefile
access.c
ats.c
bus.c
devres.c
doe.c
ecam.c
host-bridge.c
iomap.c
iov.c
irq.c
mmap.c
of.c
of_property.c
p2pdma.c
pci-acpi.c
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c
pci.c
pci.h
probe.c
proc.c
quirks.c
remove.c
rom.c
search.c
setup-bus.c
setup-res.c
slot.c
syscall.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c
pcmcia
peci
perf
phy
pinctrl
platform
pmdomain
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
pci
/
controller
/
pci-host-generic.c
Blame
Blame
Latest commit
History
History
90 lines (74 loc) · 2.29 KB
Breadcrumbs
linux
/
drivers
/
pci
/
controller
/
pci-host-generic.c
Top
File metadata and controls
Code
Blame
90 lines (74 loc) · 2.29 KB
Raw
// SPDX-License-Identifier: GPL-2.0 /* * Simple, generic PCI host controller driver targeting firmware-initialised * systems and virtual machines (e.g. the PCI emulation provided by kvmtool). * * Copyright (C) 2014 ARM Limited * * Author: Will Deacon <will.deacon@arm.com> */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> #include <linux/pci-ecam.h> #include <linux/platform_device.h> static const struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = { .bus_shift = 16, .pci_ops = { .map_bus = pci_ecam_map_bus, .read = pci_generic_config_read, .write = pci_generic_config_write, } }; static bool pci_dw_valid_device(struct pci_bus *bus, unsigned int devfn) { struct pci_config_window *cfg = bus->sysdata; /* * The Synopsys DesignWare PCIe controller in ECAM mode will not filter * type 0 config TLPs sent to devices 1 and up on its downstream port, * resulting in devices appearing multiple times on bus 0 unless we * filter out those accesses here. */ if (bus->number == cfg->busr.start && PCI_SLOT(devfn) > 0) return false; return true; } static void __iomem *pci_dw_ecam_map_bus(struct pci_bus *bus, unsigned int devfn, int where) { if (!pci_dw_valid_device(bus, devfn)) return NULL; return pci_ecam_map_bus(bus, devfn, where); } static const struct pci_ecam_ops pci_dw_ecam_bus_ops = { .pci_ops = { .map_bus = pci_dw_ecam_map_bus, .read = pci_generic_config_read, .write = pci_generic_config_write, } }; static const struct of_device_id gen_pci_of_match[] = { { .compatible = "pci-host-cam-generic", .data = &gen_pci_cfg_cam_bus_ops }, { .compatible = "pci-host-ecam-generic", .data = &pci_generic_ecam_ops }, { .compatible = "marvell,armada8k-pcie-ecam", .data = &pci_dw_ecam_bus_ops }, { .compatible = "socionext,synquacer-pcie-ecam", .data = &pci_dw_ecam_bus_ops }, { .compatible = "snps,dw-pcie-ecam", .data = &pci_dw_ecam_bus_ops }, { }, }; MODULE_DEVICE_TABLE(of, gen_pci_of_match); static struct platform_driver gen_pci_driver = { .driver = { .name = "pci-host-generic", .of_match_table = gen_pci_of_match, }, .probe = pci_host_common_probe, .remove_new = pci_host_common_remove, }; module_platform_driver(gen_pci_driver); MODULE_DESCRIPTION("Generic PCI host controller driver"); MODULE_LICENSE("GPL v2");
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
You can’t perform that action at this time.