summaryrefslogtreecommitdiff
path: root/drivers/fastboot/fb_fsl/fb_fsl_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fastboot/fb_fsl/fb_fsl_command.c')
-rw-r--r--drivers/fastboot/fb_fsl/fb_fsl_command.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_fsl/fb_fsl_command.c b/drivers/fastboot/fb_fsl/fb_fsl_command.c
index 5cf3bd83c7..14a202ce58 100644
--- a/drivers/fastboot/fb_fsl/fb_fsl_command.c
+++ b/drivers/fastboot/fb_fsl/fb_fsl_command.c
@@ -664,6 +664,37 @@ static void flashing(char *cmd, char *response)
strcpy(response, "OKAY");
}
}
+#ifdef CONFIG_ID_ATTESTATION
+ else if (endswith(cmd, FASTBOOT_APPEND_ATTESTATION_ID)) {
+ if (trusty_append_attestation_id(ATTESTATION_ID_BRAND, strlen(ATTESTATION_ID_BRAND))) {
+ printf("Error append ATTESTATION_ID_BRAND failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_BRAND failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_DEVICE, strlen(ATTESTATION_ID_DEVICE))) {
+ printf("Error append ATTESTATION_ID_DEVICE failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_DEVICE failed!");
+ } else if (trusty_append_attestation_id(CONFIG_ATTESTATION_ID_PRODUCT, strlen(CONFIG_ATTESTATION_ID_PRODUCT))) {
+ printf("Error append ATTESTATION_ID_PRODUCT failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_PRODUCT failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_MANUFACTURER, strlen(ATTESTATION_ID_MANUFACTURER))) {
+ printf("Error append ATTESTATION_ID_MANUFACTURER failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_MANUFACTURER failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_MODEL, strlen(ATTESTATION_ID_MODEL))) {
+ printf("Error append ATTESTATION_ID_MODEL failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_MODEL failed!");
+ } else {
+ char *serial = get_serial();
+
+ if (!serial) {
+ printf("Error Failed to append the serial number!\n");
+ strcpy(response, "FAIL Failed to append the serial number!");
+ } else if (trusty_append_attestation_id(serial, 16)) {
+ printf("Error Failed to append the serial number!\n");
+ strcpy(response, "FAILFailed to append the serial number!");
+ } else
+ strcpy(response, "OKAY");
+ }
+ }
+#endif
#ifndef CONFIG_AVB_ATX
else if (endswith(cmd, FASTBOOT_SET_RPMB_KEY)) {
if (fastboot_set_rpmb_key(fastboot_buf_addr, fastboot_bytes_received)) {
@@ -831,6 +862,18 @@ static void flash(char *cmd, char *response)
#if defined(CONFIG_FASTBOOT_LOCK)
if (strncmp(cmd, "gpt", 3) == 0) {
int gpt_valid = 0;
+ int status, mmc_no;
+ struct blk_desc *dev_desc;
+ mmc_no = fastboot_devinfo.dev_id;
+ dev_desc = blk_get_dev("mmc", mmc_no);
+ if (dev_desc) {
+ if (dev_desc->part_type != PART_TYPE_EFI)
+ dev_desc->part_type = PART_TYPE_EFI;
+ }
+ else {
+ fastboot_fail("", response);
+ return;
+ }
gpt_valid = partition_table_valid();
/* If gpt is valid, load partitons table into memory.
So if the next command is "fastboot reboot bootloader",