blob: 774211d676a10f32c7f30e9a36ed3dc353221c55 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2006
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * custom_img_config.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This Module defines the FOTA (Firmware Over the Air) related setting.
49 *
50 * Author:
51 * -------
52 * Carlos Yeh (mtk02377) system auto generatorm0.25 + scatFrame m0.01 + sysGenUtility m0.10
53 *
54
55 *============================================================================
56 * HISTORY
57 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
58 *------------------------------------------------------------------------------
59 * $Revision$
60 * $Modtime$
61 * $Log$
62 *
63 * 01 20 2015 raymondwt.chen
64 * [MOLY00091518] [System Service][MOLY Kernel Internal Request] Clean build warning
65 * .Remove and organize bootloader/security code
66 *
67 * 08 07 2013 peiwen.qing
68 * [MOLY00032860] Set max size of MOLY image to 16MB
69 * .
70 *
71 *
72 *------------------------------------------------------------------------------
73 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
74 *============================================================================
75
76 ****************************************************************************/
77
78#ifndef __CUSTOM_IMG_CONFIG_H__
79#define __CUSTOM_IMG_CONFIG_H__
80
81#include "kal_general_types.h"
82#include "custom_FeatureConfig.h"
83
84/****************************************************************************
85 Following definitions are used to configure flash memory arrangement for Bootloader image
86
87 Item 1. the maximum size of FOTA bootloader image
88
89 ****************************************************************************/
90#define BL_IMG_MAX_SIZE (0x40000)
91
92/****************************************************************************
93 Following definitions are used to configure flash memory arrangement for FOTA Engine image
94
95 Item 1. the base address of FOTA update engine image
96
97 Item 2. the maximum available flash memory size for update engine image
98
99 Item 3. the maximum available flash memory size for update engine image back up
100
101 Item 4. the maximum flash memory area for bootloader to search update engine image
102
103 Item 5. the execution start address for bootloader to place update engine image
104 Note: This value MUST be the same with scatter file setting
105
106 ****************************************************************************/
107#define FOTA_UE_FLASH_BASE_ADDRESS (0) //[_IMG_CFG_H_Gen_FOTA_UE_BASE]
108
109#define FOTA_UE_RESIDENT_FLASH_SPACE_SIZE (0) //[_IMG_CFG_H_Gen_FOTA_UE_RESIDENT_SIZE]
110
111#define FOTA_UE_BACKUP_FLASH_SPACE_SIZE (0) //[_IMG_CFG_H_Gen_FOTA_UE_BACKUP_SIZE]
112
113#define FOTA_UE_SEARCH_RANGE_SIZE (0x400000)
114
115#define FOTA_UE_EXECUTION_BASE (0) // [_IMG_CFG_H_Gen_FOTA_UE_EXECUTION_BASE]
116/****************************************************************************
117 Following definitions are used to configure flash memory arrangement for MAUI image
118
119 Item 1. the number of MAUI image binary parts
120
121 Item 2. the start address and maximum available flash memory size for each MAUI image
122 Note: This maximum available value specifies the size of flash memory that a image can
123 occupy except reserved flash blocks specified in Item 7. The start address should
124 be synchronized with the begin address of each image binary during update/delta
125 package generation process.
126
127 Item 3. the start address of flash storage reserved for update package
128
129 Item 4. the size of flash storage reserved for update package
130
131 Item 5. the start address of back up area for update purpose
132
133 Item 6. the maximum flash block number in update package area
134
135 Item 7. the size of back up area for update purpose
136 Note: Certain FOTA solution, like RedBend, requires a dedicate flash space to back up flash
137 content during update process. In contrast, some colution, such as Bitfone, would use
138 leftover flash blocks that are not occupied by firmware image as back up area. In this case,
139 the value of maximum available flash memory has to be increased to compensate back up
140 requirement.
141
142 Item 8. the flash blocks reserved for flash management
143 Note: This value specifies the amount of blocks that must be reseerved from
144 the gap between maximum avilable flash size, Item2, and the flash memory size
145 really occupied by firmware image.
146
147 ****************************************************************************/
148
149#define FOTA_MAUI_IMAGE_AMOUNT (1)
150#if defined(_NAND_FLASH_BOOTING_) || defined(__EMMC_BOOTING__)
151 #define MAX_LENGTH_ROM (0x01000000)
152 #define MAX_LENGTH_SECONDARY_ROM (0xFFFFFFFF)
153 #define MAX_LENGTH_DEMAND_PAGING_ROM0 (0xFFFFFFFF)
154 #define MAX_LENGTH_DSP_ROM (0xFFFFFFFF)
155#else /* _NAND_FLASH_BOOTING_ || __EMMC_BOOTING__ */
156 #define MAX_LENGTH_ROM (0xFFFFFFFF)
157#endif /* _NAND_FLASH_BOOTING_ || __EMMC_BOOTING__ */
158
159//[_IMG_CFG_H_Gen_IMG_DEFINITION] +
160#if defined(__MTK_TARGET__)
161
162#define MAUI_LOAD_ADDRESS_ROM ((kal_uint32)0)
163
164#else /* __MTK_TARGET__ */
165
166#define MAUI_LOAD_ADDRESS_ROM ((kal_uint32)0)
167
168#endif /* __MTK_TARGET__ */
169
170#define FOTA_MAUI_FLASH_SPACE { {MAUI_LOAD_ADDRESS_ROM, MAX_LENGTH_ROM, 0x0}, \
171 END_MAUI_INFO}
172
173//[_IMG_CFG_H_Gen_IMG_DEFINITION] -
174
175#define FOTA_PACKAGE_STORAGE_BASE (0) //[_IMG_CFG_H_Gen_PKG_STORAGE_BASE]
176
177#define FOTA_PACKAGE_STORAGE_SIZE (0) //[_IMG_CFG_H_Gen_PKG_STORAGE_SIZE]
178
179#define FOTA_PACKAGE_BLOCK_NUMBER (0) //[_IMG_CFG_H_Gen_PKG_BLOCK_NUM]
180
181#define FOTA_BACKUP_STORAGE_BASE (0) //[_IMG_CFG_H_Gen_BACKUP_STORAGE_BASE]
182
183#define FOTA_BACKUP_STORAGE_SIZE (0) //[_IMG_CFG_H_Gen_BACKUP_STORAGE_SIZE]
184
185#define FOTA_RESERVED_FLASH_BLOCKS (5)
186
187/****************************************************************************
188 Following definitions are used for MAUI image manageemt
189
190 Item 1. the size of mapping table for MAUI ROM image
191
192 Item 2. the size of mapping table for FUE ROM image
193
194 ****************************************************************************/
195#define FOTA_MAUI_MAPPING_TABLE_SIZE (0x800)
196
197/****************************************************************************
198 Following definitions are used for NAND flash device configuration
199
200 Item 1. the maximum page size of supported NAND flash device
201
202 ****************************************************************************/
203#define FOTA_FLASH_MAX_PAGE_SIZE (0x800)
204
205/****************************************************************************
206 Following definitions are used for FUE update process
207
208 Item 1. the maximum heap size for FUE
209
210 ****************************************************************************/
211#define FOTA_CUSTOM_POOL_SIZE (0x200000)
212
213/****************************************************************************
214 Following definitions are used for FOTA update package certification flow
215
216 Item 1. the maximum length of message authentication code (in bytes)
217
218 Item 2. the maximum length of key to encrypt message authentication code (in bytes)
219
220 ****************************************************************************/
221#define FOTA_CUSTOM_PACKAGE_MAC_SIZE (20)
222
223#define FOTA_CUSTOM_PACKAGE_SIG_SIZE (128)
224
225#define FOTA_CUSTOM_PACKAGE_KEY_MAX_LEN (128)
226
227#define FOTA_EXTRA_RESERVED_BLOCKS (5)
228
229/* Following data structure should be modified according to requirements in adoption of third partys solution */
230#define __FUE_DUMMY_UPDATE_SUPPORT__
231
232#if defined(__FUE_DUMMY_UPDATE_SUPPORT__)
233
234/*
235 * !CAUTION! size of FOTA_Custom_Update_Info MUST be equal to 88 bytes
236 */
237typedef struct {
238 kal_uint32 FOTA_test_info1;
239 kal_uint32 FOTA_test_info2;
240 kal_uint32 FOTA_test_info3;
241 kal_uint32 FOTA_test_info4;
242 kal_uint32 FOTA_test_padding[18];
243} FOTA_Custom_Update_Info;
244
245#elif defined(__FUE_HP_SUPPORT__)
246
247#include "Hp_update.h"
248
249#elif defined(__FUE_REDBEND_SUPPORT__)
250
251#include "RedBend_update.h"
252
253#else
254
255#error "Unsupported FOTA update information!!"
256
257#endif /* __FUE_DUMMY_UPDATE_SUPPORT__ */
258
259typedef struct {
260 kal_uint32 m_pkg_mod_key_len;
261 kal_char m_pkg_mod_key[(FOTA_CUSTOM_PACKAGE_KEY_MAX_LEN<<1)+1];
262 kal_uint32 m_pkg_exp_key_len;
263 kal_char m_pkg_exp_key[(FOTA_CUSTOM_PACKAGE_KEY_MAX_LEN<<1)+1];
264} FOTA_Custom_Package_Certificate_st;
265/****************************************************************************
266 Following definitions are used for CBR region attribute
267
268 Item 1. the block used for store CBR data. Each Normal block will occupy 2 physical blocks
269
270 Item 2. the block used for bad block replacement on NAND flash. For the device, it should be zero
271
272 Total blocks occupied by CBR will be CBR_REGION_NORMAL_BLOCK_NUM*2+CBR_REGION_SPARE_BLOCK_NUM
273 ****************************************************************************/
274#define CBR_REGION_NORMAL_BLOCK_NUM [AUTOGEN_IMG_CFG_H_Gen_CBR_NORMAL_BLOCK_NUM]
275
276#define CBR_REGION_SPARE_BLOCK_NUM [AUTOGEN_IMG_CFG_H_Gen_CBR_SPARE_BLOCK_NUM]
277
278
279/****************************************************************************
280 Following definitions are used for searching MAUI ROM in the flash
281
282 Item 1. The address in the flash where MAUI binary resides
283
284 Item 2. The address in the flash where Factory binary resides
285
286 ****************************************************************************/
287#define MAUI_ROM_START_ADDR 0x00020000
288
289#define FACTORY_ROM_START_ADDR 0x00010000
290
291
292#endif /* __CUSTOM_IMG_CONFIG_H__ */