xref: /rk3399_rockchip-uboot/include/spl_ab.h (revision 894688431927c1b73c64860c8aa71463c2593ea2)
1 /* SPDX-License-Identifier:     GPL-2.0+ */
2 /*
3  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
4  */
5 
6 #ifndef _SPL_AB_H_
7 #define _SPL_AB_H_
8 
9 #include <android_avb/libavb_ab.h>
10 #include <android_avb/avb_ab_flow.h>
11 
12 #define AB_METADATA_OFFSET 4
13 
14 /*
15  * spl_get_current_slot
16  *
17  * @dev_desc: block description
18  * @partition: partition name
19  * @slot: A/B slot
20  *
21  * return: 0 success, others fail.
22  */
23 int spl_get_current_slot(struct blk_desc *dev_desc, char *partition,
24 			 char *slot);
25 
26 /*
27  * spl_ab_append_part_slot
28  *
29  * @dev_desc: block description
30  * @part_name: partition name
31  * @new_name: append the slot suffix
32  *
33  * return: 0 success, others fail.
34  */
35 int spl_ab_append_part_slot(struct blk_desc *dev_desc,
36 			    const char *part_name,
37 			    char *new_name);
38 
39 /*
40  * spl_ab_decrease_tries
41  *
42  * @dev_desc: block description
43  *
44  * return: 0 success, others fail.
45  */
46 int spl_ab_decrease_tries(struct blk_desc *dev_desc);
47 
48  #endif
49