SJA1105R firmware and configuration

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

SJA1105R firmware and configuration

1,416 Views
hkaranji
Contributor I

Hi,

I am using SJA1105R automotive switch.

I am using the driver provided here sja1105x_linux_switchdev - SJA1105x Ethernet switches Linux Driver 

I generated the firmware hex file (examplePQRS_SJA1105PR.hex) and C file (examplePQRS_SJA1105PR.c) using examplePQRS.py in sw425110 Configuration-generation-tool.

I want to know how to use above files?

The generated C file has function SJA1105P_loadConfig.

However in file sja1105x_linux_switchdev/platform_independent/src/NXP_SJA1105P_configStream.c the function SJA1105P_loadConfig is already there.

Do I need to replace NXP_SJA1105P_configStream.c with examplePQRS_SJA1105PR.c?

The device tree specifies a firmware name. So I have specified examplePQRS_SJA1105PR.hex as firmware name and copied this file into /lib/firmware.

My question is if we are generating a C file using same hex file do we really need the firmware file at all?

Overall I am confused about the usage of the firmware hex file and c file.

Appreciate any kind of help.

Thanks,

Hrishikesh

0 Kudos
5 Replies

1,164 Views
hkaranji
Contributor I

Hi,

Thanks a lot for your reply.

Which is the latest code base I should be using for this?

Hrishikesh

0 Kudos

1,164 Views
bpe
NXP Employee
NXP Employee

If you are working with a package that incorporates the switch driver,
e.g. NXP automotive BSP, stay with the most recent BSP. If you are
maintaining your custom kernel, stay with this repository, master branch:

https://source.codeaurora.org/external/autoivnsw/sja1105x_linux_switchdev/


Have a great day,
Platon

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,164 Views
hkaranji
Contributor I

Hi,

Thanks a lot.

We are already using same repository.

Thanks,

Hrishikesh

0 Kudos

1,164 Views
bpe
NXP Employee
NXP Employee

My apologies for the late update, you don't have to alter the driver
source code to modify the static configuration, although in theory you can.
The recommended way to provide a static switch configuration to the Linux driver is by means of a
firmware binary file. The driver should build the default one for
you. The location of the file is specified in the Device Tree.
The firmware file format is binary, not hex, so if you created
your static configuration externally, use intelhex.py to convert from
hex to bin. See this for an invocation example.


Have a great day,
Platon

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,164 Views
hkaranji
Contributor I

Hi,

I used this utility to make firmware bin and tried to load.

I am getting following error,

root@sa8155:~# dmesg

[ 1824.448536] calling  sja1105p_driver_init+0x0/0x1000 [sja1105pqrs] @ 1357

[ 1824.448708] sja1105pqrs spi1.0: Loading SJA1105P SPI driver

[ 1824.448721] sja1105pqrs spi1.0: sja1105p_probe 669

[ 1824.448727] sja1105pqrs spi1.0: Probing switch number 0

[ 1824.448733] sja1105pqrs spi1.0: SJA1105P SPI Clock set to 25000000Hz, bits per word set to 32

[ 1824.448742] sja1105pqrs spi1.0: Found a matching DT entry (type 0)

[ 1824.448751] sja1105pqrs spi1.0: Firmware name "PQRS_SJA1105PR.bin" found

[ 1824.448759] sja1105pqrs spi1.0: Properties of port 0 found

[ 1824.448766] sja1105pqrs spi1.0: port-0 logical-port-num=0

[ 1824.448773] sja1105pqrs spi1.0: port-0 is-host=1

[ 1824.448780] sja1105pqrs spi1.0: port-0 null-phy=1 (phy_not_mac=1)

[ 1824.448789] sja1105pqrs spi1.0: Properties of port 1 found

[ 1824.448795] sja1105pqrs spi1.0: port-1 logical-port-num=1

[ 1824.448801] sja1105pqrs spi1.0: port-1 is-host=0

[ 1824.448807] sja1105pqrs spi1.0: port-1 null-phy=1 (phy_not_mac=1)

[ 1824.448816] sja1105pqrs spi1.0: Properties of port 2 found

[ 1824.448823] sja1105pqrs spi1.0: port-2 logical-port-num=2

[ 1824.448829] sja1105pqrs spi1.0: port-2 is-host=0

[ 1824.448835] sja1105pqrs spi1.0: port-2 null-phy=1 (phy_not_mac=1)

[ 1824.448843] sja1105pqrs spi1.0: Properties of port 3 found

[ 1824.448850] sja1105pqrs spi1.0: port-3 logical-port-num=3

[ 1824.448856] sja1105pqrs spi1.0: port-3 is-host=0

[ 1824.448862] sja1105pqrs spi1.0: port-3 null-phy=1 (phy_not_mac=1)

[ 1824.448871] sja1105pqrs spi1.0: Properties of port 4 found

[ 1824.448877] sja1105pqrs spi1.0: port-4 logical-port-num=4

[ 1824.448883] sja1105pqrs spi1.0: port-4 is-host=0

[ 1824.448889] sja1105pqrs spi1.0: port-4 null-phy=1 (phy_not_mac=1)

[ 1824.449452] sja1105pqrs spi1.0: Detected Device ID af00030e ((null))

[ 1824.449952] sja1105pqrs spi1.0: sja1105p_probe 747

[ 1824.449958] sja1105pqrs spi1.0: SJA1105P switch preparing to load PQRS_SJA1105PR.bin

[ 1824.450391] sja1105pqrs spi1.0: sja1105p_probe 754

[ 1824.450397] sja1105pqrs spi1.0: SJA1105P switch firmware request succeeded

[ 1824.450402] sja1105pqrs spi1.0: sja1105p_probe 762

