xref: /rk3399_rockchip-uboot/include/spl_ab.h (revision fcdd83d4455871c49a93236c3f1cb964727f8c0c)
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_get_partitions_sector
28  *
29  * @dev_desc: block description
30  * @partition: partition name
31  * @sectors: firmware load address
32  */
33 int spl_get_partitions_sector(struct blk_desc *dev_desc, char *partition,
34 			       u32 *sectors);
35 
36  #endif
37