|
@@ -161,6 +161,7 @@ static void prvSetupHardware( void )
|
|
|
#ifdef APP_FOR_BURN
|
|
#ifdef APP_FOR_BURN
|
|
|
extern int UsbHostInit(void);
|
|
extern int UsbHostInit(void);
|
|
|
|
|
|
|
|
|
|
+#ifdef BURN_SECURE_IMAGE
|
|
|
#if APP_FOR_BURN == BURN_SECURE_IMAGE
|
|
#if APP_FOR_BURN == BURN_SECURE_IMAGE
|
|
|
static u32 aeskey[8] = {
|
|
static u32 aeskey[8] = {
|
|
|
0x543f6ccb, 0xad08aa59, 0xdb825b6b, 0x0f219d51,
|
|
0x543f6ccb, 0xad08aa59, 0xdb825b6b, 0x0f219d51,
|
|
@@ -172,6 +173,7 @@ static u32 rotk_hash0[8] = {
|
|
|
0x7e7cf66b, 0x4ce36ddf, 0x1444a7f5, 0xe1fd197b,
|
|
0x7e7cf66b, 0x4ce36ddf, 0x1444a7f5, 0xe1fd197b,
|
|
|
};
|
|
};
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
static int BurnImage(eUpdateMedia umedia)
|
|
static int BurnImage(eUpdateMedia umedia)
|
|
|
{
|
|
{
|
|
@@ -200,6 +202,7 @@ static int BurnImage(eUpdateMedia umedia)
|
|
|
fret = f_stat(filename, &fileinfo);
|
|
fret = f_stat(filename, &fileinfo);
|
|
|
if (fret != FR_OK) {
|
|
if (fret != FR_OK) {
|
|
|
printf("Get file info fail\n");
|
|
printf("Get file info fail\n");
|
|
|
|
|
+ f_close(&fp);
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -230,6 +233,7 @@ static int BurnImage(eUpdateMedia umedia)
|
|
|
f_close(&fp);
|
|
f_close(&fp);
|
|
|
vPortFree(filebuf);
|
|
vPortFree(filebuf);
|
|
|
|
|
|
|
|
|
|
+#ifdef BURN_SECURE_IMAGE
|
|
|
#if APP_FOR_BURN == BURN_SECURE_IMAGE
|
|
#if APP_FOR_BURN == BURN_SECURE_IMAGE
|
|
|
EFUSE_WriteWords(0, aeskey, 8);
|
|
EFUSE_WriteWords(0, aeskey, 8);
|
|
|
EFUSE_LoadKeyData();
|
|
EFUSE_LoadKeyData();
|
|
@@ -244,6 +248,7 @@ static int BurnImage(eUpdateMedia umedia)
|
|
|
EFUSE_SetFieldValue(EFUSE_SECURE_BOOT_TYPE, EFUSE_SECURE_BOOT_TYPE_AUTH | EFUSE_SECURE_BOOT_TYPE_ENCRYPT);
|
|
EFUSE_SetFieldValue(EFUSE_SECURE_BOOT_TYPE, EFUSE_SECURE_BOOT_TYPE_AUTH | EFUSE_SECURE_BOOT_TYPE_ENCRYPT);
|
|
|
EFUSE_SetFieldValue(EFUSE_SECURE_BOOT_EN, 1);
|
|
EFUSE_SetFieldValue(EFUSE_SECURE_BOOT_EN, 1);
|
|
|
EFUSE_WriteBootcfgParity();
|
|
EFUSE_WriteBootcfgParity();
|
|
|
|
|
+#endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
if (UPDATE_CheckApp(1, 0)) {
|
|
if (UPDATE_CheckApp(1, 0)) {
|
|
@@ -439,8 +444,6 @@ int LoadFastboot(void)
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
static void MainTask(void *pvParameters)
|
|
static void MainTask(void *pvParameters)
|
|
|
{
|
|
{
|
|
|
#if DEVICE_TYPE_SELECT != EMMC_FLASH
|
|
#if DEVICE_TYPE_SELECT != EMMC_FLASH
|