[ 1824.450544] sja1105pqrs spi1.0: REG_PORT_STATUS(0): speed=2 phyMode=1 xmiiMode=3

[ 1824.450676] sja1105pqrs spi1.0: REG_PORT_STATUS(1): speed=2 phyMode=1 xmiiMode=3

[ 1824.450808] sja1105pqrs spi1.0: REG_PORT_STATUS(2): speed=2 phyMode=1 xmiiMode=3

[ 1824.450938] sja1105pqrs spi1.0: REG_PORT_STATUS(3): speed=2 phyMode=1 xmiiMode=3

[ 1824.451069] sja1105pqrs spi1.0: REG_PORT_STATUS(4): speed=2 phyMode=1 xmiiMode=3

[ 1824.451456] sja1105pqrs spi1.0: CGU-PORT0:

[ 1824.451462] sja1105pqrs spi1.0: IDIV:      Autoblock=0, Idiv=by 1, pd=0

[ 1824.451467] sja1105pqrs spi1.0: MII TXC:   Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.451473] sja1105pqrs spi1.0: RGMII TXC: Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.451857] sja1105pqrs spi1.0: CGU-PORT1:

[ 1824.451862] sja1105pqrs spi1.0: IDIV:      Autoblock=0, Idiv=by 1, pd=0

[ 1824.451867] sja1105pqrs spi1.0: MII TXC:   Autoblock=0, clksrc=IDIV0, pd=0

[ 1824.451873] sja1105pqrs spi1.0: RGMII TXC: Autoblock=0, clksrc=IDIV0, pd=0

[ 1824.452259] sja1105pqrs spi1.0: CGU-PORT2:

[ 1824.452265] sja1105pqrs spi1.0: IDIV:      Autoblock=1, Idiv=by 1, pd=1

[ 1824.452270] sja1105pqrs spi1.0: MII TXC:   Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.452275] sja1105pqrs spi1.0: RGMII TXC: Autoblock=0, clksrc=PLL1_240, pd=0

[ 1824.452743] sja1105pqrs spi1.0: CGU-PORT3:

[ 1824.452748] sja1105pqrs spi1.0: IDIV:      Autoblock=1, Idiv=by 1, pd=1

[ 1824.452753] sja1105pqrs spi1.0: MII TXC:   Autoblock=0, clksrc=IDIV0, pd=0

[ 1824.452758] sja1105pqrs spi1.0: RGMII TXC: Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.453216] sja1105pqrs spi1.0: CGU-PORT4:

[ 1824.453221] sja1105pqrs spi1.0: IDIV:      Autoblock=0, Idiv=by 1, pd=0

[ 1824.453226] sja1105pqrs spi1.0: MII TXC:   Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.453231] sja1105pqrs spi1.0: RGMII TXC: Autoblock=1, clksrc=MII0_TX_CLK, pd=1

[ 1824.453237] sja1105pqrs spi1.0: Config 1st word=af00030e

[ 1824.453247] sja1105pqrs spi1.0: Config Block Id=0x5 size=5 CRC=9a1ca02b offset=1 total_size=9

[ 1824.453256] sja1105pqrs spi1.0: Config Block Id=0x6 size=90 CRC=4ed2c50f offset=10 total_size=103

[ 1824.453267] sja1105pqrs spi1.0: Config Block Id=0x7 size=34 CRC=dd3964cc offset=104 total_size=141

[ 1824.453276] sja1105pqrs spi1.0: Config Block Id=0x8 size=26 CRC=6af62353 offset=142 total_size=171

[ 1824.453286] sja1105pqrs spi1.0: Config Block Id=0x9 size=40 CRC=db43ac9 offset=172 total_size=215

[ 1824.453296] sja1105pqrs spi1.0: Config Block Id=0xd size=4 CRC=12d08c8f offset=216 total_size=223

[ 1824.453305] sja1105pqrs spi1.0: Config Block Id=0xe size=3 CRC=c8a7cee6 offset=224 total_size=230

[ 1824.453315] sja1105pqrs spi1.0: Config Block Id=0x10 size=4 CRC=8aa0dfbc offset=231 total_size=238

[ 1824.453327] sja1105pqrs spi1.0: Config Block Id=0x11 size=11 CRC=efa3e65a offset=239 total_size=253

[ 1824.453337] sja1105pqrs spi1.0: Config Block Id=0x13 size=20 CRC=9d19f2f3 offset=254 total_size=277

[ 1824.453347] sja1105pqrs spi1.0: Config Block Id=0x4e size=1 CRC=3a5d5e24 offset=278 total_size=282

[ 1824.453356] sja1105pqrs spi1.0: Config Block Id=0xc8 size=36 CRC=9317441a offset=283 total_size=322

[ 1824.453362] sja1105pqrs spi1.0: Unknown block id=c8, remaining_sz=43

[ 1824.453371] sja1105pqrs spi1.0: Config Block Id=0x0 size=0 CRC=932751aa offset=323 total_size=326

[ 1824.453377] sja1105pqrs spi1.0: Final Block

[ 1824.453382] sja1105pqrs spi1.0: Looking for AVB parameters

[ 1824.453390] sja1105pqrs spi1.0: Got dev=          (null) name= eth0

[ 1824.453396] sja1105pqrs spi1.0: Failed to retrieve net_device from eth0

[ 1824.453401] sja1105pqrs spi1.0: SJA1105P failed to get net device!

[ 1824.453434] sja1105pqrs spi1.0: Firmware loading failed with -22!

[ 1824.453518] sja1105pqrs: probe of spi1.0 failed with error -22

[ 1824.453705] initcall sja1105p_driver_init+0x0/0x1000 [sja1105pqrs] returned 0 after 5013 usecs

Can you help on this?

Thanks,

Hrishikesh

0 Kudos