in Linux flashing sja1110 failed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

in Linux flashing sja1110 failed

2,267 Views
liujialu_2024
Contributor III

on board S32G-VNP-RDB2 with bsp41.0

accoring to the doc: S32G-VNP-RDB2 Ethernet Enablement Guide

In Linux flashing the sja1110 firmware:

rmmod sja1110
modprobe sja1110
echo flash_image_2G5.bin > /sys/devices/platform/soc/402d0000.spi/spi_master/spi5/spi5.0/uc-configuration/uc_fw_upload

it failed.

dmesg information run the above 3 commands:

[Apr28 23:30] sja1110 spi5.1: [sja1110_remove]
[ +0.000439] sja1110 spi5.0: [sja1110_remove]
[ +21.808442] SPI driver sja1110 has no spi_device_id for nxp,sja1110-switch
[ +0.000022] SPI driver sja1110 has no spi_device_id for nxp,sja1110-uc
[ +0.000109] sja1110 spi5.0: probing uc
[ +0.000173] sja1110 spi5.1: probing switch
[ +0.000347] sja1110 spi5.1: Could not get GPIO from device tree
[ +0.000031] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[ +0.000103] sja1110 spi5.1: Direct firmware load for sja1110_switch.bin failed with error -2
[ +0.000011] sja1110 spi5.1: request_firmware failed with -2
[ +0.000007] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[ +0.000033] sja1110 spi5.0: Direct firmware load for sja1110_uc.bin failed with error -2
[ +0.000008] sja1110 spi5.0: request_firmware failed with -2
[Apr28 23:31] sja1110 spi5.0: [sysfs_set_cfg_upload] received command to upload binary 'flash_image_2G5.bin' to uc
[ +0.000156] sja1110 spi5.0: Direct firmware load for flash_image_2G5.bin failed with error -2
[ +0.000018] sja1110 spi5.0: request_firmware failed with -2
[ +0.000006] sja1110 spi5.0: Could not initialize hw (type=1)

Tags (2)
0 Kudos
Reply
5 Replies

2,242 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @liujialu_2024,

Althought it is not mentioned in the Ethernet enablement guide, you need to configure the following u-boot variable to be able to probe the SJA1110 device. This is mentioned in the BSP41 user manual page 64:

alejandro_e_1-1735324092580.png

 

 

I was able to correctly probe the device after this configuration:

root@s32g274ardb2:~# dmesg | grep -i "sja"
[    0.547163] gpio-24 (sja1110-rst-phy-t1): hogged as output/low
[    0.552584] gpio-81 (sja1110-rst-core): hogged as output/low
[    0.761346] sja1105 spi5.1: Probed switch chip: SJA1110A
[    4.441672] sja1105 spi5.1: Probed switch chip: SJA1110A
[    4.487130] sja1105 spi5.1: Probed switch chip: SJA1110A
[    4.487503] sja1105 spi5.1: Probed switch chip: SJA1110A
[    6.430754] sja1110: loading out-of-tree module taints kernel.
[    6.431356] SPI driver sja1110 has no spi_device_id for nxp,sja1110-switch
[    6.431363] SPI driver sja1110 has no spi_device_id for nxp,sja1110-uc
[    7.797913] sja1105 spi5.1: Probed switch chip: SJA1110A
[    7.809068] sja1105 spi5.1: Probed switch chip: SJA1110A
[    8.112979] sja1105 spi5.1 p1 (uninitialized): PHY [spi5.1-base-tx:01] driver [NXP CBTX (SJA1110)] (irq=POLL)
[    8.149055] sja1105 spi5.1: configuring for fixed/2500base-x link mode
[    8.152055] sja1105 spi5.1: Link is Up - 2.5Gbps/Full - flow control off
[    8.158514] sja1105 spi5.1 trx5 (uninitialized): PHY [spi5.1-base-t1:01] driver [NXP C45 TJA1103] (irq=POLL)
[    8.185793] sja1105 spi5.1 trx6 (uninitialized): PHY [spi5.1-base-t1:02] driver [NXP C45 TJA1103] (irq=POLL)
[    8.215230] sja1105 spi5.1 trx7 (uninitialized): PHY [spi5.1-base-t1:03] driver [NXP C45 TJA1103] (irq=POLL)
[    8.250855] sja1105 spi5.1 trx8 (uninitialized): PHY [spi5.1-base-t1:04] driver [NXP C45 TJA1103] (irq=POLL)
[    8.268145] sja1105 spi5.1 trx9 (uninitialized): PHY [spi5.1-base-t1:05] driver [NXP C45 TJA1103] (irq=POLL)
[    8.297809] sja1105 spi5.1 trx10 (uninitialized): PHY [spi5.1-base-t1:06] driver [NXP C45 TJA1103] (irq=POLL)
root@s32g274ardb2:~#

 

