Env: 4 PCIe RC enabled. Each RC connected to one switch with 5 devices. Total 20 PCIe devices and 32 buses.
When uboot started, it was looked good on pci_init(). But if I entered pci command to read device info, I would get 0xFFFF from device. Also in linux, I could not find any of decives by lspci.
In LSDK-20.12, everything is good. So I think it is not the hardware issue.
The details and logs are below:
1. A part of uboot debug message of pci_init(). The vendor ID(1745) and device ID(5000) can be read properly.
pci_uclass_pre_probe, bus=-1/pcie@3400000, parent=root_driver
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
decode_regions: len=14, cells_per_record=7
decode_regions: region 0, pci_addr=0, addr=8000020000, size=10000, space_code=1
- type=1, pos=0
decode_regions: region 1, pci_addr=40000000, addr=8040000000, size=40000000, space_code=2
- type=0, pos=1
ofnode_read_bool: u-boot,skip-auto-config-until-reloc: false
Using SERDES1 Protocol: 10 (0xa)
Using SERDES2 Protocol: 7 (0x7)
Using SERDES3 Protocol: 2 (0x2)
fdtdec_get_bool: big-endian
pcie@3400000 dbi:3400000 lut:3480000 ctrl:0x34c0000 cfg0:0x8000000000, big-endian:0
PCIe1: pcie@3400000 Root ComplexiATU0:
LOWER PHYS 0x00000000
UPPER PHYS 0x00000080
LOWER BUS 0x00000000
UPPER BUS 0x00000000
LIMIT 0x00000fff
CR1 0x00000004
CR2 0x80000000
iATU1:
LOWER PHYS 0x00001000
UPPER PHYS 0x00000080
LOWER BUS 0x00000000
UPPER BUS 0x00000000
LIMIT 0x00001fff
CR1 0x00000005
CR2 0x80000000
iATU2:
LOWER PHYS 0x00020000
UPPER PHYS 0x00000080
LOWER BUS 0x00000000
UPPER BUS 0x00000000
LIMIT 0x0002ffff
CR1 0x00000002
CR2 0x80000000
iATU3:
LOWER PHYS 0x40000000
UPPER PHYS 0x00000080
LOWER BUS 0x40000000
UPPER BUS 0x00000000
LIMIT 0x7fffffff
CR1 0x00000000
CR2 0x80000000
iATU4:
LOWER PHYS 0x00000000
UPPER PHYS 0x00000000
LOWER BUS 0x00000000
UPPER BUS 0x00000000
LIMIT 0x00000fff
CR1 0x00000000
CR2 0x00000000
iATU5:
LOWER PHYS 0x00000000
UPPER PHYS 0x00000000
LOWER BUS 0x00000000
UPPER BUS 0x00000000
LIMIT 0x00000fff
CR1 0x00000000
CR2 0x00000000
: x1 gen2
pci_uclass_post_probe: probing bus 0
pci_bind_bus_devices: bus 0/pcie@3400000: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1957, device=8d90
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
PCI Autoconfig: Bus Memory region: [40000000-7fffffff],
Physical Memory [8040000000-807fffffffx]
PCI Autoconfig: Bus I/O region: [0-ffff],
Physical Memory [8000020000-800002ffffx]
pci_auto_config_devices: device pci_0:0.0
PCI Autoconfig: Found P2P bridge, device 0
dm_pci_hose_probe_bus
pci_get_bus_max: ret=0
dm_pci_hose_probe_bus: bus = 1/pci_0:0.0
pci_uclass_pre_probe, bus=-1/pci_0:0.0, parent=pcie@3400000
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 1
pci_bind_bus_devices: bus 1/pci_0:0.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_1:0.0
PCI Autoconfig: Found P2P bridge, device 0
dm_pci_hose_probe_bus
pci_get_bus_max: ret=1
dm_pci_hose_probe_bus: bus = 2/pci_1:0.0
pci_uclass_pre_probe, bus=-1/pci_1:0.0, parent=pci_0:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 2
pci_bind_bus_devices: bus 2/pci_1:0.0: found device 1, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_bind_bus_devices: bus 2/pci_1:0.0: found device 2, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_bind_bus_devices: bus 2/pci_1:0.0: found device 3, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_bind_bus_devices: bus 2/pci_1:0.0: found device 4, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_bind_bus_devices: bus 2/pci_1:0.0: found device 5, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=12d8, device=2608
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_2:1.0
PCI Autoconfig: Found P2P bridge, device 1
dm_pci_hose_probe_bus
pci_get_bus_max: ret=2
dm_pci_hose_probe_bus: bus = 3/pci_2:1.0
pci_uclass_pre_probe, bus=-1/pci_2:1.0, parent=pci_1:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 3
pci_bind_bus_devices: bus 3/pci_2:1.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1745, device=5000
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_3:0.0
PCI Autoconfig: BAR 0, Mem, size=0x100000, address=0x40000000 bus_lower=0x40100000
PCI Autoconfig: BAR 1, Mem, size=0x10000, address=0x40100000 bus_lower=0x40110000
pci_auto_config_devices: done
pci_auto_config_devices: device pci_2:2.0
PCI Autoconfig: Found P2P bridge, device 2
dm_pci_hose_probe_bus
pci_get_bus_max: ret=3
dm_pci_hose_probe_bus: bus = 4/pci_2:2.0
pci_uclass_pre_probe, bus=-1/pci_2:2.0, parent=pci_1:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 4
pci_bind_bus_devices: bus 4/pci_2:2.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1745, device=5000
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_4:0.0
PCI Autoconfig: BAR 0, Mem, size=0x100000, address=0x40200000 bus_lower=0x40300000
PCI Autoconfig: BAR 1, Mem, size=0x10000, address=0x40300000 bus_lower=0x40310000
pci_auto_config_devices: done
pci_auto_config_devices: device pci_2:3.0
PCI Autoconfig: Found P2P bridge, device 3
dm_pci_hose_probe_bus
pci_get_bus_max: ret=4
dm_pci_hose_probe_bus: bus = 5/pci_2:3.0
pci_uclass_pre_probe, bus=-1/pci_2:3.0, parent=pci_1:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 5
pci_bind_bus_devices: bus 5/pci_2:3.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1745, device=5000
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_5:0.0
PCI Autoconfig: BAR 0, Mem, size=0x100000, address=0x40400000 bus_lower=0x40500000
PCI Autoconfig: BAR 1, Mem, size=0x10000, address=0x40500000 bus_lower=0x40510000
pci_auto_config_devices: done
pci_auto_config_devices: device pci_2:4.0
PCI Autoconfig: Found P2P bridge, device 4
dm_pci_hose_probe_bus
pci_get_bus_max: ret=5
dm_pci_hose_probe_bus: bus = 6/pci_2:4.0
pci_uclass_pre_probe, bus=-1/pci_2:4.0, parent=pci_1:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 6
pci_bind_bus_devices: bus 6/pci_2:4.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1745, device=5000
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_6:0.0
PCI Autoconfig: BAR 0, Mem, size=0x100000, address=0x40600000 bus_lower=0x40700000
PCI Autoconfig: BAR 1, Mem, size=0x10000, address=0x40700000 bus_lower=0x40710000
pci_auto_config_devices: done
pci_auto_config_devices: device pci_2:5.0
PCI Autoconfig: Found P2P bridge, device 5
dm_pci_hose_probe_bus
pci_get_bus_max: ret=6
dm_pci_hose_probe_bus: bus = 7/pci_2:5.0
pci_uclass_pre_probe, bus=-1/pci_2:5.0, parent=pci_1:0.0
Looking for highest alias id for 'pci'
- spi0, /flexspi@20c0000
- spi1, /dspi@2100000
pci_uclass_post_probe: probing bus 7
pci_bind_bus_devices: bus 7/pci_2:5.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=1745, device=5000
pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices: start
pci_auto_config_devices: device pci_7:0.0
PCI Autoconfig: BAR 0, Mem, size=0x100000, address=0x40800000 bus_lower=0x40900000
PCI Autoconfig: BAR 1, Mem, size=0x10000, address=0x40900000 bus_lower=0x40910000
pci_auto_config_devices: done
pci_auto_config_devices: done
pci_auto_config_devices: done
pci_auto_config_devices: done
2. uboot pci command
=> pci 3
Scanning PCI devices on bus 3
BusDevFun VendorId DeviceId Device Class Sub-Class
_____________________________________________________________
03.00.00 0xffff 0xffff Does not fit any class 0xff
3. lspci
# lspci -t
-+-[0004:00]---00.0-[01-ff]--
+-[0003:00]---00.0-[01-ff]----00.0-[02]--+-01.0-[03]--
| +-02.0-[04]--
| +-03.0-[05]--
| +-04.0-[06]--
| \-05.0-[07]--
+-[0002:00]---00.0-[01-ff]----00.0-[02]--+-01.0-[03]--
| +-02.0-[04]--
| +-03.0-[05]--
| +-04.0-[06]--
| \-05.0-[07]--
+-[0001:00]---00.0-[01-ff]----00.0-[02]--+-01.0-[03]--
| +-02.0-[04]--
| +-03.0-[05]--
| +-04.0-[06]--
| \-05.0-[07]--
\-[0000:00]---00.0-[01-ff]----00.0-[02]--+-01.0-[03]--
+-02.0-[04]--
+-03.0-[05]--
+-04.0-[06]--
\-05.0-[07]--
4. LSDK-20.12 uboot pci command
=> pci 3
Scanning PCI devices on bus 3
BusDevFun VendorId DeviceId Device Class Sub-Class
_____________________________________________________________
03.00.00 0x1745 0x5000 Multimedia device 0x80
5. LSDK-20.12 lspci
# lspci -t
-+-[0004:00]---00.0-[01-ff]--
+-[0003:00]---00.0-[01-ff]----00.0-[02-07]--+-01.0-[03]----00.0
| +-02.0-[04]----00.0
| +-03.0-[05]----00.0
| +-04.0-[06]----00.0
| \-05.0-[07]----00.0
+-[0002:00]---00.0-[01-ff]----00.0-[02-07]--+-01.0-[03]----00.0
| +-02.0-[04]----00.0
| +-03.0-[05]----00.0
| +-04.0-[06]----00.0
| \-05.0-[07]----00.0
+-[0001:00]---00.0-[01-ff]----00.0-[02-07]--+-01.0-[03]----00.0
| +-02.0-[04]----00.0
| +-03.0-[05]----00.0
| +-04.0-[06]----00.0
| \-05.0-[07]----00.0
\-[0000:00]---00.0-[01-ff]----00.0-[02-07]--+-01.0-[03]----00.0
+-02.0-[04]----00.0
+-03.0-[05]----00.0
+-04.0-[06]----00.0
\-05.0-[07]----00.0
Solved! Go to Solution.
Thanks for the reply.
I found that there is a bug on uboot v2021.04. At file pci-uclass.c, it did not set the maximum bus number to the subordinate register of switch.
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -646,6 +646,8 @@ int dm_pci_hose_probe_bus(struct udevice *bus)
return log_msg_ret("probe", ret);
}
+ if (!ea_pos)
+ sub_bus = pci_get_bus_max();
dm_pciauto_postscan_setup_bridge(bus, sub_bus);
return sub_bus;
Hi,
Could you please provide the debug success logs from LSDK 20.12 ?
Thanks for the reply.
I found that there is a bug on uboot v2021.04. At file pci-uclass.c, it did not set the maximum bus number to the subordinate register of switch.
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -646,6 +646,8 @@ int dm_pci_hose_probe_bus(struct udevice *bus)
return log_msg_ret("probe", ret);
}
+ if (!ea_pos)
+ sub_bus = pci_get_bus_max();
dm_pciauto_postscan_setup_bridge(bus, sub_bus);
return sub_bus;