/*
 * Copyright 2021 Sony Corporation
 */

#ifndef _DTBO_H_
#define _DTBO_H_

#define DEFAULT_DTB_PART	"bootdata"
#define KEY_BUFFER_SIZE  32
#define STRING_BUFFER_SIZE  64
#define DTBO_INDEX_BUFFER_SIZE  384
#define DIGIT_NUM  10
#define ANDROID_BOOTARGS_DTBO_IDX	"androidboot.dtbo_idx"

int get_dtbo_cfg_selection(char *partition, char *cfg_name, char *type, char *setting);
int set_dtbo_cfg_selection(char *partition, char *cfg_name);
int ls_dtbo_cfg(char *partition);

struct DTBO_IDX_T {
	int dtbo_id;
	struct list_head list;
};

int add_dtbo_idx(int id);
int dtbo_selection_and_overlay(void);
int get_dtbo_img_size(unsigned long dtbo_img_addr, unsigned long *dtbo_img_size);
int verify_dtbo_img(unsigned char *auth_data, unsigned char *sign_data, unsigned long auth_size);

#endif // _DTBO_H_
