summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure')
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.cproject11
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.project25
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/main_s.c131
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.c78
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.h37
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.c272
-rw-r--r--FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.h18
8 files changed, 15 insertions, 559 deletions
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.cproject b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.cproject
index 349cc5d2a..bbf6bfa1b 100644
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.cproject
+++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.cproject
@@ -119,6 +119,7 @@
<listOptionValue builtIn="false" value="../../../../NXP_Code/CMSIS"/>
<listOptionValue builtIn="false" value="../../../../NXP_Code/device"/>
<listOptionValue builtIn="false" value="../../../../NXP_Code/startup"/>
+ <listOptionValue builtIn="false" value="../../../../NXP_Code/trustzone"/>
<listOptionValue builtIn="false" value="../../../../NXP_Code/utilities"/>
<listOptionValue builtIn="false" value="../../../../NXP_Code/component/uart"/>
<listOptionValue builtIn="false" value="../../../../NXP_Code/component/lists"/>
@@ -333,16 +334,6 @@
</tool>
</toolChain>
</folderInfo>
- <folderInfo id="com.crt.advproject.config.exe.debug.650465968.1580633237" name="/" resourcePath="reg_tests">
- <toolChain id="com.crt.advproject.toolchain.exe.debug.1643158192" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug" unusedChildren="">
- <tool id="com.crt.advproject.cpp.exe.debug.1303225074" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug.248036726"/>
- <tool id="com.crt.advproject.gcc.exe.debug.806639634" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug.1827685058"/>
- <tool id="com.crt.advproject.gas.exe.debug.2004350830" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug.355931849"/>
- <tool id="com.crt.advproject.link.cpp.exe.debug.141362876" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug.767850316"/>
- <tool id="com.crt.advproject.link.exe.debug.558086384" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug.1425769789"/>
- <tool id="com.crt.advproject.tool.debug.debug.404468304" name="MCU Debugger" superClass="com.crt.advproject.tool.debug.debug.1632770985"/>
- </toolChain>
- </folderInfo>
<sourceEntries>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Config"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="NSCFunctions"/>
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.project b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.project
index b4c624902..4c798137b 100644
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.project
+++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.project
@@ -124,27 +124,17 @@
<link>
<name>User/main_s.c</name>
<type>1</type>
- <locationURI>PROJECT_LOC/main_s.c</locationURI>
+ <locationURI>DEMO_ROOT/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/User/Secure/main_s.c</locationURI>
</link>
<link>
<name>User/nsc_printf.c</name>
<type>1</type>
- <locationURI>PROJECT_LOC/nsc_printf.c</locationURI>
+ <locationURI>DEMO_ROOT/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NSC_Functions/nsc_printf.c</locationURI>
</link>
<link>
<name>User/nsc_printf.h</name>
<type>1</type>
- <locationURI>PROJECT_LOC/nsc_printf.h</locationURI>
- </link>
- <link>
- <name>User/tzm_config.c</name>
- <type>1</type>
- <locationURI>PROJECT_LOC/tzm_config.c</locationURI>
- </link>
- <link>
- <name>User/tzm_config.h</name>
- <type>1</type>
- <locationURI>PROJECT_LOC/tzm_config.h</locationURI>
+ <locationURI>DEMO_ROOT/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NSC_Functions/nsc_printf.h</locationURI>
</link>
</linkedResources>
<filteredResources>
@@ -176,6 +166,15 @@
</matcher>
</filter>
<filter>
+ <id>1682451336783</id>
+ <name>NXP_Code/startup</name>
+ <type>6</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-startup_LPC55S69_cm33_core0.s</arguments>
+ </matcher>
+ </filter>
+ <filter>
<id>1681721650651</id>
<name>reg_tests/GCC</name>
<type>9</type>
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.settings/org.eclipse.core.resources.prefs b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/main_s.c b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/main_s.c
deleted file mode 100644
index abe5b7d85..000000000
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/main_s.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * FreeRTOS V202212.00
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
-
-/* FreeRTOS includes. */
-#include "secure_port_macros.h"
-
-/* Device includes. */
-#include "fsl_device_registers.h"
-#include "fsl_debug_console.h"
-#include "arm_cmse.h"
-#include "board.h"
-#include "tzm_config.h"
-#include "pin_mux.h"
-#include "clock_config.h"
-#include "fsl_power.h"
-
-#if ( __ARM_FEATURE_CMSE & 1 ) == 0
- #error "Need ARMv8-M security extensions"
-#elif ( __ARM_FEATURE_CMSE & 2 ) == 0
- #error "Compile with --cmse"
-#endif
-
-/* Start address of non-secure application. */
-#define mainNONSECURE_APP_START_ADDRESS ( 0x00010000UL )
-
-/* typedef for non-secure Reset Handler. */
-typedef void ( *NonSecureResetHandler_t ) ( void ) __attribute__( ( cmse_nonsecure_call ) );
-/*-----------------------------------------------------------*/
-
-/**
- * @brief Boots into the non-secure code.
- *
- * @param[in] ulNonSecureStartAddress Start address of the non-secure application.
- */
-static void prvBootNonSecure( uint32_t ulNonSecureStartAddress );
-
-/**
- * @brief Application-specific implementation of the SystemInitHook() weak
- * function.
- */
-void SystemInitHook( void );
-/*-----------------------------------------------------------*/
-
-/* For instructions on how to build and run this demo, visit the following link:
- * https://www.freertos.org/RTOS-Cortex-M33-LPC55S69-MCUXpresso-GCC.html
- */
-
-/* Secure main(). */
-int main(void)
-{
- /* Set BOD VBAT level to 1.65V. */
- POWER_SetBodVbatLevel( kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false );
-
- /* Attach main clock divide to FLEXCOMM0 (debug console). */
- CLOCK_AttachClk( BOARD_DEBUG_UART_CLK_ATTACH );
-
- /* Init board hardware. */
- BOARD_InitPins();
- BOARD_BootClockFROHF96M();
- BOARD_InitDebugConsole();
-
- /* Boot the non-secure code. */
- PRINTF( "Booting Non-Secure World.\r\n" );
- prvBootNonSecure( mainNONSECURE_APP_START_ADDRESS );
-
- /* Non-secure software does not return, this code is not executed. */
- for( ; ; )
- {
- /* Should not reach here. */
- }
-}
-/*-----------------------------------------------------------*/
-
-static void prvBootNonSecure( uint32_t ulNonSecureStartAddress )
-{
- NonSecureResetHandler_t pxNonSecureResetHandler;
-
- /* Setup the non-secure vector table. */
- SCB_NS->VTOR = ulNonSecureStartAddress;
-
- /* Main Stack Pointer value for the non-secure side is the first entry in
- * the non-secure vector table. Read the first entry and assign the same to
- * the non-secure main stack pointer(MSP_NS). */
- secureportSET_MSP_NS( *( ( uint32_t * )( ulNonSecureStartAddress ) ) );
-
- /* Reset Handler for the non-secure side is the second entry in the
- * non-secure vector table. Read the second entry to get the non-secure
- * Reset Handler. */
- pxNonSecureResetHandler = ( NonSecureResetHandler_t )( * ( ( uint32_t * ) ( ( ulNonSecureStartAddress ) + 4U ) ) );
-
- /* Start non-secure state software application by jumping to the non-secure
- * Reset Handler. */
- pxNonSecureResetHandler();
-}
-/*-----------------------------------------------------------*/
-
-void SystemInitHook( void )
-{
- /* Set CP10 and CP11 full access from Non-Secure code. */
- SCB_NS->CPACR |= ( ( 3UL << 10 * 2 ) | ( 3UL << 11 * 2 ) );
-
- /* The TrustZone should be configured as early as possible after RESET.
- * Therefore it is called from SystemInit() during startup. The
- * SystemInitHook() weak function overloading is used for this purpose.
- */
- BOARD_InitTrustZone();
-}
-/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.c b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.c
deleted file mode 100644
index d3d04719f..000000000
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * FreeRTOS V202212.00
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
-
-/* ARM includes. */
-#include <arm_cmse.h>
-
-/* Interface includes. */
-#include "nsc_printf.h"
-
-/* FreeRTOS includes. */
-#include "secure_port_macros.h"
-
-/* Device includes. */
-#include "fsl_debug_console.h"
-/*-----------------------------------------------------------*/
-
-/* Maximum length of the string that the non-secure code
- * can print. */
-#define MAX_ALLOWED_STRING_LENGTH 0x400
-/*-----------------------------------------------------------*/
-
-secureportNON_SECURE_CALLABLE void NSC_Printf( char const *str )
-{
- uint32_t isInvalidSting = 0;
- size_t stringLength;
-
- /* Check whether the string is null terminated. */
- stringLength = strnlen( str, MAX_ALLOWED_STRING_LENGTH );
-
- if( ( stringLength == MAX_ALLOWED_STRING_LENGTH ) &&
- ( str[ stringLength ] != '\0') )
- {
- PRINTF( "[ERROR] [NSC_Printf] String too long or not null terminated!\r\n" );
- isInvalidSting = 1;
- }
-
- if( isInvalidSting == 0 )
- {
- /* Check whether the string is located in non-secure memory. */
- if( cmse_check_address_range( ( void * ) str,
- stringLength,
- ( CMSE_NONSECURE | CMSE_MPU_READ ) ) == NULL )
- {
- PRINTF( "[ERROR] [NSC_Printf] String is not located in non-secure memory!\r\n" );
- isInvalidSting = 1;
- }
- }
-
- /* Print the string if it is a valid string. */
- if( isInvalidSting == 0 )
- {
- PRINTF( str );
- }
-}
-/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.h
deleted file mode 100644
index 1362b4556..000000000
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/nsc_printf.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * FreeRTOS V202212.00
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
-
-#ifndef NSC_PRINTF_H
-#define NSC_PRINTF_H
-
-/**
- * @brief Non-Secure callable printf function.
- *
- * @param str The string to print.
- */
-void NSC_Printf( char const *str );
-
-#endif /* NSC_PRINTF_H */
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.c b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.c
deleted file mode 100644
index d3a18c74d..000000000
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/***********************************************************************************************************************
- * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
- * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
- **********************************************************************************************************************/
-
-/* clang-format off */
-/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
-!!GlobalInfo
-product: TEE v3.0
-processor: LPC55S69
-package_id: LPC55S69JBD100
-mcu_data: ksdk2_0
-processor_version: 0.10.1
- * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
-/* clang-format on */
-
-/***********************************************************************************************************************
- * Included files
- **********************************************************************************************************************/
-#include "fsl_common.h"
-#include "tzm_config.h"
-
-/***********************************************************************************************************************
- * Definitions
- **********************************************************************************************************************/
-/* SAU region boundaries */
-#define SAU_REGION_0_BASE 0
-#define SAU_REGION_0_END 0x0FFFFFFFU
-#define SAU_REGION_1_BASE 0x20000000U
-#define SAU_REGION_1_END 0xDFFFFFFFU
-#define SAU_REGION_2_BASE 0x1000FE00U
-#define SAU_REGION_2_END 0x1000FFFFU
-
-
-
-/* clang-format off */
-/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
-functional_group:
-- called_from_default_init: 'true'
-- id_prefix: ''
-- prefix_user_defined: 'true'
-- name: 'BOARD_InitTEE'
-- description: ''
-- ahb:
- - regions: [{memory: PROGRAM_FLASH, security: s_priv, start: '0x00000000', size: '0x00010000'}, {memory: PROGRAM_FLASH, security: ns_user, start: '0x00010000',
- size: '0x00090000'}, {memory: BootROM, security: ns_user, start: '0x00000000', size: '0x00020000'}, {memory: SRAMX, security: ns_user, start: '0x00000000',
- size: '0x00008000'}, {memory: SRAM0, security: s_priv, start: '0x00000000', size: '0x00008000'}, {memory: SRAM0, security: ns_user, start: '0x00008000', size: '0x00008000'},
- {memory: SRAM1, security: ns_user, start: '0x00000000', size: '0x00010000'}, {memory: SRAM2, security: ns_user, start: '0x00000000', size: '0x00010000'}, {memory: SRAM3,
- security: ns_user, start: '0x00000000', size: '0x00010000'}, {memory: SRAM4, security: ns_user, start: '0x00000000', size: '0x00004000'}, {memory: USB_RAM,
- security: ns_user, start: '0x00000000', size: '0x00004000'}]
- - masters: {ns_user: {id: [HASH, MCM33C, MCM33S, PQ, SDIO, SDMA0, SDMA1, USBFSD, USBFSH]}}
- - peripherals: {ns_user: {id: [ADC0, AHB_SECURE_CTRL, ANACTRL, CASPER, CRC_ENGINE, CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4, DBGMAILBOX, DMA0, DMA1, FLASH,
- FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, GINT0, GINT1, GPIO, HASHCRYPT, INPUTMUX, MAILBOX, MRT0, OSTIMER, PINT, PLU, PMC,
- POWERQUAD, PRINCE, PUF, RNG, RTC, SCT0, SDIF, SECGPIO, SECPINT, SPI8, SYSCTL, USB0, USBFSH, USBHSD, USBHSH, USBPHY, UTICK0, WWDT]}, s_priv: {id: [FLEXCOMM0,
- IOCON, SYSCON]}}
- - interrupts:
- - masking: {Non-masked: {id: [acmp_capt_irq, adc_irq, casper_irq, ctimer0_irq, ctimer1_irq, ctimer2_irq, ctimer3_irq, ctimer4_irq, flexcomm0_irq, flexcomm1_irq,
- flexcomm2_irq, flexcomm3_irq, flexcomm4_irq, flexcomm5_irq, flexcomm6_irq, flexcomm7_irq, global_irq0, global_irq1, lspi_hs_irq, mailbox_irq, mrt_irq, os_event_irq,
- pin_int4, pin_int5, pin_int6, pin_int7, pin_irq0, pin_irq1, pin_irq2, pin_irq3, plu_irq, pq_irq, qddkey_irq, rtc_irq, sct_irq, sdio_irq, sdma0_irq, sdma1_irq,
- sec_hypervisor_call_irq, sec_int0, sec_int1, sec_vio_irq, sha_irq, sys_irq, usb0_irq, usb0_needclk_irq, usb1_irq, usb1_needclk_irq, usb1_utmi_irq, utick_irq]}}
- - security: {Secure: {id: [acmp_capt_irq, adc_irq, casper_irq, ctimer0_irq, ctimer1_irq, ctimer2_irq, ctimer3_irq, ctimer4_irq, flexcomm0_irq, flexcomm1_irq,
- flexcomm2_irq, flexcomm3_irq, flexcomm4_irq, flexcomm5_irq, flexcomm6_irq, flexcomm7_irq, global_irq0, global_irq1, lspi_hs_irq, mailbox_irq, mrt_irq, os_event_irq,
- pin_int4, pin_int5, pin_int6, pin_int7, pin_irq0, pin_irq1, pin_irq2, pin_irq3, plu_irq, pq_irq, qddkey_irq, rtc_irq, sct_irq, sdio_irq, sdma0_irq, sdma1_irq,
- sec_hypervisor_call_irq, sec_int0, sec_int1, sec_vio_irq, sha_irq, sys_irq, usb0_irq, usb0_needclk_irq, usb1_irq, usb1_needclk_irq, usb1_utmi_irq, utick_irq]}}
- - pins_masks:
- - pio0: {Non-masked: {id: ['0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27', '28',
- '3', '31', '4', '5', '6', '7', '8', '9']}, Masked: {id: ['29', '30']}}
- - pio1: {Non-masked: {id: ['0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27', '28',
- '29', '3', '30', '31', '4', '5', '6', '7', '8', '9']}}
-- sau:
- - enabled: 'true'
- - all_non_secure: 'false'
- - generate_code_for_disabled_regions: 'false'
- - regions: [{index: '0', enabled: 'true', security: ns, start: '0x00000000', size: '0x10000000'}, {index: '1', enabled: 'true', security: ns, start: '0x20000000',
- size: '0xC0000000'}, {index: '2', enabled: 'true', security: nsc, start: '0x1000FE00', size: '0x00000200'}, {index: '3', enabled: 'false', security: ns, start: '0x00000000',
- size: '0x00000020'}, {index: '4', enabled: 'false', security: ns, start: '0x00000000', size: '0x00000020'}, {index: '5', enabled: 'false', security: ns, start: '0x00000000',
- size: '0x00000020'}, {index: '6', enabled: 'false', security: ns, start: '0x00000000', size: '0x00000020'}, {index: '7', enabled: 'false', security: ns, start: '0x00000000',
- size: '0x00000020'}]
-- global_options:
- - no:
- - id: [AIRCR_PRIS, AIRCR_BFHFNMINS, AIRCR_SYSRESETREQS, SCR_SLEEPDEEPS, SHCSR_SECUREFAULTENA, NSACR_CP2, NSACR_CP3, NSACR_CP4, NSACR_CP5, NSACR_CP6, NSACR_CP7,
- CPPWR_SU0, CPPWR_SUS0, CPPWR_SU1, CPPWR_SUS1, CPPWR_SU2, CPPWR_SUS2, CPPWR_SU3, CPPWR_SUS3, CPPWR_SU4, CPPWR_SUS4, CPPWR_SU5, CPPWR_SUS5, CPPWR_SU6, CPPWR_SUS6,
- CPPWR_SU7, CPPWR_SUS7, CPPWR_SU10, CPPWR_SUS10, CPPWR_SU11, CPPWR_SUS11, SEC_GPIO_MASK0_LOCK, SEC_GPIO_MASK1_LOCK, SEC_CPU1_INT_MASK0_LOCK, SEC_CPU1_INT_MASK1_LOCK,
- MASTER_SEC_LEVEL_LOCK, CPU0_LOCK_NS_VTOR, CPU0_LOCK_NS_MPU, CPU0_LOCK_S_VTAIRCR, CPU0_LOCK_S_MPU, CPU0_LOCK_SAU, CPU0_LOCK_REG_LOCK, CPU1_LOCK_NS_VTOR, CPU1_LOCK_NS_MPU,
- CPU1_LOCK_REG_LOCK, AHB_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK, AHB_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK, AHB_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT, AHB_MISC_CTRL_REG_DISABLE_SIMPLE_MASTER_STRICT_MODE,
- AHB_MISC_CTRL_REG_DISABLE_SMART_MASTER_STRICT_MODE, AHB_MISC_CTRL_REG_IDAU_ALL_NS]
- - yes:
- - id: [NSACR_CP0, NSACR_CP1, NSACR_CP10, NSACR_CP11, AHB_MISC_CTRL_REG_ENABLE_SECURE_CHECKING, AHB_MISC_CTRL_REG_WRITE_LOCK, _legacy_source_names_]
- - c_code:
- - id: [_output_type_]
-- user_memory_regions: [{id: Region_1, security: s_priv, name: Secure Code, start: '0x10000000', size: '0x0000FE00'}, {id: Region_2, security: nsc_priv, name: Veneer
- Table, start: '0x1000FE00', size: '0x00000200'}, {id: Region_3, security: s_priv, name: Secure Stack and Data, start: '0x30000000', size: '0x00008000'}, {id: Region_4,
- security: ns_user, name: Non-secure Code, description: Privilege check is disabled so reset value (NS-User) can be used, start: '0x00010000', size: '0x00068000'},
- {id: Region_5, security: ns_user, name: Non-secure Stack and Data, description: 'Privilege check is disabled so reset value (NS-User) can be used. ', start: '0x20008000',
- size: '0x0002B000'}]
-- mpus:
- - mpu:
- - enabled: 'false'
- - id: 's'
- - priv_default_map: 'false'
- - handler_enabled: 'false'
- - generate_code_for_disabled_regions: 'false'
- - attributes: [{index: '0', id: '0', memory_type: device, device: nGnRE}, {index: '1', id: '1', memory_type: device, device: nGnRE}, {index: '2', id: '2', memory_type: device,
- device: nGnRE}, {index: '3', id: '3', memory_type: device, device: nGnRE}, {index: '4', id: '4', memory_type: device, device: nGnRE}, {index: '5', id: '5',
- memory_type: device, device: nGnRE}, {index: '6', id: '6', memory_type: device, device: nGnRE}, {index: '7', id: '7', memory_type: device, device: nGnRE}]
- - regions: [{executable: 'false', read_only: 'false', attributes_index: '0', index: '0', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'},
- {executable: 'false', read_only: 'false', attributes_index: '0', index: '1', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false',
- read_only: 'false', attributes_index: '0', index: '2', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false',
- attributes_index: '0', index: '3', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0',
- index: '4', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '5',
- enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '6', enabled: 'false',
- security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '7', enabled: 'false', security: priv,
- start: '0x00000000', size: '0x00000020'}]
- - mpu:
- - enabled: 'false'
- - id: 'ns'
- - priv_default_map: 'false'
- - handler_enabled: 'false'
- - generate_code_for_disabled_regions: 'false'
- - attributes: [{index: '0', id: '0', memory_type: device, device: nGnRE}, {index: '1', id: '1', memory_type: device, device: nGnRE}, {index: '2', id: '2', memory_type: device,
- device: nGnRE}, {index: '3', id: '3', memory_type: device, device: nGnRE}, {index: '4', id: '4', memory_type: device, device: nGnRE}, {index: '5', id: '5',
- memory_type: device, device: nGnRE}, {index: '6', id: '6', memory_type: device, device: nGnRE}, {index: '7', id: '7', memory_type: device, device: nGnRE}]
- - regions: [{executable: 'false', read_only: 'false', attributes_index: '0', index: '0', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'},
- {executable: 'false', read_only: 'false', attributes_index: '0', index: '1', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false',
- read_only: 'false', attributes_index: '0', index: '2', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false',
- attributes_index: '0', index: '3', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0',
- index: '4', enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '5',
- enabled: 'false', security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '6', enabled: 'false',
- security: priv, start: '0x00000000', size: '0x00000020'}, {executable: 'false', read_only: 'false', attributes_index: '0', index: '7', enabled: 'false', security: priv,
- start: '0x00000000', size: '0x00000020'}]
- * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
-/* clang-format on */
-
-/***********************************************************************************************************************
- * BOARD_InitTrustZone function
- **********************************************************************************************************************/
-void BOARD_InitTrustZone()
-{
- /* SAU configuration */
-
- /* Set SAU Control register: Disable SAU and All Secure */
- SAU->CTRL = 0;
-
- /* Set SAU region number */
- SAU->RNR = 0;
- /* Region base address */
- SAU->RBAR = SAU_REGION_0_BASE & SAU_RBAR_BADDR_Msk;
- /* Region end address */
- SAU->RLAR = (SAU_REGION_0_END & SAU_RLAR_LADDR_Msk)
- | ((0U << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk)
- | ((1U << SAU_RLAR_ENABLE_Pos) & SAU_RLAR_ENABLE_Msk);
-
- /* Set SAU region number */
- SAU->RNR = 1;
- /* Region base address */
- SAU->RBAR = SAU_REGION_1_BASE & SAU_RBAR_BADDR_Msk;
- /* Region end address */
- SAU->RLAR = (SAU_REGION_1_END & SAU_RLAR_LADDR_Msk)
- | ((0U << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk)
- | ((1U << SAU_RLAR_ENABLE_Pos) & SAU_RLAR_ENABLE_Msk);
-
- /* Set SAU region number */
- SAU->RNR = 2;
- /* Region base address */
- SAU->RBAR = SAU_REGION_2_BASE & SAU_RBAR_BADDR_Msk;
- /* Region end address */
- SAU->RLAR = (SAU_REGION_2_END & SAU_RLAR_LADDR_Msk)
- | ((1U << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk)
- | ((1U << SAU_RLAR_ENABLE_Pos) & SAU_RLAR_ENABLE_Msk);
-
- /* Force memory writes before continuing */
- __DSB();
- /* Flush and refill pipeline with updated permissions */
- __ISB();
-
- /* Set SAU Control register: Enable SAU and All Secure (applied only if disabled) */
- SAU->CTRL = ((0U << SAU_CTRL_ALLNS_Pos) & SAU_CTRL_ALLNS_Msk)
- | ((1U << SAU_CTRL_ENABLE_Pos) & SAU_CTRL_ENABLE_Msk);
-
- /* AHB configuration */
-
- /*--------------------------------------------------------------------
- - AHB Security Level Configurations
- -------------------------------------------------------------------*/
- /* Configuration of AHB Secure Controller
- Possible values for every memory sector or peripheral rule:
- 0 Non-secure, User access allowed.
- 1 Non-secure, Privileged access allowed.
- 2 Secure, User access allowed.
- 3 Secure, Privileged access allowed.
- */
-
- /* Security level configuration of MPC checker */
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_FLASH_MEM_RULE[0] = 0x00000033U;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_FLASH_MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_FLASH_MEM_RULE[2] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_ROM_MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_ROM_MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_ROM_MEM_RULE[2] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_FLASH_ROM[0].SEC_CTRL_ROM_MEM_RULE[3] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAMX[0].MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM0[0].MEM_RULE[0] = 0x33333333U;
- AHB_SECURE_CTRL->SEC_CTRL_RAM0[0].MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM1[0].MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM1[0].MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM2[0].MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM2[0].MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM3[0].MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM3[0].MEM_RULE[1] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_RAM4[0].MEM_RULE[0] = 0;
- AHB_SECURE_CTRL->SEC_CTRL_USB_HS[0].MEM_RULE[0] = 0;
-
- /* Security level configuration of PPC checker */
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE0_MEM_CTRL0 = 0xFCCCCCFFU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE0_MEM_CTRL1 = 0xFCCCFFCCU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE0_MEM_CTRL2 = 0xFFFFCFFFU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE1_MEM_CTRL0 = 0xFFFFCFFCU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE1_MEM_CTRL1 = 0xFFCCFCCCU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE1_MEM_CTRL2 = 0xFFCCFFFFU;
- AHB_SECURE_CTRL->SEC_CTRL_APB_BRIDGE[0].SEC_CTRL_APB_BRIDGE1_MEM_CTRL3 = 0xFFCFCCFCU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT8_SLAVE0_RULE = 0xCFCCFCFFU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT8_SLAVE1_RULE = 0xFFFCCCCCU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT9_SLAVE0_RULE = 0xCCCCFFFFU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT9_SLAVE1_RULE = 0xCFFCCFFCU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT10[0].SLAVE0_RULE = 0xCCCCCCFCU;
- AHB_SECURE_CTRL->SEC_CTRL_AHB_PORT10[0].SLAVE1_RULE = 0xFFFFFFCCU;
-
- /* Security level configuration of masters */
- AHB_SECURE_CTRL->MASTER_SEC_LEVEL = 0x80000000U;
- AHB_SECURE_CTRL->MASTER_SEC_ANTI_POL_REG = 0xBFFFFFFFU;
-
- /*--------------------------------------------------------------------
- - Pins: Reading GPIO state
- -------------------------------------------------------------------*/
- /* Possible values for every pin:
- * 0b0 Deny
- * 0b1 Allow */
- AHB_SECURE_CTRL->SEC_GPIO_MASK0 = 0x9FFFFFFFU;
- AHB_SECURE_CTRL->SEC_GPIO_MASK1 = 0xFFFFFFFFU;
-
- /*--------------------------------------------------------------------
- - Interrupts: Interrupt handling by Core1
- -------------------------------------------------------------------*/
- /* Possible values for every interrupt:
- * 0b0 Deny
- * 0b1 Allow */
- AHB_SECURE_CTRL->SEC_CPU_INT_MASK0 = 0xFFFFFFFFU;
- AHB_SECURE_CTRL->SEC_CPU_INT_MASK1 = 0xFFFFFFFFU;
-
- /*--------------------------------------------------------------------
- - Interrupts: Interrupt security configuration
- -------------------------------------------------------------------*/
- /* Possible values for every interrupt:
- * 0b0 Secure
- * 0b1 Non-secure */
- NVIC->ITNS[0] = 0;
- NVIC->ITNS[1] = 0;
-
- /* Global Options */
- SCB->AIRCR = (SCB->AIRCR & 0x000009FF7U) | 0x005FA0000U;
- SCB->SCR &= 0x0FFFFFFF7U;
- SCB->SHCSR &= 0x0FFF7FFFFU;
- SCB->NSACR = 0x00000C03U;
- SCnSCB->CPPWR = 0;
- AHB_SECURE_CTRL->SEC_MASK_LOCK = 0x00000AAAU;
- AHB_SECURE_CTRL->MASTER_SEC_LEVEL = (AHB_SECURE_CTRL->MASTER_SEC_LEVEL & 0x03FFFFFFFU) | 0x080000000U;
- AHB_SECURE_CTRL->MASTER_SEC_ANTI_POL_REG = (AHB_SECURE_CTRL->MASTER_SEC_ANTI_POL_REG & 0x03FFFFFFFU) | 0x080000000U;
- AHB_SECURE_CTRL->CPU0_LOCK_REG = 0x800002AAU;
- AHB_SECURE_CTRL->CPU1_LOCK_REG = 0x8000000AU;
- AHB_SECURE_CTRL->MISC_CTRL_REG = (AHB_SECURE_CTRL->MISC_CTRL_REG & 0x0FFFF0003U) | 0x00000AAA4U;
- AHB_SECURE_CTRL->MISC_CTRL_DP_REG = 0x0000AAA5U;
-}
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.h b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.h
deleted file mode 100644
index 8b48f7799..000000000
--- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/Projects/MCUXpresso/Secure/tzm_config.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _TZM_CONFIG_H_
-#define _TZM_CONFIG_H_
-
-#if defined(__cplusplus)
-extern "C" {
-#endif /* __cplusplus */
-
-
-/***********************************************************************************************************************
- * Initialize TrustZone
- **********************************************************************************************************************/
-void BOARD_InitTrustZone(void);
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* _TZM_CONFIG_H_ */