NXP MCU 技术论坛
直播中

笑过就走

9年用户 797经验值
擅长:可编程逻辑 电源/新能源 MEMS/传感技术
私信 关注
[问答]

将SJA1105Q以太网交换机添加到Renesas SOC,将sja1105.ko文件加载到内核后奔溃了怎么解决?

我正在努力将 SJA1105Q 以太网交换机添加到 Renesas SOC。将 sja1105.ko 文件加载到内核后,观察到内核崩溃。步骤和内核崩溃日志如下所示。

  • 先添加依赖模块。

    • dsa_core.ko
    • ptp.ko
    • tag_8021q.ko
  • 加载 sja1105q.ko 模块并检查 dmesg 日志是否有错误。
  • 观察到内核崩溃

[    1.585783] systemd-modules-load[207]: Inserted module 'phylink'
[    1.590334] systemd-modules-load[207]: Inserted module 'dsa_core'
[    1.592509] PTP clock support registered
[    1.592587] systemd-modules-load[207]: Inserted module 'ptp'
[    1.594032] systemd-modules-load[207]: Inserted module 'tag_8021q'
[    1.595539] systemd-modules-load[207]: Inserted module 'tag_sja1105'
[    1.599692] sja1105 spi3.1: calling sja1105_probe...
[    1.621283] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000028
[    1.630106] Mem abort info:
[    1.632900]   ESR = 0x96000005
[    1.636001]   EC = 0x25: DABT (current EL), IL = 32 bits
[    1.641328]   SET = 0, FnV = 0
[    1.644381]   EA = 0, S1PTW = 0
[    1.647530] Data abort info:
[    1.650417]   ISV = 0, ISS = 0x00000005
[    1.654262]   CM = 0, WnR = 0
[    1.657231] user pgtable: 4k pages, 39-bit VAs, pgdp=00000004d69f4000
[    1.663702] [0000000000000028] pgd=0000000000000000, pud=0000000000000000
[    1.670515] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    1.676095] Modules linked in: sja1105(+) tag_sja1105 tag_8021q ptp dsa_core phylink cp210x pl2303 ftdi_sio usbserial can_isotp(O) mcp25xxfd sd_mod usb_f_ncm u_ether libcomposite renesas_usbhs udc_core extcon_core xhci_plat_hcd xhci_hcd cdc_ncm hid_generic usbhid usb_storage scsi_mod asix ax88179_178a usbnet mii ehset spidev configfs
[    1.705731] CPU: 1 PID: 207 Comm: systemd-modules Tainted: G           O      5.4.26-work #2
[    1.714179] Hardware name: PCC VBOX (ZR3-Based) board (DT)
[    1.719671] pstate: 40000005 (nZcv daif -PAN -UAO)
[    1.724483] pc : sja1105_probe+0x130/0x2b8 [sja1105]
[    1.729456] lr : sja1105_probe+0x120/0x2b8 [sja1105]
[    1.734424] sp : ffffffc010c1b900
[    1.737738] x29: ffffffc010c1b900 x28: 0000000000000001
[    1.743056] x27: ffffff849565bec8 x26: 0000000000000001
[    1.748373] x25: ffffffc008845110 x24: 0000000000000010
[    1.753691] x23: 0000000000000000 x22: ffffffc010928000
[    1.759007] x21: 0000000000000000 x20: ffffff8497de7800
[    1.764324] x19: ffffff8495659080 x18: 000000000000000a
[    1.769641] x17: 0000000000000000 x16: 0000000000000000
[    1.774958] x15: ffffffc48f087000 x14: 00000000000002e7
[    1.780274] x13: 0000000000000231 x12: 0000000000000038
[    1.785591] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[    1.790908] x9 : 03fefeff01fefeff x8 : 7f7f7f7f7f7f7f7f
[    1.796226] x7 : ff342f3030606972 x6 : 0000000000000080
[    1.801542] x5 : 8000000000000000 x4 : 0000000000000004
[    1.806859] x3 : ffffffc010c1b940 x2 : 0035303131616a73
[    1.812176] x1 : ffffff84960c0fc0 x0 : 0000000000000000
[    1.817493] Call trace:
[    1.819945]  sja1105_probe+0x130/0x2b8 [sja1105]
[    1.824576]  spi_drv_probe+0x88/0xb0
[    1.828156]  really_probe+0x1e8/0x2ec
[    1.831821]  driver_probe_device+0xd8/0xe8
[    1.835920]  device_driver_attach+0x48/0x70
[    1.840106]  __driver_attach+0xc4/0xc8
[    1.843858]  bus_for_each_dev+0x8c/0xd4
[    1.847696]  driver_attach+0x30/0x3c
[    1.851273]  bus_add_driver+0x17c/0x1c0
[    1.855112]  driver_register+0xb0/0xe8
[    1.858862]  __spi_register_driver+0x6c/0x78
[    1.863142]  sja1105_driver_init+0x28/0x1000 [sja1105]
[    1.868290]  do_one_initcall+0xc4/0x21c
[    1.872130]  do_init_module+0x60/0x1f8
[    1.875880]  load_module+0x1dd8/0x1e84
[    1.879630]  __do_sys_finit_module+0xa4/0xc0
[    1.883902]  __arm64_sys_finit_module+0x28/0x34
[    1.888438]  el0_svc_common.constprop.2+0xec/0x158
[    1.893233]  el0_svc_handler+0x58/0x88
[    1.896984]  el0_svc+0x8/0xc
[    1.899869] Code: f900b660 d2800084 b90057bf 910103a3 (f9401418)
[    1.905971] ---[ end trace ff0846ac68861238 ]---

