Firefly开源社区

打印 上一主题 下一主题

[技术讨论] pcie在某寄存器处写入和读取会失败.

71

积分

0

威望

0

贡献

技术小白

积分
71

pcie在某寄存器处写入和读取会失败.

发表于 2024-7-22 14:49:54      浏览:934 | 回复:0        打印      只看该作者   [复制链接] 楼主
  • 固件类型: 自行编译的固件
  • SDK包名称: RK3588_LINUX_NVR_SDK_Release_V1.0.0_20220304
  • SDK更新到哪个COMMIT: 0000-00-00 00:00:00
  • SDK修改内容: rk3588.dtsi,rk3588-nvr-demo.dtsi
  • Log日志: debug07220002.zip
问题描述及复现步骤:
1.首先,设备上电,pcie bar分配打印如下:

[   27.690409] rk-pcie fe160000.pcie: invalid prsnt-gpios property in node
[  709468] rk-pcie fe160000.pcie: missing legacy IRQ resource
[   30.355071] rk-pcie fe160000.pcie: IRQ msi not found
7.709484] rk-pcie fe160000.pcie: use outband MSI support
[   27.709488] rk-pcie fe160000.pcie: Missing *config* reg space
[   27.709495] rk-pcie fe160000.pcie: host bridge /pcie@fe160000 ranges:
[   27.709511] rk-pcie fe160000.pcie:      err 0x00f1000000..0x00f10fffff -> 0x00f1000000
[   27.709518] rk-pcie fe160000.pcie:       IO 0x00f1100000..0x00f11fffff -> 0x00f1100000
[   27.709526] rk-pcie fe160000.pcie:      MEM 0x0940000000..0x094effffff -> 0x00f1200000
[   27.709532] rk-pcie fe160000.pcie:      MEM 0x0950000000..0x097fffffff -> 0x0950000000
[   27.709557] rk-pcie fe160000.pcie: Missing *config* reg space
[   27.709581] rk-pcie fe160000.pcie: invalid resource
[   27.969785] re fe160000.pcie: PCIe Link up, LTSSM is 0x11
[   27.970023] rk-pcie fe160000.pciCI host bridge to 0001:10
[   27.31] pci_bus 0001:10: root bus resource [bus 10-1f]
[   27.970051] pci_bus 0001:10: root bus resource [??? 0xf1000000-0xf10fffff flags 0x0]
[   27.970057] pci_bus 0001:10: root bus resource [io  0x100000-0x1fffff] (bus address [0xf1100000-0xf11fffff])
[   27.970062] pci_bus 0001:10: root bus resource [mem 0x940000000-0x94effffff] (bus address [0xf1200000-0x1001fffff])
[   27.970066] pci_bus 0001:10: root bus resource [mem 0x950000000-0x97fffffff pref]
[   27.970087] pci 0001:10:00.0: [1d87:3588] type 01 class 0x060400
[   27.970100] pci 0001:10:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[   27.970136] pci 0001:10:00.0: supports D1 D2
[   27.970140] pci 0001:10:00.0: PME# supported from D0 D1 D3hot
[   27.973791] pci 0001:10:00.0: Primary bus is hard wired to 0
[   27.973799] pci 0001:10:00.0: bridge configuration invalid ([bus 01-ff]), reconfiguring
[   27.974046] pci 0001:11:00.0: [1619:9024] type 00 class 0x028000
[   27.974110] pci 0001:11:00.0: reg 0x10: [mem 0x00000000-0x00ffffff 64bit]
[   27.974147] pci 0001:11:00.0: reg 0x18: [mem 0x00000000-0x000fffff 64bit]
[   27.974185] pci 0001:11:00.0: reg 0x20: [mem 0x00000000-0x00ffffff 64bit]
[   27.986105] pci_bus 0001:11: busn_res: [bus 11-1f] end is updated to 11
[   27.986146] pci 0001:10:00.0: 0708 BAR 8: assigned [mem 0x940000000-0x9427fffff] [0x940000000~0x9427fffff]
[   27.986153] pci 0001:10:00.0: 0708 BAR 6: assigned [mem 0x942800000-0x94280ffff pref] [0x942800000~0x94280ffff]
[   27.986163] pci 0001:11:00.0: 0708BAR 0: assigned [mem 0x940000000-0x940ffffff 64bit] [0x940000000~0x940ffffff]
[   27.986183] pci 0001:11:00.0: BAR 0: error updating (0xf1200004 != 0xf1000004)
[   27.986200] pci 0001:11:00.0: 0708 BAR 4: assigned [mem 0x941000000-0x941ffffff 64bit] [0x941000000~0x941ffffff]
[   27.986219] pci 0001:11:00.0: BAR 4: error updating (0xf2200004 != 0xf2000004)
[   27.986235] pci 0001:11:00.0: 0708 BAR 2: assigned [mem 0x942000000-0x9420fffff 64bit] [0x942000000~0x9420fffff]
[   27.986267] pci 0001:10:00.0: PCI bridge to [bus 11]
[   27.987761] pcieport 0001:10:00.0: PME: Signaing with IRQ 1270-0x9427fffff]


