Skip to content

Commit 77e845e

Browse files
GuEe-GUIRbb666
authored andcommitted
[DM/PCI] Fixup the bus-range probe
Signed-off-by: GuEe-GUI <[email protected]>
1 parent 8731289 commit 77e845e

File tree

1 file changed

+5
-2
lines changed
  • components/drivers/pci

1 file changed

+5
-2
lines changed

components/drivers/pci/ofw.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ rt_err_t rt_pci_ofw_parse_ranges(struct rt_ofw_node *dev_np,
284284
phy_addr_cells, phy_size_cells, cpu_addr_cells,
285285
&host_bridge->dma_regions, &host_bridge->dma_regions_nr);
286286

287-
if (err != -RT_EEMPTY)
287+
if (err && err != -RT_EEMPTY)
288288
{
289289
rt_free(host_bridge->bus_regions);
290290
host_bridge->bus_regions_nr = 0;
@@ -314,7 +314,10 @@ rt_err_t rt_pci_ofw_host_bridge_init(struct rt_ofw_node *dev_np,
314314

315315
if (rt_ofw_prop_read_u32_array_index(dev_np, "bus-range", 0, 2, host_bridge->bus_range) < 0)
316316
{
317-
return -RT_EIO;
317+
host_bridge->bus_range[0] = 0x00;
318+
host_bridge->bus_range[1] = 0xff;
319+
LOG_I("%s: No \"%s\" found, using [%#02x, %#02x]", rt_ofw_node_full_name(dev_np), "bus-range",
320+
host_bridge->bus_range[0], host_bridge->bus_range[1]);
318321
}
319322

320323
propname = rt_ofw_get_prop_fuzzy_name(dev_np, ",pci-domain$");

0 commit comments

Comments
 (0)