设备连接和 DTS 详细信息如下所示。
设备连接:


设备树配置:


/* SPI_ETH */
&msiof3 {
pinctrl-0 = <&msiof3_pins>;
pinctrl-names = "default";
status = "okay";

cs-gpios = <0>, <&gpio1 5 GPIO_ACtiVE_LOW>;
num-cs = <2>;
/*renesas,dtdl = <50>;*/
/*renesas,syncdl = <50>;*/

/* SPI3 CS2-SJA1105 mode 1 */
sja1105@1 {
/*compatible = "renesas,sh-msiof";*/
compatible = "nxp,sja1105t";
reg = <1>;
spi-max-frequency = <4000000>;
spi-cpha;
/*spi-cpol;*/
renesas,dtdl = <200>;
renesas,syncdl = <300>;
reset-gpios = <&gpio4 7 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
/* Internal port connected to ethernet port of m3 */
ethernet = <&avb>;
phy-handle = <&phy0>;
phy-mode = "rgmii";
reg = <0>;
sja1105,role-phy;
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@1 {
/* ETH3 (goes to backplane) */
label = "swp1";
phy-handle = <&mii_eth_phy3>;
phy-mode = "mii";
reg = <1>;
/* Implicit "sja1105,role-mac;" */
};
port@2 {
/* brr phy 1 (goes to backplane) */
label = "swp2";
phy-handle = <&mii_brr_phy1>;
phy-mode = "mii";
reg = <2>;
/* Implicit "sja1105,role-mac;" */
};
port@3 {
/* brr phy 2 (goes to backplane) */
phy-handle = <&mii_brr_phy2>;
label = "swp3";
phy-mode = "mii";
reg = <3>;
/* Implicit "sja1105,role-mac;" */
};
port@4 {
/* brr phy 3 (goes to backplane) */
label = "swp4";
phy-handle = <&mii_brr_phy3>;
phy-mode = "mii";
reg = <0>;
/* Implicit "sja1105,role-mac;" */
};
};

};
};

&avb {
pinctrl-0 = <&avb_pins>;
pinctrl-names = "default";
renesas,no-ether-link;
phy-handle = <&phy0>;
status = "okay";
phy-mode = "rgmii-id";

phy0: dummy_phy {
compatible = "ethernet-phy-idFFFF.FFFE";
reg = <8>;
fixed-link {
speed = <1000>;
full-duplex;
};

};
mii_eth_phy3: ksz9031@0 {
compatible = "microchip,ksz9031";
reg = <0>;
interrupt-parent = <&gpio4>;
interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
};
mii_brr_phy1: mv88q2112@1 {
compatible = "marvell,mv88q2112";
reg = <1>;
interrupt-parent = <&gpio2>;
interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&gpio4 13 GPIO_ACTIVE_LOW>;
};
mii_brr_phy2: mv88q2112@2 {
compatible = "marvell,mv88q2112";
reg = <2>;
interrupt-parent = <&gpio2>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&gpio4 12 GPIO_ACTIVE_LOW>;
};
mii_brr_phy3: mv88q2112@3 {
compatible = "marvell,mv88q2112";
reg = <3>;
interrupt-parent = <&gpio2>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
};
};
版本细节是。

  • Linux内核:5.4.26-work

请检查配置并帮助修复内核崩溃。

回帖(1)

李梅

2023-9-26 09:52:36
1.596464] systemd-modules-load[207]: Inserted module 'tag_8021q'[    1.600014] systemd-modules-load[207]: Inserted module 'sja1105q'[    1.602380] sja1105 2e1a0000.etop-ffffffff: failed to reset device, err=-61

步骤:

1. 确保系统和内核版本与 sja1105.ko 模块的要求匹配。

2. 检查是否加载了所有依赖模块(如上所示)。如果有任何缺少的依赖项,加载它们。

3. 检查 sja1105.ko 文件是否正确安装到系统中。如果不是,请卸载文件并重新安装。

4. 检查 sja1105.ko 文件是否与 SOC 的体系结构匹配。如果不是,请寻找适当的文件并将其安装到系统中。

5. 检查系统日志以查看更多有关崩溃的信息。存在其他错误吗?如果有,请尝试通过修复这些错误来解决崩溃。

6. 尝试使用其他版本的 sja1105.ko 文件,以查看是否存在文件版本兼容性问题。

7. 如果以上步骤均无法解决崩溃问题,请联系 sja1105.ko 文件的供应商以获取支持。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分