-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash_map.h
135 lines (120 loc) · 6.29 KB
/
flash_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/**
*****************************************************************************************
* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved.
*****************************************************************************************
* @file flash_map.h
* @brief Flash Layout Configuration, and flash layout must be changed with config file!
* @note flash_map.h must be generated by FlashMapGenerateTool!
* *************************************************************************************
*/
#ifndef _FLASH_MAP_H_
#define _FLASH_MAP_H_
#ifdef __cplusplus
extern "C" {
#endif
/*============================================================================*
* Sample Flash Layout (Not support bank switch)
*============================================================================*/
/* Flash total size 256K
example:
1) Reaerved: 4K (0x800000)
2) OEM Header: 4K
3) OTA Bank0: 140K (0x802000)
a) OTA Header 4K (0x803000)
b) Secure boot loader 4K (0x80D000)
Notes: Secure boot loader image start address must configured at 0x80D000 and size can't less than 4KB!
c) Patch code 40K (0x803000)
d) APP code 92K (0x80E000)
e) APP data1 0K (0x825000)
f) APP data2 0K (0x825000)
4) OTA Bank1: 0K (0x825000)
a) OTA Header 0K
b) Secure boot loader 0K
c) Patch code 0K
d) APP code 0K
e) APP data1 0K
f) APP data2 0K
5) FTL: 16K (0x825000)
6) OTA Tmp: 92K (0x829000)
7) APP Defined Section: 0K
*/
/*============================================================================*
* Sample Flash Layout (Support bank switch)
*============================================================================*/
/* Flash total size 1MB
example:
1) Reaerved: 4K (0x800000)
2) OEM Header: 4K (0x801000)
3) OTA Bank0: 252K (0x802000)
a) OTA Header 4K (0x802000)
b) Secure boot loader 0K (0x803000)
c) Patch code 40K (0x803000)
d) APP code 208K (0x80D000)
e) APP data1 0K (0x841000)
f) APP data2 0K (0x841000)
4) OTA Bank1: 252K (0x841000)
Notes: OTA Bank1 size must be same as OTA Bank0!
a) OTA Header 4K (0x841000)
b) Secure boot loader 0K (0x842000)
c) Patch code 40K (0x842000)
d) APP code 208K (0x84C000)
e) APP data1 0K (0x880000)
f) APP data2 0K (0x880000)
5) FTL: 16K (0x880000)
6) OTA Tmp: 0K (0x884000)
7) APP Defined Section: 200K (0x884000)
Notes: OTA Bank1 end address offset is aligned 512KB, so all code space is protected by flash BP.
*/
/*============================================================================*
* Flash Layout Configuration (Generated by FlashMapGenerateTool)
*============================================================================*/
#define FLASH_ADDR 0x00800000 //Fixed
#define FLASH_SIZE 0x00040000 //256K Bytes
/* ========== High Level Flash Layout Configuration ========== */
#define RESERVED_ADDR 0x00800000
#define RESERVED_SIZE 0x00001000 //4K Bytes
#define OEM_CFG_ADDR 0x00801000
#define OEM_CFG_SIZE 0x00001000 //4K Bytes
#define OTA_BANK0_ADDR 0x00802000
#define OTA_BANK0_SIZE 0x00023000 //140K Bytes
#define OTA_BANK1_ADDR 0x00825000
#define OTA_BANK1_SIZE 0x00000000 //0K Bytes
#define FTL_ADDR 0x00825000
#define FTL_SIZE 0x00004000 //16K Bytes
#define OTA_TMP_ADDR 0x00829000
#define OTA_TMP_SIZE 0x00017000 //92K Bytes
#define BKP_DATA1_ADDR 0x00000000
#define BKP_DATA1_SIZE 0x00000000 //0K Bytes
#define BKP_DATA2_ADDR 0x00000000
#define BKP_DATA2_SIZE 0x00000000 //0K Bytes
/* ========== OTA Bank0 Flash Layout Configuration ========== */
#define BANK0_OTA_HEADER_ADDR 0x00802000
#define BANK0_OTA_HEADER_SIZE 0x00001000 //4K Bytes
#define BANK0_SECURE_BOOT_ADDR 0x0080D000
#define BANK0_SECURE_BOOT_SIZE 0x00001000 //4K Bytes
#define BANK0_ROM_PATCH_ADDR 0x00803000
#define BANK0_ROM_PATCH_SIZE 0x0000A000 //40K Bytes
#define BANK0_APP_ADDR 0x0080E000
#define BANK0_APP_SIZE 0x00017000 //92K Bytes
#define BANK0_APP_DATA1_ADDR 0x00825000
#define BANK0_APP_DATA1_SIZE 0x00000000 //0K Bytes
#define BANK0_APP_DATA2_ADDR 0x00825000
#define BANK0_APP_DATA2_SIZE 0x00000000 //0K Bytes
/* ========== OTA Bank1 Flash Layout Configuration ========== */
#define BANK1_OTA_HEADER_ADDR 0x00000000
#define BANK1_OTA_HEADER_SIZE 0x00000000 //0K Bytes
#define BANK1_SECURE_BOOT_ADDR 0x00000000
#define BANK1_SECURE_BOOT_SIZE 0x00000000 //0K Bytes
#define BANK1_ROM_PATCH_ADDR 0x00000000
#define BANK1_ROM_PATCH_SIZE 0x00000000 //0K Bytes
#define BANK1_APP_ADDR 0x00000000
#define BANK1_APP_SIZE 0x00000000 //0K Bytes
#define BANK1_APP_DATA1_ADDR 0x00000000
#define BANK1_APP_DATA1_SIZE 0x00000000 //0K Bytes
#define BANK1_APP_DATA2_ADDR 0x00000000
#define BANK1_APP_DATA2_SIZE 0x00000000 //0K Bytes
#ifdef __cplusplus
}
#endif
/** @} */ /* _FLASH_MAP_H_ */
#endif