S32G2 LINUX-BSP and SJA1110

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32G2 LINUX-BSP and SJA1110

跳至解决方案
487 次查看
yangjinzhuang
Contributor IV

Hello,

        I can‘t clearly understand the  SPI communication between S32G274A and SJA1110:

        1、What is the DSA driver? If I enable it, then SJA1110 is an external module, it is the driver outof DTS tree for SJA1110? 

       2、where is the source code of DSA driver?  Is it here: https://github.com/nxp-archive/autoivnsw_sja1110_linux/tree/master , if it is not, what is this code in github for SJA1110?

           then in this code, I find that it check if the sja1110's devtype is SJA1110_SWITCH, where to set this devtype, in the DTS file?

/**

* Write a given value to a given register of the switch

* sja1110->devtype needs to be SJA1110_SWITCH

*/

static u32 sja1110_write_reg(struct sja1110_priv *sja1110, u32 reg_addr, u32 val)

{

       3、There is only sja1110.ko in Linux bsp as default, I want to visit the interface "sja1110_write_reg" provided by  https://github.com/nxp-archive/autoivnsw_sja1110_linux/tree/master/sja1110_init.c  to config sja1110 ,   what should I do?

标签 (1)
0 项奖励
回复
1 解答
317 次查看
yangjinzhuang
Contributor IV

Hello,

        Thank you for your reply, I don't have question now.

在原帖中查看解决方案

0 项奖励
回复
11 回复数
444 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @yangjinzhuang 

here are my answers to your questions:

1 - There might be a small confusion on the term "out-of-tree Linux kernel module", it does not refer to the device tree, instead it means the following [article]:

alejandro_e_0-1730497920915.png

the behavior is the following  [page 62, Linux BSP 41.0 User Manual for S32G2 platforms]:

alejandro_e_2-1730498388530.png

 

the description above is related to a simple configuration loader, not the DSA driver.

The DSA (Distributed Switch Architecture) driver behaves as described below [page 62]:

alejandro_e_3-1730498543788.png

2 - You can find the code in: https://github.com/nxp-auto-linux/linux/tree/release/bsp41.0-5.15.153-rt/drivers/net/dsa/sja1105

 

3 - the code you shared, as you can see in the name of the repo, is archived, it is no longer supported as you can see in the compatible linux versions:

alejandro_e_4-1730500619640.png

Furthermore I was not able to find any reference to S32G chip family in the repo.

 

I used the BSP41 as an example, if you need details about another version let me know and also let me know if you have more questions about this topic.

 

0 项奖励
回复
419 次查看
yangjinzhuang
Contributor IV

Hello,

         Thanks for your reply, my Linux-bsp version is 35.0 and switch chip is SJA1110.

         1、Does DSA driver support config switch's port mode(ingress/egress)?

         2、Does SJA1110's DSA driver provide same functions with SJA1105 in Linux-bsp UM?

         3、I build Linux-bsp 35.0 on Ubuntu,I can find the source code as follows in the 35.0 project

https://github.com/nxp-archive/autoivnsw_sja1110_linux/tree/master/sja1110_init.c,

then I can also see the build result of sja1110.o and sj1110.ko in the same path, they are built from sja1110_init.c, which is as same as 

https://github.com/nxp-archive/autoivnsw_sja1110_linux/tree/master/sja1110_init.c, I can't understand this with your answer before.

0 项奖励
回复
417 次查看
yangjinzhuang
Contributor IV

Hello,

        The sja1110_init.c and build result in Linux-BSP project path is as follows:

AUTO_YOCTO_BSP/build_s32g274ardb2/tmp/work/s32g274ardb2-linux/sha1110/1.0-r0/git/sja1110_init.c 

 

AUTO_YOCTO_BSP/build_s32g274ardb2/tmp/work/s32g274ardb2-linux/sha1110/1.0-r0/git/sja1110.o

 

AUTO_YOCTO_BSP/build_s32g274ardb2/tmp/work/s32g274ardb2-linux/sha1110/1.0-r0/git/sja1110.ko  

 

0 项奖励
回复
403 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @yangjinzhuang,

Here are my answers to your questions:

1 - Yes, that is the aim of the DSA driver.

2 - Yes, you can check the compatibility in https://docs.kernel.org/networking/dsa/sja1105.html 

alejandro_e_0-1730752311333.png

 

3 - Sorry, I made a mistake. The .c, .o and .ko you mention, refer the out of tree driver mentioned before, this is loaded at boot time. This is the driver that handles the configuration loading while the DSA driver handles the switch functionality.

The information for BSP35 is the following [page 60, Linux BSP 35.0 User Manual for S32G2 platforms, 19-Jan-2023]:

alejandro_e_1-1730753066243.png

 

Please also check section 7.7 Setting up SJA1110 switch.

 

If you have specific questions about the SJA1110 configuration and SPI commands, please post it here: https://community.nxp.com/t5/Other-NXP-Products/bd-p/other 

 

Let me know if this information answers your questions.

 

 

 

0 项奖励
回复
388 次查看
yangjinzhuang
Contributor IV

Hello,

       1、can you give me the command to config SJA1110's port mode after DSA driver is loaded?

      2、I see that SJA1110 has SPI_HOST and SPI_AP host access point,  I also see there are SWITCH_CONTROL_INTERNAL and SWITCH_CONTROL_SPI mode in SDK. In my understand that now, the DSA driver has no relationship with SJA1110's SPI mode and access point, is it right?

      3、what is the relationship with SPI_HOST/SPI_AP and SWITCH_CONTROL_INTERNAL/SWITCH_CONTROL_SPI? Does it set SPI_HOST with  SWITCH_CONTROL_INTERNAL  at the same time?Does it set SPI_AP with  SWITCH_CONTROL_SPI at the same time?

      4、If I set SPI_AP, the external host controller must be other SJA1110? Can the external controller be S32G274A? The design is S32G274A----SPI----SJA1110 in GLDBOX hardware. I am not sure if S32G274A can access SJA1110 through SPI on SPI_AP interface as an external host controller.

0 项奖励
回复
371 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @yangjinzhuang,

All your questions are specific to the SJA1110 chip, this is outside of my scope and the S32G forum scope. Please post your questions in the Other-NXP-Products forum. On it, one of my collogues should be able to help you with everything related to the SJA1110. Please be aware that the documentation related to the SJA1110 and its SDK requires signing a NDA, for this you can contact your FAE/NXP representative.

 

Let me know if you have more questions related to the S32G products.

Best regards,

Alejandro

0 项奖励
回复
358 次查看
yangjinzhuang
Contributor IV

Hello,

       Thank you for your reply, I will go to the  Other-NXP-Products forum, I had the NDA.

0 项奖励
回复
330 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @yangjinzhuang

Perfect, let me know if you have any other question from the S32G side.

 

Best regards,

Alejandro

0 项奖励
回复
318 次查看
yangjinzhuang
Contributor IV

Hello,

        Thank you for your reply, I don't have question now.

0 项奖励
回复
392 次查看
yangjinzhuang
Contributor IV

Hello,

        Thanks for your reply, I still want to know how to config SJA1110 and SPI commands here: https://community.nxp.com/t5/Other-NXP-Products/bd-p/other 

0 项奖励
回复
459 次查看
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @yangjinzhuang,

I will start to analyze your questions and come back to you when I have a relevant update. I appreciate your patience. 

 

Best regards,

Alejandro

0 项奖励
回复