MCUXpresso_MIMXRT1052xxxxB/boards/evkbimxrt1050/ota_examples/mcuboot_opensource/main.c
Yilin Sun 75f32185d2
Updated to v2.14.0
Signed-off-by: Yilin Sun <imi415@imi.moe>
2023-11-30 20:55:00 +08:00

79 lines
1.9 KiB
C

/*
* Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
* Copyright 2016-2021 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <sbl.h>
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#if defined(FSL_FEATURE_SOC_DCP_COUNT) && (FSL_FEATURE_SOC_DCP_COUNT > 0)
#include "fsl_dcp.h"
#endif
#if defined(FSL_FEATURE_SOC_TRNG_COUNT) && (FSL_FEATURE_SOC_TRNG_COUNT > 0)
#include "fsl_trng.h"
#endif
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Prototypes
******************************************************************************/
#if (defined(COMPONENT_MCU_ISP))
extern int isp_kboot_main(bool isInfiniteIsp);
#endif
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief Main function
*/
int main(void)
{
BOARD_InitBootClocks();
#if (defined(COMPONENT_MCU_ISP))
bool isInfiniteIsp = false;
(void)isp_kboot_main(isInfiniteIsp);
#endif
/* Init board hardware. */
BOARD_ConfigMPU();
BOARD_InitPins();
BOARD_InitDebugConsole();
SCB_DisableDCache();
PRINTF("hello sbl.\r\n");
(void)sbl_boot_main();
return 0;
}
void SBL_DisablePeripherals(void)
{
DbgConsole_Deinit();
#if defined(COMPONENT_MCUBOOT_SECURE)
#if defined(FSL_FEATURE_SOC_DCP_COUNT) && (FSL_FEATURE_SOC_DCP_COUNT > 0)
DCP_Deinit(DCP);
#endif
#if defined(FSL_FEATURE_SOC_TRNG_COUNT) && (FSL_FEATURE_SOC_TRNG_COUNT > 0)
TRNG_Deinit(TRNG);
#endif
#endif
SCB_DisableDCache();
SCB_DisableICache();
ARM_MPU_Disable();
}