Contiki-Inga 3.x
flash-cca.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Copyright (c) 2013, ADVANSEE - http://www.advansee.com/
6  * Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 /**
36  * \addtogroup cc2538
37  * @{
38  *
39  * \defgroup cc2538-flash-cca cc2538 flash CCA
40  *
41  * Definitions for the cc2538 flash lock bit page and customer configuration
42  * area
43  * @{
44  *
45  * \file
46  * Header file for the flash lock bit page and CCA definitions
47  */
48 #ifndef FLASH_CCA_H_
49 #define FLASH_CCA_H_
50 
51 #include <stdint.h>
52 /*---------------------------------------------------------------------------*/
53 /** \name Bootloader backdoor configuration bit fields
54  * @{
55  */
56 #define FLASH_CCA_BOOTLDR_CFG_DISABLE 0xEFFFFFFF /**< Disable backdoor function */
57 #define FLASH_CCA_BOOTLDR_CFG_ENABLE 0xF0FFFFFF /**< Enable backdoor function */
58 #define FLASH_CCA_BOOTLDR_CFG_ACTIVE_HIGH 0x08000000 /**< Selected pin on pad A active high */
59 #define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_M 0x07000000 /**< Selected pin on pad A mask */
60 #define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S 24 /**< Selected pin on pad A shift */
61 /** @} */
62 /*---------------------------------------------------------------------------*/
63 /** \name Image valid definitions
64  * @{
65  */
66 #define FLASH_CCA_IMAGE_VALID 0x00000000 /**< Indicates valid image in flash */
67 /** @} */
68 /*---------------------------------------------------------------------------*/
69 /** \name Lock page / debug definitions
70  * @{
71  */
72 #define FLASH_CCA_LOCKED 0 /**< Page or debug locked if bit == 0 */
73 #define FLASH_CCA_LOCK_DEBUG_BYTE 31 /**< Lock byte containing the debug lock bit */
74 #define FLASH_CCA_LOCK_DEBUG_BIT 7 /**< Debug lock bit position in the corresponding lock byte */
75 /** @} */
76 /*---------------------------------------------------------------------------*/
77 /** \name Flash lock bit page and CCA layout
78  * @{
79  */
80 typedef struct {
81  uint32_t bootldr_cfg; /**< Bootloader backdoor configuration (page bytes 2004 - 2007) */
82  uint32_t image_valid; /**< Image valid (page bytes 2008 - 2011) */
83  const void *app_entry_point; /**< Flash vector table address (page bytes 2012 - 2015) */
84  uint8_t lock[32]; /**< Page and debug lock bits (page bytes 2016 - 2047) */
85 } flash_cca_lock_page_t;
86 /** @} */
87 
88 #endif /* FLASH_CCA_H_ */
89 
90 /**
91  * @}
92  * @}
93  */