Please note that you should run the following two commands in u-boot:

=> setenv sja1110_dsa yes
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=>

 

After configuring and saving, please reboot de board so the changes may take effect.

 

Let me know if this steps solved your problem.

0 Kudos
Reply

2,207 Views
liujialu_2024
Contributor III

after set u-boot:

setenv sja1110_dsa yes

reboot, and in linux file system, the below file lost.

/sys/devices/platform/soc/402d0000.spi/spi_master/spi5/spi5.0/uc-configuration/uc_fw_upload

and disable the sja1110_dsa in u-boot.

setenv sja1110_dsa

 the uc_fw_upload file in linux file system appeared.

0 Kudos
Reply

2,195 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @liujialu_2024,

You are correct, the file/device is no longer present with that configuration. The method I described automatically loads the firmware at Linux boot time, you will only need to put your FW in the following path and with the following name:

/lib/firmware/sja1110_uc.bin

 

And define de environment variable I mentioned before.

Once you do that you can see the following messages in the system log:

root@s32g274ardb2:~# dmesg | grep -i "sja"
[    0.546665] gpio-24 (sja1110-rst-phy-t1): hogged as output/low
[    0.552087] gpio-81 (sja1110-rst-core): hogged as output/low
[    0.617716] sja1110-sw@1 enforce active low on chipselect handle
[    6.340111] sja1110: loading out-of-tree module taints kernel.
[    6.340758] SPI driver sja1110 has no spi_device_id for nxp,sja1110-switch
[    6.340766] SPI driver sja1110 has no spi_device_id for nxp,sja1110-uc
[    6.340881] sja1110 spi5.0: probing uc
[    6.341089] sja1110 spi5.1: probing switch
[    6.341490] sja1110 spi5.1: Could not get GPIO from device tree
[    6.341521] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[    6.343934] sja1110 spi5.1: Direct firmware load for sja1110_switch.bin failed with error -2
[    6.343970] sja1110 spi5.1: request_firmware failed with -2
[    6.343979] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[    6.354041] sja1110 spi5.0: [sja1110_init_hw] loaded fw 'sja1110_uc.bin'
[    6.354061] sja1110 spi5.0: [sja1110_pre_uc_upload] Found firmware of size 129912
[    6.354155] sja1110 spi5.0: [sja1110_pre_uc_upload] firmware appears to be valid
[    6.354201] sja1110 spi5.0: [sja1110_pre_uc_upload] \xc2\xb5C not ready for download (Status=0x31)
[    6.354324] sja1110 spi5.0: Uploading firmware...
[    6.781008] sja1110 spi5.0: Upload successfully verified!

 

as you can see Linux will automatically find the binary file and load it. 

 

Let me know if this method works for you.

0 Kudos
Reply

2,183 Views
liujialu_2024
Contributor III

thanks for reply. it works as you mentioned.

but my original question is:

 

on board S32G-VNP-RDB2 with bsp41.0

accoring to the doc: S32G-VNP-RDB2 Ethernet Enablement Guide

In Linux flashing the sja1110 firmware:

rmmod sja1110
modprobe sja1110
echo flash_image_2G5.bin > /sys/devices/platform/soc/402d0000.spi/spi_master/spi5/spi5.0/uc-configuration/uc_fw_upload