[root@AnchorSec:/app/bin]# insmod ./sdk_linuxkm.ko
[   59.682462] [Kernel: haki_pci_probe - 1504] dev: 0x00000000f1d9d49f, pciid: 0x00000000d0f6119a, irq: 118
[   59.682493] linux-kernel-dev 0001:11:00.0: enabling device (0000 -> 0002)
[   59.682515] [Kernel: haki_pci_probe - 1532] Set DMA to 32 bit mode
[   59.682519] [Kernel: haki_pci_probe - 1549] Found chip with name: linux-kernel-dev0
[   59.682524] [Kernel: haki_pci_probe - 1550] vendor id: 0x1619
[   59.682527] [Kernel: haki_pci_probe - 1551] device id: 0x9024
[   59.682547] [Kernel: haki_pci_probe - 1564] BAR 0 address: 0x940000000
[   59.682550] [Kernel: haki_pci_probe - 1565] BAR 0 length: 16777216(0x1000000) bytes
[   59.682561] [Kernel: haki_pci_probe - 1577] BAR 2 address: 0x942000000
[   59.682564] [Kernel: haki_pci_probe - 1578] BAR 2 length: 1048576(0x100000) bytes
[   59.682580] [Kernel: haki_pci_probe - 1590] BAR 4 address: 0x941000000
[   59.682583] [Kernel: haki_pci_probe - 1591] BAR 4 length: 16777216(0x1000000) bytes
[   59.682589] [Kernel: haki_pci_probe - 1630] chip: 0, domain: 0x1, bus: 0x11, devid: 0x0, function: 0x0
[   59.682667] [Kernel: haki_get_chip_info - 1217] chip: linux-kernel-dev0@000000007bded903, vendor: 0x1619, device: 0x9024
[   59.683300] SDK Info:
[   59.683307] sdk_version       : sdk-src-esc.6.4.2-r28659
[   59.683310] compiled          : Jul 18 2024 16:29:27
[   59.683313]
[   59.683316] Chip Configuration:
[   59.683319] MagicNum          : 0x5a5aa5a5
[   59.683322] Content_Type      : 0x0
[   59.683325] Length            : 0x80
[   59.683328] Device_ID         : 0x9911
[   59.683331] HW_Type           : 0x1
[   59.683334] HW_Major_Version  : 0x1
[   59.683336] HW_Minor_Version  : 0xabcd
[   59.683340] Mac               : 9a:78:9a:34:12:00
[   59.683343] Product_name      : zmmc-1234567890
[   59.683346] CRC               : 0x0
[   59.683351] default_probe: probe success


.0x20000这里的addr处可以写入和读取成功,
0x00000这里的addr处可以写入和读取失败;


2.pcie设备写入和读取截取的信息如下:

