Kinetis Bootloader  2.0.0
Common bootloader for Kinetis devices
bootloader.h
1 /*
2  * Copyright (c) 2013, Freescale Semiconductor, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * o Redistributions of source code must retain the above copyright notice, this list
9  * of conditions and the following disclaimer.
10  *
11  * o Redistributions in binary form must reproduce the above copyright notice, this
12  * list of conditions and the following disclaimer in the documentation and/or
13  * other materials provided with the distribution.
14  *
15  * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 #if !defined(__BOOTLOADER_H__)
31 #define __BOOTLOADER_H__
32 
33 #include "bootloader_common.h"
34 #include "bootloader/bl_peripheral.h"
35 #include "bootloader/bl_command.h"
36 #include "bootloader/bl_context.h"
37 #include "bootloader/bl_version.h"
38 #include "bootloader/bl_user_entry.h"
39 #include "bootloader/bl_peripheral_interface.h"
40 #include "bootloader/bl_shutdown_cleanup.h"
41 
43 // Definitions
45 
49 {
50  kStatus_UnknownCommand = MAKE_STATUS(kStatusGroup_Bootloader, 0),
51  kStatus_SecurityViolation = MAKE_STATUS(kStatusGroup_Bootloader, 1),
52  kStatus_AbortDataPhase = MAKE_STATUS(kStatusGroup_Bootloader, 2),
53  kStatus_Ping = MAKE_STATUS(kStatusGroup_Bootloader, 3),
54  kStatus_NoResponse = MAKE_STATUS(kStatusGroup_Bootloader, 4),
55  kStatus_NoResponseExpected = MAKE_STATUS(kStatusGroup_Bootloader, 5)
56 };
57 
66 #if 1 // Moved into each SOC based header file in future !!!!!!!!!!!!!
67 typedef struct BootloaderTree
68 {
69  void (*runBootloader)(void *arg);
71  const char *copyright;
76 #endif
77 // Prototypes
80 
81 #if defined(__cplusplus)
82 extern "C" {
83 #endif
84 
93 bool is_valid_application_location(uint32_t applicationAddress);
94 
95 #if defined(__cplusplus)
96 }
97 #endif
98 
99 #endif // __BOOTLOADER_H__
100 // EOF
bool is_valid_application_location(uint32_t applicationAddress)
Verify that a given address is ok to jump to.
Definition: bl_main.c:207
standard_version_t version
Bootloader version number.
Definition: bootloader.h:70
const char * copyright
Copyright string.
Definition: bootloader.h:71
Bootloader status group number (100).
Definition: bootloader_common.h:143
Root of the bootloader API tree.
Definition: bootloader.h:67
const aes_driver_interface_t * aesDriver
AES driver API.
Definition: bootloader.h:74
Interface for the flash driver.
Definition: bl_context.h:57
Structure of bootloader global context.
Definition: bl_context.h:117
const flash_driver_interface_t * flashDriver
Flash driver API.
Definition: bootloader.h:73
Interface for AES 128 functions.
Definition: bl_context.h:100
const bootloader_context_t * runtimeContext
Pointer to the bootloader's runtime context.
Definition: bootloader.h:72
Structure of version property.
Definition: bootloader_common.h:168
_bootloader_status
Bootloader status codes.
Definition: bootloader.h:48