@@ -48,18 +48,18 @@ static void hal_sau_init(void)
4848 sau_init_region (0 , WOLFBOOT_NSC_ADDRESS ,
4949 WOLFBOOT_NSC_ADDRESS + WOLFBOOT_NSC_SIZE - 1 , 1 );
5050
51- /* Non-secure: application flash area (boot partition) */
51+ /* Non-secure: application flash area (boot+update partition) */
5252 sau_init_region (1 , WOLFBOOT_PARTITION_BOOT_ADDRESS ,
53- WOLFBOOT_PARTITION_BOOT_ADDRESS + WOLFBOOT_PARTITION_SIZE - 1 ,
53+ WOLFBOOT_PARTITION_BOOT_ADDRESS + ( WOLFBOOT_PARTITION_SIZE * 2 ) - 1 ,
5454 0 );
5555
5656 /* Non-secure RAM */
57- sau_init_region (2 , 0x20020000 , 0x20025FFF , 0 );
57+ sau_init_region (2 , 0x20020000 , 0x20027FFF , 0 );
5858
5959 /* Peripherals */
60- sau_init_region (3 , 0x40000000 , 0x4005FFFF , 0 );
61- sau_init_region (4 , 0x40080000 , 0x400DFFFF , 0 );
62- sau_init_region (5 , 0x40100000 , 0x4013FFFF , 0 );
60+ sau_init_region (3 , 0x40000000 , 0x4003FFFF , 0 );
61+ sau_init_region (4 , 0x40080000 , 0x400AFFFF , 0 );
62+ sau_init_region (5 , 0x40100000 , 0x4010FFFF , 0 );
6363
6464 /* Enable SAU */
6565 SAU_CTRL = SAU_INIT_CTRL_ENABLE ;
@@ -70,13 +70,8 @@ static void hal_sau_init(void)
7070
7171static void periph_unsecure (void )
7272{
73- // CLOCK_EnableClock(kCLOCK_Gpio0);
74- // CLOCK_EnableClock(kCLOCK_Gpio1);
75- // CLOCK_EnableClock(kCLOCK_Port0);
76- // CLOCK_EnableClock(kCLOCK_Port1);
77-
78- // GPIO_EnablePinControlNonSecure(GPIO0, (1UL << 10) | (1UL << 27));
79- // GPIO_EnablePinControlNonSecure(GPIO1, (1UL << 2) | (1UL << 8) | (1UL << 9));
73+ CLOCK_EnableClock (kCLOCK_Iocon );
74+ CLOCK_EnableClock (kCLOCK_Gpio1 );
8075}
8176#endif
8277
@@ -96,8 +91,6 @@ void hal_init(void)
9691#if defined(__WOLFBOOT ) || !defined(TZEN )
9792 memset (& pflash , 0 , sizeof (pflash ));
9893 FLASH_Init (& pflash );
99- // FLASH_GetProperty(&pflash, kFLASH_PropertyPflashSectorSize,
100- // &pflash_sector_size);
10194#endif
10295
10396#if defined(TZEN ) && !defined(NONSECURE_APP )
@@ -153,8 +146,7 @@ int RAMFUNCTION hal_flash_erase(uint32_t address, int len)
153146 address % pflash_page_size == 0 &&
154147 len % pflash_page_size == 0 &&
155148 FLASH_Erase (& pflash , address , len , kFLASH_ApiEraseKey )
156- == kStatus_FLASH_Success &&
157- FLASH_VerifyErase (& pflash , address , len ) == kStatus_FLASH_Success
149+ == kStatus_FLASH_Success
158150 )
159151 {
160152 return 0 ;
0 commit comments