Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial PCI support #238

Merged
merged 2 commits into from
Jan 18, 2022
Merged

Add initial PCI support #238

merged 2 commits into from
Jan 18, 2022

Conversation

cjams
Copy link
Contributor

@cjams cjams commented Jan 11, 2022

The first patch of this series fixes a small typo. The second adds code for enumerating PCI devices

@cjams cjams force-pushed the pci branch 3 times, most recently from 572bfe7 to 2c52337 Compare January 11, 2022 16:52
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
@wipawel wipawel added feature New feature or request Priority: 2 Very important feature labels Jan 12, 2022
@wipawel wipawel added this to the v0.4.1 milestone Jan 12, 2022
@wipawel wipawel linked an issue Jan 12, 2022 that may be closed by this pull request
@cjams cjams force-pushed the pci branch 2 times, most recently from de68ca8 to f42d113 Compare January 17, 2022 15:14
@cjams
Copy link
Contributor Author

cjams commented Jan 17, 2022

FYI I was going to add support for mapping BARs as a follow on commit, but wanted to get early feedback before starting that. In case you wanted to keep the issue open until the BAR mapping stuff is in

@cjams cjams force-pushed the pci branch 3 times, most recently from 269c2f8 to 94acba2 Compare January 17, 2022 15:26
wipawel
wipawel previously approved these changes Jan 18, 2022
common/pci.c Show resolved Hide resolved
common/pci.c Outdated Show resolved Hide resolved
@wipawel
Copy link
Contributor

wipawel commented Jan 18, 2022

FYI I was going to add support for mapping BARs as a follow on commit, but wanted to get early feedback before starting that. In case you wanted to keep the issue open until the BAR mapping stuff is in

Nah no need to delay, let's get this PR in.

Add probe_pci, probe_pci_bus, probe_pci_dev and init_pci functions.
init_pci is called from kernel_start to setup the PCI subsystem.
In turn, init_pci calls probe_pci, which initializes the host bridge
and then recursively enumerates the rest of the PCI devices
on the system by calling probe_pci_bus/probe_pci_dev.

Each device's basic config space is stored in the pcidev_t structure,
along with a pointer to the device's parent bridge and a list_head_t
node. When a device is found, it is added to the global pci_list
structure for later reference.

Signed-off-by: Connor Davis <[email protected]>
@cjams
Copy link
Contributor Author

cjams commented Jan 18, 2022

should be good to go now

@wipawel wipawel merged commit 18f5903 into KernelTestFramework:mainline Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Priority: 2 Very important feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add PCI support
2 participants