it failed.

then how can i update the firmware in qspi flash attached with SJA1110, in Linux user space?

0 Kudos
Reply

2,171 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @liujialu_2024,

I was able to load the FW into the SJA1110 with BSP41, I just located my terminal in the directory where the firmware is and executed the following:

root@s32g274ardb2:~# rmmod sja1110
root@s32g274ardb2:~# modprobe sja1110
root@s32g274ardb2:~# echo flash_image_1G.bin > /sys/devices/platform/soc/402d0000.spi/spi_master/spi5/spi5.0/uc-configuration/uc_fw_upload
root@s32g274ardb2:~# dmesg | grep -i "sja"
[    0.546645] gpio-24 (sja1110-rst-phy-t1): hogged as output/low
[    0.552070] gpio-81 (sja1110-rst-core): hogged as output/low
[    0.617667] sja1110-sw@1 enforce active low on chipselect handle
[    6.453853] sja1110: loading out-of-tree module taints kernel.
[    6.462097] SPI driver sja1110 has no spi_device_id for nxp,sja1110-switch
[    6.462120] SPI driver sja1110 has no spi_device_id for nxp,sja1110-uc
[    6.462231] sja1110 spi5.0: probing uc
[    6.462392] sja1110 spi5.1: probing switch
[    6.462739] sja1110 spi5.1: Could not get GPIO from device tree
[    6.462766] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[    6.466091] sja1110 spi5.1: Direct firmware load for sja1110_switch.bin failed with error -2
[    6.466121] sja1110 spi5.1: request_firmware failed with -2
[    6.466130] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[    6.466172] sja1110 spi5.0: Direct firmware load for sja1110_uc.bin failed with error -2
[    6.466180] sja1110 spi5.0: request_firmware failed with -2
[   49.460579] sja1110 spi5.1: [sja1110_remove]
[   49.461042] sja1110 spi5.0: [sja1110_remove]
[   54.337266] SPI driver sja1110 has no spi_device_id for nxp,sja1110-switch
[   54.337290] SPI driver sja1110 has no spi_device_id for nxp,sja1110-uc
[   54.337403] sja1110 spi5.0: probing uc
[   54.337571] sja1110 spi5.1: probing switch
[   54.337935] sja1110 spi5.1: Could not get GPIO from device tree
[   54.337970] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[   54.338057] sja1110 spi5.1: Direct firmware load for sja1110_switch.bin failed with error -2
[   54.338069] sja1110 spi5.1: request_firmware failed with -2
[   54.338076] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[   54.338110] sja1110 spi5.0: Direct firmware load for sja1110_uc.bin failed with error -2
[   54.338118] sja1110 spi5.0: request_firmware failed with -2
[   67.488628] sja1110 spi5.0: [sysfs_set_cfg_upload] received command to upload binary 'flash_image_1G.bin' to uc
[   67.488970] sja1110 spi5.0: [sja1110_init_hw] loaded fw 'flash_image_1G.bin'
[   67.488983] sja1110 spi5.0: [sja1110_pre_uc_upload] Found firmware of size 129912
[   67.489090] sja1110 spi5.0: [sja1110_pre_uc_upload] firmware appears to be valid
[   67.489138] sja1110 spi5.0: [sja1110_pre_uc_upload] \xc2\xb5C not ready for download (Status=0x31)
[   67.489256] sja1110 spi5.0: Uploading firmware...
[   67.803842] sja1110 spi5.0: Upload successfully verified!
root@s32g274ardb2:~#

 

As you can see, the last messages related to the SJA1110 is that the upload was verified successfully. Please note that before loading the FW into the SJA1110, the green led close to it (D33) hast to be OFF, after loading the FW it has to turn ON. And as you mentioned the u-boot environment variable sja1110_dsa has to be undefined or with no value. if you are not able to load the FW please share the error you see or the system log, executing this command:

dmesg | grep -i "sja"

 

 

Let me know the result of the test.

 

0 Kudos
Reply