[   59.683367] [Kernel: haki_get_chip_info - 1217] chip: linux-kernel-dev0@000000007bded903, vendor: 0x1619, device: 0x9024
[   59.683385] [Kernel: csl_groot_chip_is_sf9028 - 440] chip_id:0x0 addr: 0x20000 bar:0x4 will write reg_data:0xc2c020000000000
[   59.683391] [Kernel: csl_groot_chip_is_sf9028 - 446] chip_id:0x0 addr: 0x20000 bar:0x4 write reg_data:0xc2c020000000000
[   59.683427] [Kernel: csl_groot_chip_is_sf9028 - 453] chip_id:0x0 addr: 0x20000 bar:0x4 read reg_data:0xc2c020000000000 ret:0
[   59.683436] [Kernel: csl_groot_chip_is_sf9028 - 458] chip_id:0x0 addr: 0x20000 bar:0x4 read reg_data:0xc2c020000000000 device_id:0x0
[   59.683442] [Kernel: csl_groot_chip_is_sf9028 - 476] chip_id:0x0 addr: 0x2e0250 bar:0x4
[   59.683451] [Kernel: csl_groot_chip_is_sf9028 - 483] chip_id:0x0 addr: 0x2e0250 bar:0x4 read reg_data:0x0 device_id:0x0 ret: 0
[   59.683459] [Kernel: csl_groot_sf9056_reg_tab_init - 720] chip_id: 0x0 ret:0
[   59.686709] [Kernel: csl_groot_sf9056_reg_tab_init - 768] chip_id: 0x0 ret:0
[   59.686722] [Kernel: csl_groot_sf9056_reg_tab_init - 772] chip_id: 0x0 ret:0
[   59.686728] [Kernel: csl_groot_sf9056_reg_tab_init - 777] chip_id: 0x0 ret:0
[   59.686844] [Kernel: csl_groot_sf9056_reg_tab_init - 782] chip_id: 0x0 ret:0
[   59.686848] [Kernel: csl_groot_sf9056_reg_tab_init - 787] chip_id: 0x0 ret:0
[   59.686855] [Kernel: csl_groot_sf9056_reg_tab_init - 794] chip_id: 0x0 ret:0
[   59.686860] [Kernel: csl_groot_sf9056_reg_tab_init - 799] chip_id: 0x0 ret:0
[   59.688070] [Kernel: csl_groot_sf9056_reg_tab_init - 803] chip_id: 0x0 ret:0
[   59.688197] [Kernel: csl_groot_sf9056_reg_tab_init - 807] chip_id: 0x0 ret:0
[   59.688201] [Kernel: csl_groot_sf9056_reg_tab_init - 811] chip_id: 0x0
[   59.688205] [Kernel: sf9056_get_freq - 507] 000 sf9056_get_freq chip_id is 0.
[   59.689220] [Kernel: sf9056_get_freq - 519] sf9056_get_freq chip_id:0x0 read pll700_data:0x0
[   59.689225] [Kernel: sf9056_get_freq - 526] read  chip_id:0X0 bar4 pll700_data:0x0 !
[   59.689229] [Kernel: sf9056_get_freq - 530] read pll700_data:0x0 loop failed, the param is empty !
[   59.689236] [1970-1-1 0:0:58 TOP    ERROR csl_groot_sf9056_reg_tab_init.c:00812 chip:00]
[   59.689238] sf9056_get_freq(chip_id, &csl_ctrl->freq), errcode = -2 [Out of memory]
[   59.689243] [Kernel: csl_groot_sf9056_reg_tab_init - 818] chip_id: 0x0 ret:-2
[   59.689248] [1970-1-1 0:0:58 TOP    ERROR csl_groot_ctrl.c:00322 chip:00]
[   59.689250] csl_groot_init_chip_func[chip_type](chip_id), errcode = -2 [Out of memory]
[   59.689257] [1970-1-1 0:0:58 REG    ERROR csl_groot_reg_tab_init.c:00012 chip:00]
[   59.689258] chip init failed!


详情见附件.

debug07220002.zip

2.16 KB, 下载次数: 0, 下载积分: 灯泡 -1 , 经验 -1

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表