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?
Solved! Go to Solution.
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]:
the behavior is the following [page 62, Linux BSP 41.0 User Manual for S32G2 platforms]:
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]:
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:
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.
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.
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
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
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]:
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.
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.
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
Hello,
Thank you for your reply, I will go to the Other-NXP-Products forum, I had the NDA.
Hello @yangjinzhuang
Perfect, let me know if you have any other question from the S32G side.
Best regards,
Alejandro
Hello,
Thank you for your reply, I don't have question now.
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
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