S32G Peripheral init flow

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

S32G Peripheral init flow

跳至解决方案
537 次查看
liuchi
Contributor III

Dear engineering friends:
I am using the S32G series. If I want to modify the peripheral init, such as IOMUX, clock.
1. in which stage of ATF, Uboot, or Linux Kernel should I make the modification?
2.Are there some peripherals that must be configured in ATF? Uboot and Linux Kernel do not have the permission to configure.
                                                                                                                   Looking forward to your replies.

标记 (1)
0 项奖励
回复
1 解答
488 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @liuchi 

Thanks for your reply.

From my understanding, actually whether enabled some of the functions in TFA or later in uboot/kernel depends on your specific design and nature booting sequence for your hardware. The code implemented in the BSP is a kind of reference.

For example, it is nature to have the PMIC, Core be enabled at the beginning, so it should be put in the TFA since you only use BSP, if the first stage is not TFA but other bootloaders, then these code have to be put into other bootloader. For DDR, it you did not use DDR from your TFA(say put it into SRAM), then it is possible to enable it later in u-boot, the IOMUX settings are similar, from BSP perspective, some of them are done in TFA, but you may also put more of them into kernel booting phase.

1. So theoretically, you may put more iomux setting to the kernel part, it is possible, but since currently, from BSP perspective, some kernel drivers may also obtain/depend on settings/configurations from u-boot, then if you want to move them fully to the kernel, there should be some more code changes instead of only changing the dts in kernel/tfa.

2. Yes, it could be set from the dts, you may reference the kernel dts file of s32 for reference.

 

BR

Chenyin   

在原帖中查看解决方案

0 项奖励
回复
4 回复数
489 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @liuchi 

Thanks for your reply.

From my understanding, actually whether enabled some of the functions in TFA or later in uboot/kernel depends on your specific design and nature booting sequence for your hardware. The code implemented in the BSP is a kind of reference.

For example, it is nature to have the PMIC, Core be enabled at the beginning, so it should be put in the TFA since you only use BSP, if the first stage is not TFA but other bootloaders, then these code have to be put into other bootloader. For DDR, it you did not use DDR from your TFA(say put it into SRAM), then it is possible to enable it later in u-boot, the IOMUX settings are similar, from BSP perspective, some of them are done in TFA, but you may also put more of them into kernel booting phase.

1. So theoretically, you may put more iomux setting to the kernel part, it is possible, but since currently, from BSP perspective, some kernel drivers may also obtain/depend on settings/configurations from u-boot, then if you want to move them fully to the kernel, there should be some more code changes instead of only changing the dts in kernel/tfa.

2. Yes, it could be set from the dts, you may reference the kernel dts file of s32 for reference.

 

BR

Chenyin   

0 项奖励
回复
480 次查看
liuchi
Contributor III

@chenyin_h 

Really appreciate your reply. Next, I will try to modify the DTS to debug the IOMUX.

0 项奖励
回复
514 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @liuchi 

Thanks for your post.

1. In general, the iomux and the clock are always initialized under the first stage bootloader, if you are working with BSP only, then it could be the TF-A, meanwhile, a few clocks may be set via the kernel booting phase during the driver initialization.

2. For example, PMIC; clock of the core; PLL; DDR etc, and EL3 level code have to run under TFA and cannot be used under uboot/kernel.

I suggest directly referencing the source code of TFA for details(arm-trusted-firmware/plat/nxp/s32), since there is not direct document on this topic.

 

BR

Chenyin

标记 (1)
0 项奖励
回复
502 次查看
liuchi
Contributor III

Key configurations such as PMIC, core clock,PLL, and DDR must be configured in TF-A — this is my understanding.

  1. But for IOMUX configurations of I2C, CAN, SPI, and modules like SerDes, PCIe, and PFE, can these be configured under Linux instead?

  2. If they can be configured under Linux, how exactly is this done? Is it through the Device Tree (DTS)?

0 项奖励
回复