1 #ifndef CODE_SWAP_HSI_H
2 #define CODE_SWAP_HSI_H
3 
4 #define SWIM_STACK_SIZE 10
5 typedef enum swim_id {
6 	SWIM_NONE = 0,
7 	SWIM_ID1 = 1,
8 	SWIM_ID2 = 2,
9 	SWIM_ID3 = 3,
10 	SWIM_ID4 = 4,
11 	SWIM_ID5 = 5,
12 	SWIM_ID6 = 6,
13 	SWIM_ID7 = 7,
14 	SWIM_ID8 = 8,
15 	SWIM_MAX
16 }swim_id_t;
17 
18 // Single image descriptor, populated in BC1, and is used for loading the images
19 typedef struct swim_img_info {
20     u32 nvm_offset;
21     u32 image_size;
22     u32 stat_times_loaded;
23     u32 stat_times_load_not_required;
24     u32 stat_times_load_failed;
25     u32 stored_gp_val;
26 }swim_img_info_t;
27 
28 // The meta data on the swappable images
29 typedef struct swim_stack {
30     u32_t       img_stack[SWIM_STACK_SIZE];
31     u32_t       cur_img_stack_id;
32 }swim_stack_t;
33 
34 typedef struct swim_meta {
35     swim_img_info_t info[SWIM_MAX];
36     // Image Stack
37 
38     u32_t      swim_group;
39     #define SWIM_GROUP_A 1
40     #define SWIM_GROUP_B 2
41     #define SWIM_GROUP_INVALID 0
42 
43     u32_t      cur_loaded_swim;
44  }swim_meta_t;
45 
46 #endif /* CODE_SWAP_HSI_H */
47