duhualieqt 发表于 2024-7-22 14:49:54

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

1.首先,设备上电,pcie bar分配打印如下:

[   27.690409] rk-pcie fe160000.pcie: invalid prsnt-gpios property in node
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
[   27.970051] pci_bus 0001:10: root bus resource [??? 0xf1000000-0xf10fffff flags 0x0]
[   27.970057] pci_bus 0001:10: root bus resource (bus address )
[   27.970062] pci_bus 0001:10: root bus resource (bus address )
[   27.970066] pci_bus 0001:10: root bus resource
[   27.970087] pci 0001:10:00.0: type 01 class 0x060400
[   27.970100] pci 0001:10:00.0: reg 0x38:
[   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 (), reconfiguring
[   27.974046] pci 0001:11:00.0: type 00 class 0x028000
[   27.974110] pci 0001:11:00.0: reg 0x10:
[   27.974147] pci 0001:11:00.0: reg 0x18:
[   27.974185] pci 0001:11:00.0: reg 0x20:
[   27.986105] pci_bus 0001:11: busn_res: end is updated to 11
[   27.986146] pci 0001:10:00.0: 0708 BAR 8: assigned
[   27.986153] pci 0001:10:00.0: 0708 BAR 6: assigned
[   27.986163] pci 0001:11:00.0: 0708BAR 0: assigned
[   27.986183] pci 0001:11:00.0: BAR 0: error updating (0xf1200004 != 0xf1000004)
[   27.986200] pci 0001:11:00.0: 0708 BAR 4: assigned
[   27.986219] pci 0001:11:00.0: BAR 4: error updating (0xf2200004 != 0xf2000004)
[   27.986235] pci 0001:11:00.0: 0708 BAR 2: assigned
[   27.986267] pci 0001:10:00.0: PCI bridge to
[   27.987761] pcieport 0001:10:00.0: PME: Signaing with IRQ 1270-0x9427fffff]


# insmod ./sdk_linuxkm.ko
[   59.682462] dev: 0x00000000f1d9d49f, pciid: 0x00000000d0f6119a, irq: 118
[   59.682493] linux-kernel-dev 0001:11:00.0: enabling device (0000 -> 0002)
[   59.682515] Set DMA to 32 bit mode
[   59.682519] Found chip with name: linux-kernel-dev0
[   59.682524] vendor id: 0x1619
[   59.682527] device id: 0x9024
[   59.682547] BAR 0 address: 0x940000000
[   59.682550] BAR 0 length: 16777216(0x1000000) bytes
[   59.682561] BAR 2 address: 0x942000000
[   59.682564] BAR 2 length: 1048576(0x100000) bytes
[   59.682580] BAR 4 address: 0x941000000
[   59.682583] BAR 4 length: 16777216(0x1000000) bytes
[   59.682589] chip: 0, domain: 0x1, bus: 0x11, devid: 0x0, function: 0x0
[   59.682667] 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] chip: linux-kernel-dev0@000000007bded903, vendor: 0x1619, device: 0x9024
[   59.683385] chip_id:0x0 addr: 0x20000 bar:0x4 will write reg_data:0xc2c020000000000
[   59.683391] chip_id:0x0 addr: 0x20000 bar:0x4 write reg_data:0xc2c020000000000
[   59.683427] chip_id:0x0 addr: 0x20000 bar:0x4 read reg_data:0xc2c020000000000 ret:0
[   59.683436] chip_id:0x0 addr: 0x20000 bar:0x4 read reg_data:0xc2c020000000000 device_id:0x0
[   59.683442] chip_id:0x0 addr: 0x2e0250 bar:0x4
[   59.683451] chip_id:0x0 addr: 0x2e0250 bar:0x4 read reg_data:0x0 device_id:0x0 ret: 0
[   59.683459] chip_id: 0x0 ret:0
[   59.686709] chip_id: 0x0 ret:0
[   59.686722] chip_id: 0x0 ret:0
[   59.686728] chip_id: 0x0 ret:0
[   59.686844] chip_id: 0x0 ret:0
[   59.686848] chip_id: 0x0 ret:0
[   59.686855] chip_id: 0x0 ret:0
[   59.686860] chip_id: 0x0 ret:0
[   59.688070] chip_id: 0x0 ret:0
[   59.688197] chip_id: 0x0 ret:0
[   59.688201] chip_id: 0x0
[   59.688205] 000 sf9056_get_freq chip_id is 0.
[   59.689220] sf9056_get_freq chip_id:0x0 read pll700_data:0x0
[   59.689225] readchip_id:0X0 bar4 pll700_data:0x0 !
[   59.689229] read pll700_data:0x0 loop failed, the param is empty !
[   59.689236]
[   59.689238] sf9056_get_freq(chip_id, &csl_ctrl->freq), errcode = -2
[   59.689243] chip_id: 0x0 ret:-2
[   59.689248]
[   59.689250] csl_groot_init_chip_func(chip_id), errcode = -2
[   59.689257]
[   59.689258] chip init failed!


详情见附件.
页: [1]
查看完整版本: pcie在某寄存器处写入和读取会失败.