File tree Expand file tree Collapse file tree 4 files changed +27
-6
lines changed
Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -2867,11 +2867,14 @@ Tested with the Nordic nRF5340-DK. This device has two cores:
286728671) Application core: Cortex-M33 at 128MHz, w/TrustZone, 1MB flash, 512KB RAM
286828682) Network core: Cortex-M33 at 64MHz, 256KB Flash and 64KB RAM
28692869
2870- Three different configurations are available at `config/examples`:
2870+ Four different configurations are available at `config/examples`:
28712871- `nrf5340.config`: for the app core; does not make use of TrustZone, i.e. it
28722872 always runs in secure mode.
28732873- `nrf5340-tz.config`: for the app core; makes use of TrustZone, i.e. boots the
28742874 application as non-secure code.
2875+ - `nrf5340-wolfcrypt-tz.config`: for the app core; same as above, but also
2876+ includes a non-secure callable (NSC) wolfPKCS11 API to perform crypto
2877+ operations via wolfCrypt and access a secure keyvault provided by wolfBoot.
28752878- `nrf5340_net.config`: for the net core.
28762879
28772880The DK board has two virtual COM ports. Application core and Network core will each output to different VCOM ports.
Original file line number Diff line number Diff line change 6868 #define USE_IPC_RECV 0
6969#endif
7070
71- /* SHM: Shared Memory between network and application cores */
72- /* first 64KB (0x10000) is used by wolfBoot and limited in nrf5340.ld */
71+ /* SHM: Shared Memory between network and application cores.
72+ * Reserve most of single-cycle RAM for wolfBoot;
73+ * use end of RAM (0x3F800 - 0x7FFFF) as shared memory */
7374#ifndef SHARED_MEM_ADDR
74- #define SHARED_MEM_ADDR (0x20000000UL + (64 * 1024))
75+ #define SHARED_MEM_ADDR 0x2003F800
7576#endif
7677
7778/* Shared memory states (mask, easier to check) */
@@ -875,13 +876,21 @@ static void periph_unsecure()
875876
876877 /* Unsecure RTC0 */
877878 SPU_PERIPHID_PERM (RTC0_PERIPHID ) &= ~SPU_PERIPHID_PERM_SECATTR ;
879+
880+ /* Unsecure QSPI */
881+ SPU_PERIPHID_PERM (QSPI_PERIPHID ) &= ~SPU_PERIPHID_PERM_SECATTR ;
878882}
879883#endif
880884
881885void hal_prepare_boot (void )
882886{
883- /* Write protect bootloader region of flash */
887+ /* Write protect bootloader region of flash.
888+ * Not needed in TrustZone configs because the application
889+ * runs in non-secure mode and the bootloader partition is marked as
890+ * secure. */
891+ #ifndef TZEN
884892 hal_flash_protect (WOLFBOOT_ORIGIN , BOOTLOADER_PARTITION_SIZE );
893+ #endif
885894
886895 if (enableShm ) {
887896 #ifdef TARGET_nrf5340_net
Original file line number Diff line number Diff line change @@ -371,6 +371,8 @@ void uart_write_sz(const char* c, unsigned int sz);
371371
372372/* QSPI */
373373#ifdef TARGET_nrf5340_app
374+ #define QSPI_PERIPHID 43
375+
374376 #if TZ_SECURE ()
375377 #define QSPI_BASE (0x5002B000)
376378 #else
Original file line number Diff line number Diff line change @@ -306,7 +306,11 @@ ifeq ($(QSPI_FLASH),1)
306306 ifeq ($(ARCH),RENESAS_RX)
307307 APP_OBJS+ =../hal/spi/spi_drv_renesas_rx.o
308308 else
309- APP_OBJS+ =../hal/spi/spi_drv_$(SPI_TARGET ) .o
309+ ifeq ($(TZEN),1)
310+ APP_OBJS+ =../hal/spi/spi_drv_$(SPI_TARGET ) _ns.o
311+ else
312+ APP_OBJS+ =../hal/spi/spi_drv_$(SPI_TARGET ) .o
313+ endif
310314 endif
311315endif
312316
@@ -596,6 +600,9 @@ delta-extra-data: image.bin
596600../hal/$(TARGET ) _ns.o : ../hal/$(TARGET ) .c FORCE
597601 $(Q )$(CC ) $(CFLAGS ) -c -o $(@ ) ../hal/$(TARGET ) .c -DNONSECURE_APP
598602
603+ ../hal/spi/spi_drv_$(SPI_TARGET ) _ns.o : ../hal/spi/spi_drv_$(SPI_TARGET ) .c FORCE
604+ $(Q )$(CC ) $(CFLAGS ) -c -o $(@ ) ../hal/spi/spi_drv_$(SPI_TARGET ) .c -DNONSECURE_APP
605+
599606% .o :% .c
600607 @echo " \t[CC-$( ARCH) ] $@ "
601608 $(Q )$(CC ) $(CFLAGS ) -c $(OUTPUT_FLAG ) $@ $^
You can’t perform that action at this time.
0 commit comments