I test sja1110 on S32GRDB2 , I have set SW12 to 1-1, sja1110 is OK when boot S32GRDB2, log as below:
[ 3.577120] sja1110 spi5.0: probing uc
[ 3.577321] sja1110 spi5.1: probing switch
[ 3.577744] sja1110 spi5.1: Could not get GPIO from device tree
[ 3.577769] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[ 3.578382] sja1110 spi5.1: [sja1110_init_hw] loaded fw 'sja1110_switch.bin'
[ 3.578483] sja1110 spi5.1: [sja1110_pre_switch_upload] Found switch config of size 2276
[ 3.578656] sja1110 spi5.1: Uploading config...
[ 3.614807] sja1110 spi5.1: Successfully configured!
[ 3.614856] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[ 3.616505] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 3.620682] sja1110 spi5.0: [sja1110_init_hw] loaded fw 'sja1110_uc.bin'
[ 3.620702] sja1110 spi5.0: [sja1110_pre_uc_upload] Found firmware of size 320312
[ 3.620812] sja1110 spi5.0: [sja1110_pre_uc_upload] firmware appears to be valid
[ 3.620870] sja1110 spi5.0: [sja1110_pre_uc_upload] µC not ready for download (Status=0x31)
[ 3.621112] sja1110 spi5.0: Uploading firmware...
then I did cmd as below:
rmmod sja1110
modprobe sja1110
then some error message print as below:
root@s32g274ardb2:~# rmmod sja1110
[ 365.287514] sja1110 spi5.1: [sja1110_remove]
[ 365.288179] sja1110 spi5.0: [sja1110_remove]
root@s32g274ardb2:~#
root@s32g274ardb2:~# modprobe sja1110
[ 367.668789] sja1110 spi5.0: probing uc
[ 367.669021] sja1110 spi5.1: probing switch
[ 367.669437] sja1110 spi5.1: Could not get GPIO from device tree
[ 367.669460] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[ 367.669598] sja1110 spi5.1: [sja1110_init_hw] loaded fw 'sja1110_switch.bin'
[ 367.669701] sja1110 spi5.1: [sja1110_pre_switch_upload] Found switch config of size 2276
[ 367.669857] sja1110 spi5.1: Uploading config...
[ 367.698018] sja1110 spi5.1: Successfully configured!
[ 367.698064] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
[ 367.698711] sja1110 spi5.0: [sja1110_init_hw] loaded fw 'sja1110_uc.bin'
r[ 367.698728] sja1110 spi5.0: [sja1110_pre_uc_upload] Found firmware of size 320312
o[ 367.698833] sja1110 spi5.0: [sja1110_pre_uc_upload] firmware appears to be valid
o[ 367.698890] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
t[ 367.698899] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
@[ 367.698905] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
s[ 367.698957] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
3[ 367.698964] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
2[ 367.698972] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
g[ 367.699022] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
2[ 367.699030] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
7[ 367.699036] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
4[ 367.699086] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
a[ 367.699093] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
r[ 367.699099] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
d[ 367.699150] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
b[ 367.699157] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
2[ 367.699163] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
:[ 367.699214] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
~[ 367.699221] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
#[ 367.699227] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
[ 367.699277] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
[ 367.699284] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
[ 367.699290] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
[ 367.699340] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
[ 367.699347] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
[ 367.699354] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
[ 367.699404] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
[ 367.699411] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
[ 367.699417] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
[ 367.699467] sja1110 spi5.0: [sja1110_uc_parse_status] Invalid status header (0x5b)
[ 367.699474] sja1110 spi5.0: [sja1110_uc_read_status] Parsing uC status failed with -22
[ 367.699480] sja1110 spi5.0: [sja1110_pre_uc_upload] Could not read µC status
[ 367.699487] sja1110 spi5.0: checking firmware failed with -22
why sja1110.ko cannot be insert at second time?
Hi,
Could you please let us know with which BSP you are working with?
The situation could be related to the SJA1110 not being set a second time to receive the new FW, have you tried resetting the SJA prior to sending the new FW?. Even though your SW12 configuration is as expected for the first boot, the second time you try to send the configuration the SJA is not waiting for any SW (it is running the application) for which the problem may be caused.
Please, let us know.
Hi,
Thanks for your feedback.
We have confirmed the behavior you are seeing.
We also have confirmed that the solution we have provided was succesfull from our side:
root@s32g274ardb2:~# rmmod sja1110
[ 15.835285] sja1110 spi5.1: [sja1110_remove]
[ 15.835868] sja1110 spi5.0: [sja1110_remove]
root@s32g274ardb2:~# modprobe sja1110
[ 41.740331] sja1110 spi5.0: probing uc
[ 41.740569] sja1110 spi5.1: probing switch
[ 41.740994] sja1110 spi5.1: Could not get GPIO from device tree
[ 41.741021] sja1110 spi5.1: [sja1110_post_probe_upload_worker] Trying to initialize switch
[ 41.741172] sja1110 spi5.1: [sja1110_init_hw] loaded fw 'sja1110_switch.bin'
[ 41.741263] sja1110 spi5.1: [sja1110_pre_switch_upload] Found switch config of size 2276
[ 41.741412] sja1110 spi5.1: Uploading config...
[ 41.767460] sja1110 spi5.1: Successfully configured!
[ 41.767507] sja1110 spi5.0: [sja1110_post_probe_upload_worker] Trying to initialize uC
r[ 41.768134] sja1110 spi5.0: [sja1110_init_hw] loaded fw 'sja1110_uc.bin'
o[ 41.768151] sja1110 spi5.0: [sja1110_pre_uc_upload] Found firmware of size 320312
o[ 41.768261] sja1110 spi5.0: [sja1110_pre_uc_upload] firmware appears to be valid
t[ 41.768320] sja1110 spi5.0: [sja1110_pre_uc_upload] µC not ready for download (Status=0x31)
@[ 41.768564] sja1110 spi5.0: Uploading firmware...
s32g274ardb2:~# [ 42.592432] sja1110 spi5.0: Upload successfully verified!
In between the rmmod command and the modprobe command we have issued a RESET to the SJA1110 by grounding the R1211 for a short period, as shown below:
After doing this, we issue the modprobe command and the software was successfully loaded to the SJA1110.
Please, let us know.
Hi,
There is a GPIO provided as "SJA_RST_N" which should provide the functionality you are looking for. Below will be an image of the schematic signal:
It should be able to do the trick. It is connected to a Schmidt trigger and an AND gate which its output is connected to the same node that we grounded before.
Please, let us know.
Thank you, but how to configure the GPIO "SJA_RST_N"?
I saw "SJA_RST_N" by command "gpioinfo gpiochip0", and then I tried to configure it by command "gpioset 0 24=0", but failed, it print "Device Busy".
I also tried to configure it by command "echo 345 > /sys/class/gpio/export", but still failed, also print "Device Busy".(gpiochip0 base is 321, "SJA_RST_N" is in line 24, 321+24=345)
The above operations are all performed in Linux BSP33.0.
I would be very happy if you could teach me how to configure it.
Hi,
We have tested the below commands to toggle the SJA_RST_N and we can reproduce the successful outcome.
root@s32g274ardb2:~# echo 24 > /sys/class/gpio/export
root@s32g274ardb2:~# echo out > /sys/class/gpio/gpio24/direction
root@s32g274ardb2:~# echo 0 > /sys/class/gpio/gpio24/value
root@s32g274ardb2:~# echo 1 > /sys/class/gpio/gpio24/value
These were executed in between the rmmod command and the modprobe.
Please, let us know.
Hi,
That is correct, it seems the commands we provided before is known as "Legacy GPIO Interfaces", which is supported on BSP30.0.
As for BSP33.0, libgpiod library is provided for this same purpose. More of it is explained on Chapter 20 of the Linux BSP33.0 User Manual for S32G2 Platforms.
Please, let us know.
Hi,
It seems that this specific pin (and others) are being used by other applications, hence the resource is not available. An image showing that gpio24 is "used":
Giving to understand that another process is using this resource. This process should be related to SJA1110 functionality.
Please, let us know.