Get XRDC DID from privileged A53 execution context

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

Get XRDC DID from privileged A53 execution context

518件の閲覧回数
bgarcia
Contributor I
Hello 
 
We are developing a solution to perform communications via SHM, for that we need to synchronize the cores via the provided SEMA42 mechanism, and in order to do so we need to know the domain ID prior to locking any SEMA42 gate. From the M7 domain reading and writing the XRDC works pretty well, but from the Automotive Linux that runs on the A53 domain (BSP37.0) we are finding it difficult to obtain this value even from a kernel module, I am referring especifically to XRDC_0.HWCFG1.DID.
 
For example this code ends up in a kernel panic:

 

u32 *xrdc = ioremap(0x401A4000, 0x1000);
printk(KERN_DEBUG "XRDC_0 status 0x%x \n", *xrdc);
iounmap(xrdc);

 

 
The RM says that "Access: Secure privileged read". The privileged part is covered by the kernel module execution environment (I can access other privileged-only peripherals like MSCM the from the kernel module), so I imagine the issue is caused by the "secure" part of it. How can we set this secure bit? Is this related to the ARM TrustZone concept?
 
Thanks
0 件の賞賛
返信
2 返答(返信)

157件の閲覧回数
furkank
Contributor I

Hello, I am trying to achieve same thing too.

  • I am using s32g274 with custom board.
  • Running nxp-auto-linux (bsp 33.0) on A53 core.
  • XRDC is configured using EB Tresos Studio where all masters have full access to all peripherals and all memory regions.
  • XRDC is initialized by M7 core.

I run the following code in a kernel module in order to read CR register of XRDC module

uint32_t* virt_addr;
uint32_t val = 0;

virt_addr = ioremap(0x401A4000, 4);
val = ioread32(virt_addr);
iounmap(virt_addr);

 

With this code I can read other system registers but cannot read XRDC registers (which require secure privileged access). When I invoke the code via a system call to kernel, I get following error message:

Message from syslogd@ at Thu Apr 28 18:48:32 2022 ...
: Internal error: synchronous external abort: 96000210 [#3] PREEMPT SMP

Message from syslogd@ at Thu Apr 28 18:48:32 2022 ...
: Code: 91016000 95fd178b b94033e2 b40001b4 (b9400281)

 

0 件の賞賛
返信

501件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Which S32G variant are you using? Are you working with an NXP reference board?

How are you configuring the XRDC? Is it being initialized by the M7 core? Or is it being configured by each core?

Also, we understand you are working with BSP37.0, but from where you are executing the code you are showing?

Please, let us know.

0 件の賞賛
返信