flc.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. If building with a C++ compiler, make all of the definitions in this header
  30. have a C binding.
  31. *******************************************************************************/
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. /******************************************************************************
  37. Image file names
  38. *******************************************************************************/
  39. #define IMG_BOOT_INFO "/sys/bootinfo.bin"
  40. #define IMG_FACTORY "/sys/factimg.bin"
  41. #define IMG_UPDATE1 "/sys/updtimg1.bin"
  42. #define IMG_UPDATE2 "/sys/updtimg2.bin"
  43. #define IMG_PREFIX "/sys/updtimg"
  44. #define IMG_SRVPACK "/sys/servicepack.ucf"
  45. #define SRVPACK_SIGN "/sys/servicepack.sig"
  46. #define CA_FILE "/cert/ca.pem"
  47. #define CERT_FILE "/cert/cert.pem"
  48. #define KEY_FILE "/cert/private.key"
  49. /******************************************************************************
  50. Special file sizes
  51. *******************************************************************************/
  52. #define IMG_SIZE (192 * 1024) /* 16KB are reserved for the bootloader and at least 48KB for the heap*/
  53. #define SRVPACK_SIZE (16 * 1024)
  54. #define SIGN_SIZE (2 * 1024)
  55. #define CA_KEY_SIZE (4 * 1024)
  56. /******************************************************************************
  57. Active Image
  58. *******************************************************************************/
  59. #define IMG_ACT_FACTORY 0
  60. #define IMG_ACT_UPDATE1 1
  61. #define IMG_ACT_UPDATE2 2
  62. #define IMG_STATUS_CHECK 0
  63. #define IMG_STATUS_READY 1
  64. /******************************************************************************
  65. Boot Info structure
  66. *******************************************************************************/
  67. typedef struct _sBootInfo_t
  68. {
  69. _u8 ActiveImg;
  70. _u8 Status;
  71. _u8 PrevImg;
  72. _u8 : 8;
  73. } sBootInfo_t;
  74. /******************************************************************************
  75. Mark the end of the C bindings section for C++ compilers.
  76. *******************************************************************************/
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif // MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H