1 /* 2 * This file is part of the MicroPython project, http://micropython.org/ 3 * 4 * The MIT License (MIT) 5 * 6 * Copyright (c) 2015 Daniel Campora 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy 9 * of this software and associated documentation files (the "Software"), to deal 10 * in the Software without restriction, including without limitation the rights 11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 * copies of the Software, and to permit persons to whom the Software is 13 * furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included in 16 * all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 * THE SOFTWARE. 25 */ 26 #ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H 27 #define MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H 28 29 /****************************************************************************** 30 31 If building with a C++ compiler, make all of the definitions in this header 32 have a C binding. 33 34 *******************************************************************************/ 35 #ifdef __cplusplus 36 extern "C" 37 { 38 #endif 39 40 /****************************************************************************** 41 Image file names 42 *******************************************************************************/ 43 #define IMG_BOOT_INFO "/sys/bootinfo.bin" 44 #define IMG_FACTORY "/sys/factimg.bin" 45 #define IMG_UPDATE1 "/sys/updtimg1.bin" 46 #define IMG_UPDATE2 "/sys/updtimg2.bin" 47 #define IMG_PREFIX "/sys/updtimg" 48 49 #define IMG_SRVPACK "/sys/servicepack.ucf" 50 #define SRVPACK_SIGN "/sys/servicepack.sig" 51 52 #define CA_FILE "/cert/ca.pem" 53 #define CERT_FILE "/cert/cert.pem" 54 #define KEY_FILE "/cert/private.key" 55 56 /****************************************************************************** 57 Special file sizes 58 *******************************************************************************/ 59 #define IMG_SIZE (192 * 1024) /* 16KB are reserved for the bootloader and at least 48KB for the heap*/ 60 #define SRVPACK_SIZE (16 * 1024) 61 #define SIGN_SIZE (2 * 1024) 62 #define CA_KEY_SIZE (4 * 1024) 63 64 /****************************************************************************** 65 Active Image 66 *******************************************************************************/ 67 #define IMG_ACT_FACTORY 0 68 #define IMG_ACT_UPDATE1 1 69 #define IMG_ACT_UPDATE2 2 70 71 #define IMG_STATUS_CHECK 0 72 #define IMG_STATUS_READY 1 73 74 /****************************************************************************** 75 Boot Info structure 76 *******************************************************************************/ 77 typedef struct _sBootInfo_t 78 { 79 _u8 ActiveImg; 80 _u8 Status; 81 _u8 PrevImg; 82 _u8 : 8; 83 } sBootInfo_t; 84 85 86 /****************************************************************************** 87 88 Mark the end of the C bindings section for C++ compilers. 89 90 *******************************************************************************/ 91 #ifdef __cplusplus 92 } 93 #endif 94 95 #endif // MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H 96