Skip to content
Snippets Groups Projects
Commit 2bb02e4f authored by Simon Glass's avatar Simon Glass
Browse files

dm: pci: Allow PCI bus numbering aliases


Commit 9cc36a2b 'dm: core: Add a flag to control sequence numbering' changed
the default uclass behaviour to not support bus numbering. This is incorrect
for PCI and that commit should have enabled the flag for PCI.

Enable it so that PCI buses can be found and the 'pci' command works again.
Also add a test for this.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 8939df09
No related branches found
No related tags found
No related merge requests found
...@@ -596,6 +596,7 @@ int pci_bridge_write_config(struct udevice *bus, pci_dev_t devfn, uint offset, ...@@ -596,6 +596,7 @@ int pci_bridge_write_config(struct udevice *bus, pci_dev_t devfn, uint offset,
UCLASS_DRIVER(pci) = { UCLASS_DRIVER(pci) = {
.id = UCLASS_PCI, .id = UCLASS_PCI,
.name = "pci", .name = "pci",
.flags = DM_UC_FLAG_SEQ_ALIAS,
.post_bind = pci_uclass_post_bind, .post_bind = pci_uclass_post_bind,
.pre_probe = pci_uclass_pre_probe, .pre_probe = pci_uclass_pre_probe,
.post_probe = pci_uclass_post_probe, .post_probe = pci_uclass_post_probe,
......
...@@ -21,6 +21,17 @@ static int dm_test_pci_base(struct unit_test_state *uts) ...@@ -21,6 +21,17 @@ static int dm_test_pci_base(struct unit_test_state *uts)
} }
DM_TEST(dm_test_pci_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); DM_TEST(dm_test_pci_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
/* Test that sandbox PCI bus numbering works correctly */
static int dm_test_pci_busnum(struct unit_test_state *uts)
{
struct udevice *bus;
ut_assertok(uclass_get_device_by_seq(UCLASS_PCI, 0, &bus));
return 0;
}
DM_TEST(dm_test_pci_busnum, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
/* Test that we can use the swapcase device correctly */ /* Test that we can use the swapcase device correctly */
static int dm_test_pci_swapcase(struct unit_test_state *uts) static int dm_test_pci_swapcase(struct unit_test_state *uts)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment