Mistake on this page?
Report an issue in GitHub or email us
rda5981_ota.h
1 /* Copyright (c) 2019 Unisoc Communications Inc.
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _RDA5981_OTA_H_
18 #define _RDA5981_OTA_H_
19 #include <stdint.h>
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 extern const unsigned int RDA_FW_INFO_ADDR;
25 extern const unsigned int RDA_UPGRADE_ADDR;
26 
27 /*
28  * function: start to wirte a partition. this func will erase given flash region
29  * @addr: partition start address, must be 4k alignment
30  * @img_len: length of image getted from OTA server, must be 4k alignment
31  * return: 0:success, else:fail
32  */
33 int rda5981_write_partition_start(unsigned int addr, unsigned int img_len);
34 
35 /*
36  * function: write image to flash, without erase.
37  * the write region must be inside of the area given by func rda5981_write_partition_start
38  * the write region must be in order, otherwise the end function will return crc error.
39  * the maximum length could be write once time is 0x1000
40  * @offset: offset from image inital position, must be 1k alignment
41  * @buf: data to be written
42  * @len: buffer len, max #0x1000, must be 1k alignment
43  * return: 0:success, else:fail
44  */
45 int rda5981_write_partition(unsigned int offset, const unsigned char *buf, unsigned int len);
46 
47 /*
48  * function: end of writing partition
49  * return: 0:crc32 check success, else:fail
50  */
51 int rda5981_write_partition_end(void);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /*_RDA5981_OTA_H_*/
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.