bootloader.h
/*
* Copyright (c) 2013, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(__BOOTLOADER_H__)
#define __BOOTLOADER_H__
#include "bootloader_common.h"
#include "bootloader/bl_peripheral.h"
#include "bootloader/bl_command.h"
#include "bootloader/bl_context.h"
#include "bootloader/bl_version.h"
#include "bootloader/bl_user_entry.h"
#include "bootloader/bl_peripheral_interface.h"
#include "bootloader/bl_shutdown_cleanup.h"
// Definitions
enum _bootloader_status
{
kStatus_UnknownCommand = MAKE_STATUS(kStatusGroup_Bootloader, 0),
kStatus_SecurityViolation = MAKE_STATUS(kStatusGroup_Bootloader, 1),
kStatus_AbortDataPhase = MAKE_STATUS(kStatusGroup_Bootloader, 2),
kStatus_Ping = MAKE_STATUS(kStatusGroup_Bootloader, 3),
kStatus_NoResponse = MAKE_STATUS(kStatusGroup_Bootloader, 4),
kStatus_NoResponseExpected = MAKE_STATUS(kStatusGroup_Bootloader, 5)
};
#if 1 // Moved into each SOC based header file in future !!!!!!!!!!!!!
typedef struct BootloaderTree
{
void (*runBootloader)(void *arg);
standard_version_t version;
const char *copyright;
const bootloader_context_t *runtimeContext;
const flash_driver_interface_t *flashDriver;
const aes_driver_interface_t *aesDriver;
} bootloader_tree_t;
#endif
// Prototypes
#if defined(__cplusplus)
extern "C" {
#endif
bool is_valid_application_location(uint32_t applicationAddress);
#if defined(__cplusplus)
}
#endif
#endif // __BOOTLOADER_H__
// EOF
is_valid_application_location
bool is_valid_application_location(uint32_t applicationAddress)
Verify that a given address is ok to jump to.
Definition: bl_main.c:207
bootloader_tree_t::version
standard_version_t version
Bootloader version number.
Definition: bootloader.h:70
bootloader_tree_t::copyright
const char * copyright
Copyright string.
Definition: bootloader.h:71
kStatusGroup_Bootloader
Bootloader status group number (100).
Definition: bootloader_common.h:143
bootloader_tree_t
Root of the bootloader API tree.
Definition: bootloader.h:67
bootloader_tree_t::aesDriver
const aes_driver_interface_t * aesDriver
AES driver API.
Definition: bootloader.h:74
flash_driver_interface_t
Interface for the flash driver.
Definition: bl_context.h:57
bootloader_context_t
Structure of bootloader global context.
Definition: bl_context.h:117
bootloader_tree_t::flashDriver
const flash_driver_interface_t * flashDriver
Flash driver API.
Definition: bootloader.h:73
aes_driver_interface_t
Interface for AES 128 functions.
Definition: bl_context.h:100
bootloader_tree_t::runtimeContext
const bootloader_context_t * runtimeContext
Pointer to the bootloader&#39;s runtime context.
Definition: bootloader.h:72
standard_version_t
Structure of version property.
Definition: bootloader_common.h:168
_bootloader_status
_bootloader_status
Bootloader status codes.
Definition: bootloader.h:48