Preventing a CPU core from accessing peripheral registers

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

Preventing a CPU core from accessing peripheral registers

跳至解决方案
1,150 次查看
andreasgoergner
Contributor I

Dear Vybrid Experts!

Is it possible to prevent a specific CPU (the Cortex-M4 for instance) from accessing peripheral registers? I'm aware that there is hardware supported semaphore engine integrated in Vybrid, but if a software is not using the semaphore programming model / the semaphore engine, it looks to me that it is not possible to prevent a CPU from accessing GPIOs or other peripherals (in a case of a software accident / wrong pointers for instance) by hardware.

Could you please confirm?

Thanks!

- Andreas

0 项奖励
回复
1 解答
703 次查看
billpringlemeir
Contributor V

This is possible with the CSU functionality.  Note that this is an ALL or nothing for the entire GPIO logic (all ports!).  The cortex-M4 is M0 and M1 on the NIC bus with the CSU protecting a S1 partition including the GPIO functionality.  The M4 and all it's controlled DMA peripherals (bus masters) should be marked as 'non-secure' or normal.  The CSU will then prevent any access to the GPIOs.

It is unfortunate that the Vybrid designers grouped all of the GPIO ports together in the same address space.  It would be very convenient to have some banks as critical and others as non-critical.  For instance PORT-A never modified by A5 and PORT-D never modified by the M4.  They have tried to make the GPIO interface possible to use in the AMP design, but they did not protect against malicious software (whether intentional or not).  The CSU has bits that will lock a setup and prevent any software from changing the permission.  For the other AIPS peripherals, they all have separate 4k register sections and can be individually protected.

For example, if you allow the M4 to access the USB0, then in theory you can program the USB0 to DMA memory from the GPIO register bank.  So you would make the USB and M4 bus master ports both 'normal' or non-secure.  Similarly, the TZASC can carve up memory to ensure that the M4 never steps on A5 critical memory (and vice-versa).  TZASC is to partition/protect memory and the CSU is to protect peripherals.

Note: The CSU and TZASC is documented in the security manual.  Although you can also get some TZASC documents from ARM.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
704 次查看
billpringlemeir
Contributor V

This is possible with the CSU functionality.  Note that this is an ALL or nothing for the entire GPIO logic (all ports!).  The cortex-M4 is M0 and M1 on the NIC bus with the CSU protecting a S1 partition including the GPIO functionality.  The M4 and all it's controlled DMA peripherals (bus masters) should be marked as 'non-secure' or normal.  The CSU will then prevent any access to the GPIOs.

It is unfortunate that the Vybrid designers grouped all of the GPIO ports together in the same address space.  It would be very convenient to have some banks as critical and others as non-critical.  For instance PORT-A never modified by A5 and PORT-D never modified by the M4.  They have tried to make the GPIO interface possible to use in the AMP design, but they did not protect against malicious software (whether intentional or not).  The CSU has bits that will lock a setup and prevent any software from changing the permission.  For the other AIPS peripherals, they all have separate 4k register sections and can be individually protected.

For example, if you allow the M4 to access the USB0, then in theory you can program the USB0 to DMA memory from the GPIO register bank.  So you would make the USB and M4 bus master ports both 'normal' or non-secure.  Similarly, the TZASC can carve up memory to ensure that the M4 never steps on A5 critical memory (and vice-versa).  TZASC is to partition/protect memory and the CSU is to protect peripherals.

Note: The CSU and TZASC is documented in the security manual.  Although you can also get some TZASC documents from ARM.

0 项奖励
回复
703 次查看
andreasgoergner
Contributor I

Thanks Bill,

Good information!

- Andreas

0 项奖励
回复
703 次查看
kef2
Senior Contributor V

I didn't touch M4 core yet, but A5 MMU allows disabling and/or remapping accesses to specific blocks of addresses. Minimum block size is 4kB.

0 项奖励
回复