summaryrefslogtreecommitdiff
path: root/test/dm/pci.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-17 08:04:48 -0400
committerTom Rini <trini@konsulko.com>2020-07-17 08:04:48 -0400
commit7c3cc6f106ed1ca13b0ff6eea9f8e1473240aef3 (patch)
tree8c67a8ed3ab24b1421161960103d8614cbde659a /test/dm/pci.c
parent42e7659db0ac7089d3a2f80ee1c3b8eb64d84706 (diff)
parentd40d2c570600396b54dece16429727ef50cfeef0 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- New timer API to allow delays with a 32-bit microsecond timer - Add dynamic ACPI structs (DSDT/SSDT) generations to the DM core - x86: Enable ACPI table generation by default - x86: Enable the copy framebuffer on Coral - x86: A few fixes to FSP2 with ApolloLake - x86: Drop setup_pcat_compatibility() - x86: Primary-to-Sideband Bus minor fixes
Diffstat (limited to 'test/dm/pci.c')
-rw-r--r--test/dm/pci.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dm/pci.c b/test/dm/pci.c
index fb93e4c78ae..39e82b3699f 100644
--- a/test/dm/pci.c
+++ b/test/dm/pci.c
@@ -339,3 +339,17 @@ static int dm_test_pci_addr_live(struct unit_test_state *uts)
}
DM_TEST(dm_test_pci_addr_live, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT |
DM_TESTF_LIVE_TREE);
+
+/* Test device_is_on_pci_bus() */
+static int dm_test_pci_on_bus(struct unit_test_state *uts)
+{
+ struct udevice *dev;
+
+ ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(0, 0x1f, 0), &dev));
+ ut_asserteq(true, device_is_on_pci_bus(dev));
+ ut_asserteq(false, device_is_on_pci_bus(dev_get_parent(dev)));
+ ut_asserteq(true, device_is_on_pci_bus(dev));
+
+ return 0;
+}
+DM_TEST(dm_test_pci_on_bus, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);