1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: UPG ab mode config file for product. 15 */ 16 #ifndef UPG_AB_H 17 #define UPG_AB_H 18 19 typedef enum { 20 UPG_REGION_A, 21 UPG_REGION_B, 22 UPG_REGION_COUNT 23 } upg_region_index; 24 25 upg_region_index upg_get_run_region(void); 26 upg_region_index upg_get_upg_region(void); 27 uint32_t upg_get_region_addr(upg_region_index upg_region); 28 uint32_t upg_get_region_size(upg_region_index upg_region); 29 uint32_t upg_ab_image_read(upg_region_index upg_region, uint32_t offset, uint8_t *buf, size_t len); 30 uint32_t upg_ab_image_write(upg_region_index upg_region, uint32_t offset, uint8_t *buf, size_t len); 31 errcode_t upg_set_run_region(upg_region_index upg_region); 32 errcode_t upg_region_erase(upg_region_index region); 33 errcode_t upg_ab_start(upg_region_index upg_region); 34 35 #endif /* UPG_AB_H */