SJA1110 configuration and SPI command

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SJA1110 configuration and SPI command

1,038件の閲覧回数
yangjinzhuang
Contributor IV

Hello,

       I have a hardware GLDBOX, it's switch chip is SJA1110A, the S32G274A communicate with SJA1110A through SPI, the SJA1110A's SPI works at SPI_HOST mode in default.

      How to change SJA1110A's SPI mode to SPI_AP mode?

     On S32G274A, if I enable DSA driver to config SJA1110A, how to config port mode? What is the command of SPI to config port mode?

     Thank you very much.

0 件の賞賛
返信
3 返答(返信)

941件の閲覧回数
PavelL
NXP Employee
NXP Employee

Hello @yangjinzhuang ,

I apologize for the late response.

Here is linux driver for the switch SJA1110: https://docs.kernel.org/networking/dsa/sja1105.html

An API of reading/writing reg over SPI is provided in the Linux driver - you can refer to it as well:
https://github.com/nxp-archive/autoivnsw_sja1110_linux/blob/master/sja1110_init.c#L85

Best regards,

Pavel

0 件の賞賛
返信

936件の閲覧回数
yangjinzhuang
Contributor IV

Hello,

       I see the SJA1110 register's write and read API, both noticed that " * sja1110->devtype needs to be SJA1110_SWITCH" ,  I don't know where is the devtype setted?

      I only find that in the device-tree has uc and switch spi_node.

 

     I understand that SJA1110 should set to SPI_AP to support S32G274A to read/write sja1110a's register, is it right? By default, SJA1110 worked at SPI_HOST mode.

     Thank you!

0 件の賞賛
返信

861件の閲覧回数
PavelL
NXP Employee
NXP Employee

Hello @yangjinzhuang ,

I apologize for the late response.

SJA1110_SWITCH is defined in autoivnsw_sja1110_linux/sja1110_init.h at master · nxp-archive/autoivnsw_sja1110_linux · GitHub as a simple enum:

enum spi_devtype {SJA1110_SWITCH, SJA1110_UC};

Best regards,

Pavel

0 件の賞賛
返信