X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Ffsl_validate.h;h=fbcbd4249677d1161dc19fe9f8ee1c5da1009687;hb=6786ce1ce14feb4d02854a0c04bc0cce505be46e;hp=a71e1ce2b0e1c8dc486e83f216772ab6b2a822b2;hpb=814013253fd4cf932d0fb32f7043f09a2a748d9a;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/fsl_validate.h b/include/fsl_validate.h index a71e1ce..fbcbd424 100644 --- a/include/fsl_validate.h +++ b/include/fsl_validate.h @@ -1,7 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2015 Freescale Semiconductor, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _FSL_VALIDATE_H_ @@ -9,9 +8,10 @@ #include #include -#include #include +struct cmd_tbl; + #define WORD_SIZE 4 /* Minimum and maximum size of RSA signature length in bits */ @@ -40,8 +40,8 @@ struct fsl_secboot_img_hdr { u8 num_srk; u8 srk_sel; u8 reserve; - u8 ie_flag; } len_kr; + u8 ie_flag; u32 uid_flag; @@ -69,6 +69,11 @@ struct fsl_secboot_img_hdr { #define MAX_KEY_ENTRIES 8 #endif +#if defined(CONFIG_FSL_ISBC_KEY_EXT) +#define IE_FLAG_MASK 0x1 +#define SCRATCH_IE_LOW_ADR 13 +#define SCRATCH_IE_HIGH_ADR 14 +#endif #else /* CONFIG_ESBC_HDR_LS */ @@ -150,6 +155,10 @@ struct fsl_secboot_img_hdr { #define MAX_KEY_ENTRIES 4 #endif +#if defined(CONFIG_FSL_ISBC_KEY_EXT) +#define IE_FLAG_MASK 0xFFFFFFFF +#endif + #endif /* CONFIG_ESBC_HDR_LS */ @@ -202,6 +211,17 @@ struct fsl_secboot_sg_table { }; #endif +/* ESBC global structure. + * Data to be used across verification of different images. + * Stores following Data: + * IE Table + */ +struct fsl_secboot_glb { +#if defined(CONFIG_FSL_ISBC_KEY_EXT) + uintptr_t ie_addr; + struct ie_key_info ie_tbl; +#endif +}; /* * ESBC private structure. * Private structure used by ESBC to store following fields @@ -213,7 +233,7 @@ struct fsl_secboot_sg_table { */ struct fsl_secboot_img_priv { uint32_t hdr_location; - u32 ie_addr; + uintptr_t ie_addr; u32 key_len; struct fsl_secboot_img_hdr hdr; @@ -242,16 +262,29 @@ struct fsl_secboot_img_priv { uint32_t img_size; /* ESBC Image Size */ }; -int do_esbc_halt(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]); +int do_esbc_halt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int fsl_secboot_validate(uintptr_t haddr, char *arg_hash_str, uintptr_t *img_addr_ptr); -int fsl_secboot_blob_encap(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]); -int fsl_secboot_blob_decap(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]); +int fsl_secboot_blob_encap(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); +int fsl_secboot_blob_decap(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); int fsl_check_boot_mode_secure(void); int fsl_setenv_chain_of_trust(void); + +/* + * This function is used to validate the main U-boot binary from + * SPL just before passing control to it using QorIQ Trust + * Architecture header (appended to U-boot image). + */ +void spl_validate_uboot(uint32_t hdr_addr, uintptr_t img_addr); + +/* + * This header is appended at end of image and copied to DDR along + * with the U-Boot image and later used as part of the validation + * flow + */ +#define FSL_U_BOOT_HDR_SIZE (16 << 10) #endif