File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -123,3 +123,7 @@ Patch List:
123
123
* Disable the priority setting for IRQ in FSP HAL layer so that priority setting will not be override when Open() API is called.
124
124
Impacted files:
125
125
zephyr/ra/portable/bsp_irq.h
126
+
127
+ * Add new implementation for R_BSP_SecurityInit on Zephyr.
128
+ Impacted files:
129
+ zephyr/ra/portable/bsp_security.h
Original file line number Diff line number Diff line change @@ -26,6 +26,36 @@ FSP_HEADER
26
26
* Exported global functions (to be accessed by other files)
27
27
**********************************************************************************************************************/
28
28
void R_BSP_NonSecureEnter (void );
29
+ void R_BSP_RegisterProtectDisable (bsp_reg_protect_t regs_to_unprotect );
30
+ void R_BSP_RegisterProtectEnable (bsp_reg_protect_t regs_to_protect );
31
+
32
+ /*******************************************************************************************************************/ /**
33
+ * Initialize security features for TrustZone.
34
+ *
35
+ * This function initializes ARM security register and Renesas SAR registers for secure projects.
36
+ *
37
+ * @note IDAU settings must be configured to match project settings with a separate configuration tool.
38
+ **********************************************************************************************************************/
39
+ __STATIC_INLINE void R_BSP_SecurityInit (void )
40
+ {
41
+ #if FSP_PRIV_TZ_USE_SECURE_REGS
42
+ /* Disable protection using PRCR register. */
43
+ R_BSP_RegisterProtectDisable (BSP_REG_PROTECT_SAR );
44
+
45
+ /* Initialize peripherals to secure mode for flat projects */
46
+ R_PSCU -> PSARB = 0 ;
47
+ R_PSCU -> PSARC = 0 ;
48
+ R_PSCU -> PSARD = 0 ;
49
+ R_PSCU -> PSARE = 0 ;
50
+
51
+ R_CPSCU -> ICUSARG = 0 ;
52
+ R_CPSCU -> ICUSARH = 0 ;
53
+ R_CPSCU -> ICUSARI = 0 ;
54
+
55
+ /* Enable protection using PRCR register. */
56
+ R_BSP_RegisterProtectEnable (BSP_REG_PROTECT_SAR );
57
+ #endif
58
+ }
29
59
30
60
/** Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
31
61
FSP_FOOTER
You can’t perform that action at this time.
0 commit comments