/** ****************************************************************************** * @file patch_header_check.h * @author * @version V0.0.1 * @date 2017-09-01 * @brief This file contains all the functions regarding patch header check. ****************************************************************************** * @attention * * This module is a confidential and proprietary property of RealTek and * possession or use of this module requires written permission of RealTek. * * Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. ****************************************************************************** */ #ifndef _PATCH_HEADER_CHECK_H_ #define _PATCH_HEADER_CHECK_H_ #include #include #include "rtl876x.h" #include "flash_device.h" #include "rtl876x_ic_type.h" /** @addtogroup FLASH_DEVICE Flash Device * @{ */ /*============================================================================* * Constants *============================================================================*/ /** @defgroup FLASH_DEVICE_Exported_Constants Flash Device Exported Constants * @brief * @{ */ #define SIGNATURE_APP_CB 0x0e85d101 /**< patch callback app signature definition*/ #define UUID_SIZE 16 #define DEFINED_IC_TYPE IC_TYPE #define DFU_HEADER_SIZE 12 /*currently, first 12 byte only will be treated as image header*/ #define IMG_HEADER_SIZE 1024 #define FSBL_EXT_PATTERN 0x736c #define UP_ALIGN(size, align) (((size) + (align) - 1) & ~(align - 1)) /** End of FLASH_DEVICE_Exported_Constants * @} */ /*============================================================================* * Types *============================================================================*/ /** @defgroup FLASH_DEVICE_Exported_Types Flash Device Exported Types * @brief * @{ */ typedef enum { IMAGE_FIRST = 0x278D, SCCD = 0x278D, OCCD = 0x278E, FactoryCode = 0x278F, OTA = 0x2790, /**< OTA header */ SecureBoot = 0x2791, RomPatch = 0x2792, AppPatch = 0x2793, AppData1 = 0x2794, AppData2 = 0x2795, AppData3 = 0x2796, AppData4 = 0x2797, AppData5 = 0x2798, AppData6 = 0x2799, UpperStack = 0x279a, IMAGE_MAX = 0x279b, IMAGE_USER_DATA = 0xFFFE, /**