diff -Nru xilinx-bootgen-2021.2/authentication-versal.cpp xilinx-bootgen-2022.2/authentication-versal.cpp --- xilinx-bootgen-2021.2/authentication-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/authentication-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -245,7 +245,6 @@ } /******************************************************************************/ - uint32_t VersalAuthenticationContext::GetCertificateSize(void) { return certSize; @@ -902,7 +901,7 @@ size_t hashSecLen = (*section)->Length; //If !bootloader AND !headers - if ((*section)->firstChunkSize != 0 && !(*section)->isBootloader && (*section)->isPartitionData) + if ((*section)->firstChunkSize != 0 && !((*section)->isBootloader && !bi.options.IsVersalNetSeries()) && (*section)->isPartitionData) { hashSecLen = (*section)->firstChunkSize + hashLength; } @@ -917,7 +916,7 @@ memcpy(partitionAc + acSection->Length - signatureLength, (*section)->Data, hashSecLen); /* Calculate the final hash */ - Versalcrypto_hash(shaHash, partitionAc, hashSecLen + (acSection->Length - signatureLength), !(*section)->isBootloader); + Versalcrypto_hash(shaHash, partitionAc, hashSecLen + (acSection->Length - signatureLength), !((*section)->isBootloader && !bi.options.IsVersalNetSeries())); LOG_TRACE("Hash of %s (LE):", acSection->Name.c_str()); LOG_DUMP_BYTES(shaHash, hashLength); /* Create the PKCS padding for the hash */ @@ -1437,7 +1436,7 @@ { for (uint32_t index = 0; index < WORDS_PER_DEVICE_DNA; index++) { - deviceDNA[index] = ReadBigEndian32(dnaValue); + deviceDNA[WORDS_PER_DEVICE_DNA - (index+1)] = ReadBigEndian32(dnaValue); dnaValue += sizeof(uint32_t); } } @@ -1600,4 +1599,4 @@ { //AuthenticationContext::authKeyLength = EC_P521_KEY_LENGTH; } -} \ No newline at end of file +} diff -Nru xilinx-bootgen-2021.2/authkeys.cpp xilinx-bootgen-2022.2/authkeys.cpp --- xilinx-bootgen-2021.2/authkeys.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/authkeys.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -470,7 +470,7 @@ } fclose(file); } - if (eckey != NULL) + else if (eckey != NULL) { if (!secret) { @@ -488,6 +488,10 @@ } fclose(file); } + else + { + LOG_ERROR("Failed to generate authentication keys for the given algorithm."); + } } if (!fileWritten) diff -Nru xilinx-bootgen-2021.2/bif.l xilinx-bootgen-2022.2/bif.l --- xilinx-bootgen-2021.2/bif.l 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bif.l 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,7 @@ early_handoff return tok::EARLY_HANDOFF; delay_handoff return tok::DELAY_HANDOFF; delay_load return tok::DELAY_LOAD; +delay_auth return tok::DELAY_AUTH; hivec return tok::HIVEC; blocks return tok::BLOCKS; authblocks return tok::AUTHBLOCKS; @@ -67,6 +68,8 @@ image return tok::IMAGE; metaheader return tok::METAHEADER; section return tok::BIF_SECTION; +lockstep return tok::LOCKSTEP; +include return tok::INCLUDE; offset yylval->number = tok::OFFSET; return tok::OFFSET; reserve_legacy yylval->number = tok::RESERVE_LEGACY; return tok::RESERVE_LEGACY; @@ -132,15 +135,21 @@ uboot yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; pmc yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; non-pmc yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; + plm yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; + non-plm yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; -partition_type return tok::PARTITION_TYPE; -type return tok::PARTITION_TYPE; - cdo yylval->number = PartitionType::CONFIG_DATA_OBJ;return tok::PTYPEVALUE; - raw yylval->number = PartitionType::RAW; return tok::PTYPEVALUE; - cfi yylval->number = PartitionType::CFI; return tok::PTYPEVALUE; - cfi-gsc yylval->number = PartitionType::CFI_GSC; return tok::PTYPEVALUE; - slr-boot yylval->number = PartitionType::SLR_BOOT; return tok::PTYPEVALUE; - slr-config yylval->number = PartitionType::SLR_CONFIG; return tok::PTYPEVALUE; +partition_type return tok::PARTITION_TYPE; +type return tok::PARTITION_TYPE; + cdo yylval->number = PartitionType::CONFIG_DATA_OBJ; return tok::PTYPEVALUE; + raw yylval->number = PartitionType::RAW; return tok::PTYPEVALUE; + cfi yylval->number = PartitionType::CFI; return tok::PTYPEVALUE; + cfi-gsc yylval->number = PartitionType::CFI_GSC; return tok::PTYPEVALUE; + slr-boot yylval->number = PartitionType::SLR_BOOT; return tok::PTYPEVALUE; + slr-config yylval->number = PartitionType::SLR_CONFIG; return tok::PTYPEVALUE; + slr-slave yylval->number = PartitionType::SLR_SLAVE; return tok::PTYPEVALUE; + slr-slave-boot yylval->number = PartitionType::SLR_SLAVE_BOOT; return tok::PTYPEVALUE; + slr-slave-config yylval->number = PartitionType::SLR_SLAVE_CONFIG; return tok::PTYPEVALUE; + elf yylval->number = PartitionType::ELF; return tok::PTYPEVALUE; keysrc_encryption yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; keysrc yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; @@ -186,7 +195,9 @@ opt_key yylval->number = OptKey::OptKeyinSecHdr; return tok::OPT_KEY; puf4kmode yylval->number = PufMode::PUF4K; return tok::PUF4KMODE; shutter yylval->number = tok::SHUTTER; return tok::SHUTTER; + puf_ro_swap yylval->number = tok::PUFROSWAP; return tok::PUFROSWAP; dpacm_enable yylval->number = DpaCM::DpaCMEnable; return tok::DPA_CM; + dice_enable yylval->number = tok::DICE; return tok::DICE; smap_width yylval->number = tok::SMAP_WIDTH; return tok::SMAP_WIDTH; bypass_idcode_check yylval->number = tok::BYPASS_IDCODE_CHECK; return tok::BYPASS_IDCODE_CHECK; a_hwrot yylval->number = tok::A_HWROT; return tok::A_HWROT; @@ -219,20 +230,27 @@ core return tok::DEST_CPU; a53-0 yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; a72-0 yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; + a78-0 yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; a5x-0 yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; a53-1 yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; a72-1 yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; + a78-1 yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; a5x-1 yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; a53-2 yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; + a78-2 yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; a5x-2 yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; a53-3 yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; + a78-3 yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; a5x-3 yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; r5-0 yylval->number = DestinationCPU::R5_0; return tok::DEST_CPU_TYPE; + r52-0 yylval->number = DestinationCPU::R5_0; return tok::DEST_CPU_TYPE; r5-1 yylval->number = DestinationCPU::R5_1; return tok::DEST_CPU_TYPE; + r52-1 yylval->number = DestinationCPU::R5_1; return tok::DEST_CPU_TYPE; r5-lockstep yylval->number = DestinationCPU::R5_lockstep; return tok::DEST_CPU_TYPE; pmu yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; psm yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; aie yylval->number = DestinationCPU::AIE; return tok::DEST_CPU_TYPE; + cluster yylval->number = tok::CLUSTER_NUM; return tok::CLUSTER_NUM; destination_device return tok::DEST_DEVICE; ps yylval->number = DestinationDevice::DEST_DEV_PS; return tok::DEST_DEVICE_TYPE; diff -Nru xilinx-bootgen-2021.2/bif.tab.cpp xilinx-bootgen-2022.2/bif.tab.cpp --- xilinx-bootgen-2021.2/bif.tab.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bif.tab.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -448,249 +448,261 @@ case 5: /* Line 670 of lalr1.cc */ #line 202 "../s/bif.y" - { currentBifOptions = new BifOptions(options.GetArchType(),(yysemantic_stack_[(1) - (1)].string)); } + { options.includeBifOptionsList.push_back((yysemantic_stack_[(3) - (3)].string)); } break; case 6: /* Line 670 of lalr1.cc */ -#line 204 "../s/bif.y" - { options.bifOptions = currentBifOptions; - options.bifOptionsList.push_back(currentBifOptions); } +#line 203 "../s/bif.y" + { currentBifOptions = new BifOptions(options.GetArchType(),(yysemantic_stack_[(1) - (1)].string)); } break; - case 15: + case 7: /* Line 670 of lalr1.cc */ -#line 218 "../s/bif.y" - { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } +#line 205 "../s/bif.y" + { options.bifOptions = currentBifOptions; + options.bifOptionsList.push_back(currentBifOptions); } break; - case 21: + case 16: /* Line 670 of lalr1.cc */ -#line 229 "../s/bif.y" - { currentBifOptions->SetMetaHeaderEncryptType((yysemantic_stack_[(3) - (3)].encrvalue_t)); } +#line 219 "../s/bif.y" + { currentPartitionBifOptions = new PartitionBifOptions(); + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); } break; case 22: /* Line 670 of lalr1.cc */ #line 230 "../s/bif.y" - { currentBifOptions->SetMetaHeaderEncryptionKeySource((yysemantic_stack_[(3) - (3)].encrkeysrc_t)); } + { currentBifOptions->SetMetaHeaderEncryptType((yysemantic_stack_[(3) - (3)].encrvalue_t)); } break; case 23: /* Line 670 of lalr1.cc */ #line 231 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.encrKeyFile = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->SetMetaHeaderEncryptionKeySource((yysemantic_stack_[(3) - (3)].encrkeysrc_t), options.IsVersalNetSeries()); } break; case 24: /* Line 670 of lalr1.cc */ #line 232 "../s/bif.y" - { currentBifOptions->SetMetaHeaderAuthType((yysemantic_stack_[(3) - (3)].authvalue_t)); } + { currentBifOptions->metaHdrAttributes.encrKeyFile = (yysemantic_stack_[(3) - (3)].string); } break; case 25: /* Line 670 of lalr1.cc */ #line 233 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.ppk = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->SetMetaHeaderAuthType((yysemantic_stack_[(3) - (3)].authvalue_t)); } break; case 26: /* Line 670 of lalr1.cc */ #line 234 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.psk = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->metaHdrAttributes.ppk = (yysemantic_stack_[(3) - (3)].string); } break; case 27: /* Line 670 of lalr1.cc */ #line 235 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.spk = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->metaHdrAttributes.psk = (yysemantic_stack_[(3) - (3)].string); } break; case 28: /* Line 670 of lalr1.cc */ #line 236 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.ssk = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->metaHdrAttributes.spk = (yysemantic_stack_[(3) - (3)].string); } break; case 29: /* Line 670 of lalr1.cc */ #line 237 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.spkSignature = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->metaHdrAttributes.ssk = (yysemantic_stack_[(3) - (3)].string); } break; case 30: /* Line 670 of lalr1.cc */ #line 238 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.presign = (yysemantic_stack_[(3) - (3)].string); } + { currentBifOptions->metaHdrAttributes.spkSignature = (yysemantic_stack_[(3) - (3)].string); } break; case 31: /* Line 670 of lalr1.cc */ #line 239 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.revokeId = (yysemantic_stack_[(3) - (3)].number); } + { currentBifOptions->metaHdrAttributes.presign = (yysemantic_stack_[(3) - (3)].string); } break; case 32: /* Line 670 of lalr1.cc */ #line 240 "../s/bif.y" - { currentBifOptions->metaHdrAttributes.checksum = (yysemantic_stack_[(3) - (3)].checksumvalue_t); } + { currentBifOptions->metaHdrAttributes.revokeId = (yysemantic_stack_[(3) - (3)].number); } break; case 33: /* Line 670 of lalr1.cc */ #line 241 "../s/bif.y" + { currentBifOptions->metaHdrAttributes.checksum = (yysemantic_stack_[(3) - (3)].checksumvalue_t); } + break; + + case 34: +/* Line 670 of lalr1.cc */ +#line 242 "../s/bif.y" { currentBifOptions->metaHdrAttributes.dpaCM = DpaCM::DpaCMEnable; } break; - case 35: + case 36: /* Line 670 of lalr1.cc */ -#line 243 "../s/bif.y" +#line 244 "../s/bif.y" { currentBifOptions->metaHdrAttributes.pufHdLoc = PufHdLoc::PUFinBH; currentBifOptions->SetPufHdinBHFlag();} break; - case 38: + case 39: /* Line 670 of lalr1.cc */ -#line 251 "../s/bif.y" +#line 252 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(1) - (1)].number)); currentBifOptions->metaHdrAttributes.encrBlocks = currentPartitionBifOptions->GetEncryptionBlocks(); } break; - case 39: + case 40: /* Line 670 of lalr1.cc */ -#line 253 "../s/bif.y" +#line 254 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(4) - (1)].number), (yysemantic_stack_[(4) - (3)].number)); currentBifOptions->metaHdrAttributes.encrBlocks = currentPartitionBifOptions->GetEncryptionBlocks(); } break; - case 40: + case 41: /* Line 670 of lalr1.cc */ -#line 255 "../s/bif.y" +#line 256 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(4) - (1)].number), 0); currentBifOptions->metaHdrAttributes.defEncrBlockSize = (yysemantic_stack_[(4) - (1)].number); } break; - case 41: -/* Line 670 of lalr1.cc */ -#line 259 "../s/bif.y" - { currentBifOptions->SetPdiId((yysemantic_stack_[(3) - (3)].number)); } - break; - case 42: /* Line 670 of lalr1.cc */ #line 260 "../s/bif.y" - { currentBifOptions->SetParentId((yysemantic_stack_[(3) - (3)].number)); } + { currentBifOptions->SetPdiId((yysemantic_stack_[(3) - (3)].number)); } break; case 43: /* Line 670 of lalr1.cc */ #line 261 "../s/bif.y" - { currentBifOptions->SetIdCode((yysemantic_stack_[(3) - (3)].number)); } + { currentBifOptions->SetParentId((yysemantic_stack_[(3) - (3)].number)); } break; case 44: /* Line 670 of lalr1.cc */ #line 262 "../s/bif.y" - { currentBifOptions->SetExtendedIdCode((yysemantic_stack_[(3) - (3)].number)); } + { currentBifOptions->SetIdCode((yysemantic_stack_[(3) - (3)].number)); } break; case 45: /* Line 670 of lalr1.cc */ #line 263 "../s/bif.y" - { currentBifOptions->AddFiles((yysemantic_stack_[(3) - (1)].number), (yysemantic_stack_[(3) - (3)].string)); } + { currentBifOptions->SetExtendedIdCode((yysemantic_stack_[(3) - (3)].number)); } break; case 46: /* Line 670 of lalr1.cc */ #line 264 "../s/bif.y" - { currentBifOptions->SetEncryptionKeySource((yysemantic_stack_[(3) - (3)].encrkeysrc_t)); } + { currentBifOptions->AddFiles((yysemantic_stack_[(3) - (1)].number), (yysemantic_stack_[(3) - (3)].string)); } break; - case 49: + case 47: /* Line 670 of lalr1.cc */ -#line 271 "../s/bif.y" - { currentImageBifOptions = new ImageBifOptions(); } +#line 265 "../s/bif.y" + { currentBifOptions->SetEncryptionKeySource((yysemantic_stack_[(3) - (3)].encrkeysrc_t)); } break; - case 50: + case 48: /* Line 670 of lalr1.cc */ -#line 272 "../s/bif.y" - { currentBifOptions->imageBifOptionList.push_back(currentImageBifOptions); } +#line 266 "../s/bif.y" + { currentBifOptions->SetPdiType((yysemantic_stack_[(3) - (3)].ptype_t)); } break; - case 58: + case 51: /* Line 670 of lalr1.cc */ -#line 286 "../s/bif.y" - { currentImageBifOptions->SetImageId((yysemantic_stack_[(3) - (3)].number)); } +#line 273 "../s/bif.y" + { currentImageBifOptions = new ImageBifOptions(); } break; - case 59: + case 52: /* Line 670 of lalr1.cc */ -#line 287 "../s/bif.y" - { currentImageBifOptions->SetImageName((yysemantic_stack_[(3) - (3)].string)); } +#line 274 "../s/bif.y" + { currentBifOptions->imageBifOptionList.push_back(currentImageBifOptions); } break; case 60: /* Line 670 of lalr1.cc */ #line 288 "../s/bif.y" - { currentImageBifOptions->SetDelayHandoff(true); } + { currentImageBifOptions->SetImageId((yysemantic_stack_[(3) - (3)].number)); } break; case 61: /* Line 670 of lalr1.cc */ #line 289 "../s/bif.y" - { currentImageBifOptions->SetDelayLoad(true); } + { currentImageBifOptions->SetImageName((yysemantic_stack_[(3) - (3)].string)); } break; case 62: /* Line 670 of lalr1.cc */ #line 290 "../s/bif.y" - { currentImageBifOptions->SetMemCopyAddress((yysemantic_stack_[(3) - (3)].number)); } + { currentImageBifOptions->SetDelayHandoff(true); } break; case 63: /* Line 670 of lalr1.cc */ #line 291 "../s/bif.y" - { currentImageBifOptions->SetImageType((yysemantic_stack_[(3) - (3)].ptype_t)); } + { currentImageBifOptions->SetDelayLoad(true); } break; case 64: /* Line 670 of lalr1.cc */ #line 292 "../s/bif.y" - { currentImageBifOptions->SetUniqueId((yysemantic_stack_[(3) - (3)].number)); } + { currentImageBifOptions->SetMemCopyAddress((yysemantic_stack_[(3) - (3)].number)); } break; case 65: /* Line 670 of lalr1.cc */ #line 293 "../s/bif.y" - { currentImageBifOptions->SetParentUniqueId((yysemantic_stack_[(3) - (3)].number)); } + { currentImageBifOptions->SetImageType((yysemantic_stack_[(3) - (3)].ptype_t)); } break; case 66: /* Line 670 of lalr1.cc */ #line 294 "../s/bif.y" + { currentImageBifOptions->SetUniqueId((yysemantic_stack_[(3) - (3)].number)); } + break; + + case 67: +/* Line 670 of lalr1.cc */ +#line 295 "../s/bif.y" + { currentImageBifOptions->SetParentUniqueId((yysemantic_stack_[(3) - (3)].number)); } + break; + + case 68: +/* Line 670 of lalr1.cc */ +#line 296 "../s/bif.y" { currentImageBifOptions->SetFunctionId((yysemantic_stack_[(3) - (3)].number)); } break; - case 72: + case 74: /* Line 670 of lalr1.cc */ -#line 307 "../s/bif.y" +#line 308 "../s/bif.y" { if(options.GetArchType() == Arch::VERSAL) LOG_WARNING("BIF attribute error !!! [keysrc_encryption] not supported in VERSAL architecture.\n\t Please see 'bootgen -arch versal -bif_help keysrc'"); currentBifOptions->SetEncryptionKeySource((yysemantic_stack_[(4) - (4)].encrkeysrc_t)); options.SetEncryptedKeySource((yysemantic_stack_[(4) - (4)].encrkeysrc_t)); } break; - case 73: + case 75: /* Line 670 of lalr1.cc */ -#line 310 "../s/bif.y" +#line 311 "../s/bif.y" { if(options.GetArchType() == Arch::ZYNQ) LOG_ERROR("BIF attribute error !!!\n\t\t[fsbl_config] not supported in ZYNQ architecture"); } break; - case 77: + case 79: /* Line 670 of lalr1.cc */ -#line 315 "../s/bif.y" +#line 316 "../s/bif.y" { if(options.GetArchType() == Arch::ZYNQ) LOG_ERROR("BIF attribute error !!!\n\t\t[bootdevice] not supported in ZYNQ architecture"); if(options.GetArchType() == Arch::VERSAL) @@ -698,100 +710,100 @@ currentBifOptions->SetBootDevice((yysemantic_stack_[(4) - (4)].bootdevice_t)); } break; - case 78: + case 80: /* Line 670 of lalr1.cc */ -#line 320 "../s/bif.y" +#line 321 "../s/bif.y" { LOG_ERROR("This usage of boot_device is no more supported.\n\t Please see 'bootgen -arch versal -bif_help boot_device'"); } break; - case 85: + case 87: /* Line 670 of lalr1.cc */ -#line 331 "../s/bif.y" +#line 332 "../s/bif.y" { currentBifOptions->SetBootDevice((yysemantic_stack_[(1) - (1)].bootdevice_t)); } break; - case 86: + case 88: /* Line 670 of lalr1.cc */ -#line 332 "../s/bif.y" +#line 333 "../s/bif.y" { currentBifOptions->SetBootDeviceAddress((yysemantic_stack_[(3) - (3)].number)); } break; - case 92: + case 94: /* Line 670 of lalr1.cc */ -#line 344 "../s/bif.y" +#line 345 "../s/bif.y" { currentBifOptions->SetAuthJtagRevokeID((yysemantic_stack_[(3) - (3)].number)); } break; - case 93: + case 95: /* Line 670 of lalr1.cc */ -#line 345 "../s/bif.y" +#line 346 "../s/bif.y" { currentBifOptions->SetAuthJtagDeviceDna((yysemantic_stack_[(3) - (3)].string)); } break; - case 94: + case 96: /* Line 670 of lalr1.cc */ -#line 346 "../s/bif.y" +#line 347 "../s/bif.y" { currentBifOptions->SetAuthJtagTimeOut((yysemantic_stack_[(3) - (3)].number)); } break; - case 95: + case 97: /* Line 670 of lalr1.cc */ -#line 349 "../s/bif.y" +#line 350 "../s/bif.y" { currentBifOptions->SetCore((yysemantic_stack_[(1) - (1)].core_t)); LOG_WARNING("[fsbl_config] a53_x64 | a53_x32 | r5_single | r5_dual is no more supported. Use 'destination_cpu' attribute for bootloader partition"); } break; - case 96: + case 98: /* Line 670 of lalr1.cc */ -#line 352 "../s/bif.y" +#line 353 "../s/bif.y" { currentBifOptions->SetBhRsa((yysemantic_stack_[(1) - (1)].bhrsa_t)); } break; - case 97: + case 99: /* Line 670 of lalr1.cc */ -#line 354 "../s/bif.y" +#line 355 "../s/bif.y" { LOG_ERROR("Authentication using SHA2 is no more supported."); } break; - case 98: + case 100: /* Line 670 of lalr1.cc */ -#line 356 "../s/bif.y" +#line 357 "../s/bif.y" { LOG_ERROR("[fsbl_config] bi_integrity_sha3 is no more supported. Use 'checksum' attribute of bootloader partition"); } break; - case 99: + case 101: /* Line 670 of lalr1.cc */ -#line 358 "../s/bif.y" +#line 359 "../s/bif.y" { currentBifOptions->SetPufHdLoc((yysemantic_stack_[(1) - (1)].pufhdloc_t)); } break; - case 100: + case 102: /* Line 670 of lalr1.cc */ -#line 360 "../s/bif.y" +#line 361 "../s/bif.y" { currentBifOptions->SetAuthOnly((yysemantic_stack_[(1) - (1)].authonly_t)); } break; - case 101: + case 103: /* Line 670 of lalr1.cc */ -#line 362 "../s/bif.y" +#line 363 "../s/bif.y" { currentBifOptions->SetOptKey((yysemantic_stack_[(1) - (1)].optkey_t)); } break; - case 102: + case 104: /* Line 670 of lalr1.cc */ -#line 364 "../s/bif.y" +#line 365 "../s/bif.y" { currentBifOptions->SetPufMode(PufMode::PUF4K); } break; - case 103: + case 105: /* Line 670 of lalr1.cc */ -#line 366 "../s/bif.y" +#line 367 "../s/bif.y" { currentBifOptions->SetShutterValue((yysemantic_stack_[(3) - (3)].number)); } break; - case 104: + case 106: /* Line 670 of lalr1.cc */ -#line 368 "../s/bif.y" +#line 369 "../s/bif.y" { if(options.GetArchType() != Arch::VERSAL) LOG_ERROR("BIF attribute error !!!\n\t\t'dpacm_enable' is supported only in VERSAL architecture"); if(options.GetArchType() == Arch::VERSAL) @@ -800,578 +812,616 @@ } break; - case 105: + case 107: /* Line 670 of lalr1.cc */ -#line 374 "../s/bif.y" +#line 375 "../s/bif.y" { if(((yysemantic_stack_[(3) - (3)].number) != 8) && ((yysemantic_stack_[(3) - (3)].number) !=16) && ((yysemantic_stack_[(3) - (3)].number) != 32) && ((yysemantic_stack_[(3) - (3)].number) != 0)) LOG_ERROR("Invalid smap_width value in BIF. Valid values are 8, 16 and 32"); currentBifOptions->smapWidth = (yysemantic_stack_[(3) - (3)].number); } break; - case 106: + case 108: /* Line 670 of lalr1.cc */ -#line 378 "../s/bif.y" +#line 379 "../s/bif.y" { currentBifOptions->SetBypassIdcodeFlag(true); } break; - case 107: + case 109: /* Line 670 of lalr1.cc */ -#line 379 "../s/bif.y" +#line 380 "../s/bif.y" { currentBifOptions->SetAHwRoTFlag(true); } break; - case 108: + case 110: /* Line 670 of lalr1.cc */ -#line 380 "../s/bif.y" +#line 381 "../s/bif.y" { currentBifOptions->SetSHwRoTFlag(true); } break; - case 109: + case 111: +/* Line 670 of lalr1.cc */ +#line 382 "../s/bif.y" + { if(options.GetArchType() == Arch::VERSAL && options.IsVersalNetSeries()) + currentBifOptions->SetPufRingOscilltorSwapConfigValue((yysemantic_stack_[(3) - (3)].number)); + else + LOG_ERROR("BIF attribute error !!!\n\t 'puf_ro_swap' is supported only in VersalNet architecture"); + } + break; + + case 112: +/* Line 670 of lalr1.cc */ +#line 387 "../s/bif.y" + { if(options.GetArchType() == Arch::VERSAL && options.IsVersalNetSeries()) + currentBifOptions->SetDiceEnable(); + else + LOG_ERROR("BIF attribute error !!!\n\t 'dice_enable' is supported only in VersalNet architecture"); + } + break; + + case 113: /* Line 670 of lalr1.cc */ -#line 383 "../s/bif.y" +#line 394 "../s/bif.y" { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } + currentPartitionBifOptions->SetArchType(options.GetArchType(),options.IsVersalNetSeries()); } break; - case 110: + case 114: /* Line 670 of lalr1.cc */ -#line 386 "../s/bif.y" +#line 397 "../s/bif.y" { currentPartitionBifOptions->filename = (yysemantic_stack_[(5) - (5)].string); currentPartitionBifOptions->filelist.push_back((yysemantic_stack_[(5) - (5)].string)); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } break; - case 111: + case 115: /* Line 670 of lalr1.cc */ -#line 390 "../s/bif.y" +#line 401 "../s/bif.y" { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); currentPartitionBifOptions->filename = (yysemantic_stack_[(1) - (1)].string); currentPartitionBifOptions->filelist.push_back((yysemantic_stack_[(1) - (1)].string)); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } break; - case 112: + case 116: /* Line 670 of lalr1.cc */ -#line 396 "../s/bif.y" +#line 407 "../s/bif.y" { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); } break; - case 120: + case 124: /* Line 670 of lalr1.cc */ -#line 410 "../s/bif.y" +#line 421 "../s/bif.y" { currentPartitionBifOptions->filename = (yysemantic_stack_[(3) - (3)].string); currentPartitionBifOptions->filelist.push_back((yysemantic_stack_[(3) - (3)].string)); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } break; - case 121: + case 125: /* Line 670 of lalr1.cc */ -#line 413 "../s/bif.y" +#line 424 "../s/bif.y" { currentPartitionBifOptions->partitionId = (yysemantic_stack_[(3) - (3)].number); } break; - case 123: + case 127: /* Line 670 of lalr1.cc */ -#line 415 "../s/bif.y" +#line 426 "../s/bif.y" { currentPartitionBifOptions->fileType = (yysemantic_stack_[(3) - (3)].number); } break; - case 124: + case 128: /* Line 670 of lalr1.cc */ -#line 416 "../s/bif.y" +#line 427 "../s/bif.y" { currentPartitionBifOptions->bifSection = (yysemantic_stack_[(3) - (3)].string); - currentPartitionBifOptions->filename = currentPartitionBifOptions->GetOutputFileFromBifSection(options.GetOutputFileNames().front(), (yysemantic_stack_[(3) - (3)].string)); + currentPartitionBifOptions->filename = currentPartitionBifOptions->GetOutputFileFromBifSection(options.GetOutputFileNames().front(), (yysemantic_stack_[(3) - (3)].string), currentImageBifOptions->GetImageType()); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } break; - case 138: + case 142: /* Line 670 of lalr1.cc */ -#line 444 "../s/bif.y" +#line 455 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[bootvectors] only supported in ZYNQMP architecture"); currentBifOptions->SetBootVectorArray((yysemantic_stack_[(1) - (1)].number)); } break; - case 139: + case 143: /* Line 670 of lalr1.cc */ -#line 449 "../s/bif.y" +#line 460 "../s/bif.y" { currentPartitionBifOptions->SetAuthBlockAttr((yysemantic_stack_[(1) - (1)].number)); } break; - case 140: + case 144: /* Line 670 of lalr1.cc */ -#line 451 "../s/bif.y" +#line 462 "../s/bif.y" { currentPartitionBifOptions->bootloader = true;} break; - case 141: + case 145: /* Line 670 of lalr1.cc */ -#line 452 "../s/bif.y" +#line 463 "../s/bif.y" { currentPartitionBifOptions->boot = true;} break; - case 142: + case 146: /* Line 670 of lalr1.cc */ -#line 453 "../s/bif.y" +#line 464 "../s/bif.y" { currentPartitionBifOptions->user = true;} break; - case 143: + case 147: /* Line 670 of lalr1.cc */ -#line 454 "../s/bif.y" +#line 465 "../s/bif.y" { currentPartitionBifOptions->Static = true;} break; - case 144: + case 148: /* Line 670 of lalr1.cc */ -#line 455 "../s/bif.y" +#line 466 "../s/bif.y" { currentPartitionBifOptions->noautostart = true;} break; - case 145: + case 149: /* Line 670 of lalr1.cc */ -#line 456 "../s/bif.y" +#line 467 "../s/bif.y" { currentPartitionBifOptions->multiboot = true;} break; - case 146: + case 150: /* Line 670 of lalr1.cc */ -#line 457 "../s/bif.y" +#line 468 "../s/bif.y" { currentPartitionBifOptions->Protected = true;} break; - case 147: + case 151: /* Line 670 of lalr1.cc */ -#line 458 "../s/bif.y" +#line 469 "../s/bif.y" { currentPartitionBifOptions->SetEarlyHandoff(true); } break; - case 148: + case 152: /* Line 670 of lalr1.cc */ -#line 459 "../s/bif.y" +#line 470 "../s/bif.y" { currentPartitionBifOptions->SetHivec(true); } break; - case 149: + case 153: /* Line 670 of lalr1.cc */ -#line 460 "../s/bif.y" +#line 471 "../s/bif.y" { if(currentPartitionBifOptions->bootloader!=true) LOG_ERROR("XIP mode can be enabled only for bootloader"); currentBifOptions->SetXipMode(); } break; - case 150: + case 154: /* Line 670 of lalr1.cc */ -#line 463 "../s/bif.y" +#line 474 "../s/bif.y" { currentPartitionBifOptions->fileType = (yysemantic_stack_[(1) - (1)].number); } break; - case 151: + case 155: /* Line 670 of lalr1.cc */ -#line 464 "../s/bif.y" +#line 475 "../s/bif.y" { currentPartitionBifOptions->bootImage = true; } break; - case 152: + case 156: /* Line 670 of lalr1.cc */ -#line 465 "../s/bif.y" +#line 476 "../s/bif.y" { currentPartitionBifOptions->fileType = (yysemantic_stack_[(1) - (1)].number); } break; - case 153: + case 157: /* Line 670 of lalr1.cc */ -#line 466 "../s/bif.y" +#line 477 "../s/bif.y" { currentPartitionBifOptions->fileType = (yysemantic_stack_[(1) - (1)].number); } break; - case 154: + case 158: /* Line 670 of lalr1.cc */ -#line 467 "../s/bif.y" +#line 478 "../s/bif.y" { currentPartitionBifOptions->SetPartitionType((yysemantic_stack_[(1) - (1)].ptype_t)); } break; - case 155: + case 159: /* Line 670 of lalr1.cc */ -#line 470 "../s/bif.y" +#line 479 "../s/bif.y" + { currentPartitionBifOptions->SetLockStepFlag();} + break; + + case 160: +/* Line 670 of lalr1.cc */ +#line 482 "../s/bif.y" { currentPartitionBifOptions->SetTrustZone(::TrustZone::Secure); } break; - case 156: + case 161: /* Line 670 of lalr1.cc */ -#line 471 "../s/bif.y" +#line 483 "../s/bif.y" { currentPartitionBifOptions->SetTrustZone((yysemantic_stack_[(3) - (3)].trustzone_t)); } break; - case 157: + case 162: /* Line 670 of lalr1.cc */ -#line 474 "../s/bif.y" +#line 486 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(1) - (1)].number)); } break; - case 158: + case 163: /* Line 670 of lalr1.cc */ -#line 475 "../s/bif.y" +#line 487 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(4) - (1)].number), (yysemantic_stack_[(4) - (3)].number)); } break; - case 159: + case 164: /* Line 670 of lalr1.cc */ -#line 476 "../s/bif.y" +#line 488 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionBlocks((yysemantic_stack_[(4) - (1)].number), 0); } break; - case 160: + case 165: /* Line 670 of lalr1.cc */ -#line 478 "../s/bif.y" +#line 490 "../s/bif.y" { currentPartitionBifOptions->SetAuthType((yysemantic_stack_[(3) - (3)].authvalue_t)); } break; - case 161: + case 166: /* Line 670 of lalr1.cc */ -#line 479 "../s/bif.y" +#line 491 "../s/bif.y" { currentPartitionBifOptions->SetEncryptType((yysemantic_stack_[(3) - (3)].encrvalue_t)); } break; - case 162: + case 167: /* Line 670 of lalr1.cc */ -#line 480 "../s/bif.y" +#line 492 "../s/bif.y" { currentPartitionBifOptions->SetChecksumType((yysemantic_stack_[(3) - (3)].checksumvalue_t)); } break; - case 163: + case 168: /* Line 670 of lalr1.cc */ -#line 481 "../s/bif.y" +#line 493 "../s/bif.y" { currentPartitionBifOptions->SetOwnerType((yysemantic_stack_[(3) - (3)].powner_t)); } break; - case 164: + case 169: /* Line 670 of lalr1.cc */ -#line 482 "../s/bif.y" +#line 494 "../s/bif.y" { currentPartitionBifOptions->SetDestCpu((yysemantic_stack_[(3) - (3)].destcpu_t)); } break; - case 165: + case 170: /* Line 670 of lalr1.cc */ -#line 483 "../s/bif.y" +#line 495 "../s/bif.y" { currentPartitionBifOptions->SetDestDevice((yysemantic_stack_[(3) - (3)].destdevice_t)); } break; - case 166: + case 171: /* Line 670 of lalr1.cc */ -#line 484 "../s/bif.y" +#line 496 "../s/bif.y" { currentPartitionBifOptions->SetExceptionLevel((yysemantic_stack_[(3) - (3)].el_t)); } break; - case 167: + case 172: /* Line 670 of lalr1.cc */ -#line 485 "../s/bif.y" +#line 497 "../s/bif.y" { currentPartitionBifOptions->SetAesKeyFile((yysemantic_stack_[(3) - (3)].string)); } break; - case 168: + case 173: /* Line 670 of lalr1.cc */ -#line 486 "../s/bif.y" +#line 498 "../s/bif.y" { currentPartitionBifOptions->ppkFile = ((yysemantic_stack_[(3) - (3)].string)); } break; - case 169: + case 174: /* Line 670 of lalr1.cc */ -#line 487 "../s/bif.y" +#line 499 "../s/bif.y" { currentPartitionBifOptions->pskFile = ((yysemantic_stack_[(3) - (3)].string)); } break; - case 170: + case 175: /* Line 670 of lalr1.cc */ -#line 488 "../s/bif.y" +#line 500 "../s/bif.y" { currentPartitionBifOptions->spkFile = ((yysemantic_stack_[(3) - (3)].string)); } break; - case 171: + case 176: /* Line 670 of lalr1.cc */ -#line 489 "../s/bif.y" +#line 501 "../s/bif.y" { currentPartitionBifOptions->sskFile = ((yysemantic_stack_[(3) - (3)].string)); } break; - case 172: + case 177: /* Line 670 of lalr1.cc */ -#line 490 "../s/bif.y" +#line 502 "../s/bif.y" { currentPartitionBifOptions->spkSelect =((yysemantic_stack_[(3) - (3)].spkselect_t)); currentPartitionBifOptions->spkSelLocal = true; } break; - case 173: + case 178: /* Line 670 of lalr1.cc */ -#line 491 "../s/bif.y" +#line 503 "../s/bif.y" { currentPartitionBifOptions->SetSpkId((yysemantic_stack_[(3) - (3)].number)); } break; - case 174: + case 179: /* Line 670 of lalr1.cc */ -#line 492 "../s/bif.y" +#line 504 "../s/bif.y" { currentPartitionBifOptions->spkSignatureFile = ((yysemantic_stack_[(3) - (3)].string)); } break; - case 176: + case 181: /* Line 670 of lalr1.cc */ -#line 494 "../s/bif.y" +#line 506 "../s/bif.y" { currentPartitionBifOptions->SetPartitionType((yysemantic_stack_[(3) - (3)].ptype_t)); } break; - case 177: + case 182: /* Line 670 of lalr1.cc */ -#line 495 "../s/bif.y" +#line 507 "../s/bif.y" { currentPartitionBifOptions->SetEncryptionKeySource((yysemantic_stack_[(3) - (3)].encrkeysrc_t)); } break; - case 178: + case 183: /* Line 670 of lalr1.cc */ -#line 496 "../s/bif.y" +#line 508 "../s/bif.y" { currentPartitionBifOptions->SetRevokeId((yysemantic_stack_[(3) - (3)].number)); } break; - case 179: + case 184: /* Line 670 of lalr1.cc */ -#line 497 "../s/bif.y" +#line 509 "../s/bif.y" { currentPartitionBifOptions->SetDpaCM(DpaCM::DpaCMEnable); } break; - case 180: + case 185: /* Line 670 of lalr1.cc */ -#line 498 "../s/bif.y" +#line 510 "../s/bif.y" { currentPartitionBifOptions->SetSlrNum((yysemantic_stack_[(3) - (3)].number)); } break; - case 181: + case 186: /* Line 670 of lalr1.cc */ -#line 499 "../s/bif.y" - { currentPartitionBifOptions->SetPufHdLocation(PufHdLoc::PUFinBH); } +#line 511 "../s/bif.y" + { currentPartitionBifOptions->SetClusterNum((yysemantic_stack_[(3) - (3)].number)); } break; - case 190: + case 187: /* Line 670 of lalr1.cc */ #line 512 "../s/bif.y" + { currentPartitionBifOptions->SetPufHdLocation(PufHdLoc::PUFinBH); } + break; + + case 188: +/* Line 670 of lalr1.cc */ +#line 513 "../s/bif.y" + { currentPartitionBifOptions->SetDelayAuth(true); } + break; + + case 197: +/* Line 670 of lalr1.cc */ +#line 526 "../s/bif.y" { (yyval.authvalue_t) = ::Authentication::None;} break; - case 192: + case 199: /* Line 670 of lalr1.cc */ -#line 516 "../s/bif.y" +#line 530 "../s/bif.y" { (yyval.encrvalue_t) = ::Encryption::None;} break; - case 194: + case 201: /* Line 670 of lalr1.cc */ -#line 520 "../s/bif.y" +#line 534 "../s/bif.y" { (yyval.checksumvalue_t) = ::Checksum::None;} break; - case 211: + case 218: /* Line 670 of lalr1.cc */ -#line 569 "../s/bif.y" +#line 583 "../s/bif.y" { currentPartitionBifOptions->alignment = (yysemantic_stack_[(3) - (3)].number); } break; - case 212: + case 219: /* Line 670 of lalr1.cc */ -#line 570 "../s/bif.y" +#line 584 "../s/bif.y" { currentPartitionBifOptions->offset = (yysemantic_stack_[(3) - (3)].number); } break; - case 213: + case 220: /* Line 670 of lalr1.cc */ -#line 571 "../s/bif.y" +#line 585 "../s/bif.y" { currentPartitionBifOptions->SetReserveLength((yysemantic_stack_[(3) - (3)].number), false); } break; - case 214: + case 221: /* Line 670 of lalr1.cc */ -#line 572 "../s/bif.y" +#line 586 "../s/bif.y" { currentPartitionBifOptions->SetReserveLength((yysemantic_stack_[(3) - (3)].number), true); } break; - case 215: + case 222: /* Line 670 of lalr1.cc */ -#line 573 "../s/bif.y" +#line 587 "../s/bif.y" { currentPartitionBifOptions->load = (yysemantic_stack_[(3) - (3)].number); } break; - case 216: + case 223: /* Line 670 of lalr1.cc */ -#line 574 "../s/bif.y" +#line 588 "../s/bif.y" { currentPartitionBifOptions->startup = (yysemantic_stack_[(3) - (3)].number); } break; - case 217: + case 224: /* Line 670 of lalr1.cc */ -#line 575 "../s/bif.y" +#line 589 "../s/bif.y" { currentPartitionBifOptions->bigEndian = true; } break; - case 218: + case 225: /* Line 670 of lalr1.cc */ -#line 576 "../s/bif.y" +#line 590 "../s/bif.y" { currentPartitionBifOptions->a32Mode = true; } break; - case 219: + case 226: /* Line 670 of lalr1.cc */ -#line 577 "../s/bif.y" +#line 591 "../s/bif.y" { currentPartitionBifOptions->pid = (yysemantic_stack_[(3) - (3)].number); } break; - case 220: + case 227: /* Line 670 of lalr1.cc */ -#line 580 "../s/bif.y" +#line 594 "../s/bif.y" { currentPartitionBifOptions->presignFile = (yysemantic_stack_[(3) - (3)].string); } break; - case 221: + case 228: /* Line 670 of lalr1.cc */ -#line 581 "../s/bif.y" +#line 595 "../s/bif.y" { currentPartitionBifOptions->SetUdfDataFile((yysemantic_stack_[(3) - (3)].string)); } break; - case 238: + case 245: /* Line 670 of lalr1.cc */ -#line 606 "../s/bif.y" +#line 620 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[auth_params] is supported only in ZYNQMP architecture"); currentBifOptions->SetPPKSelection((yysemantic_stack_[(3) - (3)].number)); } break; - case 239: + case 246: /* Line 670 of lalr1.cc */ -#line 609 "../s/bif.y" +#line 623 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[auth_params] is supported only in ZYNQMP architecture"); currentBifOptions->SetSPKSelection((yysemantic_stack_[(3) - (3)].spkselect_t)); } break; - case 240: + case 247: /* Line 670 of lalr1.cc */ -#line 612 "../s/bif.y" +#line 626 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_WARNING("BIF attribute error !!!\n\t\t[auth_params] is supported only in ZYNQMP architecture"); currentBifOptions->SetSpkId((yysemantic_stack_[(3) - (3)].number)); } break; - case 241: + case 248: /* Line 670 of lalr1.cc */ -#line 615 "../s/bif.y" +#line 629 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[auth_params] is supported only in ZYNQMP architecture"); currentBifOptions->SetHeaderAuthentication(); } break; - case 244: + case 251: /* Line 670 of lalr1.cc */ -#line 624 "../s/bif.y" +#line 638 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[split] not supported in ZYNQ architecture"); currentBifOptions->SetSplitMode((yysemantic_stack_[(3) - (3)].splitmode_t)); } break; - case 248: + case 255: /* Line 670 of lalr1.cc */ -#line 634 "../s/bif.y" +#line 648 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[split] not supported in ZYNQ architecture"); currentBifOptions->SetSplitFmt(File::MCS); } break; - case 249: + case 256: /* Line 670 of lalr1.cc */ -#line 637 "../s/bif.y" +#line 651 "../s/bif.y" { if(options.GetArchType() != Arch::ZYNQMP) LOG_ERROR("BIF attribute error !!!\n\t\t[split] not supported in ZYNQ architecture"); currentBifOptions->SetSplitFmt(File::BIN); } break; - case 254: + case 261: /* Line 670 of lalr1.cc */ -#line 649 "../s/bif.y" +#line 663 "../s/bif.y" { (yyval.number) = (yysemantic_stack_[(3) - (2)].number); } break; - case 256: + case 263: /* Line 670 of lalr1.cc */ -#line 656 "../s/bif.y" +#line 670 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(2) - (2)].number); *options.debugstr << (yyval.number) << " + " << (yysemantic_stack_[(2) - (2)].number) << std::endl;} break; - case 257: + case 264: /* Line 670 of lalr1.cc */ -#line 657 "../s/bif.y" +#line 671 "../s/bif.y" {(yyval.number) = ~(yysemantic_stack_[(2) - (2)].number); *options.debugstr << (yyval.number) << " ~ " << (yysemantic_stack_[(2) - (2)].number) << std::endl;} break; - case 259: + case 266: /* Line 670 of lalr1.cc */ -#line 662 "../s/bif.y" +#line 676 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) * (yysemantic_stack_[(3) - (3)].number); *options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " + " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 260: + case 267: /* Line 670 of lalr1.cc */ -#line 663 "../s/bif.y" +#line 677 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) / (yysemantic_stack_[(3) - (3)].number); *options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " / " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 261: + case 268: /* Line 670 of lalr1.cc */ -#line 664 "../s/bif.y" +#line 678 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) % (yysemantic_stack_[(3) - (3)].number); *options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " % " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 263: + case 270: /* Line 670 of lalr1.cc */ -#line 668 "../s/bif.y" +#line 682 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) + (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " + " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 264: + case 271: /* Line 670 of lalr1.cc */ -#line 669 "../s/bif.y" +#line 683 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) - (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " - " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 266: + case 273: /* Line 670 of lalr1.cc */ -#line 673 "../s/bif.y" +#line 687 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) << (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " << " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 267: + case 274: /* Line 670 of lalr1.cc */ -#line 674 "../s/bif.y" +#line 688 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) >> (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " >> " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 269: + case 276: /* Line 670 of lalr1.cc */ -#line 678 "../s/bif.y" +#line 692 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) & (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " & " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 271: + case 278: /* Line 670 of lalr1.cc */ -#line 682 "../s/bif.y" +#line 696 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) ^ (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " ^ " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; - case 273: + case 280: /* Line 670 of lalr1.cc */ -#line 687 "../s/bif.y" +#line 701 "../s/bif.y" {(yyval.number) = (yysemantic_stack_[(3) - (1)].number) | (yysemantic_stack_[(3) - (3)].number);*options.debugstr << (yyval.number) << " = " << (yysemantic_stack_[(3) - (1)].number) << " | " << (yysemantic_stack_[(3) - (3)].number) << std::endl;} break; /* Line 670 of lalr1.cc */ -#line 1375 "../bisonflex/bif.tab.cpp" +#line 1425 "../bisonflex/bif.tab.cpp" default: break; } @@ -1583,59 +1633,61 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const short int BisonParser::yypact_ninf_ = -380; + const short int BisonParser::yypact_ninf_ = -372; const short int BisonParser::yypact_[] = { - -380, 12, -62, -380, -380, -380, 28, 17, -380, 679, - -380, -380, 116, 108, 46, 71, 78, 88, 91, -380, - 96, -380, -380, 95, 100, 110, -380, -380, -380, -380, - -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, - -380, -380, -380, -380, -380, -380, -380, 68, -380, -380, - 65, -380, -380, -380, 134, -380, -380, -380, 492, 131, - 144, 152, -380, 162, 164, 616, -17, 77, 222, 222, - 222, -380, 222, 65, -380, 57, 171, -16, -380, -380, - -380, -380, 52, -380, -380, -380, -380, 204, 208, 209, - 214, 215, 216, 217, 218, 220, 221, 224, 225, 229, - 232, 233, 235, -380, -380, 238, 244, 245, -380, -380, - -380, -380, -380, -380, 247, 249, 250, 251, 258, 260, - 261, 266, 267, -380, -380, -380, -380, -380, 270, 272, - 273, 275, 276, 284, -380, -380, -380, 287, 13, 368, - -380, -380, -380, -380, -380, -380, -380, -380, -380, 77, - 222, 57, 243, 159, 145, 286, 294, 302, 303, -380, - 304, 305, -380, -380, -380, -380, 222, 222, 222, -380, - -380, 5, 6, 23, 183, 177, 186, 186, 186, -380, - 186, 176, -380, -380, -380, -380, -380, -380, 318, 319, - -380, -380, -380, -380, -380, -380, -380, -380, 327, 332, - -380, -380, -380, -380, -380, -380, -380, -380, 333, 336, - 337, 334, 49, -380, -42, -7, -69, 226, 754, 222, - 227, 213, 223, 230, 222, 222, 222, 222, 222, 222, - 222, 210, 222, 222, 222, 52, 280, 52, 222, 222, - 52, 57, 52, 52, 52, 52, 52, 52, -380, 492, - -380, 492, -380, -380, -380, 343, 186, -380, 171, 352, - 353, 356, -380, 355, 360, 361, 363, 252, 52, 616, - 222, -380, -17, -380, -380, -61, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 248, 365, 372, 387, - 401, 413, 417, 418, 420, 421, 422, 423, 424, 425, - -380, -380, 386, 136, 222, 222, -380, 171, 222, 357, - 222, -380, -16, -380, -380, -380, -380, -380, -380, -380, - -380, -380, -380, -380, -380, -380, -380, -380, 186, -380, - -380, -380, -380, -380, -380, -380, 186, 186, 186, 186, - 186, 186, 186, -380, -380, 186, -380, 426, -44, -380, - 186, -380, -380, -380, 186, 186, -380, -380, -380, -380, - -380, -380, -380, -380, -380, -380, 222, -380, 222, 222, - 210, 159, 298, 148, 145, -380, -380, -380, 186, -380, - -380, -380, -380, -380, 5, 5, 6, 6, 23, 183, - 177, -380, 427, 431, 432, 433, 434, 435, -380, -380, - 437, -380, 264, -380, -380, -42, -7, -69, 222, 222, - 52, 57, 52, 52, 52, 52, 52, 52, -380, 176, - -380, 186, 186, -380, 186, -380, 186, -380, 222, -65, - -380, 186, 186, -380, 355, -380, -380, -380, -380, -380, - 363, 252, 222, 222, 222, 222, 369, 222, 384, -380, - -380, -380, -380, 186, -380, 438, -43, -380, -380, -380, - -380, -380, -380, -380, -380, -380, -380, 295, -51, -380, - 186, 186, 186, 186, -380, 186, -380, 222, 127, -380, - -380, -380, 297, -47, -380, -380 + -372, 9, -4, -372, 44, -372, -372, 106, 58, -372, + -372, -372, 13, -372, 746, -372, -372, 114, 68, 100, + 85, 89, 93, 75, 107, -372, 136, 135, 162, 167, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, 144, -372, -372, 61, -372, -372, -372, 178, -372, + -372, -372, 550, 209, 211, 220, -372, 225, 226, 680, + 112, -20, 105, -11, -11, -11, -372, -11, 61, -372, + 115, 214, 19, -372, -372, -372, -372, 106, -372, -372, + -372, -372, -372, 237, 238, 240, 250, 251, 253, 255, + 257, 258, 261, 262, 265, 266, 269, 270, 271, -372, + -372, 276, 277, 278, -372, -372, -372, -372, -372, -372, + 279, 282, 288, 290, 296, 297, 298, 299, -372, 301, + 305, -372, -372, -372, -372, -372, 307, 311, 312, 315, + 316, 318, -372, -372, -372, 321, 8, 420, -372, -372, + -372, -372, -372, -372, -372, -372, -372, 105, -11, 115, + 319, 157, 113, 320, 325, 332, -372, 333, -372, 334, + 335, -372, -372, -372, -372, -11, -11, -11, -372, -372, + 59, 63, 57, 121, 197, 206, 206, 206, -372, 206, + 182, -372, -372, -372, -372, -372, -372, -372, 344, 345, + 346, -372, -372, -372, -372, -372, -372, -372, -372, 349, + 351, -372, -372, -372, -372, -372, -372, -372, -372, 348, + 352, 355, 353, 43, -372, 76, -35, -51, 246, 826, + -11, 229, 235, 236, 234, -11, -11, -11, -11, -11, + -11, -11, 233, -11, -11, -11, 106, 302, 106, -11, + -11, -11, 106, 115, 106, 106, 106, 106, 106, 106, + -372, 550, -372, 550, -372, -372, -372, 371, 206, -372, + 214, 372, 373, 376, -372, 368, 378, 379, 381, 112, + 106, 680, -11, -372, -20, -372, -372, -136, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, 79, 382, + 383, 384, 385, 386, 387, 392, 394, 395, 396, 397, + 398, 399, -372, -372, 402, 174, -11, -11, -11, -372, + 214, -11, 326, -11, -372, 19, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, 206, -372, -372, -372, -372, -372, -372, -372, 206, + 206, 206, 206, 206, 206, 206, -372, -372, 206, -372, + 400, -50, -372, 206, -372, -372, -372, 206, 206, 206, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -11, -372, -11, -11, 233, 157, 267, 161, 113, -372, + -372, -372, 206, -372, -372, -372, -372, -372, 59, 59, + 63, 63, 57, 121, 197, -372, 404, 405, 406, 407, + 408, 409, -372, -372, 410, -372, 260, -372, -372, 76, + -35, -51, -11, -11, 106, 115, 106, 106, 106, 106, + 106, 106, -372, 182, -372, 206, 206, 206, -372, 206, + -372, 206, -372, -11, 15, -372, 206, 206, -372, 368, + -372, -372, -372, -372, -372, 381, 112, -11, -11, -11, + -11, 337, -11, 295, -372, -372, -372, -372, 206, -372, + 417, -49, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, 272, -73, -372, 206, 206, 206, 206, -372, + 206, -372, -11, 72, -372, -372, -372, 273, -57, -372, + -372 }; /* YYDEFACT[S] -- default reduction number in state S. Performed when @@ -1644,85 +1696,87 @@ const unsigned short int BisonParser::yydefact_[] = { - 3, 0, 2, 1, 5, 4, 0, 0, 7, 0, - 112, 6, 109, 0, 0, 0, 0, 0, 0, 69, - 0, 250, 251, 0, 0, 0, 228, 227, 229, 184, - 185, 186, 187, 188, 189, 182, 222, 230, 231, 232, - 233, 234, 224, 225, 226, 11, 12, 10, 47, 14, - 68, 9, 8, 13, 0, 183, 223, 111, 0, 0, - 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, - 0, 49, 0, 67, 15, 0, 0, 0, 48, 109, - 70, 71, 0, 140, 149, 147, 148, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, - 0, 0, 0, 217, 218, 0, 0, 0, 141, 142, - 143, 144, 145, 146, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 236, 151, 237, 150, 235, 222, 231, - 232, 233, 234, 224, 197, 181, 179, 0, 115, 114, - 131, 127, 175, 128, 154, 129, 130, 152, 153, 0, - 0, 0, 0, 0, 0, 0, 0, 125, 0, 207, - 0, 83, 85, 78, 253, 252, 0, 0, 0, 255, - 258, 262, 265, 268, 270, 272, 42, 43, 44, 51, - 41, 20, 198, 46, 106, 107, 108, 102, 0, 0, - 199, 200, 202, 203, 204, 205, 206, 201, 0, 87, - 95, 96, 104, 97, 98, 99, 101, 100, 0, 0, - 0, 0, 89, 45, 0, 0, 0, 0, 0, 0, + 3, 0, 2, 1, 0, 6, 4, 0, 0, 257, + 258, 5, 0, 8, 0, 116, 7, 113, 0, 0, + 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, + 235, 234, 236, 191, 192, 193, 194, 195, 196, 189, + 229, 237, 238, 239, 240, 241, 231, 232, 233, 12, + 13, 11, 49, 15, 70, 10, 9, 14, 0, 190, + 230, 115, 0, 0, 0, 0, 75, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 0, 69, 16, + 0, 0, 0, 50, 113, 72, 73, 0, 144, 153, + 151, 152, 159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 160, 0, 0, 0, 0, 0, 0, 224, + 225, 0, 0, 0, 145, 146, 147, 148, 149, 150, + 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, + 0, 243, 155, 244, 154, 242, 229, 238, 239, 240, + 241, 231, 204, 187, 184, 0, 119, 118, 135, 131, + 180, 132, 158, 133, 134, 156, 157, 0, 0, 0, + 0, 0, 0, 0, 0, 129, 48, 0, 214, 0, + 85, 87, 80, 260, 259, 0, 0, 0, 262, 265, + 269, 272, 275, 277, 279, 43, 44, 45, 53, 42, + 21, 205, 47, 112, 108, 109, 110, 104, 0, 0, + 0, 206, 207, 209, 210, 211, 212, 213, 208, 0, + 89, 97, 98, 106, 99, 100, 101, 103, 102, 0, + 0, 0, 0, 91, 46, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, - 118, 0, 119, 77, 81, 136, 138, 72, 0, 0, - 0, 0, 241, 79, 0, 0, 80, 0, 0, 0, - 0, 76, 0, 256, 257, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 117, 0, 122, 0, 123, 79, 83, 140, 142, 74, + 0, 0, 0, 0, 248, 81, 0, 0, 82, 0, + 0, 0, 0, 78, 0, 263, 264, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 35, 33, 0, 17, 0, 0, 75, 0, 0, 0, - 0, 82, 0, 91, 190, 191, 160, 192, 193, 161, - 194, 195, 162, 196, 163, 123, 122, 154, 219, 209, - 165, 208, 164, 210, 166, 156, 211, 212, 213, 214, - 215, 216, 173, 243, 172, 178, 132, 134, 157, 133, - 139, 220, 124, 221, 180, 121, 120, 177, 167, 168, - 169, 170, 171, 174, 116, 117, 0, 74, 0, 0, - 0, 0, 0, 0, 0, 176, 110, 126, 86, 84, - 254, 259, 260, 261, 263, 264, 266, 267, 269, 271, - 273, 50, 0, 0, 0, 0, 0, 0, 60, 61, - 0, 52, 55, 54, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 20, - 19, 103, 105, 88, 92, 93, 94, 90, 0, 0, - 137, 238, 240, 239, 242, 247, 244, 248, 249, 245, - 246, 0, 0, 0, 0, 0, 0, 0, 0, 57, - 24, 21, 32, 31, 34, 36, 38, 30, 22, 23, - 25, 26, 27, 28, 29, 18, 135, 0, 0, 63, - 64, 65, 66, 58, 59, 62, 56, 0, 0, 159, - 158, 37, 0, 0, 40, 39 + 0, 0, 36, 34, 0, 18, 0, 0, 0, 77, + 0, 0, 0, 0, 84, 0, 93, 197, 198, 165, + 199, 200, 166, 201, 202, 167, 203, 168, 127, 126, + 158, 226, 216, 170, 215, 169, 217, 171, 161, 218, + 219, 220, 221, 222, 223, 178, 250, 177, 183, 136, + 138, 162, 137, 143, 227, 128, 228, 185, 186, 125, + 124, 182, 172, 173, 174, 175, 176, 179, 120, 121, + 0, 76, 0, 0, 0, 0, 0, 0, 0, 181, + 114, 130, 88, 86, 261, 266, 267, 268, 270, 271, + 273, 274, 276, 278, 280, 52, 0, 0, 0, 0, + 0, 0, 62, 63, 0, 54, 57, 56, 55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 21, 20, 111, 105, 107, 90, 94, + 95, 96, 92, 0, 0, 141, 245, 247, 246, 249, + 254, 251, 255, 256, 252, 253, 0, 0, 0, 0, + 0, 0, 0, 0, 59, 25, 22, 33, 32, 35, + 37, 39, 31, 23, 24, 26, 27, 28, 29, 30, + 19, 139, 0, 0, 65, 66, 67, 68, 60, 61, + 64, 58, 0, 0, 164, 163, 38, 0, 0, 41, + 40 }; /* YYPGOTO[NTERM-NUM]. */ const short int BisonParser::yypgoto_[] = { - -380, -380, -380, -380, -380, -380, -380, -380, -290, -380, - -20, -380, -380, -380, 411, -380, -380, -379, -380, 173, - 441, -380, -380, 192, -380, -243, -203, -380, -380, -6, - -380, 456, -380, -117, -380, 197, -58, -380, 39, 102, - -380, -380, 268, -380, -380, -380, -380, 64, 79, 80, - -380, -212, -146, -380, -380, -380, -380, -380, -380, -380, - -380, -57, -380, -380, -380, -380, -380, 475, -380, -380, - 118, 120, 117, -380, -380, -63, -380, -87, -67, -64, - 212, 259, 207, -68 + -372, -372, -372, -372, -372, -372, -372, -372, -300, -372, + -61, -372, -372, -372, 411, -372, -372, -371, -372, 145, + 421, -372, -372, 173, -372, -239, -215, -372, -372, -12, + -372, 446, -372, -78, -372, 191, -65, -372, 20, 96, + -372, -372, 248, -372, -372, -372, -372, 62, 60, 64, + -372, -69, -156, -372, -372, -372, -372, -372, -372, -372, + -372, -67, -372, -372, -372, -372, -372, 468, -372, -372, + 98, 102, 99, -372, -372, -7, -372, -158, -62, -60, + 189, 192, 193, -63 }; /* YYDEFGOTO[NTERM-NUM]. */ const short int BisonParser::yydefgoto_[] = { - -1, 1, 2, 5, 6, 9, 45, 181, 302, 303, - 454, 455, 46, 47, 48, 179, 286, 401, 402, 49, - 50, 51, 152, 160, 161, 198, 211, 212, 199, 80, - 65, 81, 58, 137, 138, 156, 139, 140, 346, 254, - 255, 349, 141, 142, 347, 143, 54, 316, 319, 322, - 324, 144, 183, 200, 201, 202, 203, 204, 205, 206, - 207, 162, 332, 330, 334, 145, 146, 147, 56, 148, - 263, 344, 266, 436, 439, 57, 169, 170, 171, 172, - 173, 174, 175, 256 + -1, 1, 2, 6, 8, 14, 49, 190, 314, 315, + 469, 470, 50, 51, 52, 188, 298, 415, 416, 53, + 54, 55, 160, 169, 170, 209, 222, 223, 210, 85, + 69, 86, 62, 145, 146, 164, 147, 148, 359, 266, + 267, 362, 149, 150, 360, 151, 58, 329, 332, 335, + 337, 152, 192, 211, 212, 213, 214, 215, 216, 217, + 218, 171, 345, 343, 347, 153, 154, 155, 60, 156, + 275, 357, 278, 451, 454, 61, 178, 179, 180, 181, + 182, 183, 184, 268 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1732,188 +1786,204 @@ const unsigned short int BisonParser::yytable_[] = { - 176, 177, 178, 52, 180, 257, 327, 157, 158, 313, - 163, 320, 3, 420, 4, 367, 164, 165, 249, 213, - 8, 250, 252, 449, 208, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 7, 93, 94, 314, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 321, - 105, 106, 68, 107, 312, 375, 108, 109, 110, 111, - 112, 113, 114, 115, 423, 116, 117, 118, 10, 476, - 119, 209, 210, 317, 315, 79, 285, 69, 166, 273, - 274, 120, 167, 168, 70, 467, 285, 121, 380, 208, - 285, 71, 253, 285, 285, 357, 122, 72, 480, 74, - 275, 75, 485, 76, 429, 478, 26, 27, 28, 427, - 318, 66, 159, 77, 67, 123, 124, 125, 126, 127, - 128, 37, 129, 130, 131, 132, 133, 43, 44, 465, - 21, 22, 364, 134, 365, 17, 209, 210, 59, 135, - 82, 419, 149, 21, 22, 276, 277, 278, 136, 279, - 280, 328, 287, 288, 289, 150, 336, 337, 338, 339, - 340, 341, 342, 151, 345, 348, 350, 60, 281, 282, - 354, 355, 351, 153, 353, 154, 290, 356, 182, 358, - 359, 360, 361, 362, 363, 291, 264, 265, 292, 381, - 382, 383, 287, 288, 289, 259, 260, 261, 262, 61, - 62, 63, 378, 437, 438, 376, 159, 64, 164, 165, - 214, 157, 384, 385, 215, 216, 290, 386, 387, 293, - 217, 218, 219, 220, 221, 291, 222, 223, 292, 469, - 224, 225, 184, 185, 186, 226, 421, 422, 227, 228, - 424, 229, 426, 294, 230, 295, 296, 297, 298, 299, - 231, 232, 391, 233, 258, 234, 235, 236, 79, 293, - 187, 188, 300, 189, 237, 458, 238, 239, 392, 448, - 166, 301, 240, 241, 167, 168, 242, 482, 243, 244, - 404, 245, 246, 294, 392, 295, 296, 297, 298, 299, - 247, 248, 267, 190, 191, 192, 193, 194, 195, 196, - 431, 432, 300, 164, 165, 268, 197, 269, 271, 270, - 272, 301, 393, 394, 395, 284, 396, 397, 398, 399, - 400, 19, 283, 285, 304, 305, 21, 22, 393, 394, - 395, 306, 396, 397, 398, 399, 400, 307, 311, 308, - 453, 456, 309, 310, 331, 323, 343, 457, 366, 459, - 460, 461, 462, 463, 464, 333, 352, 329, 368, 369, - 348, 468, 370, 335, 371, 166, 372, 373, 374, 167, - 168, 405, 134, 251, 470, 471, 472, 473, 406, 475, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 418, 93, 94, 407, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 392, 105, 106, 408, 107, 456, - 483, 108, 109, 110, 111, 112, 113, 114, 115, 409, - 116, 117, 118, 410, 411, 119, 412, 413, 414, 415, - 416, 417, 435, 441, 425, 428, 120, 442, 443, 444, - 445, 446, 121, 447, 479, 474, 484, 477, 393, 394, - 395, 122, 396, 397, 398, 399, 400, 481, 78, 403, - 73, 26, 27, 28, 379, 53, 377, 466, 430, 450, - 123, 124, 125, 126, 127, 128, 37, 129, 130, 131, - 132, 133, 43, 44, 55, 451, 326, 452, 134, 434, - 433, 440, 390, 0, 135, 388, 0, 0, 0, 0, - 0, 0, 0, 136, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 0, 93, 94, 0, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 0, 105, - 106, 0, 107, 0, 0, 108, 109, 110, 111, 112, - 113, 114, 115, 389, 116, 117, 118, 0, 0, 119, + 11, 166, 56, 269, 165, 172, 167, 297, 326, 3, + 185, 186, 187, 261, 189, 434, 13, 285, 286, 394, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 381, 99, 100, 333, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 464, 111, 112, 325, 113, + 330, 7, 114, 115, 116, 117, 118, 119, 120, 121, + 219, 122, 123, 124, 15, 12, 125, 126, 262, 264, + 297, 84, 4, 334, 70, 173, 174, 5, 76, 127, + 224, 438, 495, 405, 219, 128, 297, 129, 331, 84, + 265, 73, 491, 297, 297, 74, 130, 371, 500, 75, + 406, 173, 174, 71, 444, 493, 72, 30, 31, 32, + 442, 220, 221, 77, 287, 168, 131, 132, 133, 134, + 135, 136, 41, 137, 138, 139, 140, 141, 47, 48, + 395, 396, 397, 480, 142, 220, 221, 63, 175, 79, + 143, 80, 176, 177, 9, 10, 407, 408, 409, 144, + 410, 411, 412, 413, 414, 276, 277, 25, 173, 174, + 340, 327, 9, 10, 175, 81, 64, 341, 176, 177, + 82, 482, 349, 350, 351, 352, 353, 354, 355, 433, + 358, 361, 363, 378, 87, 379, 367, 368, 369, 9, + 10, 299, 300, 301, 271, 272, 273, 274, 328, 299, + 300, 301, 65, 66, 67, 288, 289, 290, 293, 294, + 389, 68, 291, 292, 23, 302, 165, 452, 453, 392, + 157, 175, 158, 302, 303, 176, 177, 304, 497, 398, + 399, 159, 303, 400, 401, 304, 161, 162, 142, 364, + 168, 366, 191, 225, 226, 370, 227, 372, 373, 374, + 375, 376, 377, 435, 436, 437, 228, 229, 439, 230, + 441, 231, 305, 232, 233, 463, 295, 234, 235, 473, + 305, 236, 237, 390, 193, 238, 239, 240, 194, 195, + 196, 406, 241, 242, 243, 244, 418, 306, 245, 307, + 308, 309, 310, 311, 246, 306, 247, 307, 308, 309, + 310, 311, 248, 249, 250, 251, 312, 252, 197, 198, + 199, 253, 200, 254, 312, 313, 406, 255, 256, 446, + 447, 257, 258, 313, 259, 260, 279, 407, 408, 409, + 270, 410, 411, 412, 413, 414, 280, 281, 283, 282, + 284, 296, 201, 202, 203, 204, 205, 206, 207, 297, + 316, 317, 318, 319, 321, 208, 320, 324, 322, 468, + 471, 323, 407, 408, 409, 342, 410, 411, 412, 413, + 414, 336, 344, 348, 346, 356, 380, 385, 382, 383, + 361, 483, 384, 365, 386, 387, 388, 484, 419, 420, + 421, 422, 423, 424, 485, 486, 487, 488, 425, 490, + 426, 427, 428, 429, 430, 431, 432, 450, 440, 443, + 456, 457, 458, 459, 460, 461, 462, 472, 489, 474, + 475, 476, 477, 478, 479, 263, 492, 494, 499, 471, + 498, 496, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 417, 99, 100, 78, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 393, 111, 112, + 57, 113, 83, 481, 114, 115, 116, 117, 118, 119, + 120, 121, 391, 122, 123, 124, 445, 339, 125, 126, + 466, 465, 59, 449, 402, 467, 448, 455, 403, 0, + 404, 127, 0, 0, 0, 0, 0, 128, 0, 129, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 32, 0, 0, 0, 0, 0, 0, 131, 132, + 133, 134, 135, 136, 41, 137, 138, 139, 140, 141, + 47, 48, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, + 0, 144, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 0, 99, 100, 0, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, + 0, 113, 0, 0, 114, 115, 116, 117, 118, 119, + 120, 121, 0, 122, 123, 124, 0, 0, 125, 126, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 127, 0, 0, 0, 0, 0, 128, 0, 129, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 32, 0, 0, 0, 0, 0, 0, 131, 132, + 133, 134, 135, 136, 41, 137, 138, 139, 140, 141, + 47, 48, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, + 0, 144, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 163, 98, 0, 99, 100, 0, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, + 0, 113, 0, 0, 114, 115, 116, 117, 118, 119, + 120, 121, 0, 122, 0, 124, 0, 0, 125, 126, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 16, 0, 0, 0, 0, 0, 17, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 130, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 32, 0, 0, 0, 0, 0, 0, 131, 132, + 133, 134, 135, 136, 41, 137, 138, 139, 140, 141, + 47, 48, 0, 0, 0, 0, 142, 20, 21, 22, + 0, 0, 143, 0, 0, 0, 23, 24, 0, 0, + 0, 144, 0, 0, 25, 0, 26, 0, 0, 9, + 10, 0, 0, 0, 27, 28, 0, 29, 88, 89, + 90, 91, 92, 0, 0, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 0, 0, 0, 39, 0, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, + 114, 115, 116, 117, 118, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 120, 0, 0, 0, 0, 0, 121, 0, 0, 0, - 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 27, 28, 0, 0, - 0, 0, 0, 0, 123, 124, 125, 126, 127, 128, - 37, 129, 130, 131, 132, 133, 43, 44, 0, 0, - 0, 0, 134, 0, 0, 0, 0, 0, 135, 0, - 0, 0, 0, 0, 0, 0, 0, 136, 83, 84, - 85, 86, 87, 88, 89, 90, 155, 92, 0, 93, - 94, 0, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 0, 105, 106, 0, 107, 0, 0, 108, - 109, 110, 111, 112, 113, 114, 115, 0, 116, 0, - 118, 0, 0, 119, 0, 0, 0, 0, 0, 0, - 0, 0, 10, 11, 0, 0, 0, 0, 0, 12, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 123, 124, - 125, 126, 127, 128, 37, 129, 130, 131, 132, 133, - 43, 44, 0, 0, 0, 0, 134, 14, 15, 16, - 0, 0, 135, 0, 0, 0, 17, 18, 0, 0, - 0, 136, 19, 0, 20, 0, 0, 21, 22, 0, - 0, 0, 23, 24, 0, 25, 83, 84, 85, 86, - 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 0, 0, 0, 35, 0, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 0, 0, 108, 109, 110, - 111, 112, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, - 0, 0, 0, 0, 0, 0, 325, 124, 125, 126, - 127, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 0, 0, 0, 134 + 0, 0, 0, 0, 0, 30, 31, 32, 0, 0, + 0, 0, 0, 0, 338, 132, 133, 134, 135, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, + 0, 0, 142 }; /* YYCHECK. */ const short int BisonParser::yycheck_[] = { - 68, 69, 70, 9, 72, 151, 218, 65, 25, 212, - 67, 80, 0, 303, 76, 258, 81, 82, 5, 82, - 3, 138, 139, 402, 40, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 7, 23, 24, 80, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 118, - 37, 38, 6, 40, 5, 267, 43, 44, 45, 46, - 47, 48, 49, 50, 307, 52, 53, 54, 3, 448, - 57, 87, 88, 80, 116, 10, 137, 6, 143, 166, - 167, 68, 147, 148, 6, 150, 137, 74, 149, 40, - 137, 3, 149, 137, 137, 241, 83, 6, 149, 3, - 168, 6, 149, 3, 148, 148, 93, 94, 95, 312, - 117, 3, 129, 3, 6, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 419, - 78, 79, 249, 120, 251, 67, 87, 88, 22, 126, - 6, 5, 11, 78, 79, 140, 141, 142, 135, 143, - 144, 219, 16, 17, 18, 11, 224, 225, 226, 227, - 228, 229, 230, 11, 232, 233, 234, 51, 145, 146, - 238, 239, 235, 11, 237, 11, 40, 240, 121, 242, - 243, 244, 245, 246, 247, 49, 41, 42, 52, 276, - 277, 278, 16, 17, 18, 36, 37, 38, 39, 83, - 84, 85, 270, 55, 56, 268, 129, 91, 81, 82, - 6, 269, 279, 280, 6, 6, 40, 281, 282, 83, - 6, 6, 6, 6, 6, 49, 6, 6, 52, 441, - 6, 6, 61, 62, 63, 6, 304, 305, 6, 6, - 308, 6, 310, 107, 6, 109, 110, 111, 112, 113, - 6, 6, 4, 6, 11, 6, 6, 6, 10, 83, - 89, 90, 126, 92, 6, 411, 6, 6, 20, 5, - 143, 135, 6, 6, 147, 148, 6, 150, 6, 6, - 286, 6, 6, 107, 20, 109, 110, 111, 112, 113, - 6, 4, 6, 122, 123, 124, 125, 126, 127, 128, - 368, 369, 126, 81, 82, 11, 135, 5, 4, 6, - 5, 135, 64, 65, 66, 138, 68, 69, 70, 71, - 72, 73, 139, 137, 6, 6, 78, 79, 64, 65, - 66, 4, 68, 69, 70, 71, 72, 5, 4, 6, - 408, 409, 6, 6, 131, 119, 136, 410, 5, 412, - 413, 414, 415, 416, 417, 132, 76, 130, 6, 6, - 428, 429, 6, 133, 9, 143, 6, 6, 5, 147, - 148, 6, 120, 5, 442, 443, 444, 445, 6, 447, + 7, 70, 14, 159, 69, 72, 26, 143, 223, 0, + 73, 74, 75, 5, 77, 315, 3, 175, 176, 155, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 4, 23, 24, 6, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 20, 37, 38, 6, 40, 477, - 478, 43, 44, 45, 46, 47, 48, 49, 50, 6, - 52, 53, 54, 6, 6, 57, 6, 6, 6, 6, - 6, 6, 134, 6, 77, 9, 68, 6, 6, 6, - 6, 6, 74, 6, 149, 76, 149, 9, 64, 65, - 66, 83, 68, 69, 70, 71, 72, 477, 47, 286, - 19, 93, 94, 95, 272, 9, 269, 428, 366, 405, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 9, 406, 218, 407, 120, 371, - 370, 374, 285, -1, 126, 283, -1, -1, -1, -1, - -1, -1, -1, 135, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, -1, 23, 24, -1, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, -1, 37, - 38, -1, 40, -1, -1, 43, 44, 45, 46, 47, - 48, 49, 50, 284, 52, 53, 54, -1, -1, 57, + 22, 270, 24, 25, 85, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 416, 38, 39, 5, 41, + 85, 7, 44, 45, 46, 47, 48, 49, 50, 51, + 41, 53, 54, 55, 3, 7, 58, 59, 146, 147, + 143, 10, 76, 124, 6, 86, 87, 81, 3, 71, + 87, 320, 155, 4, 41, 77, 143, 79, 123, 10, + 157, 6, 463, 143, 143, 6, 88, 253, 155, 6, + 21, 86, 87, 3, 154, 154, 6, 99, 100, 101, + 325, 92, 93, 6, 177, 135, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 288, 289, 290, 433, 126, 92, 93, 23, 149, 3, + 132, 6, 153, 154, 83, 84, 67, 68, 69, 141, + 71, 72, 73, 74, 75, 42, 43, 78, 86, 87, + 229, 85, 83, 84, 149, 3, 52, 230, 153, 154, + 3, 156, 235, 236, 237, 238, 239, 240, 241, 5, + 243, 244, 245, 261, 6, 263, 249, 250, 251, 83, + 84, 17, 18, 19, 37, 38, 39, 40, 122, 17, + 18, 19, 88, 89, 90, 146, 147, 148, 151, 152, + 279, 97, 149, 150, 70, 41, 281, 56, 57, 282, + 11, 149, 11, 41, 50, 153, 154, 53, 156, 291, + 292, 11, 50, 293, 294, 53, 11, 11, 126, 246, + 135, 248, 127, 6, 6, 252, 6, 254, 255, 256, + 257, 258, 259, 316, 317, 318, 6, 6, 321, 6, + 323, 6, 88, 6, 6, 5, 145, 6, 6, 425, + 88, 6, 6, 280, 60, 6, 6, 6, 64, 65, + 66, 21, 6, 6, 6, 6, 298, 113, 6, 115, + 116, 117, 118, 119, 6, 113, 6, 115, 116, 117, + 118, 119, 6, 6, 6, 6, 132, 6, 94, 95, + 96, 6, 98, 6, 132, 141, 21, 6, 6, 382, + 383, 6, 6, 141, 6, 4, 6, 67, 68, 69, + 11, 71, 72, 73, 74, 75, 11, 5, 4, 6, + 5, 144, 128, 129, 130, 131, 132, 133, 134, 143, + 6, 6, 6, 4, 6, 141, 5, 4, 6, 422, + 423, 6, 67, 68, 69, 136, 71, 72, 73, 74, + 75, 125, 137, 139, 138, 142, 5, 9, 6, 6, + 443, 444, 6, 81, 6, 6, 5, 456, 6, 6, + 6, 6, 6, 6, 457, 458, 459, 460, 6, 462, + 6, 6, 6, 6, 6, 6, 4, 140, 82, 9, + 6, 6, 6, 6, 6, 6, 6, 424, 81, 426, + 427, 428, 429, 430, 431, 5, 9, 155, 155, 492, + 493, 492, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 298, 24, 25, 25, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 284, 38, 39, + 14, 41, 51, 443, 44, 45, 46, 47, 48, 49, + 50, 51, 281, 53, 54, 55, 380, 229, 58, 59, + 420, 419, 14, 385, 295, 421, 384, 388, 296, -1, + 297, 71, -1, -1, -1, -1, -1, 77, -1, 79, + -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, + 100, 101, -1, -1, -1, -1, -1, -1, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, -1, -1, -1, -1, 126, -1, -1, -1, + -1, -1, 132, -1, -1, -1, -1, -1, -1, -1, + -1, 141, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, 25, -1, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, -1, 38, 39, + -1, 41, -1, -1, 44, 45, 46, 47, 48, 49, + 50, 51, -1, 53, 54, 55, -1, -1, 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 68, -1, -1, -1, -1, -1, 74, -1, -1, -1, - -1, -1, -1, -1, -1, 83, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 93, 94, 95, -1, -1, - -1, -1, -1, -1, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, -1, -1, - -1, -1, 120, -1, -1, -1, -1, -1, 126, -1, - -1, -1, -1, -1, -1, -1, -1, 135, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, - 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, -1, 37, 38, -1, 40, -1, -1, 43, - 44, 45, 46, 47, 48, 49, 50, -1, 52, -1, - 54, -1, -1, 57, -1, -1, -1, -1, -1, -1, - -1, -1, 3, 4, -1, -1, -1, -1, -1, 10, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, - -1, 22, -1, -1, -1, -1, -1, -1, -1, 93, - 94, 95, -1, -1, -1, -1, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, -1, -1, -1, -1, 120, 58, 59, 60, - -1, -1, 126, -1, -1, -1, 67, 68, -1, -1, - -1, 135, 73, -1, 75, -1, -1, 78, 79, -1, - -1, -1, 83, 84, -1, 86, 12, 13, 14, 15, - -1, -1, 93, 94, 95, 96, 97, 98, 99, 100, - 101, -1, -1, -1, 105, -1, 107, 108, 109, 110, - 111, 112, 113, 114, 115, -1, -1, 43, 44, 45, - 46, 47, 48, -1, -1, -1, -1, -1, -1, -1, + -1, 71, -1, -1, -1, -1, -1, 77, -1, 79, + -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, + 100, 101, -1, -1, -1, -1, -1, -1, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, -1, -1, -1, -1, 126, -1, -1, -1, + -1, -1, 132, -1, -1, -1, -1, -1, -1, -1, + -1, 141, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, 25, -1, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, -1, 38, 39, + -1, 41, -1, -1, 44, 45, 46, 47, 48, 49, + 50, 51, -1, 53, -1, 55, -1, -1, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, -1, -1, -1, -1, -1, 10, 77, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 21, 88, 23, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, + 100, 101, -1, -1, -1, -1, -1, -1, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, -1, -1, -1, -1, 126, 61, 62, 63, + -1, -1, 132, -1, -1, -1, 70, 71, -1, -1, + -1, 141, -1, -1, 78, -1, 80, -1, -1, 83, + 84, -1, -1, -1, 88, 89, -1, 91, 12, 13, + 14, 15, 16, -1, -1, 99, 100, 101, 102, 103, + 104, 105, 106, 107, -1, -1, -1, 111, -1, 113, + 114, 115, 116, 117, 118, 119, 120, 121, -1, -1, + 44, 45, 46, 47, 48, 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 93, 94, 95, - -1, -1, -1, -1, -1, -1, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - -1, -1, -1, -1, 120 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 99, 100, 101, -1, -1, + -1, -1, -1, -1, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, -1, -1, + -1, -1, 126 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -1921,55 +1991,57 @@ const unsigned char BisonParser::yystos_[] = { - 0, 152, 153, 0, 76, 154, 155, 7, 3, 156, - 3, 4, 10, 22, 58, 59, 60, 67, 68, 73, - 75, 78, 79, 83, 84, 86, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 105, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 157, 163, 164, 165, 170, - 171, 172, 180, 182, 197, 218, 219, 226, 183, 22, - 51, 83, 84, 85, 91, 181, 3, 6, 6, 6, - 6, 3, 6, 171, 3, 6, 3, 3, 165, 10, - 180, 182, 6, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 23, 24, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 37, 38, 40, 43, 44, - 45, 46, 47, 48, 49, 50, 52, 53, 54, 57, - 68, 74, 83, 102, 103, 104, 105, 106, 107, 109, - 110, 111, 112, 113, 120, 126, 135, 184, 185, 187, - 188, 193, 194, 196, 202, 216, 217, 218, 220, 11, - 11, 11, 173, 11, 11, 20, 186, 187, 25, 129, - 174, 175, 212, 212, 81, 82, 143, 147, 148, 227, - 228, 229, 230, 231, 232, 233, 234, 234, 234, 166, - 234, 158, 121, 203, 61, 62, 63, 89, 90, 92, - 122, 123, 124, 125, 126, 127, 128, 135, 176, 179, - 204, 205, 206, 207, 208, 209, 210, 211, 40, 87, - 88, 177, 178, 226, 6, 6, 6, 6, 6, 6, + 0, 158, 159, 0, 76, 81, 160, 7, 161, 83, + 84, 232, 7, 3, 162, 3, 4, 10, 21, 23, + 61, 62, 63, 70, 71, 78, 80, 88, 89, 91, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 111, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 163, + 169, 170, 171, 176, 177, 178, 186, 188, 203, 224, + 225, 232, 189, 23, 52, 88, 89, 90, 97, 187, + 6, 3, 6, 6, 6, 6, 3, 6, 177, 3, + 6, 3, 3, 171, 10, 186, 188, 6, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, + 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 38, 39, 41, 44, 45, 46, 47, 48, 49, + 50, 51, 53, 54, 55, 58, 59, 71, 77, 79, + 88, 108, 109, 110, 111, 112, 113, 115, 116, 117, + 118, 119, 126, 132, 141, 190, 191, 193, 194, 199, + 200, 202, 208, 222, 223, 224, 226, 11, 11, 11, + 179, 11, 11, 21, 192, 193, 208, 26, 135, 180, + 181, 218, 218, 86, 87, 149, 153, 154, 233, 234, + 235, 236, 237, 238, 239, 240, 240, 240, 172, 240, + 164, 127, 209, 60, 64, 65, 66, 94, 95, 96, + 98, 128, 129, 130, 131, 132, 133, 134, 141, 182, + 185, 210, 211, 212, 213, 214, 215, 216, 217, 41, + 92, 93, 183, 184, 232, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 4, 5, 190, 5, 190, 218, 196, 197, 240, 209, + 11, 37, 38, 39, 40, 227, 42, 43, 229, 6, + 11, 5, 6, 4, 5, 234, 234, 240, 146, 147, + 148, 149, 150, 151, 152, 145, 144, 143, 173, 17, + 18, 19, 41, 50, 53, 88, 113, 115, 116, 117, + 118, 119, 132, 141, 165, 166, 6, 6, 6, 4, + 5, 6, 6, 6, 4, 5, 183, 85, 122, 204, + 85, 123, 205, 85, 124, 206, 125, 207, 108, 199, + 208, 240, 136, 220, 137, 219, 138, 221, 139, 240, + 240, 240, 240, 240, 240, 240, 142, 228, 240, 195, + 201, 240, 198, 240, 232, 81, 232, 240, 240, 240, + 232, 209, 232, 232, 232, 232, 232, 232, 190, 190, + 5, 182, 6, 6, 6, 9, 6, 6, 5, 208, + 232, 192, 240, 180, 155, 234, 234, 234, 235, 235, + 236, 236, 237, 238, 239, 4, 21, 67, 68, 69, + 71, 72, 73, 74, 75, 174, 175, 176, 186, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, - 184, 5, 184, 212, 190, 191, 234, 203, 11, 36, - 37, 38, 39, 221, 41, 42, 223, 6, 11, 5, - 6, 4, 5, 228, 228, 234, 140, 141, 142, 143, - 144, 145, 146, 139, 138, 137, 167, 16, 17, 18, - 40, 49, 52, 83, 107, 109, 110, 111, 112, 113, - 126, 135, 159, 160, 6, 6, 4, 5, 6, 6, - 6, 4, 5, 177, 80, 116, 198, 80, 117, 199, - 80, 118, 200, 119, 201, 102, 193, 202, 234, 130, - 214, 131, 213, 132, 215, 133, 234, 234, 234, 234, - 234, 234, 234, 136, 222, 234, 189, 195, 234, 192, - 234, 226, 76, 226, 234, 234, 226, 203, 226, 226, - 226, 226, 226, 226, 184, 184, 5, 176, 6, 6, - 6, 9, 6, 6, 5, 202, 226, 186, 234, 174, - 149, 228, 228, 228, 229, 229, 230, 230, 231, 232, - 233, 4, 20, 64, 65, 66, 68, 69, 70, 71, - 72, 168, 169, 170, 180, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, - 159, 234, 234, 176, 234, 77, 234, 177, 9, 148, - 190, 234, 234, 222, 221, 134, 224, 55, 56, 225, - 223, 6, 6, 6, 6, 6, 6, 6, 5, 168, - 198, 199, 200, 234, 161, 162, 234, 226, 203, 226, - 226, 226, 226, 226, 226, 159, 189, 150, 234, 202, - 234, 234, 234, 234, 76, 234, 168, 9, 148, 149, - 149, 161, 150, 234, 149, 149 + 6, 6, 4, 5, 165, 240, 240, 240, 182, 240, + 82, 240, 183, 9, 154, 196, 240, 240, 228, 227, + 140, 230, 56, 57, 231, 229, 6, 6, 6, 6, + 6, 6, 6, 5, 174, 204, 205, 206, 240, 167, + 168, 240, 232, 209, 232, 232, 232, 232, 232, 232, + 165, 195, 156, 240, 208, 240, 240, 240, 240, 81, + 240, 174, 9, 154, 155, 155, 167, 156, 240, 155, + 155 }; #if YYDEBUG @@ -1993,7 +2065,7 @@ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405 + 405, 406, 407, 408, 409, 410, 411 }; #endif @@ -2001,68 +2073,70 @@ const unsigned char BisonParser::yyr1_[] = { - 0, 151, 152, 153, 153, 155, 154, 156, 156, 156, - 156, 156, 156, 156, 156, 158, 157, 159, 159, 159, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 161, 161, 162, 162, - 162, 163, 163, 163, 163, 163, 163, 164, 164, 166, - 165, 167, 167, 167, 167, 168, 168, 168, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 170, 170, 171, - 171, 171, 172, 173, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 174, 174, 175, 175, 176, 176, 177, - 177, 177, 178, 178, 178, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 181, - 180, 180, 183, 182, 184, 184, 184, 184, 184, 184, - 185, 185, 185, 185, 185, 186, 186, 187, 187, 187, - 187, 187, 188, 188, 189, 189, 190, 190, 191, 192, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 194, 194, 195, 195, 195, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, - 198, 198, 199, 199, 200, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 219, 219, 219, 219, 220, 220, 220, 221, 221, - 221, 221, 221, 222, 223, 223, 223, 224, 225, 225, - 226, 226, 227, 227, 227, 228, 228, 228, 229, 229, - 229, 229, 230, 230, 230, 231, 231, 231, 232, 232, - 233, 233, 234, 234 + 0, 157, 158, 159, 159, 160, 161, 160, 162, 162, + 162, 162, 162, 162, 162, 162, 164, 163, 165, 165, + 165, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 167, 167, 168, + 168, 168, 169, 169, 169, 169, 169, 169, 169, 170, + 170, 172, 171, 173, 173, 173, 173, 174, 174, 174, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, + 176, 177, 177, 177, 178, 179, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 180, 180, 181, 181, 182, + 182, 183, 183, 183, 184, 184, 184, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 187, 186, 186, 189, 188, 190, 190, + 190, 190, 190, 190, 191, 191, 191, 191, 191, 192, + 192, 193, 193, 193, 193, 193, 194, 194, 195, 195, + 196, 196, 197, 198, 199, 199, 199, 199, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, + 200, 200, 201, 201, 201, 202, 202, 202, 202, 202, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, + 203, 203, 203, 203, 203, 203, 203, 204, 204, 205, + 205, 206, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 223, 223, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, + 225, 225, 226, 226, 226, 227, 227, 227, 227, 227, + 228, 229, 229, 229, 230, 231, 231, 232, 232, 233, + 233, 233, 234, 234, 234, 235, 235, 235, 235, 236, + 236, 236, 237, 237, 237, 238, 238, 239, 239, 240, + 240 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ const unsigned char BisonParser::yyr2_[] = { - 0, 2, 1, 0, 2, 0, 6, 0, 2, 2, - 2, 2, 2, 2, 2, 0, 5, 1, 3, 2, - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 1, 3, 1, 1, 3, 1, 4, - 4, 3, 3, 3, 3, 3, 3, 1, 2, 0, - 5, 0, 2, 2, 2, 1, 3, 2, 3, 3, - 1, 1, 3, 3, 3, 3, 3, 2, 1, 0, - 2, 2, 4, 0, 5, 4, 4, 4, 3, 4, - 4, 4, 4, 1, 3, 1, 3, 1, 3, 1, - 3, 2, 3, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 3, 1, 1, 1, 0, - 5, 1, 0, 4, 1, 1, 3, 3, 2, 2, - 3, 3, 3, 3, 3, 1, 3, 1, 1, 1, - 1, 1, 3, 3, 1, 3, 1, 3, 1, 1, + 0, 2, 1, 0, 2, 3, 0, 6, 0, 2, + 2, 2, 2, 2, 2, 2, 0, 5, 1, 3, + 2, 0, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 1, 3, 1, 1, 3, 1, + 4, 4, 3, 3, 3, 3, 3, 3, 3, 1, + 2, 0, 5, 0, 2, 2, 2, 1, 3, 2, + 3, 3, 1, 1, 3, 3, 3, 3, 3, 2, + 1, 0, 2, 2, 4, 0, 5, 4, 4, 4, + 3, 4, 4, 4, 4, 1, 3, 1, 3, 1, + 3, 1, 3, 2, 3, 3, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, + 1, 3, 1, 0, 5, 1, 0, 4, 1, 1, + 3, 3, 2, 2, 3, 3, 3, 3, 3, 1, + 3, 1, 1, 1, 1, 1, 3, 3, 1, 3, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 4, 4, + 1, 3, 1, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 1, 3, 3, 3, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 3, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 1, 1, 3, - 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 2, 2, 1, 3, - 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, - 1, 3, 1, 3 + 3, 3, 3, 3, 1, 1, 3, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, + 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 2, 2, 1, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 1, 3, 1, 3, 1, + 3 }; #if YYDEBUG @@ -2073,35 +2147,36 @@ { "$end", "error", "$undefined", "OBRACE", "EBRACE", "COMMA", "EQUAL", "COLON", "QUOTE", "SEMICOLON", "OBRACKET", "EBRACKET", "BOOTLOADER", - "XIP_MODE", "EARLY_HANDOFF", "HIVEC", "AUTHENTICATION", "ENCRYPTION", - "CHECKSUM", "PARTITION_OWNER", "PARTITION_TYPE", "PARTITION_NUM", - "BOOT_DEVICE", "DEST_DEVICE", "DEST_CPU", "ADDRESS", "EXCEPTION_LEVEL", - "TRUSTZONE", "ALIGNMENT", "OFFSET", "RESERVE_LEGACY", "RESERVE", "LOAD", - "STARTUP", "BIGENDIAN", "A32_MODE", "PPK_SELECT", "SPK_ID", "SPK_SELECT", - "HEADER_AUTH", "REVOKE_ID", "SPLIT_MODE", "SPLIT_FMT", "BOOT", "USER", - "STATIC", "NOAUTOSTART", "MULTIBOOT", "PROTECTED", "BLOCKS", - "AUTHBLOCKS", "BOOTVECTORS", "PRESIGN", "BIF_SECTION", "UDF_DATA", "MCS", - "BIN", "SLR_NUM", "PARENT_ID", "ID_CODE", "EXT_ID_CODE", - "BYPASS_IDCODE_CHECK", "A_HWROT", "S_HWROT", "UNIQUE_ID", - "PARENT_UNIQUE_ID", "FUNCTION_ID", "IMAGE", "ID", "NAME", - "DELAY_HANDOFF", "DELAY_LOAD", "COPY", "PARTITION", "PFILE", - "METAHEADER", "WORD", "HEXWORD", "FILENAME", "QFILENAME", "NONE", - "DECVALUE", "HEXVALUE", "KEYSRC_ENCRYPTION", "FSBL_CONFIG", - "AUTH_PARAMS", "AUTHJTAG_CONFIG", "DEVICE_DNA", "JTAG_TIMEOUT", - "PUF4KMODE", "SHUTTER", "SPLIT", "SMAP_WIDTH", "PUF_HELPER_FILE", - "BH_KEY_FILE", "BH_KEY_IV", "BH_KEK_IV", "BBRAM_KEK_IV", "EFUSE_KEK_IV", - "EFUSE_USER_KEK0_IV", "EFUSE_USER_KEK1_IV", "USER_KEYS", "PMCDATA", - "BOOTIMAGE", "UDF_BH", "INIT", "PMUFW_IMAGE", "AES_KEY_FILE", - "FAMILY_KEY", "PPK_FILE", "PSK_FILE", "SPK_FILE", "SSK_FILE", - "SPK_SIGNATURE_FILE", "BH_SIGNATURE_FILE", "HEADER_SIGNATURE_FILE", - "AUTHVALUE", "ENCRVALUE", "CHECKSUMVALUE", "POWNERVALUE", "PTYPEVALUE", - "KEY_SRC", "CORE", "BH_RSA", "AUTH_HASH", "INT_HASH", "PUFHD_LOC", - "OPT_KEY", "AUTH_ONLY", "BOOT_DEVICE_TYPE", "DEST_DEVICE_TYPE", - "DEST_CPU_TYPE", "EXCEPTION_LEVEL_TYPE", "TRUSTZONE_TYPE", "SPLITMODE", - "DPA_CM", "SPKSELECT", "OR", "XOR", "AND", "MULT", "DIVIDE", "MODULO", - "PLUS", "MINUS", "LSHIFT", "RSHIFT", "NEGATION", "LPAREN", "RPAREN", - "ASTERISK", "$accept", "bif", "group_list", "bifoptions", "$@1", - "file_list", "metahdr_spec", "$@2", "metahdr_attr_list", "metahdr_attr", + "XIP_MODE", "EARLY_HANDOFF", "HIVEC", "LOCKSTEP", "AUTHENTICATION", + "ENCRYPTION", "CHECKSUM", "PARTITION_OWNER", "PARTITION_TYPE", + "PARTITION_NUM", "BOOT_DEVICE", "DEST_DEVICE", "DEST_CPU", "ADDRESS", + "EXCEPTION_LEVEL", "TRUSTZONE", "ALIGNMENT", "OFFSET", "RESERVE_LEGACY", + "RESERVE", "LOAD", "STARTUP", "BIGENDIAN", "A32_MODE", "PPK_SELECT", + "SPK_ID", "SPK_SELECT", "HEADER_AUTH", "REVOKE_ID", "SPLIT_MODE", + "SPLIT_FMT", "BOOT", "USER", "STATIC", "NOAUTOSTART", "MULTIBOOT", + "PROTECTED", "BLOCKS", "AUTHBLOCKS", "BOOTVECTORS", "PRESIGN", + "BIF_SECTION", "UDF_DATA", "MCS", "BIN", "SLR_NUM", "CLUSTER_NUM", + "DICE", "PARENT_ID", "ID_CODE", "EXT_ID_CODE", "BYPASS_IDCODE_CHECK", + "A_HWROT", "S_HWROT", "UNIQUE_ID", "PARENT_UNIQUE_ID", "FUNCTION_ID", + "IMAGE", "ID", "NAME", "DELAY_HANDOFF", "DELAY_LOAD", "COPY", "INCLUDE", + "DELAY_AUTH", "PARTITION", "PFILE", "METAHEADER", "WORD", "HEXWORD", + "FILENAME", "QFILENAME", "NONE", "DECVALUE", "HEXVALUE", + "KEYSRC_ENCRYPTION", "FSBL_CONFIG", "AUTH_PARAMS", "AUTHJTAG_CONFIG", + "DEVICE_DNA", "JTAG_TIMEOUT", "PUF4KMODE", "PUFROSWAP", "SHUTTER", + "SPLIT", "SMAP_WIDTH", "PUF_HELPER_FILE", "BH_KEY_FILE", "BH_KEY_IV", + "BH_KEK_IV", "BBRAM_KEK_IV", "EFUSE_KEK_IV", "EFUSE_USER_KEK0_IV", + "EFUSE_USER_KEK1_IV", "USER_KEYS", "PMCDATA", "BOOTIMAGE", "UDF_BH", + "INIT", "PMUFW_IMAGE", "AES_KEY_FILE", "FAMILY_KEY", "PPK_FILE", + "PSK_FILE", "SPK_FILE", "SSK_FILE", "SPK_SIGNATURE_FILE", + "BH_SIGNATURE_FILE", "HEADER_SIGNATURE_FILE", "AUTHVALUE", "ENCRVALUE", + "CHECKSUMVALUE", "POWNERVALUE", "PTYPEVALUE", "KEY_SRC", "CORE", + "BH_RSA", "AUTH_HASH", "INT_HASH", "PUFHD_LOC", "OPT_KEY", "AUTH_ONLY", + "BOOT_DEVICE_TYPE", "DEST_DEVICE_TYPE", "DEST_CPU_TYPE", + "EXCEPTION_LEVEL_TYPE", "TRUSTZONE_TYPE", "SPLITMODE", "DPA_CM", + "SPKSELECT", "OR", "XOR", "AND", "MULT", "DIVIDE", "MODULO", "PLUS", + "MINUS", "LSHIFT", "RSHIFT", "NEGATION", "LPAREN", "RPAREN", "ASTERISK", + "$accept", "bif", "group_list", "bifoptions", "$@1", "file_list", + "metahdr_spec", "$@2", "metahdr_attr_list", "metahdr_attr", "metahdr_blk", "metahdr_blk_attr", "new_pdi_spec", "image_spec", "image_list", "$@3", "image_content", "image_attributes_list", "image_attributes", "partition_spec", "partition_content", "other_spec", @@ -2127,88 +2202,90 @@ const BisonParser::rhs_number_type BisonParser::yyrhs_[] = { - 152, 0, -1, 153, -1, -1, 153, 154, -1, -1, - 76, 155, 7, 3, 156, 4, -1, -1, 156, 180, - -1, 156, 172, -1, 156, 164, -1, 156, 157, -1, - 156, 163, -1, 156, 182, -1, 156, 170, -1, -1, - 75, 3, 158, 159, 4, -1, 160, -1, 160, 5, - 159, -1, 160, 159, -1, -1, 17, 6, 199, -1, - 83, 6, 203, -1, 107, 6, 226, -1, 16, 6, - 198, -1, 109, 6, 226, -1, 110, 6, 226, -1, - 111, 6, 226, -1, 112, 6, 226, -1, 113, 6, - 226, -1, 52, 6, 226, -1, 40, 6, 234, -1, - 18, 6, 200, -1, 135, -1, 49, 6, 161, -1, - 126, -1, 162, -1, 162, 9, 161, -1, 234, -1, - 234, 148, 234, 149, -1, 234, 148, 150, 149, -1, - 68, 6, 234, -1, 58, 6, 234, -1, 59, 6, - 234, -1, 60, 6, 234, -1, 197, 6, 226, -1, - 83, 6, 203, -1, 165, -1, 164, 165, -1, -1, - 67, 3, 166, 167, 4, -1, -1, 167, 168, -1, - 167, 180, -1, 167, 170, -1, 169, -1, 169, 5, - 168, -1, 169, 168, -1, 68, 6, 234, -1, 69, - 6, 76, -1, 70, -1, 71, -1, 72, 6, 234, - -1, 20, 6, 202, -1, 64, 6, 234, -1, 65, - 6, 234, -1, 66, 6, 234, -1, 73, 171, -1, - 171, -1, -1, 171, 180, -1, 171, 182, -1, 10, - 83, 11, 203, -1, -1, 10, 84, 173, 11, 176, - -1, 84, 3, 176, 4, -1, 22, 3, 174, 4, - -1, 10, 22, 11, 212, -1, 22, 6, 212, -1, - 10, 85, 11, 221, -1, 10, 91, 11, 223, -1, - 10, 51, 11, 190, -1, 86, 3, 177, 4, -1, - 175, -1, 175, 5, 174, -1, 212, -1, 25, 6, - 234, -1, 179, -1, 179, 5, 176, -1, 178, -1, - 178, 5, 177, -1, 178, 177, -1, 40, 6, 234, - -1, 87, 6, 77, -1, 88, 6, 234, -1, 204, - -1, 205, -1, 207, -1, 208, -1, 209, -1, 211, - -1, 210, -1, 89, -1, 90, 6, 234, -1, 206, - -1, 92, 6, 234, -1, 61, -1, 62, -1, 63, - -1, -1, 10, 181, 186, 11, 226, -1, 226, -1, - -1, 3, 183, 184, 4, -1, 187, -1, 185, -1, - 185, 5, 184, -1, 187, 5, 184, -1, 185, 184, - -1, 187, 184, -1, 74, 6, 226, -1, 68, 6, - 234, -1, 20, 6, 193, -1, 20, 6, 102, -1, - 53, 6, 76, -1, 187, -1, 187, 5, 186, -1, - 193, -1, 196, -1, 216, -1, 217, -1, 188, -1, - 49, 6, 189, -1, 50, 6, 192, -1, 195, -1, - 195, 9, 189, -1, 191, -1, 191, 5, 190, -1, - 234, -1, 234, -1, 12, -1, 43, -1, 44, -1, - 45, -1, 46, -1, 47, -1, 48, -1, 14, -1, - 15, -1, 13, -1, 105, -1, 103, -1, 218, -1, - 220, -1, 202, -1, 27, -1, 27, 6, 133, -1, - 234, -1, 234, 148, 234, 149, -1, 234, 148, 150, - 149, -1, 16, 6, 198, -1, 17, 6, 199, -1, - 18, 6, 200, -1, 19, 6, 201, -1, 24, 6, - 213, -1, 23, 6, 214, -1, 26, 6, 215, -1, - 107, 6, 226, -1, 109, 6, 226, -1, 110, 6, - 226, -1, 111, 6, 226, -1, 112, 6, 226, -1, - 38, 6, 222, -1, 37, 6, 234, -1, 113, 6, - 226, -1, 194, -1, 20, 6, 202, -1, 83, 6, - 203, -1, 40, 6, 234, -1, 135, -1, 57, 6, - 234, -1, 126, -1, 105, -1, 218, -1, 96, -1, - 97, -1, 98, -1, 99, -1, 100, -1, 101, -1, - 80, -1, 116, -1, 80, -1, 117, -1, 80, -1, - 118, -1, 119, -1, 120, -1, 121, -1, 122, -1, - 123, -1, 135, -1, 124, -1, 125, -1, 126, -1, - 127, -1, 128, -1, 129, -1, 131, -1, 130, -1, - 132, -1, 28, 6, 234, -1, 29, 6, 234, -1, - 30, 6, 234, -1, 31, 6, 234, -1, 32, 6, - 234, -1, 33, 6, 234, -1, 34, -1, 35, -1, - 21, 6, 234, -1, 52, 6, 226, -1, 54, 6, - 226, -1, 107, -1, 219, -1, 113, -1, 114, -1, - 115, -1, 94, -1, 93, -1, 95, -1, 108, -1, - 109, -1, 110, -1, 111, -1, 112, -1, 106, -1, - 102, -1, 104, -1, 36, 6, 234, -1, 38, 6, - 222, -1, 37, 6, 234, -1, 39, -1, 221, 9, - 221, -1, 136, -1, 41, 6, 224, -1, 42, 6, - 225, -1, 223, 5, 223, -1, 134, -1, 55, -1, - 56, -1, 78, -1, 79, -1, 82, -1, 81, -1, - 148, 234, 149, -1, 227, -1, 143, 228, -1, 147, - 228, -1, 228, -1, 229, 140, 228, -1, 229, 141, - 228, -1, 229, 142, 228, -1, 229, -1, 230, 143, - 229, -1, 230, 144, 229, -1, 230, -1, 231, 145, - 230, -1, 231, 146, 230, -1, 231, -1, 232, 139, - 231, -1, 232, -1, 233, 138, 232, -1, 233, -1, - 234, 137, 233, -1 + 158, 0, -1, 159, -1, -1, 159, 160, -1, 76, + 7, 232, -1, -1, 81, 161, 7, 3, 162, 4, + -1, -1, 162, 186, -1, 162, 178, -1, 162, 170, + -1, 162, 163, -1, 162, 169, -1, 162, 188, -1, + 162, 176, -1, -1, 80, 3, 164, 165, 4, -1, + 166, -1, 166, 5, 165, -1, 166, 165, -1, -1, + 18, 6, 205, -1, 88, 6, 209, -1, 113, 6, + 232, -1, 17, 6, 204, -1, 115, 6, 232, -1, + 116, 6, 232, -1, 117, 6, 232, -1, 118, 6, + 232, -1, 119, 6, 232, -1, 53, 6, 232, -1, + 41, 6, 240, -1, 19, 6, 206, -1, 141, -1, + 50, 6, 167, -1, 132, -1, 168, -1, 168, 9, + 167, -1, 240, -1, 240, 154, 240, 155, -1, 240, + 154, 156, 155, -1, 71, 6, 240, -1, 61, 6, + 240, -1, 62, 6, 240, -1, 63, 6, 240, -1, + 203, 6, 232, -1, 88, 6, 209, -1, 21, 6, + 208, -1, 171, -1, 170, 171, -1, -1, 70, 3, + 172, 173, 4, -1, -1, 173, 174, -1, 173, 186, + -1, 173, 176, -1, 175, -1, 175, 5, 174, -1, + 175, 174, -1, 71, 6, 240, -1, 72, 6, 81, + -1, 73, -1, 74, -1, 75, 6, 240, -1, 21, + 6, 208, -1, 67, 6, 240, -1, 68, 6, 240, + -1, 69, 6, 240, -1, 78, 177, -1, 177, -1, + -1, 177, 186, -1, 177, 188, -1, 10, 88, 11, + 209, -1, -1, 10, 89, 179, 11, 182, -1, 89, + 3, 182, 4, -1, 23, 3, 180, 4, -1, 10, + 23, 11, 218, -1, 23, 6, 218, -1, 10, 90, + 11, 227, -1, 10, 97, 11, 229, -1, 10, 52, + 11, 196, -1, 91, 3, 183, 4, -1, 181, -1, + 181, 5, 180, -1, 218, -1, 26, 6, 240, -1, + 185, -1, 185, 5, 182, -1, 184, -1, 184, 5, + 183, -1, 184, 183, -1, 41, 6, 240, -1, 92, + 6, 82, -1, 93, 6, 240, -1, 210, -1, 211, + -1, 213, -1, 214, -1, 215, -1, 217, -1, 216, + -1, 94, -1, 96, 6, 240, -1, 212, -1, 98, + 6, 240, -1, 64, -1, 65, -1, 66, -1, 95, + 6, 240, -1, 60, -1, -1, 10, 187, 192, 11, + 232, -1, 232, -1, -1, 3, 189, 190, 4, -1, + 193, -1, 191, -1, 191, 5, 190, -1, 193, 5, + 190, -1, 191, 190, -1, 193, 190, -1, 79, 6, + 232, -1, 71, 6, 240, -1, 21, 6, 199, -1, + 21, 6, 108, -1, 54, 6, 81, -1, 193, -1, + 193, 5, 192, -1, 199, -1, 202, -1, 222, -1, + 223, -1, 194, -1, 50, 6, 195, -1, 51, 6, + 198, -1, 201, -1, 201, 9, 195, -1, 197, -1, + 197, 5, 196, -1, 240, -1, 240, -1, 12, -1, + 44, -1, 45, -1, 46, -1, 47, -1, 48, -1, + 49, -1, 14, -1, 15, -1, 13, -1, 111, -1, + 109, -1, 224, -1, 226, -1, 208, -1, 16, -1, + 28, -1, 28, 6, 139, -1, 240, -1, 240, 154, + 240, 155, -1, 240, 154, 156, 155, -1, 17, 6, + 204, -1, 18, 6, 205, -1, 19, 6, 206, -1, + 20, 6, 207, -1, 25, 6, 219, -1, 24, 6, + 220, -1, 27, 6, 221, -1, 113, 6, 232, -1, + 115, 6, 232, -1, 116, 6, 232, -1, 117, 6, + 232, -1, 118, 6, 232, -1, 39, 6, 228, -1, + 38, 6, 240, -1, 119, 6, 232, -1, 200, -1, + 21, 6, 208, -1, 88, 6, 209, -1, 41, 6, + 240, -1, 141, -1, 58, 6, 240, -1, 59, 6, + 240, -1, 132, -1, 77, -1, 111, -1, 224, -1, + 102, -1, 103, -1, 104, -1, 105, -1, 106, -1, + 107, -1, 85, -1, 122, -1, 85, -1, 123, -1, + 85, -1, 124, -1, 125, -1, 126, -1, 127, -1, + 128, -1, 129, -1, 141, -1, 130, -1, 131, -1, + 132, -1, 133, -1, 134, -1, 135, -1, 137, -1, + 136, -1, 138, -1, 29, 6, 240, -1, 30, 6, + 240, -1, 31, 6, 240, -1, 32, 6, 240, -1, + 33, 6, 240, -1, 34, 6, 240, -1, 35, -1, + 36, -1, 22, 6, 240, -1, 53, 6, 232, -1, + 55, 6, 232, -1, 113, -1, 225, -1, 119, -1, + 120, -1, 121, -1, 100, -1, 99, -1, 101, -1, + 114, -1, 115, -1, 116, -1, 117, -1, 118, -1, + 112, -1, 108, -1, 110, -1, 37, 6, 240, -1, + 39, 6, 228, -1, 38, 6, 240, -1, 40, -1, + 227, 9, 227, -1, 142, -1, 42, 6, 230, -1, + 43, 6, 231, -1, 229, 5, 229, -1, 140, -1, + 56, -1, 57, -1, 83, -1, 84, -1, 87, -1, + 86, -1, 154, 240, 155, -1, 233, -1, 149, 234, + -1, 153, 234, -1, 234, -1, 235, 146, 234, -1, + 235, 147, 234, -1, 235, 148, 234, -1, 235, -1, + 236, 149, 235, -1, 236, 150, 235, -1, 236, -1, + 237, 151, 236, -1, 237, 152, 236, -1, 237, -1, + 238, 145, 237, -1, 238, -1, 239, 144, 238, -1, + 239, -1, 240, 143, 239, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -2216,68 +2293,70 @@ const unsigned short int BisonParser::yyprhs_[] = { - 0, 0, 3, 5, 6, 9, 10, 17, 18, 21, - 24, 27, 30, 33, 36, 39, 40, 46, 48, 52, - 55, 56, 60, 64, 68, 72, 76, 80, 84, 88, - 92, 96, 100, 104, 106, 110, 112, 114, 118, 120, - 125, 130, 134, 138, 142, 146, 150, 154, 156, 159, - 160, 166, 167, 170, 173, 176, 178, 182, 185, 189, - 193, 195, 197, 201, 205, 209, 213, 217, 220, 222, - 223, 226, 229, 234, 235, 241, 246, 251, 256, 260, - 265, 270, 275, 280, 282, 286, 288, 292, 294, 298, - 300, 304, 307, 311, 315, 319, 321, 323, 325, 327, - 329, 331, 333, 335, 339, 341, 345, 347, 349, 351, - 352, 358, 360, 361, 366, 368, 370, 374, 378, 381, - 384, 388, 392, 396, 400, 404, 406, 410, 412, 414, - 416, 418, 420, 424, 428, 430, 434, 436, 440, 442, - 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, - 464, 466, 468, 470, 472, 474, 476, 480, 482, 487, - 492, 496, 500, 504, 508, 512, 516, 520, 524, 528, - 532, 536, 540, 544, 548, 552, 554, 558, 562, 566, - 568, 572, 574, 576, 578, 580, 582, 584, 586, 588, - 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, - 610, 612, 614, 616, 618, 620, 622, 624, 626, 628, - 630, 632, 636, 640, 644, 648, 652, 656, 658, 660, - 664, 668, 672, 674, 676, 678, 680, 682, 684, 686, - 688, 690, 692, 694, 696, 698, 700, 702, 704, 708, - 712, 716, 718, 722, 724, 728, 732, 736, 738, 740, - 742, 744, 746, 748, 750, 754, 756, 759, 762, 764, - 768, 772, 776, 778, 782, 786, 788, 792, 796, 798, - 802, 804, 808, 810 + 0, 0, 3, 5, 6, 9, 13, 14, 21, 22, + 25, 28, 31, 34, 37, 40, 43, 44, 50, 52, + 56, 59, 60, 64, 68, 72, 76, 80, 84, 88, + 92, 96, 100, 104, 108, 110, 114, 116, 118, 122, + 124, 129, 134, 138, 142, 146, 150, 154, 158, 162, + 164, 167, 168, 174, 175, 178, 181, 184, 186, 190, + 193, 197, 201, 203, 205, 209, 213, 217, 221, 225, + 228, 230, 231, 234, 237, 242, 243, 249, 254, 259, + 264, 268, 273, 278, 283, 288, 290, 294, 296, 300, + 302, 306, 308, 312, 315, 319, 323, 327, 329, 331, + 333, 335, 337, 339, 341, 343, 347, 349, 353, 355, + 357, 359, 363, 365, 366, 372, 374, 375, 380, 382, + 384, 388, 392, 395, 398, 402, 406, 410, 414, 418, + 420, 424, 426, 428, 430, 432, 434, 438, 442, 444, + 448, 450, 454, 456, 458, 460, 462, 464, 466, 468, + 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, + 490, 492, 496, 498, 503, 508, 512, 516, 520, 524, + 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, + 568, 570, 574, 578, 582, 584, 588, 592, 594, 596, + 598, 600, 602, 604, 606, 608, 610, 612, 614, 616, + 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, + 638, 640, 642, 644, 646, 648, 650, 652, 654, 658, + 662, 666, 670, 674, 678, 680, 682, 686, 690, 694, + 696, 698, 700, 702, 704, 706, 708, 710, 712, 714, + 716, 718, 720, 722, 724, 726, 730, 734, 738, 740, + 744, 746, 750, 754, 758, 760, 762, 764, 766, 768, + 770, 772, 776, 778, 781, 784, 786, 790, 794, 798, + 800, 804, 808, 810, 814, 818, 820, 824, 826, 830, + 832 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned short int BisonParser::yyrline_[] = { - 0, 196, 196, 198, 199, 202, 202, 208, 209, 210, - 211, 212, 213, 214, 215, 218, 218, 223, 224, 225, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 247, 248, 251, 253, - 255, 259, 260, 261, 262, 263, 264, 267, 268, 271, - 271, 275, 276, 277, 278, 281, 282, 283, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 298, 299, 302, - 303, 304, 307, 310, 310, 313, 314, 315, 320, 321, - 322, 323, 324, 327, 328, 331, 332, 335, 336, 339, - 340, 341, 344, 345, 346, 349, 352, 354, 356, 358, - 360, 362, 364, 366, 368, 374, 378, 379, 380, 383, - 383, 390, 396, 396, 402, 403, 404, 405, 406, 407, - 410, 413, 414, 415, 416, 421, 422, 425, 426, 427, - 428, 429, 432, 433, 436, 437, 440, 441, 444, 449, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, - 463, 464, 465, 466, 467, 470, 471, 474, 475, 476, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 502, 503, 504, 505, 506, 507, 508, 509, - 512, 513, 516, 517, 520, 521, 524, 527, 530, 533, - 536, 539, 542, 545, 548, 551, 554, 557, 560, 563, - 566, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 580, 581, 584, 585, 586, 587, 588, 589, 590, 591, - 592, 595, 596, 597, 598, 601, 602, 603, 606, 609, - 612, 615, 618, 621, 624, 627, 628, 631, 634, 637, - 643, 644, 647, 648, 649, 655, 656, 657, 661, 662, - 663, 664, 667, 668, 669, 672, 673, 674, 677, 678, - 681, 682, 686, 687 + 0, 196, 196, 198, 199, 202, 203, 203, 209, 210, + 211, 212, 213, 214, 215, 216, 219, 219, 224, 225, + 226, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 248, 249, 252, + 254, 256, 260, 261, 262, 263, 264, 265, 266, 269, + 270, 273, 273, 277, 278, 279, 280, 283, 284, 285, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 299, + 300, 303, 304, 305, 308, 311, 311, 314, 315, 316, + 321, 322, 323, 324, 325, 328, 329, 332, 333, 336, + 337, 340, 341, 342, 345, 346, 347, 350, 353, 355, + 357, 359, 361, 363, 365, 367, 369, 375, 379, 380, + 381, 382, 387, 394, 394, 401, 407, 407, 413, 414, + 415, 416, 417, 418, 421, 424, 425, 426, 427, 432, + 433, 436, 437, 438, 439, 440, 443, 444, 447, 448, + 451, 452, 455, 460, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 474, 475, 476, 477, 478, 479, + 482, 483, 486, 487, 488, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 516, + 517, 518, 519, 520, 521, 522, 523, 526, 527, 530, + 531, 534, 535, 538, 541, 544, 547, 550, 553, 556, + 559, 562, 565, 568, 571, 574, 577, 580, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 594, 595, 598, + 599, 600, 601, 602, 603, 604, 605, 606, 609, 610, + 611, 612, 615, 616, 617, 620, 623, 626, 629, 632, + 635, 638, 641, 642, 645, 648, 651, 657, 658, 661, + 662, 663, 669, 670, 671, 675, 676, 677, 678, 681, + 682, 683, 686, 687, 688, 691, 692, 695, 696, 700, + 701 }; // Print the state stack on the debug stream. @@ -2357,7 +2436,8 @@ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150 + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; @@ -2366,24 +2446,24 @@ } const int BisonParser::yyeof_ = 0; - const int BisonParser::yylast_ = 874; + const int BisonParser::yylast_ = 952; const int BisonParser::yynnts_ = 84; const int BisonParser::yyempty_ = -2; const int BisonParser::yyfinal_ = 3; const int BisonParser::yyterror_ = 1; const int BisonParser::yyerrcode_ = 256; - const int BisonParser::yyntokens_ = 151; + const int BisonParser::yyntokens_ = 157; - const unsigned int BisonParser::yyuser_token_number_max_ = 405; + const unsigned int BisonParser::yyuser_token_number_max_ = 411; const BisonParser::token_number_type BisonParser::yyundef_token_ = 2; /* Line 1141 of lalr1.cc */ #line 23 "../s/bif.y" } // BIF /* Line 1141 of lalr1.cc */ -#line 2385 "../bisonflex/bif.tab.cpp" +#line 2465 "../bisonflex/bif.tab.cpp" /* Line 1142 of lalr1.cc */ -#line 692 "../s/bif.y" +#line 706 "../s/bif.y" void BIF::BisonParser::error(const BIF::BisonParser::location_type &loc, const std::string &msg) { Parsing::Error(loc,msg); diff -Nru xilinx-bootgen-2021.2/bif.tab.hpp xilinx-bootgen-2022.2/bif.tab.hpp --- xilinx-bootgen-2021.2/bif.tab.hpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bif.tab.hpp 2022-09-26 06:24:42.000000000 +0000 @@ -137,141 +137,147 @@ XIP_MODE = 268, EARLY_HANDOFF = 269, HIVEC = 270, - AUTHENTICATION = 271, - ENCRYPTION = 272, - CHECKSUM = 273, - PARTITION_OWNER = 274, - PARTITION_TYPE = 275, - PARTITION_NUM = 276, - BOOT_DEVICE = 277, - DEST_DEVICE = 278, - DEST_CPU = 279, - ADDRESS = 280, - EXCEPTION_LEVEL = 281, - TRUSTZONE = 282, - ALIGNMENT = 283, - OFFSET = 284, - RESERVE_LEGACY = 285, - RESERVE = 286, - LOAD = 287, - STARTUP = 288, - BIGENDIAN = 289, - A32_MODE = 290, - PPK_SELECT = 291, - SPK_ID = 292, - SPK_SELECT = 293, - HEADER_AUTH = 294, - REVOKE_ID = 295, - SPLIT_MODE = 296, - SPLIT_FMT = 297, - BOOT = 298, - USER = 299, - STATIC = 300, - NOAUTOSTART = 301, - MULTIBOOT = 302, - PROTECTED = 303, - BLOCKS = 304, - AUTHBLOCKS = 305, - BOOTVECTORS = 306, - PRESIGN = 307, - BIF_SECTION = 308, - UDF_DATA = 309, - MCS = 310, - BIN = 311, - SLR_NUM = 312, - PARENT_ID = 313, - ID_CODE = 314, - EXT_ID_CODE = 315, - BYPASS_IDCODE_CHECK = 316, - A_HWROT = 317, - S_HWROT = 318, - UNIQUE_ID = 319, - PARENT_UNIQUE_ID = 320, - FUNCTION_ID = 321, - IMAGE = 322, - ID = 323, - NAME = 324, - DELAY_HANDOFF = 325, - DELAY_LOAD = 326, - COPY = 327, - PARTITION = 328, - PFILE = 329, - METAHEADER = 330, - WORD = 331, - HEXWORD = 332, - FILENAME = 333, - QFILENAME = 334, - NONE = 335, - DECVALUE = 336, - HEXVALUE = 337, - KEYSRC_ENCRYPTION = 338, - FSBL_CONFIG = 339, - AUTH_PARAMS = 340, - AUTHJTAG_CONFIG = 341, - DEVICE_DNA = 342, - JTAG_TIMEOUT = 343, - PUF4KMODE = 344, - SHUTTER = 345, - SPLIT = 346, - SMAP_WIDTH = 347, - PUF_HELPER_FILE = 348, - BH_KEY_FILE = 349, - BH_KEY_IV = 350, - BH_KEK_IV = 351, - BBRAM_KEK_IV = 352, - EFUSE_KEK_IV = 353, - EFUSE_USER_KEK0_IV = 354, - EFUSE_USER_KEK1_IV = 355, - USER_KEYS = 356, - PMCDATA = 357, - BOOTIMAGE = 358, - UDF_BH = 359, - INIT = 360, - PMUFW_IMAGE = 361, - AES_KEY_FILE = 362, - FAMILY_KEY = 363, - PPK_FILE = 364, - PSK_FILE = 365, - SPK_FILE = 366, - SSK_FILE = 367, - SPK_SIGNATURE_FILE = 368, - BH_SIGNATURE_FILE = 369, - HEADER_SIGNATURE_FILE = 370, - AUTHVALUE = 371, - ENCRVALUE = 372, - CHECKSUMVALUE = 373, - POWNERVALUE = 374, - PTYPEVALUE = 375, - KEY_SRC = 376, - CORE = 377, - BH_RSA = 378, - AUTH_HASH = 379, - INT_HASH = 380, - PUFHD_LOC = 381, - OPT_KEY = 382, - AUTH_ONLY = 383, - BOOT_DEVICE_TYPE = 384, - DEST_DEVICE_TYPE = 385, - DEST_CPU_TYPE = 386, - EXCEPTION_LEVEL_TYPE = 387, - TRUSTZONE_TYPE = 388, - SPLITMODE = 389, - DPA_CM = 390, - SPKSELECT = 391, - OR = 392, - XOR = 393, - AND = 394, - MULT = 395, - DIVIDE = 396, - MODULO = 397, - PLUS = 398, - MINUS = 399, - LSHIFT = 400, - RSHIFT = 401, - NEGATION = 402, - LPAREN = 403, - RPAREN = 404, - ASTERISK = 405 + LOCKSTEP = 271, + AUTHENTICATION = 272, + ENCRYPTION = 273, + CHECKSUM = 274, + PARTITION_OWNER = 275, + PARTITION_TYPE = 276, + PARTITION_NUM = 277, + BOOT_DEVICE = 278, + DEST_DEVICE = 279, + DEST_CPU = 280, + ADDRESS = 281, + EXCEPTION_LEVEL = 282, + TRUSTZONE = 283, + ALIGNMENT = 284, + OFFSET = 285, + RESERVE_LEGACY = 286, + RESERVE = 287, + LOAD = 288, + STARTUP = 289, + BIGENDIAN = 290, + A32_MODE = 291, + PPK_SELECT = 292, + SPK_ID = 293, + SPK_SELECT = 294, + HEADER_AUTH = 295, + REVOKE_ID = 296, + SPLIT_MODE = 297, + SPLIT_FMT = 298, + BOOT = 299, + USER = 300, + STATIC = 301, + NOAUTOSTART = 302, + MULTIBOOT = 303, + PROTECTED = 304, + BLOCKS = 305, + AUTHBLOCKS = 306, + BOOTVECTORS = 307, + PRESIGN = 308, + BIF_SECTION = 309, + UDF_DATA = 310, + MCS = 311, + BIN = 312, + SLR_NUM = 313, + CLUSTER_NUM = 314, + DICE = 315, + PARENT_ID = 316, + ID_CODE = 317, + EXT_ID_CODE = 318, + BYPASS_IDCODE_CHECK = 319, + A_HWROT = 320, + S_HWROT = 321, + UNIQUE_ID = 322, + PARENT_UNIQUE_ID = 323, + FUNCTION_ID = 324, + IMAGE = 325, + ID = 326, + NAME = 327, + DELAY_HANDOFF = 328, + DELAY_LOAD = 329, + COPY = 330, + INCLUDE = 331, + DELAY_AUTH = 332, + PARTITION = 333, + PFILE = 334, + METAHEADER = 335, + WORD = 336, + HEXWORD = 337, + FILENAME = 338, + QFILENAME = 339, + NONE = 340, + DECVALUE = 341, + HEXVALUE = 342, + KEYSRC_ENCRYPTION = 343, + FSBL_CONFIG = 344, + AUTH_PARAMS = 345, + AUTHJTAG_CONFIG = 346, + DEVICE_DNA = 347, + JTAG_TIMEOUT = 348, + PUF4KMODE = 349, + PUFROSWAP = 350, + SHUTTER = 351, + SPLIT = 352, + SMAP_WIDTH = 353, + PUF_HELPER_FILE = 354, + BH_KEY_FILE = 355, + BH_KEY_IV = 356, + BH_KEK_IV = 357, + BBRAM_KEK_IV = 358, + EFUSE_KEK_IV = 359, + EFUSE_USER_KEK0_IV = 360, + EFUSE_USER_KEK1_IV = 361, + USER_KEYS = 362, + PMCDATA = 363, + BOOTIMAGE = 364, + UDF_BH = 365, + INIT = 366, + PMUFW_IMAGE = 367, + AES_KEY_FILE = 368, + FAMILY_KEY = 369, + PPK_FILE = 370, + PSK_FILE = 371, + SPK_FILE = 372, + SSK_FILE = 373, + SPK_SIGNATURE_FILE = 374, + BH_SIGNATURE_FILE = 375, + HEADER_SIGNATURE_FILE = 376, + AUTHVALUE = 377, + ENCRVALUE = 378, + CHECKSUMVALUE = 379, + POWNERVALUE = 380, + PTYPEVALUE = 381, + KEY_SRC = 382, + CORE = 383, + BH_RSA = 384, + AUTH_HASH = 385, + INT_HASH = 386, + PUFHD_LOC = 387, + OPT_KEY = 388, + AUTH_ONLY = 389, + BOOT_DEVICE_TYPE = 390, + DEST_DEVICE_TYPE = 391, + DEST_CPU_TYPE = 392, + EXCEPTION_LEVEL_TYPE = 393, + TRUSTZONE_TYPE = 394, + SPLITMODE = 395, + DPA_CM = 396, + SPKSELECT = 397, + OR = 398, + XOR = 399, + AND = 400, + MULT = 401, + DIVIDE = 402, + MODULO = 403, + PLUS = 404, + MINUS = 405, + LSHIFT = 406, + RSHIFT = 407, + NEGATION = 408, + LPAREN = 409, + RPAREN = 410, + ASTERISK = 411 }; }; @@ -448,7 +454,7 @@ #line 23 "../s/bif.y" } // BIF /* Line 33 of lalr1.cc */ -#line 452 "../bisonflex/bif.tab.hpp" +#line 458 "../bisonflex/bif.tab.hpp" diff -Nru xilinx-bootgen-2021.2/bif.y xilinx-bootgen-2022.2/bif.y --- xilinx-bootgen-2021.2/bif.y 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bif.y 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,7 +101,7 @@ %token OBRACE EBRACE %token COMMA EQUAL COLON QUOTE SEMICOLON %token OBRACKET EBRACKET -%token BOOTLOADER XIP_MODE EARLY_HANDOFF HIVEC +%token BOOTLOADER XIP_MODE EARLY_HANDOFF HIVEC LOCKSTEP %token AUTHENTICATION ENCRYPTION CHECKSUM %token PARTITION_OWNER PARTITION_TYPE PARTITION_NUM %token BOOT_DEVICE DEST_DEVICE DEST_CPU ADDRESS @@ -114,9 +114,9 @@ %token PRESIGN BIF_SECTION %token UDF_DATA %token MCS BIN -%token SLR_NUM +%token SLR_NUM CLUSTER_NUM DICE %token PARENT_ID ID_CODE EXT_ID_CODE BYPASS_IDCODE_CHECK A_HWROT S_HWROT UNIQUE_ID PARENT_UNIQUE_ID FUNCTION_ID -%token IMAGE ID NAME DELAY_HANDOFF DELAY_LOAD COPY +%token IMAGE ID NAME DELAY_HANDOFF DELAY_LOAD COPY INCLUDE DELAY_AUTH %token PARTITION PFILE %token METAHEADER %token WORD HEXWORD @@ -125,7 +125,7 @@ %token DECVALUE HEXVALUE %token KEYSRC_ENCRYPTION FSBL_CONFIG AUTH_PARAMS %token AUTHJTAG_CONFIG DEVICE_DNA JTAG_TIMEOUT -%token PUF4KMODE SHUTTER SPLIT SMAP_WIDTH +%token PUF4KMODE PUFROSWAP SHUTTER SPLIT SMAP_WIDTH %token PUF_HELPER_FILE BH_KEY_FILE BH_KEY_IV %token BH_KEK_IV BBRAM_KEK_IV EFUSE_KEK_IV EFUSE_USER_KEK0_IV EFUSE_USER_KEK1_IV USER_KEYS %token PMCDATA BOOTIMAGE UDF_BH INIT PMUFW_IMAGE @@ -199,7 +199,8 @@ | group_list bifoptions ; -bifoptions : WORD { currentBifOptions = new BifOptions(options.GetArchType(),$1); } +bifoptions : INCLUDE COLON filename { options.includeBifOptionsList.push_back($3); } + | WORD { currentBifOptions = new BifOptions(options.GetArchType(),$1); } COLON OBRACE file_list EBRACE { options.bifOptions = currentBifOptions; options.bifOptionsList.push_back(currentBifOptions); } @@ -216,7 +217,7 @@ ; metahdr_spec : METAHEADER OBRACE { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); } metahdr_attr_list EBRACE ; @@ -227,7 +228,7 @@ metahdr_attr : /* empty */ | ENCRYPTION EQUAL encrvalue { currentBifOptions->SetMetaHeaderEncryptType($3); } - | KEYSRC_ENCRYPTION EQUAL key_src { currentBifOptions->SetMetaHeaderEncryptionKeySource($3); } + | KEYSRC_ENCRYPTION EQUAL key_src { currentBifOptions->SetMetaHeaderEncryptionKeySource($3, options.IsVersalNetSeries()); } | AES_KEY_FILE EQUAL filename { currentBifOptions->metaHdrAttributes.encrKeyFile = $3; } | AUTHENTICATION EQUAL authvalue { currentBifOptions->SetMetaHeaderAuthType($3); } | PPK_FILE EQUAL filename { currentBifOptions->metaHdrAttributes.ppk = $3; } @@ -262,6 +263,7 @@ | EXT_ID_CODE EQUAL expression { currentBifOptions->SetExtendedIdCode($3); } | other_file_attr EQUAL filename { currentBifOptions->AddFiles($1, $3); } | KEYSRC_ENCRYPTION EQUAL key_src { currentBifOptions->SetEncryptionKeySource($3); } + | PARTITION_TYPE EQUAL ptypevalue { currentBifOptions->SetPdiType($3); } ; image_spec : image_list @@ -292,7 +294,6 @@ | UNIQUE_ID EQUAL expression { currentImageBifOptions->SetUniqueId($3); } | PARENT_UNIQUE_ID EQUAL expression { currentImageBifOptions->SetParentUniqueId($3); } | FUNCTION_ID EQUAL expression { currentImageBifOptions->SetFunctionId($3); } - ; partition_spec : PARTITION partition_content @@ -378,23 +379,33 @@ | BYPASS_IDCODE_CHECK { currentBifOptions->SetBypassIdcodeFlag(true); } | A_HWROT { currentBifOptions->SetAHwRoTFlag(true); } | S_HWROT { currentBifOptions->SetSHwRoTFlag(true); } + | PUFROSWAP EQUAL expression { if(options.GetArchType() == Arch::VERSAL && options.IsVersalNetSeries()) + currentBifOptions->SetPufRingOscilltorSwapConfigValue($3); + else + LOG_ERROR("BIF attribute error !!!\n\t 'puf_ro_swap' is supported only in VersalNet architecture"); + } + | DICE { if(options.GetArchType() == Arch::VERSAL && options.IsVersalNetSeries()) + currentBifOptions->SetDiceEnable(); + else + LOG_ERROR("BIF attribute error !!!\n\t 'dice_enable' is supported only in VersalNet architecture"); + } ; file_spec : OBRACKET { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } + currentPartitionBifOptions->SetArchType(options.GetArchType(),options.IsVersalNetSeries()); } attribute_list EBRACKET filename { currentPartitionBifOptions->filename = $5; currentPartitionBifOptions->filelist.push_back($5); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } | filename { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); currentPartitionBifOptions->filename = $1; currentPartitionBifOptions->filelist.push_back($1); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); }; new_file_spec : OBRACE { currentPartitionBifOptions = new PartitionBifOptions(); - currentPartitionBifOptions->SetArchType(options.GetArchType()); } + currentPartitionBifOptions->SetArchType(options.GetArchType(), options.IsVersalNetSeries()); } new_attribute_list EBRACE ; @@ -413,8 +424,8 @@ | ID EQUAL expression { currentPartitionBifOptions->partitionId = $3; } | PARTITION_TYPE EQUAL boolattr | PARTITION_TYPE EQUAL PMCDATA { currentPartitionBifOptions->fileType = $3; } - | BIF_SECTION EQUAL WORD { currentPartitionBifOptions->bifSection = $3; - currentPartitionBifOptions->filename = currentPartitionBifOptions->GetOutputFileFromBifSection(options.GetOutputFileNames().front(), $3); + | BIF_SECTION EQUAL WORD { currentPartitionBifOptions->bifSection = $3; + currentPartitionBifOptions->filename = currentPartitionBifOptions->GetOutputFileFromBifSection(options.GetOutputFileNames().front(), $3, currentImageBifOptions->GetImageType()); currentBifOptions->Add(currentPartitionBifOptions, currentImageBifOptions); } ; @@ -465,6 +476,7 @@ | key_file { currentPartitionBifOptions->fileType = $1; } | other_files { currentPartitionBifOptions->fileType = $1; } | ptypevalue { currentPartitionBifOptions->SetPartitionType($1); } + | LOCKSTEP { currentPartitionBifOptions->SetLockStepFlag();} ; trustzone_type : TRUSTZONE { currentPartitionBifOptions->SetTrustZone(::TrustZone::Secure); } @@ -496,7 +508,9 @@ | REVOKE_ID EQUAL expression { currentPartitionBifOptions->SetRevokeId($3); } | DPA_CM { currentPartitionBifOptions->SetDpaCM(DpaCM::DpaCMEnable); } | SLR_NUM EQUAL expression { currentPartitionBifOptions->SetSlrNum($3); } + | CLUSTER_NUM EQUAL expression { currentPartitionBifOptions->SetClusterNum($3); } | PUFHD_LOC { currentPartitionBifOptions->SetPufHdLocation(PufHdLoc::PUFinBH); } + | DELAY_AUTH { currentPartitionBifOptions->SetDelayAuth(true); } ; other_file_attr : INIT diff -Nru xilinx-bootgen-2021.2/bif.yy.cpp xilinx-bootgen-2022.2/bif.yy.cpp --- xilinx-bootgen-2021.2/bif.yy.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bif.yy.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -406,8 +406,8 @@ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 244 -#define YY_END_OF_BUFFER 245 +#define YY_NUM_RULES 262 +#define YY_END_OF_BUFFER 263 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -415,130 +415,136 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1103] = +static yyconst flex_int16_t yy_accept[1171] = { 0, - 0, 0, 245, 243, 240, 241, 242, 243, 232, 234, - 223, 224, 225, 226, 218, 227, 238, 231, 212, 212, - 215, 216, 243, 217, 243, 214, 237, 219, 220, 236, - 237, 214, 214, 214, 214, 214, 214, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 221, 235, 222, 233, 240, 241, 0, 0, - 238, 1, 238, 212, 214, 238, 228, 229, 214, 0, - 237, 214, 214, 237, 214, 214, 214, 237, 237, 237, - 214, 237, 237, 237, 237, 237, 214, 214, 237, 237, - 214, 237, 214, 214, 214, 237, 237, 237, 237, 214, - - 237, 237, 237, 237, 237, 237, 48, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 182, 237, - 237, 237, 181, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 239, 0, 0, - 2, 238, 213, 0, 214, 237, 214, 237, 237, 214, - 68, 179, 237, 237, 237, 237, 237, 237, 208, 237, - 237, 237, 86, 88, 237, 237, 237, 237, 237, 237, - 237, 237, 214, 237, 238, 237, 237, 237, 237, 237, - - 237, 206, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 207, 75, 237, 148, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 32, 82, 177, 237, 237, 237, 237, 178, 237, 237, - 238, 237, 87, 237, 237, 70, 237, 237, 155, 238, - 145, 146, 237, 237, 237, 237, 193, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 56, 149, 237, 184, - 0, 238, 237, 238, 237, 238, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 7, 237, 238, 237, 30, 163, 237, 237, 237, 237, - - 237, 237, 237, 186, 187, 188, 189, 237, 237, 237, - 237, 237, 50, 80, 237, 237, 237, 237, 237, 33, - 237, 237, 237, 29, 237, 238, 160, 203, 237, 49, - 144, 237, 238, 67, 237, 237, 237, 237, 153, 237, - 237, 237, 151, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 174, 175, 238, 237, 237, 237, - 237, 237, 152, 238, 238, 238, 237, 237, 76, 77, - 237, 237, 238, 154, 238, 237, 237, 237, 237, 237, - 237, 237, 237, 85, 237, 237, 8, 237, 164, 167, - 170, 172, 237, 166, 169, 171, 173, 237, 165, 168, - - 237, 237, 237, 237, 237, 237, 237, 237, 237, 95, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 238, 237, 237, 237, 237, 237, 237, 71, - 94, 237, 237, 237, 237, 237, 237, 237, 237, 17, - 237, 23, 237, 237, 237, 237, 238, 238, 237, 237, - 238, 237, 237, 237, 237, 79, 237, 237, 237, 183, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 238, 237, 237, 237, 237, 237, 147, 238, 238, 237, - 237, 237, 237, 238, 238, 237, 238, 237, 237, 237, - 237, 202, 237, 237, 237, 237, 81, 237, 237, 238, - - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 18, 237, 237, 237, - 237, 237, 237, 238, 237, 237, 237, 237, 237, 237, - 238, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 93, 237, 237, 238, 238, 237, 237, - 238, 237, 205, 26, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 143, 142, 238, - 237, 237, 237, 237, 237, 238, 238, 238, 237, 191, - 237, 237, 238, 238, 237, 238, 199, 237, 237, 237, - - 237, 237, 9, 237, 34, 237, 238, 237, 237, 237, - 123, 125, 124, 126, 138, 237, 141, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 89, 237, 237, 237, 237, 237, 237, - 237, 238, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 46, 237, 237, 237, - 118, 237, 159, 238, 237, 237, 83, 237, 132, 237, - 237, 54, 237, 237, 36, 4, 237, 37, 237, 237, - 237, 238, 127, 237, 28, 237, 139, 238, 156, 157, - - 25, 134, 237, 238, 238, 237, 238, 237, 38, 237, - 39, 31, 237, 237, 238, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 74, 237, 237, 237, 237, - 237, 237, 238, 238, 237, 237, 237, 237, 237, 237, - 150, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 161, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 52, 130, 238, 237, 237, 237, 238, - 237, 90, 238, 237, 238, 237, 237, 237, 5, 238, - - 237, 64, 6, 237, 237, 13, 131, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 60, - 55, 237, 237, 237, 237, 237, 44, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 238, 238, 237, 237, - 237, 237, 237, 237, 237, 237, 65, 237, 237, 237, - 237, 237, 237, 237, 237, 11, 237, 192, 45, 237, - 22, 237, 237, 12, 133, 238, 122, 237, 201, 158, - 204, 238, 237, 197, 237, 237, 190, 238, 104, 105, - 106, 107, 108, 109, 110, 111, 237, 35, 237, 237, - 19, 237, 237, 237, 237, 237, 237, 237, 103, 102, - - 51, 237, 20, 237, 237, 3, 237, 237, 237, 16, - 237, 210, 237, 237, 72, 73, 237, 237, 237, 237, - 237, 66, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 24, 237, 57, 237, 237, 195, 238, 237, 91, - 136, 196, 237, 198, 237, 194, 237, 237, 237, 237, - 237, 237, 237, 237, 41, 120, 140, 43, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 119, 58, 200, 237, 237, 237, 237, 10, 237, 237, - 53, 176, 237, 237, 21, 237, 237, 237, 237, 237, - 59, 237, 237, 237, 237, 237, 135, 237, 237, 237, - - 61, 237, 237, 237, 237, 237, 237, 237, 121, 211, - 237, 237, 237, 237, 40, 237, 237, 237, 100, 101, - 99, 237, 237, 15, 237, 237, 14, 97, 98, 96, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 69, 237, 128, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 84, 27, 237, 209, - 237, 162, 237, 237, 237, 237, 237, 112, 115, 185, - 237, 42, 237, 78, 129, 237, 237, 237, 237, 237, - 237, 47, 237, 237, 237, 237, 237, 237, 237, 92, - 237, 180, 237, 237, 62, 63, 137, 113, 116, 114, - - 117, 0 + 0, 0, 263, 261, 258, 259, 260, 261, 250, 252, + 241, 242, 243, 244, 236, 245, 256, 249, 230, 230, + 233, 234, 261, 235, 261, 232, 255, 237, 238, 254, + 255, 232, 232, 232, 232, 232, 232, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 239, 253, 240, 251, 258, 259, 0, 0, + 256, 1, 256, 230, 232, 256, 246, 247, 232, 0, + 255, 232, 232, 255, 232, 232, 232, 255, 255, 255, + 232, 255, 255, 255, 255, 255, 232, 232, 255, 255, + 255, 232, 255, 255, 232, 232, 232, 255, 255, 255, + + 255, 232, 255, 255, 255, 255, 255, 255, 51, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 200, 255, 255, 255, 199, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 257, + 0, 0, 2, 256, 231, 0, 232, 255, 232, 232, + 255, 255, 232, 71, 196, 255, 255, 255, 255, 255, + 255, 226, 255, 255, 255, 91, 93, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 232, 255, 256, + + 100, 255, 255, 255, 255, 255, 255, 224, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 225, 78, 255, 159, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 35, 87, + 85, 194, 255, 255, 255, 255, 195, 255, 255, 256, + 255, 255, 92, 255, 255, 73, 255, 255, 166, 256, + 156, 157, 255, 255, 255, 255, 211, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 59, 160, 255, 202, + 0, 256, 255, 256, 255, 256, 256, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 7, 255, 256, 255, 255, 33, 174, 255, 255, + 255, 255, 255, 255, 255, 255, 204, 205, 206, 207, + 255, 255, 255, 255, 255, 53, 83, 255, 255, 255, + 255, 255, 255, 36, 255, 255, 255, 32, 255, 255, + 256, 171, 221, 255, 52, 155, 255, 256, 70, 255, + 255, 255, 255, 164, 255, 255, 255, 162, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 189, + 191, 256, 256, 255, 255, 255, 255, 255, 163, 256, + 256, 256, 255, 255, 79, 80, 255, 255, 256, 165, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 90, + + 255, 255, 8, 255, 175, 179, 183, 186, 255, 178, + 182, 185, 188, 255, 176, 180, 177, 181, 184, 187, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 104, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 256, 255, 255, 255, 255, 255, 255, 255, + 255, 74, 103, 255, 255, 255, 255, 255, 255, 255, + 255, 18, 255, 24, 255, 255, 255, 255, 255, 255, + 256, 256, 255, 255, 256, 255, 255, 255, 255, 82, + 255, 255, 255, 201, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 256, 190, 192, 255, 255, + + 255, 255, 255, 158, 256, 256, 255, 255, 255, 255, + 256, 256, 256, 255, 256, 255, 255, 255, 255, 220, + 255, 255, 255, 255, 84, 255, 255, 256, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 19, 255, 255, 255, 255, 255, + 255, 256, 255, 255, 255, 255, 255, 255, 255, 255, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 102, 255, 255, 255, 256, 256, + 255, 255, 256, 256, 255, 223, 29, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 154, 153, 256, 255, 255, 255, 255, 255, 256, + 256, 256, 255, 209, 255, 255, 256, 256, 256, 255, + 256, 217, 255, 255, 255, 255, 255, 9, 255, 37, + 255, 256, 255, 255, 255, 132, 134, 133, 135, 149, + 255, 152, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 94, 255, + 197, 255, 255, 255, 255, 255, 255, 255, 255, 256, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 255, 255, 49, 255, 28, 255, 255, 127, + 255, 255, 170, 256, 255, 255, 88, 86, 255, 141, + 255, 255, 57, 255, 255, 39, 4, 255, 40, 255, + 255, 255, 255, 256, 136, 255, 31, 255, 150, 256, + 167, 168, 26, 143, 255, 256, 256, 256, 255, 256, + 255, 41, 255, 42, 34, 255, 255, 256, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 77, 255, + 255, 255, 255, 255, 255, 255, 255, 256, 256, 255, + + 255, 255, 255, 255, 255, 161, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 27, 255, 172, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 55, + 255, 139, 256, 255, 255, 255, 256, 255, 95, 256, + 256, 255, 256, 255, 255, 255, 5, 256, 255, 67, + 6, 255, 255, 13, 140, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 63, 58, 255, + 255, 255, 255, 255, 47, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 256, 256, 255, 255, + 255, 255, 255, 255, 255, 255, 68, 255, 255, 255, + + 255, 255, 255, 255, 255, 11, 255, 210, 48, 255, + 23, 255, 255, 12, 142, 255, 256, 131, 255, 219, + 169, 222, 256, 97, 255, 215, 255, 255, 208, 256, + 113, 114, 115, 116, 117, 118, 119, 120, 255, 38, + 255, 255, 20, 255, 255, 255, 255, 255, 255, 255, + 112, 111, 54, 255, 21, 255, 255, 3, 255, 255, + 17, 255, 16, 255, 228, 255, 255, 255, 75, 76, + 255, 255, 255, 255, 255, 69, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 25, 255, 60, 255, 255, + 213, 255, 256, 255, 96, 256, 147, 214, 255, 216, + + 255, 212, 255, 255, 255, 255, 255, 255, 255, 255, + 44, 129, 151, 46, 255, 255, 255, 146, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 128, 61, 218, + 255, 255, 255, 255, 10, 255, 255, 56, 144, 193, + 255, 256, 256, 255, 22, 255, 255, 255, 255, 255, + 62, 255, 255, 255, 255, 255, 145, 255, 255, 255, + 64, 255, 255, 255, 255, 255, 255, 255, 130, 229, + 255, 255, 255, 255, 256, 256, 43, 255, 255, 255, + 109, 110, 108, 255, 255, 15, 255, 255, 14, 106, + 107, 105, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 256, 256, 255, 72, 255, 137, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 89, 30, 98, 256, 255, 227, 255, 173, 255, 255, + 255, 255, 255, 121, 124, 203, 255, 45, 255, 81, + 256, 138, 255, 255, 255, 255, 255, 255, 50, 255, + 99, 255, 255, 255, 255, 255, 255, 101, 255, 198, + 255, 255, 65, 66, 148, 122, 125, 123, 126, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -584,259 +590,273 @@ 3, 3, 3, 3, 3, 3, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[1107] = +static yyconst flex_int16_t yy_base[1175] = { 0, - 0, 0, 2288, 2289, 69, 2284, 2289, 70, 2289, 2289, - 2289, 2289, 2289, 0, 2289, 0, 0, 60, 119, 38, - 2289, 2289, 2256, 2289, 2253, 171, 220, 2289, 2289, 2289, - 2256, 227, 232, 103, 103, 248, 237, 108, 122, 2223, - 37, 2227, 124, 115, 214, 258, 2222, 280, 300, 41, - 271, 2231, 2289, 2289, 2289, 2289, 169, 2276, 2271, 173, - 0, 2289, 360, 138, 413, 460, 2289, 2289, 2249, 232, - 2248, 254, 489, 257, 152, 64, 189, 264, 154, 223, - 235, 295, 153, 267, 276, 122, 318, 306, 301, 278, - 323, 296, 329, 307, 356, 365, 304, 329, 351, 330, - - 350, 353, 358, 330, 367, 379, 369, 373, 375, 377, - 378, 388, 382, 387, 231, 391, 414, 376, 393, 419, - 434, 421, 394, 397, 398, 431, 422, 430, 2247, 433, - 440, 491, 467, 493, 441, 509, 427, 437, 497, 495, - 438, 498, 526, 499, 512, 520, 522, 500, 528, 527, - 501, 529, 531, 530, 536, 532, 537, 2289, 550, 2271, - 2289, 593, 0, 0, 551, 598, 313, 547, 541, 550, - 555, 2245, 562, 544, 586, 592, 587, 588, 2244, 602, - 584, 607, 2243, 622, 612, 435, 613, 618, 589, 619, - 614, 623, 632, 560, 646, 553, 625, 626, 628, 641, - - 644, 2242, 646, 649, 650, 648, 652, 653, 651, 654, - 655, 656, 658, 2241, 2240, 669, 688, 659, 657, 660, - 671, 679, 693, 681, 684, 685, 690, 691, 696, 692, - 2239, 698, 699, 704, 694, 695, 700, 2238, 726, 702, - 739, 703, 2237, 731, 705, 2236, 701, 737, 2235, 2210, - 752, 753, 733, 749, 735, 721, 756, 744, 758, 747, - 751, 754, 757, 760, 764, 759, 2233, 2232, 762, 761, - 2252, 788, 554, 803, 774, 82, 775, 782, 783, 787, - 785, 801, 797, 798, 790, 799, 803, 806, 807, 809, - 816, 808, 2211, 812, 2229, 2228, 817, 821, 819, 826, - - 827, 830, 836, 0, 0, 0, 0, 833, 838, 841, - 845, 848, 2227, 844, 846, 849, 847, 852, 857, 2226, - 855, 858, 859, 2225, 860, 2194, 876, 2223, 865, 2222, - 2221, 861, 2192, 2219, 873, 881, 875, 877, 2218, 883, - 884, 885, 2217, 889, 887, 895, 891, 896, 897, 898, - 901, 903, 899, 916, 0, 0, 2189, 904, 907, 905, - 911, 918, 2215, 2183, 2183, 2182, 920, 923, 2211, 2210, - 925, 927, 214, 930, 2192, 929, 931, 933, 932, 938, - 936, 940, 939, 2208, 943, 949, 958, 947, 0, 0, - 0, 0, 973, 0, 0, 0, 0, 983, 0, 0, - - 951, 962, 946, 956, 967, 974, 980, 982, 984, 985, - 986, 987, 988, 989, 991, 994, 990, 998, 999, 995, - 1006, 996, 2176, 1000, 1003, 1007, 1011, 1029, 1030, 1032, - 1034, 1009, 1035, 1036, 1038, 1039, 1040, 1043, 1044, 2206, - 1047, 1045, 1048, 1050, 1049, 1052, 2192, 2174, 428, 1051, - 2178, 1056, 1053, 1058, 1062, 2202, 1059, 1060, 1067, 1070, - 1072, 1073, 1075, 1081, 1083, 1084, 1085, 1086, 1093, 1103, - 2186, 1088, 1100, 1102, 1104, 1105, 2213, 2186, 2185, 1108, - 1110, 1111, 1115, 2170, 2169, 1112, 2177, 1114, 1116, 1113, - 1119, 2194, 1117, 1118, 1124, 1120, 2193, 1122, 1131, 2175, - - 1123, 1140, 1125, 1153, 1149, 1156, 1160, 1134, 1163, 1150, - 1159, 1161, 1162, 1167, 1164, 1165, 1168, 1169, 1171, 1173, - 1174, 1175, 1179, 1195, 1170, 1189, 2191, 1172, 1197, 1196, - 1198, 1202, 1203, 2175, 1204, 1206, 1208, 1210, 1212, 1216, - 2161, 1219, 1218, 1223, 1220, 1227, 1224, 1228, 1231, 1234, - 1239, 1245, 1232, 1251, 1225, 1235, 2153, 2174, 1243, 1254, - 2171, 1257, 2185, 2184, 1259, 1261, 1266, 1264, 1267, 1268, - 1269, 1271, 1272, 1274, 1275, 1276, 1279, 2183, 2182, 2158, - 1281, 1280, 1278, 1282, 1283, 2150, 2144, 2143, 1284, 2177, - 1289, 1298, 2149, 2149, 1301, 2141, 2173, 1303, 1306, 1307, - - 1309, 1308, 2172, 1311, 2171, 1312, 2152, 1313, 1314, 1316, - 2169, 2168, 2167, 2166, 2165, 1317, 2164, 1318, 1320, 1321, - 1324, 1328, 1334, 1331, 1337, 1335, 1340, 1343, 1347, 1350, - 1342, 1348, 1353, 1355, 1357, 1358, 1361, 1363, 1366, 1367, - 1368, 1369, 1372, 0, 1373, 1375, 1377, 1379, 1380, 1381, - 1392, 1390, 1391, 1387, 1395, 1397, 1394, 1399, 1402, 1403, - 1406, 1409, 1410, 1413, 1408, 1416, 2163, 1418, 1419, 1423, - 2162, 1427, 0, 2126, 1424, 1428, 0, 1429, 2160, 1431, - 1435, 2159, 1432, 1433, 2158, 2157, 1438, 2156, 1442, 1446, - 1441, 2124, 2154, 1447, 1453, 1448, 2153, 2139, 0, 0, - - 2151, 2150, 1449, 2117, 2130, 1454, 2116, 1456, 2146, 1466, - 2145, 2144, 1467, 1468, 2110, 1472, 1474, 1475, 1477, 1480, - 1478, 1482, 1483, 1494, 1484, 1485, 1487, 1488, 1489, 1490, - 1498, 1491, 1495, 1501, 1497, 1503, 1506, 1515, 1516, 1517, - 1520, 1521, 1522, 1523, 1524, 2142, 1525, 1532, 1528, 1527, - 1533, 1534, 2143, 2148, 1536, 1542, 1543, 1547, 1544, 1554, - 2139, 1552, 1555, 1556, 1557, 1558, 1562, 1564, 1565, 1568, - 1571, 1569, 0, 1572, 1574, 1573, 1576, 1577, 1580, 1588, - 1584, 1589, 1594, 2138, 2137, 2104, 1596, 1600, 1602, 2100, - 1582, 0, 2113, 1603, 2116, 1607, 1608, 1609, 2132, 2100, - - 1637, 2130, 2129, 1612, 1619, 2128, 2127, 1616, 1638, 1615, - 1610, 1642, 1643, 1644, 1647, 1648, 1625, 1617, 1621, 2126, - 2125, 1645, 1649, 1652, 1653, 1661, 2124, 1663, 1664, 1665, - 1666, 1667, 1668, 1671, 1672, 1669, 2129, 2131, 1675, 1677, - 1688, 1690, 1673, 1670, 1692, 1691, 2121, 1697, 1698, 1681, - 1699, 1705, 1701, 1706, 1707, 2120, 1708, 2119, 2118, 1710, - 1715, 1711, 1709, 2117, 2116, 2098, 2114, 1714, 2113, 0, - 2112, 2092, 1716, 0, 1717, 1720, 2110, 2092, 2108, 2107, - 2106, 2105, 2104, 2103, 2102, 2101, 1724, 2100, 1729, 1722, - 2099, 1732, 1734, 1733, 1735, 1742, 1743, 1744, 2098, 2097, - - 2096, 1745, 2095, 1746, 1750, 2094, 1747, 1748, 1752, 2093, - 1751, 2092, 1759, 1754, 0, 0, 1768, 1769, 1755, 1770, - 1772, 2091, 1771, 1773, 1780, 1774, 1782, 1785, 1786, 1787, - 1788, 2090, 1794, 2089, 1796, 1797, 2088, 2059, 1800, 0, - 2086, 2085, 1801, 0, 1804, 2084, 1803, 1806, 1808, 1805, - 1813, 1809, 1815, 1810, 2083, 2082, 2081, 2080, 1817, 1835, - 1825, 1838, 1836, 1839, 1840, 1811, 1841, 1846, 1842, 1849, - 2079, 2078, 2077, 1812, 1847, 1816, 1850, 2076, 1851, 1852, - 2075, 0, 1862, 1863, 2074, 1864, 1867, 1870, 1868, 1871, - 2073, 1872, 1873, 1874, 1878, 1883, 2072, 1882, 1876, 1879, - - 2071, 1881, 1890, 1885, 1884, 1892, 1895, 1902, 2070, 2069, - 1893, 1903, 1904, 1907, 2058, 1906, 1911, 1912, 2057, 2055, - 2054, 1917, 1919, 2053, 1923, 1924, 2052, 2051, 2050, 2049, - 1925, 1927, 1930, 1928, 1936, 1938, 1939, 1940, 1942, 1943, - 1946, 2048, 1947, 2047, 1950, 1944, 1949, 1960, 1961, 1984, - 1988, 1952, 1969, 1981, 1982, 1956, 2046, 2044, 1987, 2043, - 1989, 2041, 1990, 1991, 1992, 1993, 1994, 2039, 2038, 2035, - 1995, 2027, 1996, 1962, 1958, 1999, 2002, 2001, 2007, 2000, - 2008, 1955, 2010, 2013, 2020, 1997, 2019, 2025, 2026, 1954, - 2022, 1620, 2040, 2042, 1176, 707, 561, 436, 432, 384, - - 230, 2289, 152, 2087, 2090, 2093 + 0, 0, 2402, 2403, 69, 2398, 2403, 70, 2403, 2403, + 2403, 2403, 2403, 0, 2403, 0, 0, 60, 119, 38, + 2403, 2403, 2370, 2403, 2367, 171, 220, 2403, 2403, 2403, + 2370, 227, 232, 103, 121, 248, 237, 108, 115, 2337, + 37, 2341, 260, 126, 214, 258, 2336, 283, 303, 41, + 276, 2345, 2403, 2403, 2403, 2403, 169, 2390, 2385, 172, + 0, 2403, 363, 121, 416, 463, 2403, 2403, 2363, 165, + 2362, 228, 492, 227, 120, 306, 320, 56, 152, 147, + 145, 294, 329, 230, 254, 267, 299, 220, 313, 148, + 324, 353, 357, 308, 302, 364, 383, 382, 361, 350, + + 386, 333, 231, 359, 378, 368, 383, 385, 417, 420, + 421, 422, 360, 398, 424, 399, 310, 393, 428, 379, + 427, 438, 498, 431, 434, 441, 444, 445, 446, 432, + 440, 499, 450, 495, 471, 500, 474, 529, 501, 503, + 504, 493, 515, 519, 548, 527, 520, 530, 531, 526, + 523, 545, 551, 552, 554, 555, 556, 557, 559, 2403, + 573, 2386, 2403, 615, 0, 0, 620, 621, 576, 577, + 565, 568, 579, 604, 2360, 566, 586, 611, 622, 610, + 602, 2359, 613, 605, 629, 2358, 643, 634, 638, 603, + 561, 639, 612, 646, 647, 648, 650, 651, 653, 668, + + 2357, 662, 666, 668, 670, 665, 671, 2356, 672, 675, + 673, 676, 679, 678, 677, 680, 681, 691, 695, 698, + 702, 2355, 2354, 703, 718, 704, 699, 706, 710, 709, + 724, 447, 713, 715, 717, 719, 720, 728, 2353, 2352, + 730, 729, 739, 732, 733, 735, 2351, 749, 750, 768, + 767, 748, 2350, 756, 760, 2349, 740, 768, 2348, 2323, + 783, 785, 762, 784, 734, 774, 791, 782, 793, 786, + 788, 789, 796, 797, 790, 800, 2346, 2345, 798, 801, + 2365, 839, 229, 843, 802, 398, 849, 815, 803, 799, + 809, 818, 837, 822, 820, 843, 825, 846, 850, 848, + + 852, 856, 857, 2324, 858, 860, 2342, 2341, 861, 862, + 864, 866, 870, 871, 872, 874, 0, 0, 0, 0, + 873, 876, 884, 887, 893, 2340, 882, 886, 897, 889, + 896, 899, 900, 2339, 903, 901, 902, 2338, 905, 907, + 2307, 922, 2336, 911, 2335, 2334, 919, 2305, 2332, 920, + 921, 924, 926, 2331, 928, 929, 935, 2330, 930, 938, + 939, 940, 942, 945, 944, 946, 948, 952, 967, 0, + 0, 2302, 963, 947, 950, 957, 972, 964, 2328, 2296, + 2296, 2295, 975, 974, 2324, 2323, 976, 981, 968, 977, + 2305, 979, 984, 985, 986, 988, 990, 991, 992, 2321, + + 993, 997, 1014, 1002, 0, 0, 0, 0, 1023, 0, + 0, 0, 0, 1035, 0, 0, 0, 0, 0, 0, + 1003, 577, 1007, 1015, 1017, 1020, 1021, 1029, 1032, 1034, + 1033, 1036, 1039, 1040, 1041, 1043, 1044, 1056, 1049, 1053, + 1061, 1050, 2289, 1054, 1062, 1058, 1057, 1073, 1082, 1084, + 1086, 1100, 1089, 1060, 1066, 1091, 1093, 1068, 1095, 1094, + 1097, 2319, 1102, 1104, 1103, 1106, 1107, 1108, 1111, 1112, + 2305, 2287, 1114, 1113, 1096, 1117, 1124, 1126, 1130, 2316, + 1131, 1133, 1134, 1137, 1135, 1136, 1142, 1139, 1144, 1145, + 1141, 1146, 1155, 309, 80, 2300, 0, 0, 1151, 1150, + + 1153, 1157, 1156, 2327, 2300, 2299, 1159, 1171, 1172, 1177, + 2284, 2283, 2285, 1169, 2290, 1178, 1175, 1179, 1180, 2307, + 1181, 1182, 1185, 144, 2306, 1190, 1184, 2288, 1193, 1195, + 1196, 1206, 1207, 1217, 1208, 1211, 1221, 1214, 1218, 1220, + 1222, 1219, 1224, 1225, 1226, 1227, 1241, 1229, 1230, 1234, + 1235, 1238, 1253, 1251, 2304, 1254, 1257, 1259, 1262, 1261, + 1265, 2288, 1263, 1239, 1270, 1273, 1268, 1278, 1282, 1285, + 2274, 1279, 1284, 1289, 1287, 1297, 1288, 1291, 1292, 1295, + 1300, 1310, 1303, 1301, 1315, 1313, 1321, 1323, 2266, 2287, + 1324, 1328, 2274, 2283, 1329, 2297, 2296, 1330, 1331, 1332, + + 1333, 1334, 1337, 1335, 1339, 1340, 1341, 1342, 1344, 1345, + 1349, 2295, 2294, 2270, 1347, 1354, 1360, 1364, 1348, 2262, + 2256, 2255, 1356, 2289, 1366, 1370, 2261, 2261, 2273, 1374, + 2252, 2284, 1375, 1381, 1378, 1383, 1379, 2283, 1384, 2282, + 1385, 2263, 1386, 1387, 1389, 2280, 2279, 2278, 2277, 2276, + 1390, 2275, 1388, 1392, 1391, 1393, 1401, 1406, 1408, 1394, + 1410, 1412, 1416, 1419, 1420, 1422, 1425, 1426, 1428, 1430, + 1427, 1431, 1435, 1437, 1438, 1439, 1440, 1441, 0, 1443, + 2274, 1444, 1450, 1446, 1453, 1454, 1456, 1458, 1465, 1238, + 1464, 1460, 1466, 1474, 1467, 1475, 1476, 1479, 1481, 1482, + + 1486, 1487, 1480, 1489, 2273, 1492, 2272, 1495, 1494, 2271, + 1500, 1501, 0, 2235, 1502, 1503, 0, 0, 1504, 2269, + 1505, 1509, 2268, 1507, 1514, 2267, 2266, 1516, 2265, 1521, + 1522, 1515, 1523, 2233, 2263, 1518, 1540, 1524, 2262, 2248, + 0, 0, 2260, 2259, 1527, 2226, 2239, 2222, 1525, 2224, + 1530, 2254, 1544, 2253, 2252, 1548, 1549, 2218, 1550, 1551, + 1553, 1555, 1559, 1556, 1558, 1560, 1569, 1563, 1564, 1565, + 1566, 1567, 1568, 1576, 1581, 1584, 1585, 1571, 1572, 1575, + 1578, 1590, 1594, 1593, 1596, 1600, 1597, 1607, 2250, 1608, + 1609, 1615, 1610, 1616, 1618, 1620, 1619, 2251, 2256, 1621, + + 1622, 1625, 1627, 1629, 1626, 2247, 1630, 1637, 1634, 1636, + 1638, 1639, 1641, 1647, 1651, 1652, 2246, 1657, 0, 1655, + 1662, 1663, 1661, 1658, 1664, 1669, 1666, 1667, 1676, 2245, + 1665, 2244, 2211, 1684, 1670, 1686, 2207, 1685, 0, 2220, + 2223, 1688, 2222, 1689, 1691, 1692, 2238, 2206, 1734, 2236, + 2235, 1695, 1696, 2234, 2233, 1707, 1698, 1705, 1699, 1703, + 1721, 1735, 1737, 1738, 1714, 1706, 1708, 2232, 2231, 1739, + 1711, 1716, 1744, 1746, 2230, 1748, 1751, 1752, 1753, 1754, + 1755, 1757, 1759, 1758, 1760, 1763, 2235, 2237, 1764, 1768, + 1775, 1777, 1762, 1769, 1785, 1783, 2227, 1786, 1788, 1766, + + 1790, 1697, 1791, 1793, 1794, 2226, 1796, 2225, 2224, 1799, + 1800, 1801, 1802, 2223, 2222, 1806, 2204, 2220, 1805, 2219, + 0, 2218, 2198, 2229, 1803, 0, 1810, 1811, 2215, 2197, + 2213, 2212, 2211, 2210, 2209, 2208, 2207, 2206, 1813, 2205, + 1814, 1821, 2204, 1817, 1825, 1827, 1828, 1832, 1831, 1830, + 2203, 2202, 2201, 1839, 2200, 1836, 1840, 2199, 1833, 1835, + 2198, 1841, 2197, 1837, 2196, 1848, 1846, 1847, 0, 0, + 1858, 1859, 1866, 1860, 1861, 2195, 1867, 1869, 1871, 1872, + 1875, 1876, 1877, 1878, 1879, 2194, 1880, 2193, 1886, 1884, + 2192, 1892, 2163, 1896, 0, 1879, 2190, 2189, 1897, 0, + + 1899, 2188, 1900, 1902, 1903, 1904, 1905, 1906, 1907, 1914, + 2187, 2186, 2185, 2184, 1917, 1919, 1930, 2183, 1908, 1931, + 1934, 1935, 1910, 1936, 1941, 1939, 1938, 2182, 2181, 2180, + 1943, 1946, 1945, 1932, 2179, 1947, 1948, 2178, 2177, 0, + 1954, 2149, 2148, 1957, 2174, 1958, 1959, 1961, 1962, 1963, + 2173, 1966, 1968, 1970, 1972, 1973, 2172, 1976, 1978, 1980, + 2171, 1981, 1983, 1984, 1991, 1993, 1995, 1996, 2170, 2169, + 1997, 1998, 2002, 2001, 2141, 2141, 2166, 2005, 2006, 2012, + 2165, 2164, 2163, 2004, 2011, 2162, 2009, 2022, 2161, 2151, + 2148, 2147, 2013, 2020, 2026, 2028, 2031, 2034, 2035, 2038, + + 2042, 2040, 2114, 2127, 2041, 2144, 2043, 2143, 2046, 2047, + 2044, 2048, 2054, 2079, 2081, 2050, 2052, 2056, 2075, 2053, + 2142, 2141, 0, 2119, 2076, 2138, 2082, 2137, 2084, 2085, + 2086, 2087, 2088, 2135, 2134, 2132, 2089, 2131, 2090, 2130, + 2101, 2051, 2094, 2092, 2095, 2097, 2098, 2101, 1719, 2103, + 0, 2110, 2104, 2091, 2113, 2115, 2118, 1228, 2116, 804, + 2133, 2136, 567, 525, 390, 311, 301, 226, 223, 2403, + 147, 2179, 2182, 2185 } ; -static yyconst flex_int16_t yy_def[1107] = +static yyconst flex_int16_t yy_def[1175] = { 0, - 1102, 1, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1103, 1102, 1103, 1103, 1103, 1103, 19, - 1102, 1102, 1102, 1102, 1102, 1102, 26, 1102, 1102, 1102, + 1170, 1, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1171, 1170, 1171, 1171, 1171, 1171, 19, + 1170, 1170, 1170, 1170, 1170, 1170, 26, 1170, 1170, 1170, 27, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1102, 1102, 1102, 1102, 1102, 1102, 1104, 1104, - 1103, 1102, 1105, 19, 19, 65, 1102, 1102, 26, 1102, - 27, 26, 27, 27, 73, 73, 73, 27, 27, 27, - 73, 27, 27, 27, 27, 27, 73, 73, 27, 27, - 73, 27, 73, 73, 73, 27, 27, 27, 27, 73, + 27, 27, 1170, 1170, 1170, 1170, 1170, 1170, 1172, 1172, + 1171, 1170, 1173, 19, 19, 65, 1170, 1170, 26, 1170, + 27, 26, 27, 27, 26, 73, 73, 27, 27, 27, + 26, 27, 27, 27, 27, 27, 26, 26, 27, 27, + 27, 26, 27, 27, 26, 73, 73, 27, 27, 27, + 27, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1170, + 1170, 1174, 1170, 1173, 66, 1171, 26, 27, 26, 73, + 27, 27, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 1102, 1102, 1106, - 1102, 1105, 66, 1103, 73, 27, 73, 27, 27, 73, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 73, 27, 1103, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 26, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 1103, 27, 27, 27, 27, 27, 27, 27, 27, 1103, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1171, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 1104, 1103, 27, 1103, 27, 1103, 27, 27, 27, 27, + 1172, 1171, 27, 1171, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 1103, 1103, 1103, 1103, 27, 27, 27, + 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 1171, 1171, 1171, 1171, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 1103, 27, 27, 27, 27, - 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, + 1171, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 1103, 1103, 1103, 27, 27, 27, - 27, 27, 27, 1103, 1103, 1103, 27, 27, 27, 27, - 27, 27, 1103, 27, 1103, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 1103, 1103, - 1103, 1103, 27, 1103, 1103, 1103, 1103, 27, 1103, 1103, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1171, + 1171, 1171, 1171, 27, 27, 27, 27, 27, 27, 1171, + 1171, 1171, 27, 27, 27, 27, 27, 27, 1171, 27, + 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 1171, 1171, 1171, 1171, 27, 1171, + 1171, 1171, 1171, 27, 1171, 1171, 1171, 1171, 1171, 1171, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 1103, 1103, 27, 27, - 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 1171, 1171, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 1103, 27, 27, 27, 27, 27, 1103, 1103, 1103, 27, - 27, 27, 27, 1103, 1103, 27, 1103, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 1103, + 27, 27, 27, 27, 27, 1171, 1171, 1171, 27, 27, + 27, 27, 27, 1171, 1171, 1171, 27, 27, 27, 27, + 1171, 1171, 1171, 27, 1171, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, - 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 1103, 1103, 27, 27, - 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 1103, - 27, 27, 27, 27, 27, 1103, 1103, 1103, 27, 27, - 27, 27, 1103, 1103, 27, 1103, 27, 27, 27, 27, + 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, + 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 1171, 1171, + 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 1171, 27, 27, 27, 27, 27, 1171, + 1171, 1171, 27, 27, 27, 27, 1171, 1171, 1171, 27, + 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, - 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 1171, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1103, 1103, 27, 27, 1103, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 1103, 27, 27, 27, 27, 27, 1103, 1103, 1103, - 27, 27, 27, 1103, 1103, 27, 1103, 27, 27, 27, - 27, 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 1171, 1171, 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 1171, 27, 27, 27, 27, 27, 1171, + 1171, 1171, 27, 27, 27, 1171, 1171, 1171, 27, 1171, + 27, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1103, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 1103, 27, 27, 27, 1103, - 27, 1103, 1103, 27, 1103, 27, 27, 27, 27, 1103, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 1171, 1171, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 1103, 1103, 27, 27, + 27, 27, 1171, 27, 27, 27, 1171, 27, 1171, 1171, + 1171, 27, 1171, 27, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 1103, 27, 27, 27, 1103, - 27, 1103, 27, 1103, 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 1103, 1103, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 1171, 27, 27, 27, + 1171, 27, 1171, 1171, 27, 1171, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 1103, 27, 1103, - 27, 27, 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 1103, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 1171, 27, 1171, 1171, 27, 27, 27, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 1171, + 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + + 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 1171, 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 0, 1102, 1102, 1102, 1102 + 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 1171, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, + 1170, 1170, 1170, 1170 } ; -static yyconst flex_int16_t yy_nxt[2360] = +static yyconst flex_int16_t yy_nxt[2474] = { 0, 4, 5, 6, 7, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, @@ -846,260 +866,273 @@ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 27, 27, 52, 27, 27, 53, 54, 55, 56, 57, 62, 61, 57, 59, 59, 63, 59, 59, 59, - 59, 111, 59, 69, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 112, 151, 399, + 59, 113, 59, 1170, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 114, 153, 613, - 400, 61, 60, 60, 60, 152, 59, 170, 59, 59, + 175, 61, 60, 60, 60, 154, 59, 1170, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 87, 91, 88, 1102, - 89, 65, 105, 66, 61, 120, 106, 90, 92, 65, - 65, 65, 65, 65, 65, 107, 114, 115, 116, 121, - 57, 69, 61, 57, 108, 109, 117, 182, 118, 158, - 1102, 1102, 66, 61, 119, 61, 61, 61, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 70, 178, + 64, 64, 64, 64, 64, 64, 87, 1170, 88, 61, + 89, 65, 107, 66, 90, 61, 108, 91, 109, 65, + 65, 65, 65, 65, 65, 92, 122, 110, 111, 93, + 57, 1170, 1170, 57, 1170, 1170, 94, 172, 160, 1170, + 123, 166, 66, 61, 61, 61, 61, 61, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 70, 161, - 159, 61, 173, 69, 71, 71, 179, 61, 69, 169, + 176, 166, 178, 69, 71, 71, 177, 61, 189, 639, 71, 69, 69, 69, 69, 69, 69, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 171, 164, 72, - 1102, 73, 71, 215, 69, 484, 485, 1102, 1102, 122, - 71, 71, 71, 71, 71, 71, 74, 75, 164, 123, - 76, 77, 124, 81, 165, 78, 125, 100, 79, 82, - 83, 1102, 174, 84, 1102, 101, 85, 80, 93, 102, - 94, 1102, 175, 95, 1102, 103, 86, 104, 126, 96, - - 127, 97, 136, 1102, 168, 1102, 128, 98, 172, 129, - 130, 99, 153, 131, 154, 132, 133, 166, 134, 155, - 137, 180, 1102, 1102, 138, 69, 69, 276, 1102, 156, - 181, 1102, 69, 186, 176, 187, 191, 69, 139, 140, - 141, 142, 69, 143, 144, 185, 196, 145, 69, 69, - 193, 146, 147, 177, 184, 148, 1102, 1102, 149, 150, - 160, 160, 161, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 183, 160, 188, 69, 197, 1102, 1102, 195, - 1102, 189, 200, 204, 190, 1102, 192, 160, 160, 160, - 160, 160, 1102, 198, 1102, 160, 1102, 160, 160, 203, - - 1102, 201, 1102, 1102, 1102, 1102, 1102, 205, 207, 1102, - 199, 1102, 202, 208, 1102, 1102, 194, 210, 1102, 218, - 1102, 1102, 213, 209, 1102, 1102, 160, 160, 160, 160, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 206, 1102, 211, 212, 219, 214, 1102, 61, 1102, 1102, - 216, 228, 227, 226, 1102, 1102, 217, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 225, 1102, 1102, 559, - 230, 220, 221, 231, 222, 232, 61, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 223, 229, 243, - 234, 224, 163, 233, 1102, 244, 240, 248, 245, 295, - - 163, 163, 163, 163, 163, 163, 69, 69, 167, 69, - 69, 69, 69, 69, 69, 69, 1102, 237, 1102, 238, - 1102, 69, 1102, 241, 1102, 1102, 1102, 1102, 1102, 69, - 69, 69, 69, 69, 69, 235, 1102, 246, 239, 1102, - 250, 253, 247, 251, 252, 236, 249, 1102, 242, 1102, - 259, 260, 254, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 256, 263, 258, 1102, 1102, 272, 271, 262, 1102, 69, - 69, 1102, 255, 268, 1102, 266, 269, 257, 261, 267, - 1102, 1102, 1102, 278, 264, 265, 271, 1102, 1102, 1102, - 273, 282, 270, 160, 160, 161, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 280, 160, 279, 281, 277, - 308, 1102, 274, 1102, 1102, 1102, 1102, 393, 303, 1102, - 160, 160, 160, 160, 160, 1102, 283, 289, 160, 1102, - 160, 160, 284, 285, 1102, 288, 293, 275, 286, 1102, - 1102, 1102, 287, 291, 290, 1102, 1102, 292, 298, 1102, - 1102, 69, 1102, 1102, 294, 1102, 300, 296, 297, 160, - 160, 160, 160, 304, 305, 306, 307, 299, 1102, 309, - 310, 1102, 311, 1102, 301, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 313, 312, - 302, 315, 317, 316, 318, 323, 1102, 314, 1102, 319, - - 321, 324, 326, 328, 330, 327, 1102, 333, 1102, 325, - 320, 1102, 1102, 322, 331, 1102, 329, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 338, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 336, 1102, 340, 343, 334, 339, 332, - 341, 344, 337, 346, 345, 350, 358, 351, 1102, 347, - 354, 335, 348, 1102, 349, 342, 355, 356, 1102, 361, - 1102, 359, 1102, 362, 1102, 352, 365, 366, 369, 370, - 373, 1102, 375, 353, 1102, 360, 1102, 363, 1102, 1102, - 1102, 1102, 372, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 357, 1102, 367, 368, 371, 379, 380, 376, 386, 374, - - 388, 1102, 1102, 377, 384, 389, 390, 391, 392, 1102, - 1102, 381, 1102, 382, 1102, 383, 378, 1102, 385, 387, - 394, 395, 396, 397, 1102, 1102, 1102, 403, 1102, 402, - 1102, 404, 401, 1102, 1102, 1102, 1102, 398, 405, 1102, - 406, 412, 407, 1102, 1102, 408, 1102, 414, 1102, 410, - 409, 416, 415, 1102, 1102, 418, 413, 1102, 411, 417, - 1102, 427, 424, 1102, 419, 1102, 422, 420, 1102, 426, - 430, 1102, 1102, 1102, 1102, 1102, 1102, 421, 428, 1102, - 431, 425, 1102, 437, 1102, 1102, 1102, 1102, 1102, 440, - 448, 429, 1102, 439, 443, 433, 434, 432, 435, 436, - - 1102, 442, 1102, 1102, 1102, 438, 441, 446, 1102, 445, - 1102, 1102, 1102, 449, 1102, 444, 1102, 452, 1102, 454, - 450, 453, 1102, 1102, 1102, 1102, 1102, 455, 1102, 459, - 1102, 1102, 1102, 458, 1102, 469, 470, 457, 1102, 462, - 456, 464, 468, 1102, 463, 1102, 465, 1102, 467, 460, - 1102, 466, 1102, 461, 1102, 473, 1102, 1102, 1102, 1102, - 1102, 475, 474, 1102, 472, 1102, 1102, 1102, 480, 486, - 1102, 483, 500, 1102, 1102, 476, 1102, 488, 1102, 490, - 481, 491, 509, 1102, 482, 1102, 493, 489, 495, 1102, - 498, 492, 499, 504, 1102, 494, 505, 501, 496, 503, - - 1102, 1102, 497, 506, 510, 508, 507, 1102, 502, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 512, - 511, 1102, 1102, 1102, 519, 1102, 1102, 1102, 513, 514, - 1102, 516, 515, 1102, 1102, 517, 1102, 521, 1102, 523, - 528, 529, 536, 518, 525, 520, 541, 526, 527, 531, - 532, 530, 522, 524, 533, 538, 1102, 1102, 535, 1102, - 537, 1102, 1102, 1102, 543, 1102, 1102, 1102, 539, 540, - 1102, 1102, 1102, 542, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 546, 548, 1102, 552, 1102, 1102, 1102, 544, 1102, - 551, 549, 554, 555, 1102, 545, 556, 1102, 562, 1102, - - 1102, 550, 1102, 547, 563, 560, 565, 553, 1102, 569, - 1102, 1102, 1102, 1102, 578, 1102, 570, 564, 566, 567, - 1102, 572, 579, 573, 571, 577, 568, 1102, 581, 1102, - 1102, 1102, 1102, 576, 574, 1102, 575, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 584, 1102, - 1102, 1102, 1102, 582, 590, 591, 592, 597, 1102, 585, - 598, 1102, 589, 583, 599, 600, 603, 1102, 601, 605, - 612, 606, 611, 608, 595, 613, 1102, 1102, 602, 610, - 1102, 614, 616, 1102, 609, 604, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 615, 1102, 1102, 1102, 1102, 1102, 1102, - - 1102, 1102, 1102, 1102, 618, 619, 1102, 621, 617, 625, - 636, 622, 626, 631, 632, 620, 1102, 627, 633, 623, - 630, 628, 1102, 1102, 1102, 1102, 638, 624, 629, 1102, - 1102, 1102, 637, 1102, 634, 1102, 640, 1102, 641, 1102, - 635, 639, 643, 1102, 642, 1102, 1102, 1102, 648, 649, - 1102, 1102, 1102, 646, 1102, 1102, 650, 647, 1102, 1102, - 653, 1102, 1102, 651, 645, 654, 1102, 659, 660, 655, - 1102, 661, 1102, 665, 662, 672, 656, 658, 1102, 657, - 669, 1102, 663, 667, 1102, 664, 1102, 668, 1102, 671, - 670, 1102, 666, 1102, 1102, 1102, 1102, 675, 1102, 1102, - - 680, 1102, 1102, 1102, 682, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 676, 685, 681, 683, 1102, 678, 688, 684, - 691, 696, 695, 679, 686, 1102, 694, 690, 1102, 689, - 1102, 687, 693, 1102, 1102, 1102, 1102, 701, 1102, 1102, - 1102, 1102, 697, 1102, 1102, 1102, 702, 1102, 1102, 706, - 709, 1102, 703, 711, 708, 1102, 719, 716, 1102, 718, - 710, 1102, 1102, 712, 1102, 713, 720, 1102, 724, 1102, - 1102, 714, 722, 721, 1102, 1102, 725, 1102, 717, 726, - 1102, 723, 1102, 727, 1102, 1102, 728, 730, 1102, 732, - 1102, 731, 733, 1102, 1102, 1102, 1102, 729, 734, 1102, - - 1102, 735, 1102, 736, 1102, 737, 1102, 1102, 1102, 739, - 753, 743, 754, 742, 1102, 747, 740, 738, 1102, 1102, - 745, 1102, 1102, 750, 1102, 746, 1102, 741, 744, 1102, - 1102, 748, 752, 1102, 751, 1102, 1102, 1102, 749, 757, - 1102, 758, 755, 1102, 756, 1102, 1102, 760, 767, 763, - 1102, 1102, 759, 764, 1102, 1102, 1102, 762, 1102, 1102, - 1102, 761, 1102, 765, 768, 1102, 766, 771, 1102, 1102, - 772, 770, 769, 1102, 1102, 1102, 1102, 781, 774, 777, - 1102, 1102, 782, 1102, 780, 783, 776, 775, 785, 779, - 784, 778, 788, 1102, 1102, 1102, 789, 794, 787, 1102, - - 796, 1102, 1102, 791, 1102, 1102, 797, 1102, 799, 1102, - 1102, 1102, 1102, 809, 1102, 1102, 1102, 1102, 1102, 803, - 798, 1102, 1102, 808, 1102, 1102, 812, 811, 1102, 804, - 1102, 805, 802, 1102, 810, 817, 801, 806, 813, 818, - 815, 816, 1102, 1102, 1102, 819, 807, 1102, 1102, 1102, - 1102, 1102, 1102, 814, 1102, 1102, 824, 822, 820, 1102, - 1102, 1102, 825, 1102, 821, 827, 828, 830, 826, 1102, - 1102, 1102, 832, 835, 1102, 823, 833, 829, 831, 1102, - 834, 1102, 1102, 1102, 1102, 1102, 839, 836, 843, 1102, - 842, 1102, 1102, 841, 846, 1102, 1102, 849, 1102, 1102, - - 1102, 1102, 848, 1102, 1102, 845, 840, 1102, 844, 1102, - 851, 1102, 853, 855, 857, 1102, 1102, 858, 852, 859, - 847, 1102, 850, 1102, 854, 860, 863, 1102, 862, 1102, - 1102, 856, 864, 861, 1102, 1102, 1102, 1102, 865, 1102, - 867, 871, 1102, 1102, 1102, 869, 1102, 1102, 1102, 875, - 892, 868, 1102, 877, 879, 880, 881, 882, 883, 884, - 885, 886, 873, 888, 1102, 1102, 887, 876, 889, 1102, - 1102, 1102, 1102, 891, 1102, 1102, 1102, 890, 898, 1102, - 1102, 899, 894, 895, 893, 900, 896, 897, 1102, 901, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - - 1102, 904, 1102, 905, 1102, 903, 902, 908, 1102, 909, - 910, 912, 914, 913, 917, 1102, 918, 1102, 1102, 1102, - 906, 907, 911, 922, 1102, 1102, 1102, 919, 1102, 920, - 921, 923, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 924, - 927, 1102, 1102, 1102, 1102, 925, 926, 1102, 931, 1102, - 929, 1102, 928, 934, 935, 930, 1102, 936, 939, 1102, - 1102, 1102, 1102, 941, 932, 933, 947, 945, 937, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 942, 1102, 1102, 1102, - 943, 1102, 1102, 950, 954, 951, 1102, 946, 949, 955, - 952, 948, 956, 953, 957, 1102, 1102, 1102, 1102, 1102, - - 1102, 1102, 959, 966, 961, 958, 960, 1102, 963, 1102, - 962, 968, 1102, 1102, 1102, 1102, 970, 972, 964, 965, - 967, 1102, 969, 1102, 1102, 974, 971, 1102, 1102, 973, - 1102, 1102, 1102, 1102, 975, 1102, 1102, 1102, 1102, 1102, - 1102, 981, 1102, 1102, 1102, 977, 983, 976, 985, 989, - 979, 993, 1102, 978, 987, 980, 986, 990, 984, 992, - 994, 988, 1102, 1102, 996, 1102, 1102, 1102, 1102, 1102, - 991, 1008, 1001, 1102, 1102, 1010, 1102, 1102, 1102, 1102, - 995, 998, 997, 999, 1000, 1002, 1006, 1003, 1007, 1102, - 1102, 1102, 1004, 1009, 1102, 1102, 1005, 1102, 1102, 1102, - - 1102, 1102, 1014, 1102, 1016, 1102, 1102, 1015, 1102, 1102, - 1102, 1102, 1102, 1012, 1011, 1018, 1013, 1102, 1023, 1102, - 1102, 1017, 1102, 1024, 1022, 1025, 1026, 1027, 1033, 1102, - 1102, 1102, 1019, 1102, 1102, 1020, 1021, 1035, 1102, 1102, - 1028, 1031, 1032, 1029, 1102, 1030, 1102, 1041, 1037, 1040, - 1102, 1102, 1102, 1034, 1102, 1102, 1038, 1102, 1045, 1039, - 1043, 1044, 1036, 1102, 1042, 1102, 1102, 1102, 1047, 1102, - 1102, 1102, 1052, 1102, 1102, 1048, 1102, 1102, 1046, 1102, - 1050, 1102, 1102, 1102, 1056, 1102, 1057, 1102, 1102, 1102, - 1053, 1049, 1061, 1060, 1051, 1054, 1102, 1059, 1055, 1064, - - 1065, 1066, 1067, 1070, 1062, 1068, 1069, 1058, 1102, 1102, - 1063, 1102, 1071, 1074, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1072, 1102, 1102, 1102, 1102, - 1073, 1075, 1080, 1081, 1102, 1102, 1076, 1102, 1077, 1082, - 1102, 1078, 1079, 1084, 1085, 1086, 1102, 1102, 1088, 1102, - 1083, 1087, 1102, 1102, 1102, 1091, 1089, 1098, 1099, 1100, - 1101, 1093, 1102, 1090, 1092, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1097, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1094, 1102, 1102, 1095, 1096, 59, 59, - 162, 162, 162, 160, 160, 160, 1102, 1102, 1102, 1102, - - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 982, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 944, 1102, 940, 1102, - 1102, 1102, 938, 1102, 1102, 1102, 1102, 1102, 1102, 916, - 915, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 878, 1102, - 874, 872, 870, 866, 1102, 1102, 1102, 838, 837, 1102, - 800, 1102, 1102, 1102, 795, 793, 792, 1102, 1102, 790, - 1102, 1102, 786, 1102, 1102, 1102, 1102, 1102, 773, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 715, 1102, 1102, - - 1102, 707, 705, 704, 1102, 700, 699, 698, 692, 1102, - 1102, 1102, 1102, 677, 674, 673, 652, 644, 1102, 607, - 1102, 1102, 596, 594, 593, 588, 587, 586, 580, 1102, - 561, 558, 557, 1102, 534, 1102, 487, 1102, 1102, 479, - 478, 477, 1102, 471, 1102, 1102, 1102, 451, 1102, 1102, - 1102, 447, 1102, 1102, 1102, 1102, 1102, 423, 1102, 1102, - 1102, 364, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 161, 1102, 1102, 1102, 158, 58, 157, - 135, 113, 110, 1102, 68, 67, 58, 1102, 3, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102 + 71, 71, 71, 71, 71, 71, 71, 1170, 167, 72, + 1170, 73, 71, 1170, 1170, 1170, 1170, 1170, 1170, 124, + 71, 71, 71, 71, 71, 71, 74, 75, 187, 125, + 76, 77, 126, 81, 171, 78, 127, 102, 79, 82, + 83, 1170, 207, 84, 183, 103, 85, 80, 95, 104, + 96, 168, 409, 97, 1170, 105, 86, 106, 128, 98, + + 129, 99, 116, 117, 118, 138, 130, 100, 184, 131, + 132, 101, 119, 133, 120, 134, 135, 155, 136, 156, + 121, 1170, 185, 139, 157, 69, 1170, 140, 1170, 1170, + 612, 69, 223, 179, 158, 1170, 1170, 1170, 1170, 69, + 1170, 141, 142, 143, 144, 69, 145, 146, 196, 173, + 147, 1170, 180, 186, 148, 149, 1170, 188, 150, 197, + 1170, 151, 152, 162, 162, 163, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 181, 162, 1170, 174, 190, + 1170, 191, 182, 69, 1170, 206, 1170, 1170, 1170, 69, + 162, 162, 162, 162, 162, 1170, 200, 203, 162, 195, + + 162, 162, 69, 202, 192, 1170, 1170, 198, 69, 1170, + 1170, 193, 1170, 1170, 194, 415, 416, 1170, 208, 209, + 1170, 210, 226, 211, 218, 1170, 1170, 201, 204, 162, + 162, 162, 162, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 199, 1170, 205, 212, 1170, 1170, 1170, + 61, 1170, 224, 219, 1170, 1170, 213, 222, 1170, 1170, + 214, 1170, 217, 215, 220, 1170, 221, 1170, 1170, 216, + 225, 1170, 1170, 1170, 1170, 239, 233, 1170, 227, 61, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 228, 229, 240, 234, 238, 165, 235, 236, 1170, 351, + + 243, 1170, 237, 165, 165, 165, 165, 165, 165, 69, + 69, 169, 69, 69, 69, 69, 69, 170, 69, 1170, + 1170, 246, 1170, 247, 69, 1170, 1170, 1170, 1170, 249, + 1170, 1170, 69, 69, 69, 69, 69, 69, 230, 244, + 257, 241, 1170, 250, 256, 248, 1170, 1170, 251, 245, + 1170, 231, 1170, 1170, 1170, 232, 1170, 1170, 1170, 242, + 264, 254, 260, 253, 255, 261, 262, 259, 252, 263, + 266, 268, 1170, 271, 258, 1170, 269, 270, 1170, 1170, + 265, 1170, 1170, 1170, 1170, 272, 1170, 267, 1170, 281, + 286, 287, 1170, 1170, 1170, 1170, 69, 537, 278, 277, + + 276, 279, 69, 1170, 1170, 308, 1170, 274, 275, 281, + 289, 273, 292, 1170, 280, 162, 162, 163, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 288, 162, 1170, + 1170, 1170, 1170, 293, 282, 284, 290, 1170, 1170, 1170, + 1170, 300, 162, 162, 162, 162, 162, 1170, 1170, 1170, + 162, 294, 162, 162, 291, 301, 1170, 304, 299, 283, + 285, 1170, 295, 296, 302, 1170, 1170, 307, 297, 303, + 1170, 310, 298, 1170, 1170, 1170, 305, 1170, 1170, 309, + 1170, 162, 162, 162, 162, 317, 318, 319, 320, 1170, + 313, 312, 1170, 1170, 311, 1170, 306, 1170, 1170, 1170, + + 1170, 314, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 315, + 322, 316, 323, 325, 324, 326, 329, 328, 1170, 321, + 330, 331, 1170, 327, 332, 1170, 1170, 335, 333, 1170, + 1170, 1170, 341, 1170, 337, 342, 1170, 1170, 348, 334, + 1170, 338, 1170, 340, 1170, 1170, 1170, 1170, 343, 336, + 345, 1170, 339, 346, 353, 1170, 1170, 1170, 344, 1170, + 1170, 1170, 1170, 355, 356, 354, 1170, 1170, 349, 347, + 366, 352, 358, 359, 360, 1170, 1170, 1170, 361, 357, + 365, 373, 350, 1170, 362, 370, 371, 1170, 367, 1170, + 363, 374, 364, 387, 1170, 1170, 368, 381, 369, 382, + + 376, 1170, 378, 385, 386, 389, 375, 391, 379, 1170, + 1170, 1170, 1170, 1170, 377, 1170, 1170, 1170, 1170, 372, + 1170, 383, 384, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 392, 396, 395, 388, 1170, 390, 393, 402, + 404, 400, 1170, 423, 401, 1170, 397, 1170, 398, 1170, + 422, 394, 1170, 424, 399, 403, 405, 406, 407, 408, + 410, 411, 412, 413, 1170, 414, 417, 418, 419, 420, + 1170, 425, 421, 1170, 430, 1170, 426, 1170, 427, 1170, + 431, 428, 433, 1170, 1170, 1170, 429, 1170, 1170, 1170, + 434, 1170, 436, 1170, 432, 438, 435, 1170, 1170, 1170, + + 1170, 1170, 437, 1170, 439, 449, 448, 440, 444, 1170, + 447, 1170, 452, 1170, 1170, 442, 1170, 441, 453, 445, + 1170, 459, 450, 1170, 1170, 446, 1170, 1170, 1170, 1170, + 1170, 462, 1170, 455, 1170, 451, 472, 454, 1170, 456, + 457, 461, 466, 464, 458, 460, 1170, 1170, 1170, 1170, + 463, 1170, 468, 1170, 470, 1170, 1170, 1170, 467, 473, + 465, 477, 1170, 469, 476, 1170, 1170, 1170, 478, 1170, + 483, 1170, 1170, 1170, 1170, 1170, 479, 1170, 474, 1170, + 497, 498, 481, 482, 1170, 480, 494, 495, 486, 488, + 487, 1170, 489, 491, 1170, 493, 490, 485, 500, 1170, + + 484, 1170, 1170, 1170, 1170, 492, 1170, 499, 1170, 511, + 512, 1170, 1170, 1170, 501, 1170, 514, 1170, 1170, 1170, + 1170, 503, 502, 507, 1170, 510, 513, 516, 528, 1170, + 1170, 508, 518, 519, 1170, 509, 521, 517, 526, 523, + 527, 1170, 1170, 532, 1170, 520, 533, 1170, 1170, 522, + 1170, 524, 525, 529, 531, 534, 1170, 536, 535, 1170, + 1170, 1170, 1170, 1170, 530, 538, 1170, 1170, 1170, 540, + 1170, 1170, 544, 547, 541, 542, 1170, 1170, 543, 539, + 1170, 1170, 545, 1170, 1170, 1170, 549, 1170, 1170, 1170, + 551, 546, 548, 1170, 553, 1170, 554, 565, 556, 557, + + 1170, 558, 555, 550, 552, 560, 564, 559, 561, 1170, + 566, 1170, 563, 1170, 571, 573, 1170, 567, 1170, 574, + 1170, 1170, 1170, 569, 1170, 570, 568, 1170, 572, 1170, + 1170, 1170, 577, 1170, 1170, 1170, 576, 578, 1170, 1170, + 1170, 1170, 579, 582, 1170, 581, 583, 593, 594, 585, + 575, 1170, 586, 1170, 580, 591, 588, 1170, 1170, 595, + 1170, 1170, 1170, 1170, 1170, 584, 1170, 592, 1170, 1170, + 587, 1170, 1170, 1170, 598, 596, 602, 1170, 1170, 603, + 1170, 606, 1170, 1170, 1170, 597, 1170, 604, 605, 609, + 599, 615, 600, 601, 611, 607, 1170, 608, 1170, 1170, + + 610, 618, 1170, 616, 1170, 1170, 1170, 1170, 1170, 1170, + 619, 1170, 1170, 623, 617, 624, 625, 1170, 626, 633, + 1170, 632, 1170, 1170, 641, 646, 635, 638, 647, 649, + 634, 630, 636, 1170, 1170, 1170, 648, 640, 1170, 644, + 651, 1170, 637, 643, 1170, 1170, 1170, 1170, 1170, 1170, + 645, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 798, 656, + 799, 1170, 1170, 653, 654, 1170, 1170, 660, 1170, 666, + 650, 657, 652, 667, 668, 655, 665, 669, 1170, 658, + 1170, 1170, 661, 670, 1170, 659, 1170, 662, 1170, 1170, + 1170, 663, 1170, 671, 672, 1170, 681, 1170, 664, 675, + + 1170, 674, 676, 677, 678, 1170, 1170, 686, 673, 1170, + 682, 1170, 1170, 685, 1170, 1170, 1170, 683, 1170, 1170, + 691, 684, 1170, 680, 1170, 692, 688, 1170, 1170, 693, + 1170, 687, 689, 697, 703, 698, 694, 1170, 700, 695, + 1170, 699, 1170, 696, 705, 701, 702, 707, 1170, 708, + 1170, 1170, 706, 704, 709, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 712, 1170, 711, 1170, 1170, 1170, 1170, + 721, 1170, 1170, 723, 1170, 1170, 1170, 710, 715, 726, + 722, 1170, 724, 1170, 732, 729, 716, 1170, 725, 719, + 733, 1170, 727, 1170, 720, 731, 730, 1170, 735, 728, + + 736, 1170, 1170, 738, 737, 1170, 1170, 739, 1170, 743, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 749, 744, 745, 752, 751, 754, 1170, 762, + 759, 753, 761, 1170, 755, 1170, 763, 1170, 756, 1170, + 770, 767, 765, 1170, 757, 764, 1170, 1170, 768, 1170, + 766, 760, 1170, 1170, 1170, 1170, 769, 1170, 1170, 775, + 773, 771, 1170, 774, 1170, 1170, 1170, 1170, 1170, 772, + 1170, 1170, 776, 1170, 778, 777, 779, 1170, 780, 782, + 1170, 1170, 786, 1170, 785, 1170, 781, 1170, 783, 788, + 791, 1170, 1170, 1170, 1170, 789, 795, 794, 784, 787, + + 792, 1170, 1170, 1170, 790, 797, 1170, 1170, 1170, 1170, + 802, 796, 793, 1170, 1170, 800, 1170, 801, 803, 1170, + 812, 1170, 1170, 805, 808, 804, 809, 1170, 1170, 1170, + 1170, 1170, 1170, 807, 1170, 806, 1170, 813, 816, 810, + 811, 1170, 1170, 1170, 818, 1170, 814, 815, 1170, 1170, + 1170, 1170, 1170, 823, 1170, 817, 820, 1170, 827, 826, + 828, 822, 821, 825, 829, 824, 830, 1170, 842, 834, + 832, 1170, 836, 831, 844, 1170, 1170, 1170, 1170, 835, + 1170, 838, 1170, 1170, 845, 1170, 1170, 1170, 857, 847, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 851, 1170, 1170, + + 856, 846, 1170, 1170, 860, 1170, 859, 852, 1170, 850, + 853, 1170, 1170, 858, 849, 854, 861, 1170, 863, 864, + 1170, 1170, 855, 1170, 1170, 865, 870, 1170, 866, 867, + 872, 862, 868, 869, 1170, 1170, 1170, 1170, 871, 873, + 875, 874, 1170, 1170, 876, 1170, 1170, 1170, 1170, 1170, + 878, 877, 1170, 1170, 1170, 881, 1170, 1170, 882, 884, + 885, 1170, 880, 1170, 1170, 1170, 1170, 879, 1170, 883, + 892, 889, 886, 893, 1170, 891, 896, 899, 1170, 1170, + 894, 898, 1170, 895, 1170, 1170, 890, 901, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 903, 1170, 1170, 897, 900, + + 902, 905, 907, 1170, 909, 904, 910, 908, 913, 912, + 914, 1170, 1170, 1170, 906, 1170, 1170, 911, 1170, 1170, + 915, 919, 1170, 1170, 1170, 1170, 1170, 916, 918, 920, + 1170, 927, 1170, 1170, 1170, 1170, 929, 942, 1170, 944, + 940, 1170, 983, 1170, 922, 945, 1170, 925, 1170, 939, + 928, 931, 932, 933, 934, 935, 936, 937, 938, 941, + 946, 1170, 1170, 943, 1170, 1170, 1170, 950, 954, 955, + 951, 1170, 952, 1170, 947, 1170, 948, 949, 1170, 1170, + 1170, 1170, 1170, 953, 1170, 1170, 1170, 1170, 957, 1170, + 1170, 1170, 956, 1170, 960, 1170, 1170, 962, 963, 965, + + 961, 967, 1170, 971, 1170, 958, 968, 972, 959, 966, + 1170, 964, 1170, 1170, 973, 1170, 974, 1170, 1170, 975, + 1170, 1170, 976, 1170, 977, 981, 1170, 1170, 1170, 1170, + 1170, 978, 1170, 1170, 979, 985, 980, 1170, 1170, 989, + 1170, 1170, 988, 982, 1170, 984, 992, 990, 1170, 994, + 997, 986, 1170, 987, 1170, 1170, 1001, 1170, 1170, 1170, + 1170, 991, 1170, 1170, 1170, 1003, 1170, 1170, 1170, 998, + 1010, 999, 1002, 1170, 1170, 1170, 1004, 1006, 1007, 1005, + 1008, 1009, 1012, 1011, 1013, 1170, 1170, 1170, 1170, 1015, + 1017, 1014, 1018, 1170, 1170, 1016, 1170, 1019, 1170, 1170, + + 1025, 1020, 1170, 1170, 1170, 1170, 1170, 1170, 1021, 1022, + 1024, 1170, 1027, 1170, 1023, 1029, 1031, 1028, 1026, 1170, + 1042, 1043, 1030, 1170, 1170, 1032, 1170, 1170, 1038, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1034, 1170, 1033, 1035, + 1036, 1170, 1041, 1045, 1170, 1037, 1170, 1039, 1049, 1050, + 1047, 1052, 1057, 1046, 1044, 1053, 1048, 1170, 1170, 1170, + 1054, 1170, 1170, 1170, 1055, 1170, 1170, 1051, 1170, 1056, + 1170, 1061, 1170, 1170, 1170, 1170, 1058, 1067, 1059, 1060, + 1062, 1170, 1063, 1066, 1170, 1170, 1170, 1064, 1170, 1170, + 1170, 1065, 1069, 1170, 1074, 1170, 1071, 1170, 1078, 1170, + + 1170, 1077, 1068, 1170, 1070, 1170, 1080, 1170, 1170, 1072, + 1170, 1170, 1073, 1079, 1085, 1087, 1088, 1086, 1170, 1084, + 1170, 1089, 1170, 1170, 1170, 1170, 1081, 1082, 1170, 1170, + 1083, 1170, 1170, 1170, 1093, 1095, 1170, 1097, 1170, 1170, + 1170, 1094, 1090, 1102, 1091, 1092, 1105, 1170, 1108, 1170, + 1109, 1100, 1099, 1170, 1096, 1170, 1098, 1101, 1170, 1106, + 1107, 1170, 1170, 1112, 1110, 1170, 1111, 1170, 1170, 1170, + 1170, 1170, 1116, 1170, 1170, 1170, 1114, 1170, 1170, 1170, + 1170, 1170, 1120, 1170, 1113, 1117, 1121, 1130, 1127, 1126, + 1115, 1118, 1125, 1131, 1119, 1137, 1132, 1133, 1134, 1135, + + 1138, 1136, 1170, 1170, 1122, 1129, 1170, 1128, 1170, 1170, + 1140, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1142, 1170, 1170, 1139, 1170, 1170, 1147, 1148, 1170, 1143, + 1170, 1170, 1144, 1149, 1153, 1145, 1146, 1170, 1152, 1154, + 1170, 1155, 1170, 1170, 1150, 1170, 1156, 1151, 1160, 1157, + 1166, 1167, 1159, 1168, 1169, 1161, 1158, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1165, 1141, 1170, 1170, + 1170, 1170, 1124, 1123, 1170, 1170, 1163, 1162, 1170, 1164, + 59, 59, 164, 164, 164, 162, 162, 162, 1170, 1170, + 1170, 1170, 1170, 1170, 1104, 1103, 1170, 1170, 1170, 1170, + + 1170, 1170, 1076, 1075, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1040, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1000, 1170, 996, 995, 1170, 1170, 1170, 993, 1170, + 1170, 1170, 1170, 1170, 1170, 970, 969, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 930, 1170, 926, 924, 923, 921, + 917, 1170, 1170, 1170, 1170, 888, 887, 1170, 848, 1170, + 1170, 1170, 843, 841, 840, 839, 1170, 1170, 837, 1170, + 1170, 833, 1170, 1170, 1170, 1170, 1170, 819, 1170, 1170, + + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 758, 1170, + 1170, 1170, 750, 748, 747, 746, 1170, 742, 741, 740, + 734, 1170, 1170, 1170, 1170, 718, 717, 714, 713, 690, + 679, 1170, 642, 1170, 1170, 631, 629, 628, 627, 622, + 621, 620, 614, 1170, 590, 589, 1170, 562, 1170, 515, + 1170, 1170, 506, 505, 504, 1170, 496, 1170, 1170, 1170, + 475, 1170, 1170, 1170, 471, 1170, 1170, 1170, 1170, 1170, + 443, 1170, 1170, 1170, 380, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 163, 1170, + 1170, 160, 58, 159, 137, 115, 112, 1170, 68, 67, + + 58, 1170, 3, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170 } ; -static yyconst flex_int16_t yy_chk[2360] = +static yyconst flex_int16_t yy_chk[2474] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1109,288 +1142,303 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 18, 20, 5, 8, 8, 18, 8, 8, 8, - 8, 41, 8, 76, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 41, 50, 276, + 8, 41, 8, 78, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 41, 50, 495, - 276, 20, 8, 8, 8, 50, 8, 76, 8, 8, + 78, 20, 8, 8, 8, 50, 8, 495, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 34, 35, 34, 86, - 34, 19, 38, 19, 1103, 44, 38, 34, 35, 19, - 19, 19, 19, 19, 19, 39, 43, 43, 43, 44, - 57, 75, 64, 57, 39, 39, 43, 86, 43, 60, - 83, 79, 19, 26, 43, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 83, + 19, 19, 19, 19, 19, 19, 34, 75, 34, 1171, + 34, 19, 38, 19, 34, 64, 38, 34, 39, 19, + 19, 19, 19, 19, 19, 35, 44, 39, 39, 35, + 57, 524, 81, 57, 80, 90, 35, 75, 60, 79, + 44, 70, 19, 26, 64, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 60, - 60, 64, 79, 26, 26, 26, 83, 26, 77, 75, + 79, 70, 81, 26, 26, 26, 80, 26, 90, 524, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 77, 70, 32, - 80, 32, 27, 115, 81, 373, 373, 1101, 115, 45, - 27, 27, 27, 27, 27, 27, 32, 32, 70, 45, - 32, 32, 45, 33, 72, 32, 45, 37, 32, 33, - 33, 72, 80, 33, 74, 37, 33, 32, 36, 37, - 36, 78, 81, 36, 84, 37, 33, 37, 46, 36, - - 46, 36, 48, 85, 74, 90, 46, 36, 78, 46, - 46, 36, 51, 46, 51, 46, 46, 72, 46, 51, - 48, 84, 82, 92, 48, 88, 94, 167, 89, 51, - 85, 97, 167, 90, 82, 90, 92, 87, 48, 49, - 49, 49, 91, 49, 49, 89, 97, 49, 93, 100, - 94, 49, 49, 82, 88, 49, 98, 104, 49, 49, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 87, 63, 91, 95, 98, 101, 99, 96, - 102, 91, 100, 104, 91, 103, 93, 63, 63, 63, - 63, 63, 96, 99, 105, 63, 107, 63, 63, 103, - - 108, 101, 109, 118, 110, 111, 106, 105, 107, 113, - 99, 1100, 102, 108, 114, 112, 95, 110, 116, 118, - 119, 123, 113, 109, 124, 125, 63, 63, 63, 63, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 106, 117, 111, 112, 119, 114, 120, 65, 122, 127, - 116, 125, 124, 123, 137, 449, 117, 128, 126, 1099, - 130, 121, 186, 1098, 138, 141, 122, 131, 135, 449, - 127, 120, 120, 128, 121, 130, 65, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 121, 126, 137, - 131, 121, 66, 130, 133, 138, 135, 141, 138, 186, - - 66, 66, 66, 66, 66, 66, 73, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 133, 132, 133, - 134, 73, 140, 136, 139, 142, 144, 148, 151, 73, - 73, 73, 73, 73, 73, 132, 136, 139, 134, 145, - 143, 144, 140, 143, 143, 132, 142, 146, 136, 147, - 148, 148, 145, 143, 150, 149, 152, 154, 153, 156, - 146, 151, 147, 155, 157, 165, 159, 150, 169, 170, - 165, 174, 145, 156, 168, 154, 156, 146, 149, 155, - 196, 273, 171, 169, 152, 153, 159, 194, 1097, 173, - 165, 174, 157, 162, 162, 162, 162, 162, 162, 162, - - 162, 162, 162, 162, 162, 171, 162, 170, 173, 168, - 196, 181, 166, 175, 177, 178, 189, 273, 194, 176, - 162, 162, 162, 162, 162, 166, 175, 178, 162, 180, - 162, 162, 176, 176, 182, 177, 184, 166, 176, 185, - 187, 191, 176, 181, 180, 188, 190, 182, 189, 184, - 192, 193, 197, 198, 185, 199, 191, 187, 188, 162, - 162, 162, 162, 195, 195, 195, 195, 190, 200, 197, - 198, 201, 199, 203, 192, 206, 204, 205, 209, 207, - 208, 210, 211, 212, 219, 213, 218, 220, 201, 200, - 193, 204, 206, 205, 207, 212, 216, 203, 221, 208, - - 210, 213, 217, 218, 220, 217, 222, 223, 224, 216, - 209, 225, 226, 211, 221, 217, 219, 227, 228, 230, - 223, 235, 236, 229, 226, 232, 233, 237, 247, 240, - 242, 234, 245, 224, 1096, 228, 230, 223, 227, 222, - 229, 232, 225, 234, 233, 237, 242, 239, 256, 234, - 240, 223, 235, 239, 236, 229, 241, 241, 244, 245, - 253, 242, 255, 247, 248, 239, 251, 252, 254, 254, - 257, 258, 259, 239, 260, 244, 254, 248, 261, 251, - 252, 262, 256, 257, 263, 259, 266, 264, 270, 269, - 241, 265, 253, 253, 255, 260, 261, 259, 266, 258, - - 270, 275, 277, 259, 264, 272, 272, 272, 272, 278, - 279, 262, 281, 262, 280, 263, 259, 285, 265, 269, - 274, 274, 274, 274, 283, 284, 286, 279, 282, 278, - 287, 280, 277, 288, 289, 292, 290, 275, 281, 294, - 282, 285, 282, 291, 297, 282, 299, 287, 298, 283, - 282, 289, 288, 300, 301, 291, 286, 302, 284, 290, - 308, 299, 294, 303, 291, 309, 292, 291, 310, 298, - 302, 314, 311, 315, 317, 312, 316, 291, 300, 318, - 303, 297, 321, 314, 319, 322, 323, 325, 332, 317, - 327, 301, 329, 316, 321, 309, 310, 308, 311, 312, - - 335, 319, 337, 327, 338, 315, 318, 325, 336, 323, - 340, 341, 342, 329, 345, 322, 344, 335, 347, 337, - 332, 336, 346, 348, 349, 350, 353, 338, 351, 344, - 352, 358, 360, 342, 359, 354, 354, 341, 361, 347, - 340, 349, 353, 354, 348, 362, 350, 367, 352, 345, - 368, 351, 371, 346, 372, 359, 376, 374, 377, 379, - 378, 361, 360, 381, 358, 380, 383, 382, 367, 374, - 385, 372, 387, 403, 388, 362, 386, 376, 401, 377, - 368, 378, 402, 404, 371, 387, 380, 376, 382, 402, - 386, 379, 386, 393, 405, 381, 393, 387, 383, 388, - - 393, 406, 385, 398, 403, 401, 398, 407, 387, 408, - 398, 409, 410, 411, 412, 413, 414, 417, 415, 405, - 404, 416, 420, 422, 410, 418, 419, 424, 406, 406, - 425, 407, 406, 421, 426, 408, 432, 412, 427, 414, - 418, 418, 425, 409, 415, 411, 430, 416, 417, 420, - 421, 419, 413, 414, 422, 427, 428, 429, 424, 430, - 426, 431, 433, 434, 432, 435, 436, 437, 428, 429, - 438, 439, 442, 431, 441, 443, 445, 444, 450, 446, - 453, 435, 437, 452, 442, 454, 457, 458, 433, 455, - 441, 438, 444, 445, 459, 434, 446, 460, 452, 461, - - 462, 439, 463, 436, 453, 450, 455, 443, 464, 460, - 465, 466, 467, 468, 469, 472, 461, 454, 457, 458, - 469, 463, 470, 464, 462, 468, 459, 473, 472, 474, - 470, 475, 476, 467, 465, 480, 466, 481, 482, 486, - 490, 488, 483, 489, 493, 494, 491, 496, 475, 498, - 501, 495, 503, 473, 481, 482, 483, 488, 499, 476, - 489, 508, 480, 474, 490, 491, 495, 502, 493, 498, - 505, 499, 504, 501, 486, 506, 505, 510, 494, 503, - 504, 507, 509, 506, 502, 496, 511, 507, 512, 513, - 509, 515, 516, 508, 514, 517, 518, 525, 519, 528, - - 520, 521, 522, 1095, 511, 512, 523, 514, 510, 518, - 525, 515, 519, 521, 522, 513, 526, 519, 523, 516, - 520, 519, 524, 530, 529, 531, 528, 517, 519, 532, - 533, 535, 526, 536, 524, 537, 530, 538, 531, 539, - 524, 529, 533, 540, 532, 543, 542, 545, 537, 538, - 544, 547, 555, 536, 546, 548, 539, 536, 549, 553, - 542, 550, 556, 540, 535, 542, 551, 544, 545, 542, - 559, 546, 552, 550, 547, 556, 542, 543, 554, 542, - 553, 560, 548, 551, 562, 549, 565, 552, 566, 555, - 554, 568, 550, 567, 569, 570, 571, 559, 572, 573, - - 566, 574, 575, 576, 568, 583, 577, 582, 581, 584, - 585, 589, 560, 571, 567, 569, 591, 562, 574, 570, - 577, 584, 583, 565, 572, 592, 582, 576, 595, 575, - 598, 573, 581, 599, 600, 602, 601, 589, 604, 606, - 608, 609, 585, 610, 616, 618, 591, 619, 620, 595, - 599, 621, 592, 601, 598, 622, 616, 608, 624, 610, - 600, 623, 626, 602, 625, 604, 618, 627, 622, 631, - 628, 606, 620, 619, 629, 632, 623, 630, 609, 624, - 633, 621, 634, 625, 635, 636, 626, 628, 637, 630, - 638, 629, 631, 639, 640, 641, 642, 627, 632, 643, - - 645, 633, 646, 634, 647, 635, 648, 649, 650, 637, - 652, 641, 652, 640, 654, 646, 638, 636, 653, 651, - 643, 657, 655, 649, 656, 645, 658, 639, 642, 659, - 660, 647, 651, 661, 650, 665, 662, 663, 648, 655, - 664, 656, 653, 666, 654, 668, 669, 658, 665, 661, - 670, 675, 657, 662, 672, 676, 678, 660, 680, 683, - 684, 659, 681, 663, 666, 687, 664, 670, 691, 689, - 672, 669, 668, 690, 694, 696, 703, 684, 675, 680, - 695, 706, 687, 708, 683, 689, 678, 676, 691, 681, - 690, 680, 695, 710, 713, 714, 696, 706, 694, 716, - - 708, 717, 718, 703, 719, 721, 710, 720, 714, 722, - 723, 725, 726, 724, 727, 728, 729, 730, 732, 718, - 713, 724, 733, 723, 735, 731, 727, 726, 734, 719, - 736, 720, 717, 737, 725, 732, 716, 721, 728, 733, - 730, 731, 738, 739, 740, 734, 722, 741, 742, 743, - 744, 745, 747, 729, 750, 749, 739, 737, 735, 748, - 751, 752, 740, 755, 736, 742, 743, 745, 741, 756, - 757, 759, 748, 751, 758, 738, 749, 744, 747, 762, - 750, 760, 763, 764, 765, 766, 755, 752, 759, 767, - 758, 768, 769, 757, 763, 770, 772, 766, 771, 774, - - 776, 775, 765, 777, 778, 762, 756, 779, 760, 791, - 768, 781, 770, 772, 775, 780, 782, 776, 769, 777, - 764, 783, 767, 787, 771, 778, 781, 788, 780, 789, - 794, 774, 782, 779, 796, 797, 798, 811, 783, 804, - 787, 791, 810, 808, 818, 789, 805, 1092, 819, 796, - 811, 788, 817, 798, 801, 801, 801, 801, 801, 801, - 801, 801, 794, 805, 801, 809, 804, 797, 808, 812, - 813, 814, 822, 810, 815, 816, 823, 809, 817, 824, - 825, 818, 813, 814, 812, 819, 815, 816, 826, 822, - 828, 829, 830, 831, 832, 833, 836, 844, 834, 835, - - 843, 825, 839, 826, 840, 824, 823, 830, 850, 831, - 832, 834, 836, 835, 839, 841, 840, 842, 846, 845, - 828, 829, 833, 844, 848, 849, 851, 841, 853, 842, - 843, 845, 852, 854, 855, 857, 863, 860, 862, 846, - 850, 868, 861, 873, 875, 848, 849, 876, 854, 890, - 852, 887, 851, 860, 861, 853, 889, 862, 868, 892, - 894, 893, 895, 873, 855, 857, 890, 887, 863, 896, - 897, 898, 902, 904, 907, 908, 875, 905, 911, 909, - 876, 914, 919, 894, 898, 895, 913, 889, 893, 902, - 896, 892, 904, 897, 905, 917, 918, 920, 923, 921, - - 924, 926, 908, 919, 911, 907, 909, 925, 914, 927, - 913, 921, 928, 929, 930, 931, 924, 926, 917, 918, - 920, 933, 923, 935, 936, 928, 925, 939, 943, 927, - 947, 945, 950, 948, 929, 949, 952, 954, 966, 974, - 951, 936, 953, 976, 959, 931, 939, 930, 945, 950, - 935, 954, 961, 933, 948, 935, 947, 951, 943, 953, - 959, 949, 960, 963, 961, 962, 964, 965, 967, 969, - 952, 974, 966, 968, 975, 976, 970, 977, 979, 980, - 960, 963, 962, 964, 965, 967, 969, 968, 970, 983, - 984, 986, 968, 975, 987, 989, 968, 988, 990, 992, - - 993, 994, 983, 999, 986, 995, 1000, 984, 1002, 998, - 996, 1005, 1004, 979, 977, 988, 980, 1003, 994, 1006, - 1011, 987, 1007, 995, 993, 996, 996, 998, 1005, 1008, - 1012, 1013, 989, 1016, 1014, 990, 992, 1007, 1017, 1018, - 999, 1003, 1004, 1000, 1022, 1002, 1023, 1016, 1011, 1014, - 1025, 1026, 1031, 1006, 1032, 1034, 1012, 1033, 1023, 1013, - 1018, 1022, 1008, 1035, 1017, 1036, 1037, 1038, 1026, 1039, - 1040, 1046, 1034, 1041, 1043, 1031, 1047, 1045, 1025, 1052, - 1033, 1090, 1082, 1056, 1038, 1075, 1039, 1048, 1049, 1074, - 1035, 1032, 1045, 1043, 1033, 1036, 1053, 1041, 1037, 1048, - - 1049, 1050, 1050, 1052, 1046, 1051, 1051, 1040, 1054, 1055, - 1047, 1050, 1053, 1056, 1059, 1051, 1061, 1063, 1064, 1065, - 1066, 1067, 1071, 1073, 1086, 1054, 1076, 1080, 1078, 1077, - 1055, 1059, 1066, 1067, 1079, 1081, 1061, 1083, 1063, 1071, - 1084, 1064, 1065, 1076, 1077, 1078, 1087, 1085, 1080, 1091, - 1073, 1079, 1088, 1089, 1072, 1084, 1081, 1093, 1093, 1094, - 1094, 1086, 1070, 1083, 1085, 1069, 1068, 1093, 1062, 1094, - 1060, 1058, 1091, 1057, 1044, 1042, 1030, 1029, 1028, 1027, - 1024, 1021, 1020, 1087, 1019, 1015, 1088, 1089, 1104, 1104, - 1105, 1105, 1105, 1106, 1106, 1106, 1010, 1009, 1001, 997, - - 991, 985, 981, 978, 973, 972, 971, 958, 957, 956, - 955, 946, 942, 941, 938, 937, 934, 932, 922, 912, - 910, 906, 903, 901, 900, 899, 891, 888, 886, 885, - 884, 883, 882, 881, 880, 879, 878, 877, 872, 871, - 869, 867, 866, 865, 864, 859, 858, 856, 847, 838, - 837, 827, 821, 820, 807, 806, 803, 802, 800, 799, - 795, 793, 790, 786, 785, 784, 761, 754, 753, 746, - 715, 712, 711, 709, 707, 705, 704, 702, 701, 698, - 697, 693, 692, 688, 686, 685, 682, 679, 674, 671, - 667, 617, 615, 614, 613, 612, 611, 607, 605, 603, - - 597, 596, 594, 593, 590, 588, 587, 586, 580, 579, - 578, 564, 563, 561, 558, 557, 541, 534, 527, 500, - 497, 492, 487, 485, 484, 479, 478, 477, 471, 456, - 451, 448, 447, 440, 423, 384, 375, 370, 369, 366, - 365, 364, 363, 357, 343, 339, 334, 333, 331, 330, - 328, 326, 324, 320, 313, 296, 295, 293, 271, 268, - 267, 250, 249, 246, 243, 238, 231, 215, 214, 202, - 183, 179, 172, 160, 129, 71, 69, 59, 58, 52, - 47, 42, 40, 31, 25, 23, 6, 3, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, - 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102 + 27, 27, 27, 27, 27, 27, 27, 88, 72, 32, + 1169, 32, 27, 1168, 74, 72, 283, 84, 103, 45, + 27, 27, 27, 27, 27, 27, 32, 32, 88, 45, + 32, 32, 45, 33, 74, 32, 45, 37, 32, 33, + 33, 85, 103, 33, 84, 37, 33, 32, 36, 37, + 36, 72, 283, 36, 86, 37, 33, 37, 46, 36, + + 46, 36, 43, 43, 43, 48, 46, 36, 85, 46, + 46, 36, 43, 46, 43, 46, 46, 51, 46, 51, + 43, 82, 86, 48, 51, 76, 87, 48, 1167, 95, + 494, 76, 117, 82, 51, 94, 494, 117, 1166, 77, + 89, 48, 49, 49, 49, 77, 49, 49, 94, 76, + 49, 91, 82, 87, 49, 49, 83, 89, 49, 95, + 102, 49, 49, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 83, 63, 100, 77, 91, + 92, 91, 83, 96, 93, 102, 104, 113, 99, 96, + 63, 63, 63, 63, 63, 106, 98, 100, 63, 93, + + 63, 63, 97, 99, 92, 105, 120, 96, 97, 98, + 107, 92, 108, 101, 92, 286, 286, 1165, 104, 105, + 118, 106, 120, 107, 113, 114, 116, 98, 101, 63, + 63, 63, 63, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 97, 109, 101, 108, 110, 111, 112, + 65, 115, 118, 114, 121, 119, 109, 116, 124, 130, + 110, 125, 112, 111, 115, 122, 115, 131, 126, 111, + 119, 127, 128, 129, 232, 130, 124, 133, 121, 65, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 122, 122, 131, 125, 129, 66, 126, 127, 135, 232, + + 133, 137, 128, 66, 66, 66, 66, 66, 66, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 142, 135, 134, 135, 73, 123, 132, 136, 139, 137, + 140, 141, 73, 73, 73, 73, 73, 73, 123, 134, + 142, 132, 143, 138, 141, 136, 144, 147, 138, 134, + 151, 123, 1164, 150, 146, 123, 138, 148, 149, 132, + 147, 140, 145, 139, 140, 145, 145, 144, 138, 146, + 148, 149, 152, 151, 143, 145, 150, 150, 153, 154, + 147, 155, 156, 157, 158, 152, 159, 148, 191, 161, + 169, 170, 171, 176, 1163, 172, 170, 422, 158, 157, + + 156, 158, 170, 169, 422, 191, 173, 154, 155, 161, + 172, 153, 176, 177, 159, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 171, 164, 181, + 190, 174, 184, 177, 167, 168, 173, 180, 178, 193, + 183, 181, 164, 164, 164, 164, 164, 167, 168, 179, + 164, 178, 164, 164, 174, 183, 185, 187, 180, 167, + 168, 188, 179, 179, 184, 189, 192, 190, 179, 185, + 187, 193, 179, 194, 195, 196, 188, 197, 198, 192, + 199, 164, 164, 164, 164, 200, 200, 200, 200, 202, + 196, 195, 206, 203, 194, 204, 189, 205, 207, 209, + + 211, 197, 210, 212, 215, 214, 213, 216, 217, 198, + 203, 199, 204, 206, 205, 207, 211, 210, 218, 202, + 212, 213, 219, 209, 214, 220, 227, 217, 215, 221, + 224, 226, 225, 228, 219, 225, 230, 229, 231, 216, + 233, 220, 234, 224, 235, 225, 236, 237, 226, 218, + 228, 231, 221, 229, 234, 238, 242, 241, 227, 244, + 245, 265, 246, 236, 237, 235, 243, 257, 231, 230, + 248, 233, 238, 241, 242, 252, 248, 249, 243, 237, + 246, 251, 231, 254, 243, 250, 250, 255, 248, 263, + 244, 252, 245, 265, 251, 258, 248, 261, 249, 262, + + 254, 266, 257, 264, 264, 267, 252, 269, 258, 268, + 261, 264, 262, 270, 255, 271, 272, 275, 267, 250, + 269, 263, 263, 273, 274, 279, 290, 276, 280, 285, + 289, 1160, 269, 271, 270, 266, 291, 268, 269, 276, + 280, 274, 288, 290, 275, 292, 272, 295, 272, 294, + 289, 269, 297, 291, 273, 279, 282, 282, 282, 282, + 284, 284, 284, 284, 293, 285, 287, 287, 287, 287, + 296, 292, 288, 298, 294, 300, 293, 299, 293, 301, + 295, 293, 297, 302, 303, 305, 293, 306, 309, 310, + 298, 311, 300, 312, 296, 302, 299, 313, 314, 315, + + 321, 316, 301, 322, 302, 312, 311, 302, 305, 327, + 310, 323, 315, 328, 324, 303, 330, 302, 316, 306, + 325, 327, 313, 331, 329, 309, 332, 333, 336, 337, + 335, 330, 339, 322, 340, 314, 342, 321, 344, 323, + 324, 329, 335, 332, 325, 328, 347, 350, 351, 342, + 331, 352, 337, 353, 340, 355, 356, 359, 336, 344, + 333, 351, 357, 339, 350, 360, 361, 362, 352, 363, + 359, 365, 364, 366, 374, 367, 353, 375, 347, 368, + 373, 373, 356, 357, 376, 355, 369, 369, 362, 364, + 363, 378, 365, 367, 369, 368, 366, 361, 375, 377, + + 360, 384, 383, 387, 390, 367, 392, 374, 388, 389, + 389, 393, 394, 395, 376, 396, 390, 397, 398, 399, + 401, 378, 377, 383, 402, 388, 389, 392, 403, 404, + 421, 384, 393, 394, 423, 387, 396, 392, 402, 398, + 402, 403, 424, 409, 425, 395, 409, 426, 427, 397, + 409, 399, 401, 403, 404, 414, 428, 421, 414, 429, + 431, 430, 414, 432, 403, 423, 433, 434, 435, 425, + 436, 437, 427, 430, 426, 426, 439, 442, 426, 424, + 440, 444, 428, 438, 447, 446, 432, 454, 441, 445, + 434, 429, 431, 455, 435, 458, 436, 446, 438, 438, + + 448, 439, 437, 433, 434, 441, 445, 440, 442, 449, + 447, 450, 444, 451, 452, 454, 453, 448, 456, 455, + 457, 460, 459, 450, 461, 451, 449, 452, 453, 463, + 465, 464, 458, 466, 467, 468, 457, 459, 469, 470, + 474, 473, 460, 464, 476, 463, 465, 475, 475, 467, + 456, 477, 468, 478, 461, 473, 470, 479, 481, 476, + 482, 483, 485, 486, 484, 466, 488, 474, 491, 487, + 469, 489, 490, 492, 479, 477, 484, 500, 499, 485, + 501, 488, 493, 503, 502, 478, 507, 486, 487, 491, + 481, 499, 482, 483, 493, 489, 514, 490, 508, 509, + + 492, 502, 517, 500, 510, 516, 518, 519, 521, 522, + 503, 527, 523, 507, 501, 508, 509, 526, 510, 517, + 529, 516, 530, 531, 527, 532, 519, 523, 533, 535, + 518, 514, 521, 532, 533, 535, 534, 526, 536, 530, + 537, 538, 522, 529, 534, 539, 542, 540, 537, 541, + 531, 543, 544, 545, 546, 1158, 548, 549, 690, 542, + 690, 550, 551, 539, 540, 552, 564, 546, 547, 549, + 536, 543, 538, 550, 551, 541, 548, 552, 554, 544, + 553, 556, 547, 552, 557, 545, 558, 547, 560, 559, + 563, 547, 561, 553, 554, 567, 564, 565, 547, 558, + + 566, 557, 559, 560, 561, 568, 572, 567, 556, 569, + 565, 573, 570, 566, 575, 577, 574, 565, 578, 579, + 572, 565, 580, 563, 576, 572, 569, 581, 584, 572, + 583, 568, 570, 574, 580, 575, 572, 582, 577, 572, + 586, 576, 585, 573, 581, 578, 579, 583, 587, 584, + 588, 591, 582, 580, 585, 592, 595, 598, 599, 600, + 601, 602, 604, 588, 603, 587, 605, 606, 607, 608, + 599, 609, 610, 601, 615, 619, 611, 586, 591, 604, + 600, 616, 602, 623, 610, 607, 592, 617, 603, 595, + 611, 618, 605, 625, 598, 609, 608, 626, 615, 606, + + 616, 630, 633, 618, 617, 635, 637, 619, 634, 623, + 636, 639, 641, 643, 644, 653, 645, 651, 655, 654, + 656, 660, 630, 625, 626, 634, 633, 636, 657, 651, + 643, 635, 645, 658, 637, 659, 653, 661, 639, 662, + 660, 657, 655, 663, 641, 654, 664, 665, 658, 666, + 656, 644, 667, 668, 671, 669, 659, 670, 672, 665, + 663, 661, 673, 664, 674, 675, 676, 677, 678, 662, + 680, 682, 666, 684, 668, 667, 669, 683, 670, 672, + 685, 686, 676, 687, 675, 688, 671, 692, 673, 678, + 683, 691, 689, 693, 695, 680, 687, 686, 674, 677, + + 684, 694, 696, 697, 682, 689, 698, 703, 699, 700, + 693, 688, 685, 701, 702, 691, 704, 692, 694, 706, + 703, 709, 708, 696, 699, 695, 700, 711, 712, 715, + 716, 719, 721, 698, 724, 697, 722, 704, 709, 701, + 702, 725, 732, 728, 712, 736, 706, 708, 730, 731, + 733, 738, 749, 721, 745, 711, 715, 751, 725, 724, + 728, 719, 716, 722, 730, 721, 731, 737, 749, 736, + 733, 753, 738, 732, 751, 756, 757, 759, 760, 737, + 761, 745, 762, 764, 753, 765, 763, 766, 767, 757, + 768, 769, 770, 771, 772, 773, 767, 761, 778, 779, + + 766, 756, 780, 774, 770, 781, 769, 762, 775, 760, + 763, 776, 777, 768, 759, 764, 771, 782, 773, 774, + 784, 783, 765, 785, 787, 775, 780, 786, 776, 777, + 782, 772, 778, 779, 788, 790, 791, 793, 781, 783, + 785, 784, 792, 794, 786, 795, 797, 796, 800, 801, + 788, 787, 802, 805, 803, 792, 804, 807, 793, 795, + 796, 809, 791, 810, 808, 811, 812, 790, 813, 794, + 803, 800, 797, 804, 814, 802, 808, 811, 815, 816, + 805, 810, 820, 807, 818, 824, 801, 813, 823, 821, + 822, 825, 831, 827, 828, 815, 826, 835, 809, 812, + + 814, 818, 821, 829, 823, 816, 824, 822, 827, 826, + 828, 834, 838, 836, 820, 842, 844, 825, 845, 846, + 829, 835, 852, 853, 902, 857, 859, 831, 834, 836, + 860, 844, 858, 866, 856, 867, 846, 857, 871, 859, + 853, 865, 902, 872, 838, 860, 1149, 842, 861, 852, + 845, 849, 849, 849, 849, 849, 849, 849, 849, 856, + 861, 849, 862, 858, 863, 864, 870, 865, 871, 872, + 866, 873, 867, 874, 862, 876, 863, 864, 877, 878, + 879, 880, 881, 870, 882, 884, 883, 885, 874, 893, + 886, 889, 873, 900, 878, 890, 894, 880, 881, 883, + + 879, 885, 891, 889, 892, 876, 886, 890, 877, 884, + 896, 882, 895, 898, 891, 899, 892, 901, 903, 893, + 904, 905, 894, 907, 895, 900, 910, 911, 912, 913, + 925, 896, 919, 916, 898, 904, 899, 927, 928, 911, + 939, 941, 910, 901, 944, 903, 916, 912, 942, 919, + 925, 905, 945, 907, 946, 947, 939, 950, 949, 948, + 959, 913, 960, 956, 964, 942, 954, 957, 962, 927, + 950, 928, 941, 967, 968, 966, 944, 946, 947, 945, + 948, 949, 956, 954, 957, 971, 972, 974, 975, 960, + 964, 959, 966, 973, 977, 962, 978, 967, 979, 980, + + 975, 968, 981, 982, 983, 984, 985, 987, 971, 972, + 974, 990, 978, 989, 973, 980, 982, 979, 977, 992, + 996, 996, 981, 994, 999, 983, 1001, 1003, 990, 1004, + 1005, 1006, 1007, 1008, 1009, 1019, 985, 1023, 984, 987, + 989, 1010, 994, 1001, 1015, 989, 1016, 992, 1006, 1007, + 1004, 1009, 1019, 1003, 999, 1010, 1005, 1017, 1020, 1034, + 1015, 1021, 1022, 1024, 1016, 1027, 1026, 1008, 1025, 1017, + 1031, 1023, 1033, 1032, 1036, 1037, 1020, 1027, 1021, 1022, + 1024, 1041, 1025, 1026, 1044, 1046, 1047, 1025, 1048, 1049, + 1050, 1025, 1032, 1052, 1041, 1053, 1034, 1054, 1046, 1055, + + 1056, 1044, 1031, 1058, 1033, 1059, 1048, 1060, 1062, 1036, + 1063, 1064, 1037, 1047, 1054, 1056, 1056, 1055, 1065, 1053, + 1066, 1058, 1067, 1068, 1071, 1072, 1049, 1050, 1074, 1073, + 1052, 1084, 1078, 1079, 1063, 1065, 1087, 1067, 1085, 1080, + 1093, 1064, 1059, 1074, 1060, 1062, 1078, 1094, 1084, 1088, + 1085, 1072, 1071, 1095, 1066, 1096, 1068, 1073, 1097, 1079, + 1080, 1098, 1099, 1093, 1087, 1100, 1088, 1102, 1105, 1101, + 1107, 1111, 1096, 1109, 1110, 1112, 1095, 1116, 1142, 1117, + 1120, 1113, 1100, 1118, 1094, 1097, 1101, 1112, 1109, 1107, + 1095, 1098, 1105, 1113, 1099, 1117, 1114, 1114, 1115, 1115, + + 1118, 1116, 1119, 1125, 1102, 1111, 1114, 1110, 1115, 1127, + 1120, 1129, 1130, 1131, 1132, 1133, 1137, 1139, 1154, 1144, + 1125, 1143, 1145, 1119, 1146, 1147, 1132, 1133, 1148, 1127, + 1150, 1153, 1129, 1137, 1144, 1130, 1131, 1152, 1143, 1145, + 1155, 1146, 1156, 1159, 1139, 1157, 1147, 1141, 1153, 1148, + 1161, 1161, 1152, 1162, 1162, 1154, 1150, 1140, 1138, 1136, + 1161, 1135, 1134, 1162, 1128, 1126, 1159, 1124, 1122, 1121, + 1108, 1106, 1104, 1103, 1092, 1091, 1156, 1155, 1090, 1157, + 1172, 1172, 1173, 1173, 1173, 1174, 1174, 1174, 1089, 1086, + 1083, 1082, 1081, 1077, 1076, 1075, 1070, 1069, 1061, 1057, + + 1051, 1045, 1043, 1042, 1039, 1038, 1035, 1030, 1029, 1028, + 1018, 1014, 1013, 1012, 1011, 1002, 998, 997, 993, 991, + 988, 986, 976, 965, 963, 961, 958, 955, 953, 952, + 951, 943, 940, 938, 937, 936, 935, 934, 933, 932, + 931, 930, 929, 924, 923, 922, 920, 918, 917, 915, + 914, 909, 908, 906, 897, 888, 887, 875, 869, 868, + 855, 854, 851, 850, 848, 847, 843, 841, 840, 837, + 833, 832, 830, 817, 806, 799, 798, 789, 758, 755, + 754, 752, 750, 748, 747, 746, 744, 743, 740, 739, + 735, 734, 729, 727, 726, 723, 720, 714, 710, 707, + + 705, 681, 652, 650, 649, 648, 647, 646, 642, 640, + 638, 632, 631, 629, 628, 627, 624, 622, 621, 620, + 614, 613, 612, 597, 596, 594, 593, 590, 589, 571, + 562, 555, 528, 525, 520, 515, 513, 512, 511, 506, + 505, 504, 496, 480, 472, 471, 462, 443, 400, 391, + 386, 385, 382, 381, 380, 379, 372, 358, 354, 349, + 348, 346, 345, 343, 341, 338, 334, 326, 308, 307, + 304, 281, 278, 277, 260, 259, 256, 253, 247, 240, + 239, 223, 222, 208, 201, 186, 182, 175, 162, 71, + 69, 59, 58, 52, 47, 42, 40, 31, 25, 23, + + 6, 3, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1170 } ; -static yyconst flex_int16_t yy_rule_linenum[244] = +static yyconst flex_int16_t yy_rule_linenum[262] = { 0, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, + 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 105, 106, - 107, 108, 109, 110, 112, 114, 115, 116, 118, 119, - 120, 121, 122, 124, 125, 126, 127, 129, 130, 131, - 132, 133, 134, 136, 137, 138, 139, 140, 141, 142, - 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 108, 109, 110, 111, 112, 113, 115, 117, 118, + 119, 121, 122, 123, 124, 125, 127, 128, 129, 130, + 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 237, - 238, 239, 240, 241, 243, 244, 245, 246, 247, 249, - 250, 251, 253, 255, 256, 257, 258, 259, 260, 261, - - 263, 265, 266, 267, 268, 269, 270, 271, 273, 274, - 275, 277, 278, 279, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 305, 306, 307, 309, - 310, 311, 312 + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 255, 256, 257, + + 258, 259, 261, 262, 263, 264, 265, 267, 268, 269, + 271, 273, 274, 275, 276, 277, 278, 279, 281, 283, + 284, 285, 286, 287, 288, 289, 291, 292, 293, 295, + 296, 297, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 323, 324, 325, 327, 328, 329, + 330 } ; /* The intent behind this definition is that it'll catch @@ -1402,7 +1450,7 @@ #define YY_RESTORE_YY_MORE_OFFSET #line 1 "../s/bif.l" /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1429,7 +1477,7 @@ /* see http://www.lysator.liu.se/c/ANSI-C-grammar-l.html */ #line 35 "../s/bif.l" # define YY_USER_ACTION yylloc->columns (yyleng); -#line 1433 "../bisonflex/bif.yy.cpp" +#line 1481 "../bisonflex/bif.yy.cpp" #define INITIAL 0 @@ -1593,7 +1641,7 @@ yylloc->step (); -#line 1597 "../bisonflex/bif.yy.cpp" +#line 1645 "../bisonflex/bif.yy.cpp" if ( !(yy_init) ) { @@ -1656,13 +1704,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1103 ) + if ( yy_current_state >= 1171 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 1102 ); + while ( yy_current_state != 1170 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1681,12 +1729,12 @@ { if ( yy_act == 0 ) std::cerr << "--scanner backing up\n"; - else if ( yy_act < 244 ) + else if ( yy_act < 262 ) std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << "(\"" << yytext << "\")\n"; - else if ( yy_act == 244 ) + else if ( yy_act == 262 ) std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; - else if ( yy_act == 245 ) + else if ( yy_act == 263 ) std::cerr << "--(end of buffer or a NUL)\n"; else std::cerr << "--EOF (start condition " << YY_START << ")\n"; @@ -1786,1145 +1834,1235 @@ case 17: YY_RULE_SETUP #line 61 "../s/bif.l" -return tok::HIVEC; +return tok::DELAY_AUTH; YY_BREAK case 18: YY_RULE_SETUP #line 62 "../s/bif.l" -return tok::BLOCKS; +return tok::HIVEC; YY_BREAK case 19: YY_RULE_SETUP #line 63 "../s/bif.l" -return tok::AUTHBLOCKS; +return tok::BLOCKS; YY_BREAK case 20: YY_RULE_SETUP #line 64 "../s/bif.l" -return tok::BIGENDIAN; +return tok::AUTHBLOCKS; YY_BREAK case 21: YY_RULE_SETUP #line 65 "../s/bif.l" -return tok::A32_MODE; +return tok::BIGENDIAN; YY_BREAK case 22: YY_RULE_SETUP #line 66 "../s/bif.l" -return tok::PARTITION; +return tok::A32_MODE; YY_BREAK case 23: YY_RULE_SETUP #line 67 "../s/bif.l" -return tok::IMAGE; +return tok::PARTITION; YY_BREAK case 24: YY_RULE_SETUP #line 68 "../s/bif.l" -return tok::METAHEADER; +return tok::IMAGE; YY_BREAK case 25: YY_RULE_SETUP #line 69 "../s/bif.l" -return tok::BIF_SECTION; +return tok::METAHEADER; YY_BREAK case 26: YY_RULE_SETUP -#line 71 "../s/bif.l" -yylval->number = tok::OFFSET; return tok::OFFSET; +#line 70 "../s/bif.l" +return tok::BIF_SECTION; YY_BREAK case 27: YY_RULE_SETUP -#line 72 "../s/bif.l" -yylval->number = tok::RESERVE_LEGACY; return tok::RESERVE_LEGACY; +#line 71 "../s/bif.l" +return tok::LOCKSTEP; YY_BREAK case 28: YY_RULE_SETUP -#line 73 "../s/bif.l" -yylval->number = tok::RESERVE; return tok::RESERVE; +#line 72 "../s/bif.l" +return tok::INCLUDE; YY_BREAK case 29: YY_RULE_SETUP #line 74 "../s/bif.l" -yylval->number = tok::LOAD; return tok::LOAD; +yylval->number = tok::OFFSET; return tok::OFFSET; YY_BREAK case 30: YY_RULE_SETUP #line 75 "../s/bif.l" -yylval->number = tok::COPY; return tok::COPY; +yylval->number = tok::RESERVE_LEGACY; return tok::RESERVE_LEGACY; YY_BREAK case 31: YY_RULE_SETUP #line 76 "../s/bif.l" -yylval->number = tok::STARTUP; return tok::STARTUP; +yylval->number = tok::RESERVE; return tok::RESERVE; YY_BREAK case 32: YY_RULE_SETUP #line 77 "../s/bif.l" -yylval->number = tok::PARTITION_NUM; return tok::PARTITION_NUM; +yylval->number = tok::LOAD; return tok::LOAD; YY_BREAK case 33: YY_RULE_SETUP #line 78 "../s/bif.l" -yylval->number = tok::INIT; return tok::INIT; +yylval->number = tok::COPY; return tok::COPY; YY_BREAK case 34: YY_RULE_SETUP #line 79 "../s/bif.l" -yylval->number = tok::UDF_BH; return tok::UDF_BH; +yylval->number = tok::STARTUP; return tok::STARTUP; YY_BREAK case 35: YY_RULE_SETUP #line 80 "../s/bif.l" -yylval->number = tok::AES_KEY_FILE; return tok::AES_KEY_FILE; +yylval->number = tok::PARTITION_NUM; return tok::PARTITION_NUM; YY_BREAK case 36: YY_RULE_SETUP #line 81 "../s/bif.l" -yylval->number = tok::PPK_FILE; return tok::PPK_FILE; +yylval->number = tok::INIT; return tok::INIT; YY_BREAK case 37: YY_RULE_SETUP #line 82 "../s/bif.l" -yylval->number = tok::PSK_FILE; return tok::PSK_FILE; +yylval->number = tok::UDF_BH; return tok::UDF_BH; YY_BREAK case 38: YY_RULE_SETUP #line 83 "../s/bif.l" -yylval->number = tok::SPK_FILE; return tok::SPK_FILE; +yylval->number = tok::AES_KEY_FILE; return tok::AES_KEY_FILE; YY_BREAK case 39: YY_RULE_SETUP #line 84 "../s/bif.l" -yylval->number = tok::SSK_FILE; return tok::SSK_FILE; +yylval->number = tok::PPK_FILE; return tok::PPK_FILE; YY_BREAK case 40: YY_RULE_SETUP #line 85 "../s/bif.l" -yylval->number = tok::SPK_SIGNATURE_FILE; return tok::SPK_SIGNATURE_FILE; +yylval->number = tok::PSK_FILE; return tok::PSK_FILE; YY_BREAK case 41: YY_RULE_SETUP #line 86 "../s/bif.l" -yylval->number = tok::BH_SIGNATURE_FILE; return tok::BH_SIGNATURE_FILE; +yylval->number = tok::SPK_FILE; return tok::SPK_FILE; YY_BREAK case 42: YY_RULE_SETUP #line 87 "../s/bif.l" -yylval->number = tok::HEADER_SIGNATURE_FILE; return tok::HEADER_SIGNATURE_FILE; +yylval->number = tok::SSK_FILE; return tok::SSK_FILE; YY_BREAK case 43: YY_RULE_SETUP #line 88 "../s/bif.l" -yylval->number = tok::BOOTVECTORS; return tok::BOOTVECTORS; +yylval->number = tok::SPK_SIGNATURE_FILE; return tok::SPK_SIGNATURE_FILE; YY_BREAK case 44: YY_RULE_SETUP #line 89 "../s/bif.l" -yylval->number = tok::BOOTIMAGE; return tok::BOOTIMAGE; +yylval->number = tok::BH_SIGNATURE_FILE; return tok::BH_SIGNATURE_FILE; YY_BREAK case 45: YY_RULE_SETUP #line 90 "../s/bif.l" -yylval->number = tok::PARENT_ID; return tok::PARENT_ID; +yylval->number = tok::HEADER_SIGNATURE_FILE; return tok::HEADER_SIGNATURE_FILE; YY_BREAK case 46: YY_RULE_SETUP #line 91 "../s/bif.l" -yylval->number = tok::ID_CODE; return tok::ID_CODE; +yylval->number = tok::BOOTVECTORS; return tok::BOOTVECTORS; YY_BREAK case 47: YY_RULE_SETUP #line 92 "../s/bif.l" -yylval->number = tok::EXT_ID_CODE; return tok::EXT_ID_CODE; +yylval->number = tok::BOOTIMAGE; return tok::BOOTIMAGE; YY_BREAK case 48: YY_RULE_SETUP #line 93 "../s/bif.l" -yylval->number = tok::ID; return tok::ID; +yylval->number = tok::PARENT_ID; return tok::PARENT_ID; YY_BREAK case 49: YY_RULE_SETUP #line 94 "../s/bif.l" -yylval->number = tok::NAME; return tok::NAME; +yylval->number = tok::ID_CODE; return tok::ID_CODE; YY_BREAK case 50: YY_RULE_SETUP #line 95 "../s/bif.l" -yylval->number = tok::PFILE; return tok::PFILE; +yylval->number = tok::EXT_ID_CODE; return tok::EXT_ID_CODE; YY_BREAK case 51: YY_RULE_SETUP #line 96 "../s/bif.l" -yylval->number = tok::BH_KEY_FILE; return tok::BH_KEY_FILE; +yylval->number = tok::ID; return tok::ID; YY_BREAK case 52: YY_RULE_SETUP #line 97 "../s/bif.l" -yylval->number = tok::PUF_HELPER_FILE; return tok::PUF_HELPER_FILE; +yylval->number = tok::NAME; return tok::NAME; YY_BREAK case 53: YY_RULE_SETUP #line 98 "../s/bif.l" -yylval->number = tok::PMUFW_IMAGE; return tok::PMUFW_IMAGE; +yylval->number = tok::PFILE; return tok::PFILE; YY_BREAK case 54: YY_RULE_SETUP #line 99 "../s/bif.l" -yylval->number = tok::PMCDATA; return tok::PMCDATA; +yylval->number = tok::BH_KEY_FILE; return tok::BH_KEY_FILE; YY_BREAK case 55: YY_RULE_SETUP #line 100 "../s/bif.l" -yylval->number = tok::BH_KEY_IV; return tok::BH_KEY_IV; +yylval->number = tok::PUF_HELPER_FILE; return tok::PUF_HELPER_FILE; YY_BREAK case 56: YY_RULE_SETUP #line 101 "../s/bif.l" -yylval->number = tok::UNIQUE_ID; return tok::UNIQUE_ID; +yylval->number = tok::PMUFW_IMAGE; return tok::PMUFW_IMAGE; YY_BREAK case 57: YY_RULE_SETUP #line 102 "../s/bif.l" -yylval->number = tok::PARENT_UNIQUE_ID; return tok::PARENT_UNIQUE_ID; +yylval->number = tok::PMCDATA; return tok::PMCDATA; YY_BREAK case 58: YY_RULE_SETUP #line 103 "../s/bif.l" -yylval->number = tok::FUNCTION_ID; return tok::FUNCTION_ID; +yylval->number = tok::BH_KEY_IV; return tok::BH_KEY_IV; YY_BREAK case 59: YY_RULE_SETUP -#line 105 "../s/bif.l" -yylval->number = tok::BBRAM_KEK_IV; return tok::BBRAM_KEK_IV; +#line 104 "../s/bif.l" +yylval->number = tok::UNIQUE_ID; return tok::UNIQUE_ID; YY_BREAK case 60: YY_RULE_SETUP -#line 106 "../s/bif.l" -yylval->number = tok::BH_KEK_IV; return tok::BH_KEK_IV; +#line 105 "../s/bif.l" +yylval->number = tok::PARENT_UNIQUE_ID; return tok::PARENT_UNIQUE_ID; YY_BREAK case 61: YY_RULE_SETUP -#line 107 "../s/bif.l" -yylval->number = tok::EFUSE_KEK_IV; return tok::EFUSE_KEK_IV; +#line 106 "../s/bif.l" +yylval->number = tok::FUNCTION_ID; return tok::FUNCTION_ID; YY_BREAK case 62: YY_RULE_SETUP #line 108 "../s/bif.l" -yylval->number = tok::EFUSE_USER_KEK0_IV; return tok::EFUSE_USER_KEK0_IV; +yylval->number = tok::BBRAM_KEK_IV; return tok::BBRAM_KEK_IV; YY_BREAK case 63: YY_RULE_SETUP #line 109 "../s/bif.l" -yylval->number = tok::EFUSE_USER_KEK1_IV; return tok::EFUSE_USER_KEK1_IV; +yylval->number = tok::BH_KEK_IV; return tok::BH_KEK_IV; YY_BREAK case 64: YY_RULE_SETUP #line 110 "../s/bif.l" -yylval->number = tok::USER_KEYS; return tok::USER_KEYS; +yylval->number = tok::EFUSE_KEK_IV; return tok::EFUSE_KEK_IV; YY_BREAK case 65: YY_RULE_SETUP -#line 112 "../s/bif.l" -yylval->number = tok::FAMILY_KEY; return tok::FAMILY_KEY; +#line 111 "../s/bif.l" +yylval->number = tok::EFUSE_USER_KEK0_IV; return tok::EFUSE_USER_KEK0_IV; YY_BREAK case 66: YY_RULE_SETUP -#line 114 "../s/bif.l" -return tok::ENCRYPTION; +#line 112 "../s/bif.l" +yylval->number = tok::EFUSE_USER_KEK1_IV; return tok::EFUSE_USER_KEK1_IV; YY_BREAK case 67: YY_RULE_SETUP -#line 115 "../s/bif.l" -yylval->number = 0; return tok::NONE; +#line 113 "../s/bif.l" +yylval->number = tok::USER_KEYS; return tok::USER_KEYS; YY_BREAK case 68: YY_RULE_SETUP -#line 116 "../s/bif.l" -yylval->number = Encryption::AES; return tok::ENCRVALUE; +#line 115 "../s/bif.l" +yylval->number = tok::FAMILY_KEY; return tok::FAMILY_KEY; YY_BREAK case 69: YY_RULE_SETUP -#line 118 "../s/bif.l" -return tok::AUTHENTICATION; +#line 117 "../s/bif.l" +return tok::ENCRYPTION; YY_BREAK case 70: YY_RULE_SETUP -#line 119 "../s/bif.l" -yylval->number = Authentication::RSA; return tok::AUTHVALUE; +#line 118 "../s/bif.l" +yylval->number = 0; return tok::NONE; YY_BREAK case 71: YY_RULE_SETUP -#line 120 "../s/bif.l" -yylval->number = Authentication::ECDSA; return tok::AUTHVALUE; +#line 119 "../s/bif.l" +yylval->number = Encryption::AES; return tok::ENCRVALUE; YY_BREAK case 72: YY_RULE_SETUP #line 121 "../s/bif.l" -yylval->number = Authentication::ECDSA; return tok::AUTHVALUE; +return tok::AUTHENTICATION; YY_BREAK case 73: YY_RULE_SETUP #line 122 "../s/bif.l" -yylval->number = Authentication::ECDSAp521; return tok::AUTHVALUE; +yylval->number = Authentication::RSA; return tok::AUTHVALUE; YY_BREAK case 74: YY_RULE_SETUP -#line 124 "../s/bif.l" -return tok::CHECKSUM; +#line 123 "../s/bif.l" +yylval->number = Authentication::ECDSA; return tok::AUTHVALUE; YY_BREAK case 75: YY_RULE_SETUP -#line 125 "../s/bif.l" -yylval->number = Checksum::MD5; return tok::CHECKSUMVALUE; +#line 124 "../s/bif.l" +yylval->number = Authentication::ECDSA; return tok::AUTHVALUE; YY_BREAK case 76: YY_RULE_SETUP -#line 126 "../s/bif.l" -yylval->number = Checksum::SHA2; return tok::CHECKSUMVALUE; +#line 125 "../s/bif.l" +yylval->number = Authentication::ECDSAp521; return tok::AUTHVALUE; YY_BREAK case 77: YY_RULE_SETUP #line 127 "../s/bif.l" -yylval->number = Checksum::SHA3; return tok::CHECKSUMVALUE; +return tok::CHECKSUM; YY_BREAK case 78: YY_RULE_SETUP -#line 129 "../s/bif.l" -return tok::PARTITION_OWNER; +#line 128 "../s/bif.l" +yylval->number = Checksum::MD5; return tok::CHECKSUMVALUE; YY_BREAK case 79: YY_RULE_SETUP -#line 130 "../s/bif.l" -return tok::PARTITION_OWNER; +#line 129 "../s/bif.l" +yylval->number = Checksum::SHA2; return tok::CHECKSUMVALUE; YY_BREAK case 80: YY_RULE_SETUP -#line 131 "../s/bif.l" -yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; +#line 130 "../s/bif.l" +yylval->number = Checksum::SHA3; return tok::CHECKSUMVALUE; YY_BREAK case 81: YY_RULE_SETUP #line 132 "../s/bif.l" -yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; +return tok::PARTITION_OWNER; YY_BREAK case 82: YY_RULE_SETUP #line 133 "../s/bif.l" -yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; +return tok::PARTITION_OWNER; YY_BREAK case 83: YY_RULE_SETUP #line 134 "../s/bif.l" -yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; +yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; YY_BREAK case 84: YY_RULE_SETUP -#line 136 "../s/bif.l" -return tok::PARTITION_TYPE; +#line 135 "../s/bif.l" +yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; YY_BREAK case 85: YY_RULE_SETUP -#line 137 "../s/bif.l" -return tok::PARTITION_TYPE; +#line 136 "../s/bif.l" +yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; YY_BREAK case 86: YY_RULE_SETUP -#line 138 "../s/bif.l" -yylval->number = PartitionType::CONFIG_DATA_OBJ;return tok::PTYPEVALUE; +#line 137 "../s/bif.l" +yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; YY_BREAK case 87: YY_RULE_SETUP -#line 139 "../s/bif.l" -yylval->number = PartitionType::RAW; return tok::PTYPEVALUE; +#line 138 "../s/bif.l" +yylval->number = PartitionOwner::FSBL; return tok::POWNERVALUE ; YY_BREAK case 88: YY_RULE_SETUP -#line 140 "../s/bif.l" -yylval->number = PartitionType::CFI; return tok::PTYPEVALUE; +#line 139 "../s/bif.l" +yylval->number = PartitionOwner::UBOOT; return tok::POWNERVALUE ; YY_BREAK case 89: YY_RULE_SETUP #line 141 "../s/bif.l" -yylval->number = PartitionType::CFI_GSC; return tok::PTYPEVALUE; +return tok::PARTITION_TYPE; YY_BREAK case 90: YY_RULE_SETUP #line 142 "../s/bif.l" -yylval->number = PartitionType::SLR_BOOT; return tok::PTYPEVALUE; +return tok::PARTITION_TYPE; YY_BREAK case 91: YY_RULE_SETUP #line 143 "../s/bif.l" -yylval->number = PartitionType::SLR_CONFIG; return tok::PTYPEVALUE; +yylval->number = PartitionType::CONFIG_DATA_OBJ; return tok::PTYPEVALUE; YY_BREAK case 92: YY_RULE_SETUP -#line 145 "../s/bif.l" -yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; +#line 144 "../s/bif.l" +yylval->number = PartitionType::RAW; return tok::PTYPEVALUE; YY_BREAK case 93: YY_RULE_SETUP -#line 146 "../s/bif.l" -yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; +#line 145 "../s/bif.l" +yylval->number = PartitionType::CFI; return tok::PTYPEVALUE; YY_BREAK case 94: YY_RULE_SETUP -#line 147 "../s/bif.l" -yylval->number = KeySource::EfuseRedKey; return tok::KEY_SRC; +#line 146 "../s/bif.l" +yylval->number = PartitionType::CFI_GSC; return tok::PTYPEVALUE; YY_BREAK case 95: YY_RULE_SETUP -#line 148 "../s/bif.l" -yylval->number = KeySource::BbramRedKey; return tok::KEY_SRC; +#line 147 "../s/bif.l" +yylval->number = PartitionType::SLR_BOOT; return tok::PTYPEVALUE; YY_BREAK case 96: YY_RULE_SETUP -#line 149 "../s/bif.l" -yylval->number = KeySource::EfuseRedKey; return tok::KEY_SRC; +#line 148 "../s/bif.l" +yylval->number = PartitionType::SLR_CONFIG; return tok::PTYPEVALUE; YY_BREAK case 97: YY_RULE_SETUP -#line 150 "../s/bif.l" -yylval->number = KeySource::EfuseBlkKey; return tok::KEY_SRC; +#line 149 "../s/bif.l" +yylval->number = PartitionType::SLR_SLAVE; return tok::PTYPEVALUE; YY_BREAK case 98: YY_RULE_SETUP -#line 151 "../s/bif.l" -yylval->number = KeySource::EfuseGryKey; return tok::KEY_SRC; +#line 150 "../s/bif.l" +yylval->number = PartitionType::SLR_SLAVE_BOOT; return tok::PTYPEVALUE; YY_BREAK case 99: YY_RULE_SETUP -#line 152 "../s/bif.l" -yylval->number = KeySource::BbramRedKey; return tok::KEY_SRC; +#line 151 "../s/bif.l" +yylval->number = PartitionType::SLR_SLAVE_CONFIG; return tok::PTYPEVALUE; YY_BREAK case 100: YY_RULE_SETUP -#line 153 "../s/bif.l" -yylval->number = KeySource::BbramBlkKey; return tok::KEY_SRC; +#line 152 "../s/bif.l" +yylval->number = PartitionType::ELF; return tok::PTYPEVALUE; YY_BREAK case 101: YY_RULE_SETUP #line 154 "../s/bif.l" -yylval->number = KeySource::BbramGryKey; return tok::KEY_SRC; +yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; YY_BREAK case 102: YY_RULE_SETUP #line 155 "../s/bif.l" -yylval->number = KeySource::BhGryKey; return tok::KEY_SRC; +yylval->number = tok::KEYSRC_ENCRYPTION; return tok::KEYSRC_ENCRYPTION; YY_BREAK case 103: YY_RULE_SETUP #line 156 "../s/bif.l" -yylval->number = KeySource::BhBlkKey; return tok::KEY_SRC; +yylval->number = KeySource::EfuseRedKey; return tok::KEY_SRC; YY_BREAK case 104: YY_RULE_SETUP #line 157 "../s/bif.l" -yylval->number = KeySource::UserKey0; return tok::KEY_SRC; +yylval->number = KeySource::BbramRedKey; return tok::KEY_SRC; YY_BREAK case 105: YY_RULE_SETUP #line 158 "../s/bif.l" -yylval->number = KeySource::UserKey1; return tok::KEY_SRC; +yylval->number = KeySource::EfuseRedKey; return tok::KEY_SRC; YY_BREAK case 106: YY_RULE_SETUP #line 159 "../s/bif.l" -yylval->number = KeySource::UserKey2; return tok::KEY_SRC; +yylval->number = KeySource::EfuseBlkKey; return tok::KEY_SRC; YY_BREAK case 107: YY_RULE_SETUP #line 160 "../s/bif.l" -yylval->number = KeySource::UserKey3; return tok::KEY_SRC; +yylval->number = KeySource::EfuseGryKey; return tok::KEY_SRC; YY_BREAK case 108: YY_RULE_SETUP #line 161 "../s/bif.l" -yylval->number = KeySource::UserKey4; return tok::KEY_SRC; +yylval->number = KeySource::BbramRedKey; return tok::KEY_SRC; YY_BREAK case 109: YY_RULE_SETUP #line 162 "../s/bif.l" -yylval->number = KeySource::UserKey5; return tok::KEY_SRC; +yylval->number = KeySource::BbramBlkKey; return tok::KEY_SRC; YY_BREAK case 110: YY_RULE_SETUP #line 163 "../s/bif.l" -yylval->number = KeySource::UserKey6; return tok::KEY_SRC; +yylval->number = KeySource::BbramGryKey; return tok::KEY_SRC; YY_BREAK case 111: YY_RULE_SETUP #line 164 "../s/bif.l" -yylval->number = KeySource::UserKey7; return tok::KEY_SRC; +yylval->number = KeySource::BhGryKey; return tok::KEY_SRC; YY_BREAK case 112: YY_RULE_SETUP #line 165 "../s/bif.l" -yylval->number = KeySource::EfuseUserKey0; return tok::KEY_SRC; +yylval->number = KeySource::BhBlkKey; return tok::KEY_SRC; YY_BREAK case 113: YY_RULE_SETUP #line 166 "../s/bif.l" -yylval->number = KeySource::EfuseUserBlkKey0; return tok::KEY_SRC; +yylval->number = KeySource::UserKey0; return tok::KEY_SRC; YY_BREAK case 114: YY_RULE_SETUP #line 167 "../s/bif.l" -yylval->number = KeySource::EfuseUserGryKey0; return tok::KEY_SRC; +yylval->number = KeySource::UserKey1; return tok::KEY_SRC; YY_BREAK case 115: YY_RULE_SETUP #line 168 "../s/bif.l" -yylval->number = KeySource::EfuseUserKey1; return tok::KEY_SRC; +yylval->number = KeySource::UserKey2; return tok::KEY_SRC; YY_BREAK case 116: YY_RULE_SETUP #line 169 "../s/bif.l" -yylval->number = KeySource::EfuseUserBlkKey1; return tok::KEY_SRC; +yylval->number = KeySource::UserKey3; return tok::KEY_SRC; YY_BREAK case 117: YY_RULE_SETUP #line 170 "../s/bif.l" -yylval->number = KeySource::EfuseUserGryKey1; return tok::KEY_SRC; +yylval->number = KeySource::UserKey4; return tok::KEY_SRC; YY_BREAK case 118: YY_RULE_SETUP #line 171 "../s/bif.l" -yylval->number = KeySource::BhKupKey; return tok::KEY_SRC; +yylval->number = KeySource::UserKey5; return tok::KEY_SRC; YY_BREAK case 119: YY_RULE_SETUP -#line 173 "../s/bif.l" -yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; +#line 172 "../s/bif.l" +yylval->number = KeySource::UserKey6; return tok::KEY_SRC; YY_BREAK case 120: YY_RULE_SETUP -#line 174 "../s/bif.l" -yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; +#line 173 "../s/bif.l" +yylval->number = KeySource::UserKey7; return tok::KEY_SRC; YY_BREAK case 121: YY_RULE_SETUP -#line 175 "../s/bif.l" -yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; +#line 174 "../s/bif.l" +yylval->number = KeySource::EfuseUserKey0; return tok::KEY_SRC; YY_BREAK case 122: YY_RULE_SETUP -#line 176 "../s/bif.l" -yylval->number = Core::R5Single; return tok::CORE; +#line 175 "../s/bif.l" +yylval->number = KeySource::EfuseUserBlkKey0; return tok::KEY_SRC; YY_BREAK case 123: YY_RULE_SETUP -#line 177 "../s/bif.l" -yylval->number = Core::A53Singlex32; return tok::CORE; +#line 176 "../s/bif.l" +yylval->number = KeySource::EfuseUserGryKey0; return tok::KEY_SRC; YY_BREAK case 124: YY_RULE_SETUP -#line 178 "../s/bif.l" -yylval->number = Core::A53Singlex32; return tok::CORE; +#line 177 "../s/bif.l" +yylval->number = KeySource::EfuseUserKey1; return tok::KEY_SRC; YY_BREAK case 125: YY_RULE_SETUP -#line 179 "../s/bif.l" -yylval->number = Core::A53Singlex64; return tok::CORE; +#line 178 "../s/bif.l" +yylval->number = KeySource::EfuseUserBlkKey1; return tok::KEY_SRC; YY_BREAK case 126: YY_RULE_SETUP -#line 180 "../s/bif.l" -yylval->number = Core::A53Singlex64; return tok::CORE; +#line 179 "../s/bif.l" +yylval->number = KeySource::EfuseUserGryKey1; return tok::KEY_SRC; YY_BREAK case 127: YY_RULE_SETUP -#line 181 "../s/bif.l" -yylval->number = Core::R5Dual; return tok::CORE; +#line 180 "../s/bif.l" +yylval->number = KeySource::BhKupKey; return tok::KEY_SRC; YY_BREAK case 128: YY_RULE_SETUP #line 182 "../s/bif.l" -yylval->number = BhRsa::BhRsaEnable; return tok::BH_RSA; +yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; YY_BREAK case 129: YY_RULE_SETUP #line 183 "../s/bif.l" -yylval->number = AuthHash::Sha2; return tok::AUTH_HASH; +yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; YY_BREAK case 130: YY_RULE_SETUP #line 184 "../s/bif.l" -yylval->number = PufHdLoc::PUFinBH; return tok::PUFHD_LOC; +yylval->number = tok::FSBL_CONFIG; return tok::FSBL_CONFIG; YY_BREAK case 131: YY_RULE_SETUP #line 185 "../s/bif.l" -yylval->number = AuthOnly::Enabled; return tok::AUTH_ONLY; +yylval->number = Core::R5Single; return tok::CORE; YY_BREAK case 132: YY_RULE_SETUP #line 186 "../s/bif.l" -yylval->number = OptKey::OptKeyinSecHdr; return tok::OPT_KEY; +yylval->number = Core::A53Singlex32; return tok::CORE; YY_BREAK case 133: YY_RULE_SETUP #line 187 "../s/bif.l" -yylval->number = PufMode::PUF4K; return tok::PUF4KMODE; +yylval->number = Core::A53Singlex32; return tok::CORE; YY_BREAK case 134: YY_RULE_SETUP #line 188 "../s/bif.l" -yylval->number = tok::SHUTTER; return tok::SHUTTER; +yylval->number = Core::A53Singlex64; return tok::CORE; YY_BREAK case 135: YY_RULE_SETUP #line 189 "../s/bif.l" -yylval->number = DpaCM::DpaCMEnable; return tok::DPA_CM; +yylval->number = Core::A53Singlex64; return tok::CORE; YY_BREAK case 136: YY_RULE_SETUP #line 190 "../s/bif.l" -yylval->number = tok::SMAP_WIDTH; return tok::SMAP_WIDTH; +yylval->number = Core::R5Dual; return tok::CORE; YY_BREAK case 137: YY_RULE_SETUP #line 191 "../s/bif.l" -yylval->number = tok::BYPASS_IDCODE_CHECK; return tok::BYPASS_IDCODE_CHECK; +yylval->number = BhRsa::BhRsaEnable; return tok::BH_RSA; YY_BREAK case 138: YY_RULE_SETUP #line 192 "../s/bif.l" -yylval->number = tok::A_HWROT; return tok::A_HWROT; +yylval->number = AuthHash::Sha2; return tok::AUTH_HASH; YY_BREAK case 139: YY_RULE_SETUP #line 193 "../s/bif.l" -yylval->number = tok::S_HWROT; return tok::S_HWROT; +yylval->number = PufHdLoc::PUFinBH; return tok::PUFHD_LOC; YY_BREAK case 140: YY_RULE_SETUP -#line 195 "../s/bif.l" -return tok::BOOT_DEVICE; +#line 194 "../s/bif.l" +yylval->number = AuthOnly::Enabled; return tok::AUTH_ONLY; YY_BREAK case 141: YY_RULE_SETUP -#line 196 "../s/bif.l" -yylval->number = tok::ADDRESS; return tok::ADDRESS; +#line 195 "../s/bif.l" +yylval->number = OptKey::OptKeyinSecHdr; return tok::OPT_KEY; YY_BREAK case 142: YY_RULE_SETUP -#line 197 "../s/bif.l" -yylval->number = BootDevice::QSPI32; return tok::BOOT_DEVICE_TYPE ; +#line 196 "../s/bif.l" +yylval->number = PufMode::PUF4K; return tok::PUF4KMODE; YY_BREAK case 143: YY_RULE_SETUP -#line 198 "../s/bif.l" -yylval->number = BootDevice::QSPI24; return tok::BOOT_DEVICE_TYPE ; +#line 197 "../s/bif.l" +yylval->number = tok::SHUTTER; return tok::SHUTTER; YY_BREAK case 144: YY_RULE_SETUP -#line 199 "../s/bif.l" -yylval->number = BootDevice::NAND; return tok::BOOT_DEVICE_TYPE ; +#line 198 "../s/bif.l" +yylval->number = tok::PUFROSWAP; return tok::PUFROSWAP; YY_BREAK case 145: YY_RULE_SETUP -#line 200 "../s/bif.l" -yylval->number = BootDevice::SD0; return tok::BOOT_DEVICE_TYPE ; +#line 199 "../s/bif.l" +yylval->number = DpaCM::DpaCMEnable; return tok::DPA_CM; YY_BREAK case 146: YY_RULE_SETUP -#line 201 "../s/bif.l" -yylval->number = BootDevice::SD1; return tok::BOOT_DEVICE_TYPE ; +#line 200 "../s/bif.l" +yylval->number = tok::DICE; return tok::DICE; YY_BREAK case 147: YY_RULE_SETUP -#line 202 "../s/bif.l" -yylval->number = BootDevice::SDLS; return tok::BOOT_DEVICE_TYPE ; +#line 201 "../s/bif.l" +yylval->number = tok::SMAP_WIDTH; return tok::SMAP_WIDTH; YY_BREAK case 148: YY_RULE_SETUP -#line 203 "../s/bif.l" -yylval->number = BootDevice::MMC; return tok::BOOT_DEVICE_TYPE ; +#line 202 "../s/bif.l" +yylval->number = tok::BYPASS_IDCODE_CHECK; return tok::BYPASS_IDCODE_CHECK; YY_BREAK case 149: YY_RULE_SETUP -#line 204 "../s/bif.l" -yylval->number = BootDevice::USB; return tok::BOOT_DEVICE_TYPE ; +#line 203 "../s/bif.l" +yylval->number = tok::A_HWROT; return tok::A_HWROT; YY_BREAK case 150: YY_RULE_SETUP -#line 205 "../s/bif.l" -yylval->number = BootDevice::ETHERNET; return tok::BOOT_DEVICE_TYPE ; +#line 204 "../s/bif.l" +yylval->number = tok::S_HWROT; return tok::S_HWROT; YY_BREAK case 151: YY_RULE_SETUP #line 206 "../s/bif.l" -yylval->number = BootDevice::PCIE; return tok::BOOT_DEVICE_TYPE ; +return tok::BOOT_DEVICE; YY_BREAK case 152: YY_RULE_SETUP #line 207 "../s/bif.l" -yylval->number = BootDevice::SATA; return tok::BOOT_DEVICE_TYPE ; +yylval->number = tok::ADDRESS; return tok::ADDRESS; YY_BREAK case 153: YY_RULE_SETUP #line 208 "../s/bif.l" -yylval->number = BootDevice::OSPI; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::QSPI32; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 154: YY_RULE_SETUP #line 209 "../s/bif.l" -yylval->number = BootDevice::SMAP; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::QSPI24; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 155: YY_RULE_SETUP #line 210 "../s/bif.l" -yylval->number = BootDevice::SBI; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::NAND; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 156: YY_RULE_SETUP #line 211 "../s/bif.l" -yylval->number = BootDevice::SD0RAW; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::SD0; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 157: YY_RULE_SETUP #line 212 "../s/bif.l" -yylval->number = BootDevice::SD1RAW; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::SD1; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 158: YY_RULE_SETUP #line 213 "../s/bif.l" -yylval->number = BootDevice::SDLSRAW; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::SDLS; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 159: YY_RULE_SETUP #line 214 "../s/bif.l" -yylval->number = BootDevice::MMCRAW; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::MMC; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 160: YY_RULE_SETUP #line 215 "../s/bif.l" -yylval->number = BootDevice::MMC0; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::USB; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 161: YY_RULE_SETUP #line 216 "../s/bif.l" -yylval->number = BootDevice::MMC0RAW; return tok::BOOT_DEVICE_TYPE ; +yylval->number = BootDevice::ETHERNET; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 162: YY_RULE_SETUP -#line 218 "../s/bif.l" -return tok::DEST_CPU; +#line 217 "../s/bif.l" +yylval->number = BootDevice::PCIE; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 163: YY_RULE_SETUP -#line 219 "../s/bif.l" -return tok::DEST_CPU; +#line 218 "../s/bif.l" +yylval->number = BootDevice::SATA; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 164: YY_RULE_SETUP -#line 220 "../s/bif.l" -yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; +#line 219 "../s/bif.l" +yylval->number = BootDevice::OSPI; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 165: YY_RULE_SETUP -#line 221 "../s/bif.l" -yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; +#line 220 "../s/bif.l" +yylval->number = BootDevice::SMAP; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 166: YY_RULE_SETUP -#line 222 "../s/bif.l" -yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; +#line 221 "../s/bif.l" +yylval->number = BootDevice::SBI; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 167: YY_RULE_SETUP -#line 223 "../s/bif.l" -yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; +#line 222 "../s/bif.l" +yylval->number = BootDevice::SD0RAW; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 168: YY_RULE_SETUP -#line 224 "../s/bif.l" -yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; +#line 223 "../s/bif.l" +yylval->number = BootDevice::SD1RAW; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 169: YY_RULE_SETUP -#line 225 "../s/bif.l" -yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; +#line 224 "../s/bif.l" +yylval->number = BootDevice::SDLSRAW; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 170: YY_RULE_SETUP -#line 226 "../s/bif.l" -yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; +#line 225 "../s/bif.l" +yylval->number = BootDevice::MMCRAW; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 171: YY_RULE_SETUP -#line 227 "../s/bif.l" -yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; +#line 226 "../s/bif.l" +yylval->number = BootDevice::MMC0; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 172: YY_RULE_SETUP -#line 228 "../s/bif.l" -yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; +#line 227 "../s/bif.l" +yylval->number = BootDevice::MMC0RAW; return tok::BOOT_DEVICE_TYPE ; YY_BREAK case 173: YY_RULE_SETUP #line 229 "../s/bif.l" -yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; +return tok::DEST_CPU; YY_BREAK case 174: YY_RULE_SETUP #line 230 "../s/bif.l" -yylval->number = DestinationCPU::R5_0; return tok::DEST_CPU_TYPE; +return tok::DEST_CPU; YY_BREAK case 175: YY_RULE_SETUP #line 231 "../s/bif.l" -yylval->number = DestinationCPU::R5_1; return tok::DEST_CPU_TYPE; +yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; YY_BREAK case 176: YY_RULE_SETUP #line 232 "../s/bif.l" -yylval->number = DestinationCPU::R5_lockstep; return tok::DEST_CPU_TYPE; +yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; YY_BREAK case 177: YY_RULE_SETUP #line 233 "../s/bif.l" -yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; +yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; YY_BREAK case 178: YY_RULE_SETUP #line 234 "../s/bif.l" -yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; +yylval->number = DestinationCPU::A53_0; return tok::DEST_CPU_TYPE; YY_BREAK case 179: YY_RULE_SETUP #line 235 "../s/bif.l" -yylval->number = DestinationCPU::AIE; return tok::DEST_CPU_TYPE; +yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; YY_BREAK case 180: YY_RULE_SETUP -#line 237 "../s/bif.l" -return tok::DEST_DEVICE; +#line 236 "../s/bif.l" +yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; YY_BREAK case 181: YY_RULE_SETUP -#line 238 "../s/bif.l" -yylval->number = DestinationDevice::DEST_DEV_PS; return tok::DEST_DEVICE_TYPE; +#line 237 "../s/bif.l" +yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; YY_BREAK case 182: YY_RULE_SETUP -#line 239 "../s/bif.l" -yylval->number = DestinationDevice::DEST_DEV_PL; return tok::DEST_DEVICE_TYPE; +#line 238 "../s/bif.l" +yylval->number = DestinationCPU::A53_1; return tok::DEST_CPU_TYPE; YY_BREAK case 183: YY_RULE_SETUP -#line 240 "../s/bif.l" -yylval->number = DestinationDevice::DEST_DEV_PMU; return tok::DEST_DEVICE_TYPE; +#line 239 "../s/bif.l" +yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; YY_BREAK case 184: YY_RULE_SETUP -#line 241 "../s/bif.l" -yylval->number = DestinationDevice::DEST_DEV_XIP; return tok::DEST_DEVICE_TYPE; +#line 240 "../s/bif.l" +yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; YY_BREAK case 185: YY_RULE_SETUP -#line 243 "../s/bif.l" -return tok::EXCEPTION_LEVEL; +#line 241 "../s/bif.l" +yylval->number = DestinationCPU::A53_2; return tok::DEST_CPU_TYPE; YY_BREAK case 186: YY_RULE_SETUP -#line 244 "../s/bif.l" -yylval->number = ExceptionLevel::EL0; return tok::EXCEPTION_LEVEL_TYPE; +#line 242 "../s/bif.l" +yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; YY_BREAK case 187: YY_RULE_SETUP -#line 245 "../s/bif.l" -yylval->number = ExceptionLevel::EL1; return tok::EXCEPTION_LEVEL_TYPE; +#line 243 "../s/bif.l" +yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; YY_BREAK case 188: YY_RULE_SETUP -#line 246 "../s/bif.l" -yylval->number = ExceptionLevel::EL2; return tok::EXCEPTION_LEVEL_TYPE; +#line 244 "../s/bif.l" +yylval->number = DestinationCPU::A53_3; return tok::DEST_CPU_TYPE; YY_BREAK case 189: YY_RULE_SETUP -#line 247 "../s/bif.l" -yylval->number = ExceptionLevel::EL3; return tok::EXCEPTION_LEVEL_TYPE; +#line 245 "../s/bif.l" +yylval->number = DestinationCPU::R5_0; return tok::DEST_CPU_TYPE; YY_BREAK case 190: YY_RULE_SETUP -#line 249 "../s/bif.l" -return tok::TRUSTZONE; +#line 246 "../s/bif.l" +yylval->number = DestinationCPU::R5_0; return tok::DEST_CPU_TYPE; YY_BREAK case 191: YY_RULE_SETUP -#line 250 "../s/bif.l" -yylval->number = TrustZone::Secure; return tok::TRUSTZONE_TYPE; +#line 247 "../s/bif.l" +yylval->number = DestinationCPU::R5_1; return tok::DEST_CPU_TYPE; YY_BREAK case 192: YY_RULE_SETUP -#line 251 "../s/bif.l" -yylval->number = TrustZone::NonSecure; return tok::TRUSTZONE_TYPE; +#line 248 "../s/bif.l" +yylval->number = DestinationCPU::R5_1; return tok::DEST_CPU_TYPE; YY_BREAK case 193: YY_RULE_SETUP -#line 253 "../s/bif.l" -yylval->number = tok::SLR_NUM; return tok::SLR_NUM; +#line 249 "../s/bif.l" +yylval->number = DestinationCPU::R5_lockstep; return tok::DEST_CPU_TYPE; YY_BREAK case 194: YY_RULE_SETUP -#line 255 "../s/bif.l" -yylval->number = tok::AUTH_PARAMS; return tok::AUTH_PARAMS; +#line 250 "../s/bif.l" +yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; YY_BREAK case 195: YY_RULE_SETUP -#line 256 "../s/bif.l" -yylval->number = tok::PPK_SELECT; return tok::PPK_SELECT; +#line 251 "../s/bif.l" +yylval->number = DestinationCPU::PMU; return tok::DEST_CPU_TYPE; YY_BREAK case 196: YY_RULE_SETUP -#line 257 "../s/bif.l" -yylval->number = tok::SPK_SELECT; return tok::SPK_SELECT; +#line 252 "../s/bif.l" +yylval->number = DestinationCPU::AIE; return tok::DEST_CPU_TYPE; YY_BREAK case 197: YY_RULE_SETUP -#line 258 "../s/bif.l" -yylval->number = SpkSelect::SPK_eFUSE; return tok::SPKSELECT; +#line 253 "../s/bif.l" +yylval->number = tok::CLUSTER_NUM; return tok::CLUSTER_NUM; YY_BREAK case 198: YY_RULE_SETUP -#line 259 "../s/bif.l" -yylval->number = SpkSelect::USER_eFUSE; return tok::SPKSELECT; +#line 255 "../s/bif.l" +return tok::DEST_DEVICE; YY_BREAK case 199: YY_RULE_SETUP -#line 260 "../s/bif.l" -yylval->number = tok::SPK_ID; return tok::SPK_ID; +#line 256 "../s/bif.l" +yylval->number = DestinationDevice::DEST_DEV_PS; return tok::DEST_DEVICE_TYPE; YY_BREAK case 200: YY_RULE_SETUP -#line 261 "../s/bif.l" -return tok::HEADER_AUTH; +#line 257 "../s/bif.l" +yylval->number = DestinationDevice::DEST_DEV_PL; return tok::DEST_DEVICE_TYPE; YY_BREAK case 201: YY_RULE_SETUP -#line 263 "../s/bif.l" -yylval->number = tok::REVOKE_ID; return tok::REVOKE_ID; +#line 258 "../s/bif.l" +yylval->number = DestinationDevice::DEST_DEV_PMU; return tok::DEST_DEVICE_TYPE; YY_BREAK case 202: YY_RULE_SETUP -#line 265 "../s/bif.l" -yylval->number = tok::SPLIT; return tok::SPLIT; +#line 259 "../s/bif.l" +yylval->number = DestinationDevice::DEST_DEV_XIP; return tok::DEST_DEVICE_TYPE; YY_BREAK case 203: YY_RULE_SETUP -#line 266 "../s/bif.l" -yylval->number = tok::SPLIT_MODE; return tok::SPLIT_MODE; +#line 261 "../s/bif.l" +return tok::EXCEPTION_LEVEL; YY_BREAK case 204: YY_RULE_SETUP -#line 267 "../s/bif.l" -yylval->number = SplitMode::SlaveMode; return tok::SPLITMODE; +#line 262 "../s/bif.l" +yylval->number = ExceptionLevel::EL0; return tok::EXCEPTION_LEVEL_TYPE; YY_BREAK case 205: YY_RULE_SETUP -#line 268 "../s/bif.l" -yylval->number = SplitMode::Normal; return tok::SPLITMODE; +#line 263 "../s/bif.l" +yylval->number = ExceptionLevel::EL1; return tok::EXCEPTION_LEVEL_TYPE; YY_BREAK case 206: YY_RULE_SETUP -#line 269 "../s/bif.l" -yylval->number = tok::SPLIT_FMT; return tok::SPLIT_FMT; +#line 264 "../s/bif.l" +yylval->number = ExceptionLevel::EL2; return tok::EXCEPTION_LEVEL_TYPE; YY_BREAK case 207: YY_RULE_SETUP -#line 270 "../s/bif.l" -return tok::MCS; +#line 265 "../s/bif.l" +yylval->number = ExceptionLevel::EL3; return tok::EXCEPTION_LEVEL_TYPE; YY_BREAK case 208: YY_RULE_SETUP -#line 271 "../s/bif.l" -return tok::BIN; +#line 267 "../s/bif.l" +return tok::TRUSTZONE; YY_BREAK case 209: YY_RULE_SETUP -#line 273 "../s/bif.l" -yylval->number = tok::AUTHJTAG_CONFIG; return tok::AUTHJTAG_CONFIG; +#line 268 "../s/bif.l" +yylval->number = TrustZone::Secure; return tok::TRUSTZONE_TYPE; YY_BREAK case 210: YY_RULE_SETUP -#line 274 "../s/bif.l" -yylval->number = tok::DEVICE_DNA; return tok::DEVICE_DNA; +#line 269 "../s/bif.l" +yylval->number = TrustZone::NonSecure; return tok::TRUSTZONE_TYPE; YY_BREAK case 211: YY_RULE_SETUP -#line 275 "../s/bif.l" -yylval->number = tok::JTAG_TIMEOUT; return tok::JTAG_TIMEOUT; +#line 271 "../s/bif.l" +yylval->number = tok::SLR_NUM; return tok::SLR_NUM; YY_BREAK case 212: YY_RULE_SETUP -#line 277 "../s/bif.l" -yylval->number=atoi(yytext); return tok::DECVALUE; +#line 273 "../s/bif.l" +yylval->number = tok::AUTH_PARAMS; return tok::AUTH_PARAMS; YY_BREAK case 213: YY_RULE_SETUP -#line 278 "../s/bif.l" -yylval->number=strtoul(yytext+2,NULL,16); return tok::HEXVALUE; +#line 274 "../s/bif.l" +yylval->number = tok::PPK_SELECT; return tok::PPK_SELECT; YY_BREAK case 214: YY_RULE_SETUP -#line 279 "../s/bif.l" -yylval->string=strdup(yytext); return tok::HEXWORD; +#line 275 "../s/bif.l" +yylval->number = tok::SPK_SELECT; return tok::SPK_SELECT; YY_BREAK case 215: YY_RULE_SETUP -#line 281 "../s/bif.l" -return tok::COLON; +#line 276 "../s/bif.l" +yylval->number = SpkSelect::SPK_eFUSE; return tok::SPKSELECT; YY_BREAK case 216: YY_RULE_SETUP -#line 282 "../s/bif.l" -return tok::SEMICOLON; +#line 277 "../s/bif.l" +yylval->number = SpkSelect::USER_eFUSE; return tok::SPKSELECT; YY_BREAK case 217: YY_RULE_SETUP -#line 283 "../s/bif.l" -return tok::EQUAL; +#line 278 "../s/bif.l" +yylval->number = tok::SPK_ID; return tok::SPK_ID; YY_BREAK case 218: YY_RULE_SETUP -#line 284 "../s/bif.l" -return tok::COMMA; +#line 279 "../s/bif.l" +return tok::HEADER_AUTH; YY_BREAK case 219: YY_RULE_SETUP -#line 285 "../s/bif.l" -return tok::OBRACKET; +#line 281 "../s/bif.l" +yylval->number = tok::REVOKE_ID; return tok::REVOKE_ID; YY_BREAK case 220: YY_RULE_SETUP -#line 286 "../s/bif.l" -return tok::EBRACKET; +#line 283 "../s/bif.l" +yylval->number = tok::SPLIT; return tok::SPLIT; YY_BREAK case 221: YY_RULE_SETUP -#line 287 "../s/bif.l" -return tok::OBRACE; +#line 284 "../s/bif.l" +yylval->number = tok::SPLIT_MODE; return tok::SPLIT_MODE; YY_BREAK case 222: YY_RULE_SETUP -#line 288 "../s/bif.l" -return tok::EBRACE; +#line 285 "../s/bif.l" +yylval->number = SplitMode::SlaveMode; return tok::SPLITMODE; YY_BREAK case 223: YY_RULE_SETUP -#line 289 "../s/bif.l" -return tok::LPAREN; +#line 286 "../s/bif.l" +yylval->number = SplitMode::Normal; return tok::SPLITMODE; YY_BREAK case 224: YY_RULE_SETUP -#line 290 "../s/bif.l" -return tok::RPAREN; +#line 287 "../s/bif.l" +yylval->number = tok::SPLIT_FMT; return tok::SPLIT_FMT; YY_BREAK case 225: YY_RULE_SETUP -#line 291 "../s/bif.l" -return tok::ASTERISK; +#line 288 "../s/bif.l" +return tok::MCS; YY_BREAK case 226: YY_RULE_SETUP -#line 293 "../s/bif.l" -return tok::PLUS; +#line 289 "../s/bif.l" +return tok::BIN; YY_BREAK case 227: YY_RULE_SETUP -#line 294 "../s/bif.l" -return tok::MINUS; +#line 291 "../s/bif.l" +yylval->number = tok::AUTHJTAG_CONFIG; return tok::AUTHJTAG_CONFIG; YY_BREAK case 228: YY_RULE_SETUP -#line 295 "../s/bif.l" -return tok::LSHIFT; +#line 292 "../s/bif.l" +yylval->number = tok::DEVICE_DNA; return tok::DEVICE_DNA; YY_BREAK case 229: YY_RULE_SETUP -#line 296 "../s/bif.l" -return tok::RSHIFT; +#line 293 "../s/bif.l" +yylval->number = tok::JTAG_TIMEOUT; return tok::JTAG_TIMEOUT; YY_BREAK case 230: YY_RULE_SETUP -#line 297 "../s/bif.l" -return tok::MULT; +#line 295 "../s/bif.l" +yylval->number=atoi(yytext); return tok::DECVALUE; YY_BREAK case 231: YY_RULE_SETUP -#line 298 "../s/bif.l" -return tok::DIVIDE; +#line 296 "../s/bif.l" +yylval->number=strtoul(yytext+2,NULL,16); return tok::HEXVALUE; YY_BREAK case 232: YY_RULE_SETUP -#line 299 "../s/bif.l" -return tok::MODULO; +#line 297 "../s/bif.l" +yylval->string=strdup(yytext); return tok::HEXWORD; YY_BREAK case 233: YY_RULE_SETUP -#line 300 "../s/bif.l" -return tok::NEGATION; +#line 299 "../s/bif.l" +return tok::COLON; YY_BREAK case 234: YY_RULE_SETUP -#line 301 "../s/bif.l" -return tok::AND; +#line 300 "../s/bif.l" +return tok::SEMICOLON; YY_BREAK case 235: YY_RULE_SETUP -#line 302 "../s/bif.l" -return tok::OR; +#line 301 "../s/bif.l" +return tok::EQUAL; YY_BREAK case 236: YY_RULE_SETUP -#line 303 "../s/bif.l" -return tok::XOR; +#line 302 "../s/bif.l" +return tok::COMMA; YY_BREAK case 237: YY_RULE_SETUP -#line 305 "../s/bif.l" -yylval->string=strdup(yytext); return tok::WORD; +#line 303 "../s/bif.l" +return tok::OBRACKET; YY_BREAK case 238: YY_RULE_SETUP -#line 306 "../s/bif.l" -yylval->string=strdup(yytext); return tok::FILENAME; +#line 304 "../s/bif.l" +return tok::EBRACKET; YY_BREAK case 239: YY_RULE_SETUP -#line 307 "../s/bif.l" -yylval->string=strdup(yytext+1); yylval->string[strlen(yytext)-2]=0; return tok::QFILENAME; +#line 305 "../s/bif.l" +return tok::OBRACE; YY_BREAK case 240: YY_RULE_SETUP -#line 309 "../s/bif.l" -yylloc->step (); +#line 306 "../s/bif.l" +return tok::EBRACE; YY_BREAK case 241: -/* rule 241 can match eol */ YY_RULE_SETUP -#line 310 "../s/bif.l" -yylloc->lines (yyleng); yylloc->step (); +#line 307 "../s/bif.l" +return tok::LPAREN; YY_BREAK case 242: YY_RULE_SETUP -#line 311 "../s/bif.l" -/* ignore (Linux only) */ +#line 308 "../s/bif.l" +return tok::RPAREN; YY_BREAK case 243: YY_RULE_SETUP -#line 312 "../s/bif.l" -printf("WARNING: bad character! '%s' (0x%02X)\n",yytext,yytext[0]); +#line 309 "../s/bif.l" +return tok::ASTERISK; YY_BREAK case 244: YY_RULE_SETUP +#line 311 "../s/bif.l" +return tok::PLUS; + YY_BREAK +case 245: +YY_RULE_SETUP +#line 312 "../s/bif.l" +return tok::MINUS; + YY_BREAK +case 246: +YY_RULE_SETUP #line 313 "../s/bif.l" +return tok::LSHIFT; + YY_BREAK +case 247: +YY_RULE_SETUP +#line 314 "../s/bif.l" +return tok::RSHIFT; + YY_BREAK +case 248: +YY_RULE_SETUP +#line 315 "../s/bif.l" +return tok::MULT; + YY_BREAK +case 249: +YY_RULE_SETUP +#line 316 "../s/bif.l" +return tok::DIVIDE; + YY_BREAK +case 250: +YY_RULE_SETUP +#line 317 "../s/bif.l" +return tok::MODULO; + YY_BREAK +case 251: +YY_RULE_SETUP +#line 318 "../s/bif.l" +return tok::NEGATION; + YY_BREAK +case 252: +YY_RULE_SETUP +#line 319 "../s/bif.l" +return tok::AND; + YY_BREAK +case 253: +YY_RULE_SETUP +#line 320 "../s/bif.l" +return tok::OR; + YY_BREAK +case 254: +YY_RULE_SETUP +#line 321 "../s/bif.l" +return tok::XOR; + YY_BREAK +case 255: +YY_RULE_SETUP +#line 323 "../s/bif.l" +yylval->string=strdup(yytext); return tok::WORD; + YY_BREAK +case 256: +YY_RULE_SETUP +#line 324 "../s/bif.l" +yylval->string=strdup(yytext); return tok::FILENAME; + YY_BREAK +case 257: +YY_RULE_SETUP +#line 325 "../s/bif.l" +yylval->string=strdup(yytext+1); yylval->string[strlen(yytext)-2]=0; return tok::QFILENAME; + YY_BREAK +case 258: +YY_RULE_SETUP +#line 327 "../s/bif.l" +yylloc->step (); + YY_BREAK +case 259: +/* rule 259 can match eol */ +YY_RULE_SETUP +#line 328 "../s/bif.l" +yylloc->lines (yyleng); yylloc->step (); + YY_BREAK +case 260: +YY_RULE_SETUP +#line 329 "../s/bif.l" +/* ignore (Linux only) */ + YY_BREAK +case 261: +YY_RULE_SETUP +#line 330 "../s/bif.l" +printf("WARNING: bad character! '%s' (0x%02X)\n",yytext,yytext[0]); + YY_BREAK +case 262: +YY_RULE_SETUP +#line 331 "../s/bif.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2928 "../bisonflex/bif.yy.cpp" +#line 3066 "../bisonflex/bif.yy.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3326,7 +3464,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1103 ) + if ( yy_current_state >= 1171 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -3359,11 +3497,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1103 ) + if ( yy_current_state >= 1171 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1102); + yy_is_jam = (yy_current_state == 1170); return yy_is_jam ? 0 : yy_current_state; } @@ -3973,7 +4111,7 @@ /* %ok-for-header */ -#line 313 "../s/bif.l" +#line 331 "../s/bif.l" diff -Nru xilinx-bootgen-2021.2/bifoptions.cpp xilinx-bootgen-2022.2/bifoptions.cpp --- xilinx-bootgen-2021.2/bifoptions.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bifoptions.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,6 +64,7 @@ , pufMode(PufMode::PUF12K) , optKey(OptKey::None) , shutterVal(SHUTTER_VAL) + , pufRoSwapConfigVal(0) , dpaCM(DpaCM::DpaCMDisable) , ppkSelect(0) , spkSelect(1) @@ -92,6 +93,9 @@ , slrConfigCnt(0) , aHwrot(false) , sHwrot(false) + , pmcdataBlocks(0) + , dice(DICE::DiceDisable) + , slrNum(0xFF) { arch = architecture; SetGroupName(name); @@ -166,7 +170,12 @@ , revokeId(0x00000000) , slrNum(0xFF) , pufHdLoc(PufHdLoc::PUFinEFuse) + , versalNetSeries(false) + , clusterNum(0) + , lockstep(false) , updateReserveInPh(false) + , bifSection("") + , delayAuth(false) { } /******************************************************************************/ @@ -264,6 +273,9 @@ { pmcDataAesFile = StringUtils::RemoveExtension(StringUtils::BaseName((currentPartitionBifOptions)->filename)) + ".nky"; } + + if(!(currentPartitionBifOptions->pmcData)) + partitionBifOptionList.push_back(currentPartitionBifOptions); currentPartitionBifOptions->pmcData = true; break; @@ -390,7 +402,7 @@ std::ifstream f(filename.c_str()); if (!f) { - LOG_ERROR("Cannot read file - %s", regInitFile.c_str()); + LOG_ERROR("Cannot read file - %s", filename.c_str()); } regInitFile = filename; LOG_TRACE("Setting Register initialization file as %s", regInitFile.c_str()); @@ -420,7 +432,7 @@ std::ifstream f(filename.c_str()); if (!f) { - LOG_ERROR("Cannot read file - %s", regInitFile.c_str()); + LOG_ERROR("Cannot read file - %s", filename.c_str()); } udfBhFile = filename; LOG_TRACE("Setting UDF of BH as %s", udfBhFile.c_str()); @@ -472,6 +484,12 @@ } /******************************************************************************/ +void BifOptions::ClearPmcCdoFileList() +{ + pmcCdoFileList.clear(); +} + +/******************************************************************************/ void BifOptions::SetPmcCdoFileList(const std::string& filename) { pmcCdoFileList.push_back(filename); @@ -594,6 +612,18 @@ } /******************************************************************************/ +void BifOptions::SetPufRingOscilltorSwapConfigValue(uint32_t value) +{ + pufRoSwapConfigVal = value; +} + +/******************************************************************************/ +void BifOptions::SetDiceEnable() +{ + dice = DICE::DiceEnable; +} + +/******************************************************************************/ void BifOptions::SetPUFHelperFileName(std::string filename) { if (arch == Arch::ZYNQ) @@ -1007,12 +1037,15 @@ } /******************************************************************************/ -static void ValidateEncryptionKeySource(KeySource::Type type) +static void ValidateEncryptionKeySource(KeySource::Type type, bool versalNetSeries) { - if ((type == KeySource::EfuseGryKey) || (type == KeySource::BhGryKey) || (type == KeySource::BbramGryKey) - || (type == KeySource::EfuseUserGryKey0) || (type == KeySource::EfuseUserGryKey1)) + if (!versalNetSeries) { - LOG_ERROR("The usage of obfuscated keys is deprecated in Versal.\n\t Refer 'bootgen -arch versal -bif_help keysrc' for valid key sources."); + if ((type == KeySource::EfuseGryKey) || (type == KeySource::BhGryKey) || (type == KeySource::BbramGryKey) + || (type == KeySource::EfuseUserGryKey0) || (type == KeySource::EfuseUserGryKey1)) + { + LOG_ERROR("The usage of obfuscated keys is deprecated in Versal.\n\t Refer 'bootgen -arch versal -bif_help keysrc' for valid key sources."); + } } static bool bhBlkKek = false; @@ -1091,9 +1124,9 @@ } /******************************************************************************/ -void BifOptions::SetMetaHeaderEncryptionKeySource(KeySource::Type type) +void BifOptions::SetMetaHeaderEncryptionKeySource(KeySource::Type type, bool versalNetSeries) { - ValidateEncryptionKeySource(type); + ValidateEncryptionKeySource(type, versalNetSeries); metaHdrAttributes.encrKeySource = type; } @@ -1162,14 +1195,15 @@ /******************************************************************************/ void PartitionBifOptions::SetEncryptionKeySource(KeySource::Type type) { - ValidateEncryptionKeySource(type); + ValidateEncryptionKeySource(type, versalNetSeries); keySrc = type; } /******************************************************************************/ -void PartitionBifOptions::SetArchType(Arch::Type type) +void PartitionBifOptions::SetArchType(Arch::Type type, bool flag) { arch = type; + versalNetSeries = flag; } /******************************************************************************/ @@ -1375,7 +1409,7 @@ /******************************************************************************/ void PartitionBifOptions::SetRevokeId(uint32_t id) { - if (revokeId > 0xFF) + if (id > 0xFF) { LOG_ERROR("revoke_id can only take values from 0x0 to 0xFF."); } @@ -1389,6 +1423,36 @@ } /******************************************************************************/ +void PartitionBifOptions::SetClusterNum(uint8_t id) +{ + if (arch == Arch::VERSAL && versalNetSeries) + { + if (id != 0 && id != 1 && id != 2 && id != 3) + { + LOG_ERROR("cluster can only take values from 0 to 3."); + } + clusterNum = id; + } + else + { + LOG_ERROR("BIF attribute error !!!\n\t 'cluster' is supported only in VersalNet architecture"); + } +} + +/******************************************************************************/ +void PartitionBifOptions::SetLockStepFlag() +{ + if (arch == Arch::VERSAL && versalNetSeries) + { + lockstep = true; + } + else + { + LOG_ERROR("BIF attribute error !!!\n\t 'lockstep' is supported only in VersalNet architecture"); + } +} + +/******************************************************************************/ std::vector& PartitionBifOptions::GetEncryptionBlocks(void) { return blocks; @@ -1437,6 +1501,12 @@ } /******************************************************************************/ +void PartitionBifOptions::SetDelayAuth(bool flag) +{ + delayAuth = flag; +} + +/******************************************************************************/ uint32_t PartitionBifOptions::GetDefaultEncryptionBlockSize(void) { return defBlockSize; @@ -1467,9 +1537,13 @@ } /******************************************************************************/ -std::string PartitionBifOptions::GetOutputFileFromBifSection(std::string out_file, std::string bif_section) +std::string PartitionBifOptions::GetOutputFileFromBifSection(std::string out_file, std::string bif_section, PartitionType::Type part_type) { std::string filename = StringUtils::RemoveExtension(out_file) + "_" + bif_section + StringUtils::GetExtension(out_file); + if (part_type == PartitionType::SLR_BOOT || part_type == PartitionType::SLR_CONFIG) + { + filename = StringUtils::RemoveExtension(out_file) + "_" + bif_section + ".bin"; + } return filename; } @@ -1747,6 +1821,18 @@ } /******************************************************************************/ +uint32_t BifOptions::GetPufRingOscilltorSwapConfigValue(void) +{ + return pufRoSwapConfigVal; +} + +/******************************************************************************/ +DICE::Type BifOptions::GetDice(void) +{ + return dice; +} + +/******************************************************************************/ DpaCM::Type BifOptions::GetDpaCM(void) { return dpaCM; @@ -1801,6 +1887,12 @@ } /******************************************************************************/ +std::string BifOptions::GetUserKeysFileName(void) +{ + return userKeyFile; +} + +/******************************************************************************/ std::string BifOptions::GetUdfBhFile(void) { return udfBhFile; @@ -1865,6 +1957,12 @@ } /******************************************************************************/ +void BifOptions::SetPdiType(PartitionType::Type type) +{ + pdiType = type; +} + +/******************************************************************************/ void BifOptions::SetBypassIdcodeFlag(bool flag) { bypassIdCode = flag; diff -Nru xilinx-bootgen-2021.2/bifoptions.h xilinx-bootgen-2022.2/bifoptions.h --- xilinx-bootgen-2021.2/bifoptions.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bifoptions.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ public: PartitionBifOptions(); - void SetArchType(Arch::Type type); + void SetArchType(Arch::Type type, bool versalNetSeries); void SetEncryptionBlocks(uint32_t size, uint32_t num = 1); void SetDefaultEncryptionBlockSize(uint32_t blk); void SetDestCpu(DestinationCPU::Type); @@ -97,12 +97,15 @@ void SetHivec(bool); void SetRevokeId(uint32_t); void SetSlrNum(uint8_t); + void SetClusterNum(uint8_t id); + void SetLockStepFlag(); void SetAesKeyFile(std::string filename); void SetUdfDataFile(std::string filename); void SetEncryptionKeySource(KeySource::Type type); void SetAuthBlockAttr(size_t blocksizeattr); void SetPufHdLocation(PufHdLoc::Type); void SetReserveLength(uint64_t length, bool flag); + void SetDelayAuth(bool flag); std::string GetUdfDataFile(void); std::vector& GetEncryptionBlocks(void); @@ -111,7 +114,8 @@ DpaCM::Type GetDpaCM(void); uint32_t GetRevokeId(void); PufHdLoc::Type GetPufHdLocation(void); - std::string GetOutputFileFromBifSection(std::string out_file, std::string bif_section); + std::string GetOutputFileFromBifSection(std::string, std::string, PartitionType::Type); + bool IsVersalNetSeries(void) { return versalNetSeries; } void Dump(void) { @@ -157,6 +161,7 @@ DpaCM::Type dpaCM; PufHdLoc::Type pufHdLoc; uint8_t slrNum; + uint8_t clusterNum; //no default declared Override alignment; @@ -178,6 +183,7 @@ bool early_handoff; bool bootloader; bool hivec; + bool lockstep; KeySource::Type keySrc; size_t authblockattr; size_t pid; @@ -197,6 +203,10 @@ std::vector filelist; bool updateReserveInPh; Arch::Type arch; + bool delayAuth; + +private: + bool versalNetSeries; }; /******************************************************************************/ @@ -355,6 +365,7 @@ void SetSplitMode(SplitMode::Type type); void SetSplitFmt(File::Type type); void SetPmcdataFile(const std::string & filename); + void ClearPmcCdoFileList(); void SetPmcCdoFileList(const std::string & filename); void SetPdiId(uint32_t id); void SetGroupName(std::string name); @@ -369,9 +380,11 @@ void SetOptKey(OptKey::Type type); void SetPufMode(PufMode::Type type); void SetShutterValue(uint32_t value); + void SetPufRingOscilltorSwapConfigValue(uint32_t value); + void SetDiceEnable(); void InsertEncryptionBlock(uint32_t size); void SetCore(Core::Type type); - void SetMetaHeaderEncryptionKeySource(KeySource::Type type); + void SetMetaHeaderEncryptionKeySource(KeySource::Type type, bool versalNetSeries); void SetMetaHeaderEncryptType(Encryption::Type type); void SetMetaHeaderAuthType(Authentication::Type type); void SetPufHdinBHFlag(); @@ -389,12 +402,15 @@ BootDevice::Type GetBootDevice(void); uint32_t GetBootDeviceAddress(void); uint32_t GetShutterValue(void); + uint32_t GetPufRingOscilltorSwapConfigValue(void); + DICE::Type GetDice(void); std::string GetHeaderSignatureFile(void); PufMode::Type GetPufMode(void); PufHdLoc::Type GetPufHdLoc(void); OptKey::Type GetOptKey(void); void SetIdCode(uint32_t id); void SetExtendedIdCode(uint32_t id); + void SetPdiType(PartitionType::Type type); void SetBypassIdcodeFlag(bool flag); void SetAHwRoTFlag(bool flag); void SetSHwRoTFlag(bool flag); @@ -421,6 +437,7 @@ std::string GetEfuseKekIVFile(void); std::string GetEfuseUserKek0IVFile(void); std::string GetEfuseUserKek1IVFile(void); + std::string GetUserKeysFileName(void); std::string GetUdfBhFile(void); SplitMode::Type GetSplitMode(void); uint32_t GetIdCode(void); @@ -449,12 +466,13 @@ std::list imageBifOptionList; std::list partitionBifOptionList; Core::Type GetCore(void); - + //Versal Binary::Address_t pmcCdoLoadAddress; std::string pmcDataAesFile; uint32_t idCode; uint32_t extendedIdCode; + PartitionType::Type pdiType; bool bypassIdCode; bool aHwrot; bool sHwrot; @@ -467,6 +485,9 @@ uint32_t slrBootCnt; uint32_t slrConfigCnt; PartitionBifOptions* lastPartitionBifOption; + BootDevice::Type bootDevice; + std::vector pmcdataBlocks; + uint8_t slrNum; private: std::string regInitFile; std::string udfBhFile; @@ -492,7 +513,6 @@ std::string aesKeyFile; std::string userKeyFile; KeySource::Type keySourceEncryption; - BootDevice::Type bootDevice; uint32_t bootDeviceAddress; std::vector bootvectors; BhRsa::Type bhAuthEnable; @@ -502,7 +522,9 @@ PufMode::Type pufMode; OptKey::Type optKey; uint32_t shutterVal; + uint32_t pufRoSwapConfigVal; DpaCM::Type dpaCM; + DICE::Type dice; bool xipMode; uint32_t ppkSelect; bool isPPKSelectGlobal; diff -Nru xilinx-bootgen-2021.2/binary-versal.cpp xilinx-bootgen-2022.2/binary-versal.cpp --- xilinx-bootgen-2021.2/binary-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/binary-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,7 +90,7 @@ if (runningAddress > sec.Address) { LOG_DUMP_IMAGE(*this); - LOG_ERROR("Section %s offset of 0x%X overlaps with prior section end address of %X", sec.Name.c_str(), sec.Address, runningAddress); + LOG_ERROR("Section %s offset of 0x%X overlaps with prior section end address of 0x%X", sec.Name.c_str(), sec.Address, runningAddress); } } else diff -Nru xilinx-bootgen-2021.2/binary.cpp xilinx-bootgen-2022.2/binary.cpp --- xilinx-bootgen-2021.2/binary.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/binary.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ if (runningAddress > sec.Address) { LOG_DUMP_IMAGE(*this); - LOG_ERROR("Section %s offset of 0x%X overlaps with prior section end address of %X", sec.Name.c_str(), sec.Address, runningAddress); + LOG_ERROR("Section %s offset of 0x%X overlaps with prior section end address of 0x%X", sec.Name.c_str(), sec.Address, runningAddress); } } else diff -Nru xilinx-bootgen-2021.2/binfile.cpp xilinx-bootgen-2022.2/binfile.cpp --- xilinx-bootgen-2021.2/binfile.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/binfile.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ { /* ignore "doFill". Always fill! */ size_t length = end - start; - if (qspiDualMode == QspiMode::PARALLEL_GQSPI) + if (qspiDualMode == QspiMode::PARALLEL_GQSPI || qspiDualMode == QspiMode::PARALLEL_LQSPI) { for (size_t i = 0; i < length/2; i++) { @@ -131,7 +131,7 @@ } totalByteOutputCount += length; } - + /******************************************************************************/ void BinFile::Write(Binary::Address_t start, Binary::Length_t length, const uint8_t *buffer) { @@ -150,6 +150,32 @@ } ofs.write((const char*)buffer1, length / 2); ofs1.write((const char*)buffer2, length / 2); + } + else if (qspiDualMode == QspiMode::PARALLEL_LQSPI) + { + uint8_t* buffer1 = new uint8_t[length / 2]; + uint8_t* buffer2 = new uint8_t[length / 2]; + int k = 0; + for (uint64_t i = 0; i < length; i += 2, k++) + { + uint8_t lsb = 0, lsbNxt = 0; + uint8_t msb = 0, msbNxt = 0; + uint8_t tempData = writedata[i]; + uint8_t tempDataNxt = writedata[i + 1]; + for (int j = 0; j < 4; j++) + { + lsb = lsb | ((tempData & 0x1) << j); + msb = msb | (((tempData & 0x2) >> 1) << j); + tempData = tempData >> 2; + lsbNxt = lsbNxt | ((tempDataNxt & 0x1) << j); + msbNxt = msbNxt | (((tempDataNxt & 0x2) >> 1) << j); + tempDataNxt = tempDataNxt >> 2; + } + buffer1[k] = (lsb << 4) | lsbNxt; + buffer2[k] = (msb << 4) | msbNxt; + } + ofs.write((const char*)buffer1, length / 2); + ofs1.write((const char*)buffer2, length / 2); } else if (qspiDualMode == QspiMode::STACKED) { diff -Nru xilinx-bootgen-2021.2/bootgenenum.h xilinx-bootgen-2022.2/bootgenenum.h --- xilinx-bootgen-2021.2/bootgenenum.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootgenenum.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -218,6 +218,26 @@ } Type; }; +/* DICE */ +struct DICE +{ + typedef enum + { + DiceDisable = 0, + DiceEnable = 3, + } Type; +}; + +/* LockStep */ +struct Lockstep +{ + typedef enum + { + LockstepDisable = 0, + LockstepEnable = 3, + } Type; +}; + /* Authentication Hash Selection */ struct AuthHash { @@ -405,7 +425,10 @@ REG_INIT, BOOTLOADER, SLR_BOOT, - SLR_CONFIG + SLR_CONFIG, + SLR_SLAVE, + SLR_SLAVE_BOOT, + SLR_SLAVE_CONFIG } Type; }; @@ -414,6 +437,7 @@ { typedef enum { + NONE, ALL, BH, IHT, diff -Nru xilinx-bootgen-2021.2/bootheader-versal.cpp xilinx-bootgen-2022.2/bootheader-versal.cpp --- xilinx-bootgen-2021.2/bootheader-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootheader-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ #include "bootheader-versal.h" #include "authentication-versal.h" +#define PLM_MAX_SIZE 0x60000 //384KB + /* ------------------------------------------------------------------------------- ***************************************************** F U N C T I O N S *** @@ -124,10 +126,25 @@ SetEncryptionKeySource(bi.options.GetEncryptedKeySource(), bi.bifOptions); SetPmcCdoLoadAddress(bi.bifOptions->GetPmcCdoLoadAddress()); SetShutterValue(bi.bifOptions->GetShutterValue()); + SetPufRingOscilltorSwapConfigValue(bi.bifOptions->GetPufRingOscilltorSwapConfigValue()); SetGreyOrBlackKey(bi.bifOptions->GetBhKeyFile()); + + if (bi.options.IsVersalNetSeries() && bi.bifOptions->GetBHKekIVFile() != "") + { + kekIvFile = bi.bifOptions->GetBHKekIVFile(); + } + SetGreyOrBlackIv(kekIvFile); SetPlmSecureHdrIv(bi.options.secHdrIv); SetPmcDataSecureHdrIv(bi.options.secHdrIvPmcData); + if (bi.options.IsVersalNetSeries()) + { + SetRevokeId(bi.imageList.front()->GetPartitionRevocationId()); + } + else + { + SetRevokeId(0x00000000); + } SetRomReserved(); SetPmcFwReserved(); BuildRegInitTable(bi.options); @@ -178,7 +195,14 @@ PartitionHeader& bootloaderHdr(*(fsbl->GetPartitionHeaderList().front())); BootloaderAddressAndSizeCheck(bootloaderHdr); - SetSourceOffset((uint32_t)bootloaderHdr.partition->section->Address); + if (bootloaderHdr.imageHeader->GetChecksumContext()->Type() != Checksum::None && bi.options.IsVersalNetSeries()) + { + SetSourceOffset((uint32_t)bootloaderHdr.partition->section->Address + SHA3_LENGTH_BYTES); + } + else + { + SetSourceOffset((uint32_t)bootloaderHdr.partition->section->Address); + } SetPlmLength((uint32_t)bootloaderHdr.GetPartitionSize()); SetBHForXIP(bi); @@ -216,6 +240,10 @@ } SetHeaderChecksum(); + if (bHTable->totalPlmLength > PLM_MAX_SIZE && !bi.options.IsVersalNetSeries()) + { + LOG_ERROR("Total PLM size : %dKB > maximum allowable size (384KB)", bHTable->totalPlmLength / 1024); + } } /******************************************************************************/ @@ -491,6 +519,16 @@ bHTable->bhAttributes |= bi.partitionHeaderList.front()->imageHeader->GetDpacm() << DPA_CM_BIT_SHIFT; bHTable->bhAttributes |= bi.bifOptions->GetBhRsa() << BH_RSA_BIT_SHIFT; bHTable->bhAttributes |= bi.bifOptions->GetPufMode() << BH_PUF_MODE_BIT_SHIFT; + + if (bi.options.IsVersalNetSeries()) + { + if (bi.partitionHeaderList.front()->imageHeader->GetAuthenticationType() != Authentication::None) + { + bHTable->bhAttributes |= BH_RSA_SINGED_BIT_MASK << BH_RSA_SINGED_BIT_SHIFT; + } + + bHTable->bhAttributes |= bi.bifOptions->GetDice() << BH_DICE_BIT_SHIFT; + } } } @@ -536,6 +574,18 @@ } /******************************************************************************/ +void VersalBootHeader::SetRevokeId(uint32_t id) +{ + bHTable->revokeId = id; +} + +/******************************************************************************/ +void VersalBootHeader::SetPufRingOscilltorSwapConfigValue(uint32_t value) +{ + bHTable->pufRoSwapConfigVal = value; +} + +/******************************************************************************/ void VersalBootHeader::SetImageHeaderByteOffset(uint32_t address) { bHTable->imageHeaderByteOffset = address; diff -Nru xilinx-bootgen-2021.2/bootheader-versal.h xilinx-bootgen-2022.2/bootheader-versal.h --- xilinx-bootgen-2021.2/bootheader-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootheader-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,8 @@ #define DEFAULT_RESERVED_VERSAL 0 #define SMAP_BUS_WIDTH 4 -#define ROM_BH_RESERVED 17 + +#define ROM_BH_RESERVED 15 #define PLM_BH_RESERVED 24 #define SHA3_PAD_SIZE_VERSAL 19 #define MAX_REG_INIT_VERSAL 512 @@ -51,6 +52,12 @@ #define DPA_CM_BIT_SHIFT 10 #define DPA_CM_BIT_MASK 3 +//VersalNet +#define BH_RSA_SINGED_BIT_SHIFT 18 +#define BH_RSA_SINGED_BIT_MASK 3 + +#define BH_DICE_BIT_SHIFT 20 +#define BH_DICE_BIT_MASK 3 /* ------------------------------------------------------------------------------- @@ -80,7 +87,9 @@ uint32_t plmSecureHdrIv[IV_LENGTH]; // (0x64) uint32_t shutterValue; // (0x70) uint32_t pmcCdoSecureHdrIv[IV_LENGTH]; // (0x74) - uint32_t romReserved[ROM_BH_RESERVED]; // (0x80) + uint32_t pufRoSwapConfigVal; // (0x80) - Valid only for VersalNet + uint32_t revokeId; // (0x84) + uint32_t romReserved[ROM_BH_RESERVED]; // (0x88) uint32_t imageHeaderByteOffset; // (0xC4) uint32_t plmReserved[PLM_BH_RESERVED]; // (0xC8) uint32_t reginit[MAX_REG_INIT_VERSAL]; // (0x128) @@ -118,6 +127,7 @@ void SetSourceOffset(uint32_t offset); void SetHeaderChecksum(void); void SetShutterValue(uint32_t value); + void SetPufRingOscilltorSwapConfigValue(uint32_t value); void SetImageHeaderByteOffset(uint32_t address); void SetEncryptionKeySource(KeySource::Type keyType, BifOptions* bifOptions); void SetGreyOrBlackKey(std::string keyFile); @@ -133,6 +143,7 @@ void SetTotalPmcCdoLength(uint32_t size); void SetBHAttributes(BootImage& bi); void SetBHAttributes(uint32_t attributes); + void SetRevokeId(uint32_t id); void SetRomReserved(); void SetPmcFwReserved(); void SetSHA3Padding(); diff -Nru xilinx-bootgen-2021.2/bootheader-zynqmp.cpp xilinx-bootgen-2022.2/bootheader-zynqmp.cpp --- xilinx-bootgen-2021.2/bootheader-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootheader-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ { /* The AC should be appended to a 64-byte aligned FSBL + PMU partition So find the pad length required for alignment and then add AC size */ - uint32_t padLength = (64 - (((bHTable->totalFsblLength + bHTable->totalPmuFwLength) & 63) & 63)); + uint32_t padLength = ((64 - ((bHTable->totalFsblLength + bHTable->totalPmuFwLength) & 63)) & 63); bHTable->totalFsblLength += (bi.headerAC->section->Length + padLength); SetHeaderChecksum(); } diff -Nru xilinx-bootgen-2021.2/bootheader.h xilinx-bootgen-2022.2/bootheader.h --- xilinx-bootgen-2021.2/bootheader.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootheader.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,6 +94,12 @@ RegisterInitPair registerInitialization [MAX_REGISTER_INITS]; } RegisterInitTable; +typedef struct +{ + uint64_t baseaddr; + uint64_t size; +} RegisterInitAddressRange; + /* ------------------------------------------------------------------------------- ********************************************************* C L A S S E S *** @@ -105,8 +111,10 @@ public: RegisterTable() : regtab(NULL) - , count(0) + , count(0) + , fileParseEnd(false) { + invalidAddr.clear(); } void Build (Options& option, RegisterInitTable* regTable0); @@ -117,6 +125,8 @@ private: RegisterInitTable* regtab; uint32_t count; + bool fileParseEnd; + std::vector invalidAddr; }; diff -Nru xilinx-bootgen-2021.2/bootimage-versal.cpp xilinx-bootgen-2022.2/bootimage-versal.cpp --- xilinx-bootgen-2021.2/bootimage-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootimage-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,40 +54,13 @@ currentAuthCtx->hash = hash; partitionHeaderTable->firstSection = NULL; convertAieElfToCdo = true; + current_image_block = 0; createSubSystemPdis = true; } /******************************************************************************/ VersalBootImage::~VersalBootImage() { - if (bootHeader) - { - delete bootHeader; - } - if (imageHeaderTable) - { - delete imageHeaderTable; - } - if (partitionHeaderTable) - { - delete partitionHeaderTable; - } - if (currentEncryptCtx) - { - delete currentEncryptCtx; - } - if (currentAuthCtx) - { - delete currentAuthCtx; - } - if (partitionOutput) - { - delete partitionOutput; - } - if (hash) - { - delete hash; - } } /******************************************************************************/ @@ -306,7 +279,8 @@ std::string baseFile = StringUtils::BaseName(it->filename); bool full_pdi = true; bool smap_exists = true; - + bool this_bootimage = false; + static uint32_t prev_image_block = 0; if (StringUtils::GetExtension(baseFile) == ".mcs") { LOG_ERROR("Parsing mcs format file is not supported : %s", baseFile.c_str()); @@ -492,6 +466,8 @@ } uint8_t* aC = new uint8_t[sizeof(AuthCertificate4096Sha3PaddingStructure)]; + memset(aC, 0, sizeof(AuthCertificate4096Sha3PaddingStructure)); + if (!(fseek(binFile, ph->GetAuthCertificateOffset(), SEEK_SET))) { size_t result = fread(aC, 1, sizeof(AuthCertificate4096Sha3PaddingStructure), binFile); @@ -528,7 +504,28 @@ } } offset += sizeof(VersalImageHeaderStructure); - subSysImageList.push_back(subsys); + if ((getenv("BOOTGEN_MERGE_IMAGES_WITH_SAME_ID") == NULL)) + { + if ((prev_image_block != current_image_block) || (this_bootimage == true)) + { + subSysImageList.push_back(subsys); + prev_image_block = current_image_block; + } + else + { + for (std::list::iterator subSysHdr = subSysImageList.begin(); subSysHdr != subSysImageList.end(); subSysHdr++) + { + if ((*subSysHdr)->GetSubSystemId() == subsys->GetSubSystemId()) + { + (*subSysHdr)->imgList.merge(subsys->imgList); + } + } + } + } + else + { + subSysImageList.push_back(subsys); + } } else { @@ -600,6 +597,8 @@ LOG_ERROR("Cannot read file %s", it->filename.c_str()); } uint8_t* aC = new uint8_t[sizeof(AuthCertificate4096Sha3PaddingStructure)]; + memset(aC, 0, sizeof(AuthCertificate4096Sha3PaddingStructure)); + if (!(fseek(binFile, ph->GetAuthCertificateOffset(), SEEK_SET))) { size_t result = fread(aC, 1, sizeof(AuthCertificate4096Sha3PaddingStructure), binFile); @@ -635,6 +634,7 @@ } offset += sizeof(VersalImageHeaderStructure); } + this_bootimage = true; } while (imageCount != 0); } @@ -805,6 +805,9 @@ image->SetPartitionRevocationId(partitionBifOptions->GetRevokeId()); image->SetDpacm(partitionBifOptions->dpaCM); image->SetPufHdLocation(partitionBifOptions->pufHdLoc); + image->SetClusterNum(partitionBifOptions->clusterNum); + image->SetLockStepFlag(partitionBifOptions->lockstep); + image->SetDelayAuthFlag(partitionBifOptions->delayAuth); if ((bifoptions->GetDpaCM() == DpaCM::DpaCMEnable) && (image->IsBootloader())) { @@ -1052,7 +1055,7 @@ uint32_t defaultEncrBlockSize = partitionBifOptions->GetDefaultEncryptionBlockSize(); image->SetDefaultEncrBlockSize(defaultEncrBlockSize); - if (image->IsBootloader()) + if (image->IsBootloader() && !(options.IsVersalNetSeries())) { for (uint32_t itr = 0; itr < encrBlocks.size(); itr++) { @@ -1063,8 +1066,8 @@ { Binary::Length_t encrBlocksSize = 0; Binary::Length_t encrOverhead = 0; - Binary::Length_t secureChunkSize = VersalPartition::GetSecureChunkSize(); - if (partitionBifOptions->authType == Authentication::None) + Binary::Length_t secureChunkSize = GetSecureChunkSize(image->IsBootloader()); + if (partitionBifOptions->authType == Authentication::None && !partitionBifOptions->delayAuth) { secureChunkSize += SHA3_LENGTH_BYTES; } @@ -1346,6 +1349,8 @@ { SubSysImageHeader *subSysImage = new SubSysImageHeader(*imgitr); bool bootimage_partition = false; + current_image_block++; + bool break_outer_loop = false; for (std::list::iterator partitr = (*imgitr)->partitionBifOptionsList.begin(); partitr != (*imgitr)->partitionBifOptionsList.end(); partitr++) { if ((*partitr)->bootImage) @@ -1385,6 +1390,20 @@ { subSysImage->SetSubSystemId(0x0); } + if ((getenv("BOOTGEN_MERGE_IMAGES_WITH_SAME_ID") == NULL)) + { + if (bootimage_partition == true) + { + for (std::list::iterator ssitr = subSysImageList.begin(); ssitr != subSysImageList.end(); ssitr++) + { + if (((*ssitr)->GetSubSystemId() == subSysImage->GetSubSystemId()) && !(img->IsBootloader() || img->GetDestCpu() == DestinationCPU::PMU)) + { + (*ssitr)->imgList.push_back(img); + break_outer_loop = true; + } + } + } + } if (subSysImage->GetDelayHandoffMode() || subSysImage->GetDelayLoadMode()) { if (img->IsBootloader()) @@ -1419,7 +1438,8 @@ } else { - subSysImage->imgList.push_back(img); + if (!break_outer_loop) + subSysImage->imgList.push_back(img); } } } @@ -1769,7 +1789,7 @@ /******************************************************************************/ void VersalBootImage::BuildAndLink(Binary* cache) { - if (imageList.size() == 0) + if (imageList.size() == 0 && options.GetSecureDebugAuthType() == Authentication::None) { LOG_WARNING("No partition images given"); } @@ -1817,7 +1837,6 @@ partitionHeaderList.clear(); if (createSubSystemPdis == true) { - AppendImagesInSubsystems(); ReplaceImages(); } else @@ -1855,3 +1874,16 @@ LOG_INFO("After Link "); LOG_DUMP_IMAGE(*cache); } + +/******************************************************************************/ +uint64_t VersalBootImage::GetSecureChunkSize(bool isBootloader) +{ + if (options.IsVersalNetSeries() && isBootloader == true) + { + return (SECURE_16K_CHUNK - SHA3_LENGTH_BYTES); + } + else + { + return (SECURE_32K_CHUNK - SHA3_LENGTH_BYTES); + } +} diff -Nru xilinx-bootgen-2021.2/bootimage-versal.h xilinx-bootgen-2022.2/bootimage-versal.h --- xilinx-bootgen-2021.2/bootimage-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootimage-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,5 +65,7 @@ void ConfigureEncryptionBlocks(ImageHeader * image, PartitionBifOptions* partitionBifOptions); void SetPmcdataFile(const std::string & filename); void SetPmcDataLoadAddress(Binary::Address_t addr); + uint64_t GetSecureChunkSize(bool isBootloader); + uint32_t current_image_block; }; #endif diff -Nru xilinx-bootgen-2021.2/bootimage-zynqmp.cpp xilinx-bootgen-2022.2/bootimage-zynqmp.cpp --- xilinx-bootgen-2021.2/bootimage-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootimage-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -327,7 +327,7 @@ if (imageAuthBlock != 0) { acSize = encrPartLen / (imageAuthBlock * 1024 * 1024); - if (encrPartLen % imageAuthBlock != 0) + if (encrPartLen % (imageAuthBlock * 1024 * 1024) != 0) { acSize++; } diff -Nru xilinx-bootgen-2021.2/bootimage.cpp xilinx-bootgen-2022.2/bootimage.cpp --- xilinx-bootgen-2021.2/bootimage.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootimage.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,42 +45,65 @@ */ /******************************************************************************/ -void BIF_File::Process(Options& options) +void BIF_File::Process(Options& options) { - std::string basefile = StringUtils::BaseName(biffilename); - - LOG_TRACE("BIF file parsing started"); - - BIF::FlexScanner scanner; - BIF::BisonParser parser(scanner, options); - - scanner.filename = biffilename; - std::ifstream s(biffilename.c_str()); - - if (!s) - { - LOG_ERROR("Cannot read BIF file - %s ", basefile.c_str()); - } - if(s.peek() == EOF) + ParseBifFile(options); + + bifOptionList = options.bifOptionsList; + + /* Parse the include bif file */ + if (options.includeBifOptionsList.size() > 1) { - LOG_ERROR("BIF file is empty - %s ", basefile.c_str()); + LOG_ERROR("Multiple include bif files is not supported."); } - scanner.switch_streams(&s); - int res = parser.parse(); - if (res) + if (options.includeBifOptionsList.size() != 0) { - LOG_ERROR("BIF file parsing failed with code %d", res); - } + options.bifOptionsList.clear(); + biffilename = options.includeBifOptionsList.front(); + ParseBifFile(options); - LOG_INFO("BIF file parsing completed successfully"); + includeBifOptionList = options.bifOptionsList; - //bifOptionList.push_back(options.bifOptions); + if (options.IsSsitBif()) + { + includeBifOptionList.back()->slrNum = 0x00; + + /* Back populate the slr number, based on the group name in master bif for SSIT use cases */ + for (std::list::iterator itr = includeBifOptionList.back()->partitionBifOptionList.begin(); itr != includeBifOptionList.back()->partitionBifOptionList.end(); itr++) + { + if (((*itr)->slrNum != 0xFF) && ((strcmp((*itr)->bifSection.c_str(), "") != 0))) + { + for (std::size_t j = 0; j < includeBifOptionList.size(); j++) + { + if (strcmp(includeBifOptionList[j]->GetGroupName().c_str(), (*itr)->bifSection.c_str()) == 0) + { + includeBifOptionList[j]->slrNum = (*itr)->slrNum; + break; + } + } + } + } + } + + ReplaceFiles(); + options.bifOptionsList = bifOptionList = includeBifOptionList; + } - bifOptionList = options.bifOptionsList; BootImage* currentbi = NULL; uint8_t index = 0; - for (std::vector::iterator bifoptions = bifOptionList.begin(); bifoptions != bifOptionList.end();bifoptions++) + + for (std::vector::iterator bifoptions = bifOptionList.begin(); bifoptions != bifOptionList.end(); bifoptions++) { + if (((*bifoptions)->slrBootCnt == 0) && ((*bifoptions)->slrConfigCnt == 0) && options.IsSsitBif()) + { + (*bifoptions)->pdiType = PartitionType::SLR_SLAVE; + if ((*bifoptions)->smapWidth != 0) + { + LOG_WARNING("smap_width for SSIT SLAVE PDIs is identified as %d. Setting it to the default value : 0.", (*bifoptions)->smapWidth); + (*bifoptions)->smapWidth = 0; + } + } + if (options.archType == Arch::ZYNQMP) { currentbi = new ZynqMpBootImage(options, index); @@ -97,6 +120,14 @@ if (currentbi != NULL) { currentbi->Add(*bifoptions); + if (currentbi->bootloaderFound && (*bifoptions)->pdiType == PartitionType::SLR_SLAVE) + { + (*bifoptions)->pdiType = PartitionType::SLR_SLAVE_BOOT; + } + else + { + (*bifoptions)->pdiType = PartitionType::SLR_SLAVE_CONFIG; + } bootImages.push_back(currentbi); } Output(options, index); @@ -178,6 +209,10 @@ else { out_filename = StringUtils::RemoveExtension(*filename) + "_" + bi->Name + StringUtils::GetExtension(*filename); + if (options.IsSsitBif()) + { + out_filename = StringUtils::RemoveExtension(*filename) + "_" + bi->Name + ".bin"; + } } OutputFile* file = OutputFile::Factory(out_filename); file->Output(options, *bi->cache); @@ -230,6 +265,7 @@ , firstIv(NULL) , firstOptKey(NULL) , overlayCDO(NULL) + , globalSlrId(0) { bifOptions = options.bifOptionsList.at(index); Name = bifOptions->GetGroupName(); @@ -323,13 +359,13 @@ } /******************************************************************************/ -void BootImage::BuildAndLink(Binary* cache) -{ - if( imageList.size() == 0 ) +void BootImage::BuildAndLink(Binary* cache) +{ + if( imageList.size() == 0 ) { LOG_WARNING("No partition images given"); } - + currentAuthCtx->SetPpkSelect(bifOptions->GetPpkSelection()); currentAuthCtx->SetSpkSelect(bifOptions->GetSpkSelection()); currentAuthCtx->SetSpkIdentification(bifOptions->GetSpkId()); @@ -642,3 +678,109 @@ { encryptionKeyFileVec.push_back(filename); } + +/******************************************************************************/ +void BIF_File::ParseBifFile(Options& options) +{ + std::string basefile = StringUtils::BaseName(biffilename); + + LOG_TRACE("Parsing BIF file - %s", basefile.c_str()); + BIF::FlexScanner scanner; + BIF::BisonParser parser(scanner, options); + + scanner.filename = biffilename; + std::ifstream s(biffilename.c_str()); + + if (!s) + { + LOG_ERROR("Cannot read BIF file - %s ", basefile.c_str()); + } + if (s.peek() == EOF) + { + LOG_ERROR("BIF file is empty - %s ", basefile.c_str()); + } + scanner.switch_streams(&s); + int res = parser.parse(); + if (res) + { + LOG_ERROR("BIF file - %s, parsing failed with code %d", basefile.c_str(), res); + } + + LOG_INFO("BIF file parsed successfully - %s ", basefile.c_str()); +} + +/******************************************************************************/ +void BIF_File::ReplaceFiles() +{ + /* If slr number matches between partitions - replace the files */ + for (size_t i = 0; i < includeBifOptionList.size(); i++) + { + for (size_t j = 0; j < bifOptionList.size(); j++) + { + for (std::list::iterator itr1 = bifOptionList[j]->partitionBifOptionList.begin(); itr1 != bifOptionList[j]->partitionBifOptionList.end(); itr1++) + { + if (includeBifOptionList[i]->slrNum == (*itr1)->slrNum) + { + if ((*itr1)->bootloader) + { + for (std::list::iterator itr2 = includeBifOptionList[i]->partitionBifOptionList.begin(); itr2 != includeBifOptionList[i]->partitionBifOptionList.end(); itr2++) + { + if ((*itr2)->bootloader) + { + if((*itr1)->slrNum != 0xFF) + LOG_TRACE("Replacing '%s' with '%s' for SLR %d", (*itr2)->filename.c_str(), (*itr1)->filename.c_str(), (*itr1)->slrNum); + else + LOG_TRACE("Replacing '%s' with '%s'", (*itr2)->filename.c_str(), (*itr1)->filename.c_str()); + + (*itr2)->filename = (*itr1)->filename; + (*itr2)->filelist = (*itr1)->filelist; + break; + } + } + } + + if ((*itr1)->pmcData) + { + for (std::list::iterator itr2 = includeBifOptionList[i]->partitionBifOptionList.begin(); itr2 != includeBifOptionList[i]->partitionBifOptionList.end(); itr2++) + { + if ((*itr2)->pmcData) + { + if ((*itr1)->slrNum != 0xFF) + LOG_TRACE("Replacing '%s' with '%s' for SLR %d", (*itr2)->filename.c_str(), (*itr1)->filename.c_str(), (*itr1)->slrNum); + else + LOG_TRACE("Replacing '%s' with '%s'", (*itr2)->filename.c_str(), (*itr1)->filename.c_str()); + + (*itr2)->filename = (*itr1)->filename; + includeBifOptionList[i]->SetPmcdataFile((*itr1)->filename); + (*itr2)->filelist = (*itr1)->filelist; + + includeBifOptionList[i]->ClearPmcCdoFileList(); + for (size_t listSize = 0; listSize < (*itr1)->filelist.size(); listSize++) + includeBifOptionList[i]->SetPmcCdoFileList((*itr1)->filelist[listSize]); + break; + } + } + } + + if ((*itr1)->destCPUType == DestinationCPU::PMU) + { + for (std::list::iterator itr2 = includeBifOptionList[i]->partitionBifOptionList.begin(); itr2 != includeBifOptionList[i]->partitionBifOptionList.end(); itr2++) + { + if ((*itr2)->destCPUType == DestinationCPU::PMU) + { + if ((*itr1)->slrNum != 0xFF) + LOG_TRACE("Replacing '%s' with '%s' for SLR %d", (*itr2)->filename.c_str(), (*itr1)->filename.c_str(), (*itr1)->slrNum); + else + LOG_TRACE("Replacing '%s' with '%s'", (*itr2)->filename.c_str(), (*itr1)->filename.c_str()); + + (*itr2)->filename = (*itr1)->filename; + (*itr2)->filelist = (*itr1)->filelist; + break; + } + } + } + } + } + } + } +} diff -Nru xilinx-bootgen-2021.2/bootimage.h xilinx-bootgen-2022.2/bootimage.h --- xilinx-bootgen-2021.2/bootimage.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/bootimage.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,11 @@ #include "partitionheadertable.h" #include "bifoptions.h" +#define R5_TCM_START_ADDRESS 0x0000 +#define R5_BTCM_START_ADDRESS 0x20000 +#define R5_TCM_BANK_LENGTH 0x10000 +#define PMU_RAM_END_ADDRESS 0xFFDDFFFF + /* Forward class declarations */ class Options; class BifOptions; @@ -66,10 +71,13 @@ public: BIF_File(std::string& filename0) : biffilename(filename0) {} void Process(Options& options); + void ParseBifFile(Options& options); + void ReplaceFiles(); private: std::string biffilename; void Output(Options& options, uint8_t index); std::vector bifOptionList; + std::vector includeBifOptionList; std::vector bootImages; }; @@ -152,6 +160,7 @@ std::string bitFilename; void * overlayCDO; + virtual uint64_t GetSecureChunkSize(bool isBootloader) { return 0; } //private: bool assumeEncryption; uint32_t* deviceKey; @@ -169,5 +178,8 @@ bool bootloaderEncrypt; KeySource::Type bootloaderKeySource; bool bootloaderAuthenticate; + uint32_t xplm_modules_data_length; + uint32_t* xplm_modules_data; + char globalSlrId; }; #endif diff -Nru xilinx-bootgen-2021.2/cdo-alloc.c xilinx-bootgen-2022.2/cdo-alloc.c --- xilinx-bootgen-2021.2/cdo-alloc.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-alloc.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,6 +1,5 @@ -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -Nru xilinx-bootgen-2021.2/cdo-alloc.h xilinx-bootgen-2022.2/cdo-alloc.h --- xilinx-bootgen-2021.2/cdo-alloc.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-alloc.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,6 +1,5 @@ -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +17,9 @@ #ifndef D_cdo_alloc #define D_cdo_alloc -#include "dyn_link.h" - -CDOUTIL_EXPORT void * myalloc(size_t len); -CDOUTIL_EXPORT void * myalloc_zero(size_t len); -CDOUTIL_EXPORT void * myrealloc(void * p, size_t len); -CDOUTIL_EXPORT void myfree(void * p); +void * myalloc(size_t len); +void * myalloc_zero(size_t len); +void * myrealloc(void * p, size_t len); +void myfree(void * p); #endif /* D_cdo_alloc */ diff -Nru xilinx-bootgen-2021.2/cdo-binary.c xilinx-bootgen-2022.2/cdo-binary.c --- xilinx-bootgen-2021.2/cdo-binary.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-binary.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,9 +31,13 @@ #define u32pair(hi, lo) (((uint64_t)(hi) << 32) | (lo)) #define HDR_IDN_WRD (0x584C4E58U) -uint32_t* slr_sync_points; -uint8_t num_of_sync_points = 0; -uint8_t search_sync_points = 0; +static uint32_t* slr_sync_points; +static uint32_t* noc_start_markers; +static uint32_t* noc_end_markers; +static uint8_t num_start_markers = 0; +static uint8_t num_end_markers = 0; +static uint8_t num_of_sync_points = 0; +static uint8_t search_sync_points = 0; enum { /*General Commands */ @@ -99,6 +103,11 @@ CMD2_BLOCK_BEGIN = 0x11bU, CMD2_BLOCK_END = 0x11cU, CMD2_BREAK = 0x11dU, + CMD2_OT_CHECK = 0x11eU, + CMD2_PSM_SEQUENCE = 0x11fU, + CMD2_PLM_UPDATE = 0x120U, + CMD2_SCATTER_WRITE = 0x121U, + CMD2_SCATTER_WRITE2 = 0x122U, /* PM Commands */ CMD2_PM_GET_API_VERSION = 0x201U, @@ -150,6 +159,12 @@ CMD2_PM_INIT_NODE = 0x23eU, CMD2_PM_FEATURE_CHECK = 0x23fU, CMD2_PM_ISO_CONTROL = 0x240U, + CMD2_PM_ACTIVATE_SUBSYSTEM = 0x241U, + CMD2_PM_SET_NODE_ACCESS = 0x242U, + CMD2_PM_BISR = 0x243, + CMD2_PM_APPLY_TRIM = 0x244, + CMD2_PM_NOC_CLOCK_ENABLE = 0x245, + CMD2_PM_IF_NOC_CLOCK_ENABLE = 0x246, /* NPI Commands */ CMD2_NPI_SEQ = 0x301U, @@ -170,6 +185,7 @@ /* Loader Commands */ CMD2_LDR_SET_IMAGE_INFO = 0x704U, + CMD2_LDR_CFRAME_CLEAR_CHECK = 0x70cU, /* EM Commands */ CMD2_EM_SET_ACTION = 0x801U, @@ -563,6 +579,28 @@ cdocmd_add_break(seq, args > 0 ? u32xe(p[i+0]) : 1); break; } + case CMD2_OT_CHECK: + if (args != 1) goto unexpected; + cdocmd_add_ot_check(seq, u32xe(p[i+0])); + break; + case CMD2_PSM_SEQUENCE: { + uint32_t i2 = i; + cdocmd_add_psm_sequence(seq); + if (decode_v2_cmd(seq, p, &i2, i2 + args, be)) { + goto error; + } + cdocmd_add_end(seq); + break; + } + case CMD2_SCATTER_WRITE: + if (args < 2) goto unexpected; + cdocmd_add_scatter_write(seq, u32xe(p[i+0]), args - 1, &p[i+1], be); + break; + case CMD2_SCATTER_WRITE2: + if (args < 3) goto unexpected; + cdocmd_add_scatter_write2(seq, u32xe(p[i+0]), u32xe(p[i+1]), args - 2, &p[i+2], be); + break; + case CMD2_NPI_SEQ: if (args != 2) goto unexpected; cdocmd_add_npi_seq(seq, u32xe(p[i+0]), u32xe(p[i+1])); @@ -777,6 +815,32 @@ if (args != 2) goto unexpected; cdocmd_add_pm_iso_control(seq, u32xe(p[i+0]), u32xe(p[i+1])); break; + case CMD2_PM_ACTIVATE_SUBSYSTEM: + if (args != 1) goto unexpected; + cdocmd_add_pm_activate_subsystem(seq, u32xe(p[i+0])); + break; + case CMD2_PM_SET_NODE_ACCESS: + if (args < 1) goto unexpected; + cdocmd_add_pm_set_node_access(seq, u32xe(p[i+0]), args - 1, &p[i+1], be); + break; + case CMD2_PM_BISR: + if (args != 1) goto unexpected; + cdocmd_add_pm_bisr(seq, u32xe(p[i+0])); + break; + case CMD2_PM_APPLY_TRIM: + if (args != 1) goto unexpected; + cdocmd_add_pm_apply_trim(seq, u32xe(p[i+0])); + break; + case CMD2_PM_NOC_CLOCK_ENABLE: + if (args < 1) goto unexpected; + cdocmd_add_pm_noc_clock_enable(seq, u32xe(p[i+0]), args - 1, &p[i+1], be); + break; + case CMD2_PM_IF_NOC_CLOCK_ENABLE: + if (args != 2 && args != 3) goto unexpected; + cdocmd_add_pm_if_noc_clock_enable(seq, u32xe(p[i+0]), u32xe(p[i+1]), + args == 3 ? u32xe(p[i+2]) : 1); + break; + case CMD2_CFU_SET_CRC32: if (args < 1) goto unexpected; if (u32xe(p[i+0]) == 0) { @@ -826,6 +890,10 @@ if (args != 4) goto unexpected; cdocmd_add_ldr_set_image_info(seq, u32xe(p[i+0]), u32xe(p[i+1]), u32xe(p[i+2]), u32xe(p[i+3])); break; + case CMD2_LDR_CFRAME_CLEAR_CHECK: + if (args != 1) goto unexpected; + cdocmd_add_ldr_cframe_clear_check(seq, u32xe(p[i+0])); + break; default: cdocmd_add_generic_command(seq, hdr & 0xffff, p + i, args, be); break; @@ -843,6 +911,68 @@ return 1; } +uint32_t check_cdo_commands(void* data, uint32_t l, uint32_t * xplm_data, uint32_t xplm_length) { + uint32_t be = 0; + uint32_t * p = (uint32_t *)data; + uint32_t hdrlen = u32xe(p[0]); + uint32_t len = u32xe(p[3]); + uint32_t total_len = hdrlen + 1 + len; + uint32_t i = hdrlen + 1; + uint32_t cmdpos = 0; + uint32_t hdr; + uint8_t cmd_id; + uint8_t module_id; + size_t index; + + if (l < total_len) { + fprintf(stderr, "warning: incomplete CDO buffer %"PRIu32", expected %"PRIu32"\n", l, total_len); + total_len = l; + } else if (l > total_len) { + l = total_len; + } + while (i < l) { + uint32_t args; + int cmd_found; + cmdpos = i; + hdr = u32xe(p[i++]); + if (verbose) { + fprintf(stderr, "info: decoding command %#"PRIx32" at %"PRIu32"\n", hdr, cmdpos); + } + args = (hdr >> 16) & 255; + if (args == 255) { + if (hdr == CMD2_END) goto found_end_marker; + if (i >= l) { + fprintf(stderr, "incomplete CDO command %#"PRIx32" at %"PRIu32"\n", hdr, cmdpos); + return -1; + } + args = u32xe(p[i++]); + } + if (l - i < args) { + fprintf(stderr, "incomplete CDO command %#"PRIx32" at %"PRIu32"\n", hdr, cmdpos); + return -1; + } + cmd_id = hdr & 0xff; + module_id = (hdr & 0xff00) >> 0x8; + // TODO: only PLM commands are supported for now + if (module_id != 0x1) continue; + cmd_found = 0; + size_t cmdInfo_size = sizeof(XPlmi_CmdInfo); + for (index = 0; index < (xplm_length/ cmdInfo_size); index++) { + uint8_t* cmdInfo = (uint8_t*)malloc(cmdInfo_size); + memset(cmdInfo, 0, cmdInfo_size); + memcpy(cmdInfo, xplm_data + (index * (cmdInfo_size/4)), cmdInfo_size); + XPlmi_CmdInfo* cmd_info = (XPlmi_CmdInfo*)(cmdInfo); + if (cmd_info->cmd_id == cmd_id && cmd_info->module_id == module_id && cmd_info->min_arg_cnt >= args && cmd_info->max_arg_cnt <= args) { + cmd_found = 1; + break; + } + } + if (cmd_found == 0) return -1; + } +found_end_marker: +return 0; +} + static uint32_t decode_v2(CdoSequence * seq, uint32_t * p, uint32_t l, uint32_t be) { uint32_t hdrlen = u32xe(p[0]); uint32_t len = u32xe(p[3]); @@ -1233,6 +1363,7 @@ CdoCommand * cmd = all2cmds(l); switch (cmd->type) { case CdoCmdProc: + case CdoCmdPsmSequence: case CdoCmdBegin: level++; break; @@ -1539,6 +1670,19 @@ case CdoCmdMarker: { uint32_t len = strlen((char *)cmd->buf); uint32_t count = (len + 3)/4; + /* Search for the START markers with string "NOC Start up", only for SSIT devices */ + if (search_sync_points && (cmd->value == 0x64 || cmd->value == 0x65) && (strcmp((char*)cmd->buf, "NOC Startup") == 0)) { + /* Store the offset of each of the START and END marker with "NOC Start up" string */ + if (cmd->value == 0x64) { + num_start_markers++; + noc_start_markers = (uint32_t *)realloc(noc_start_markers, num_start_markers * 2 * sizeof(uint32_t)); + memcpy(noc_start_markers + (num_start_markers - 1), &pos, 4); + } else { + num_end_markers++; + noc_end_markers = (uint32_t *)realloc(noc_end_markers, num_end_markers * 2 * sizeof(uint32_t)); + memcpy(noc_end_markers + (num_end_markers - 1), &pos, 4); + } + } hdr2(&p, &pos, CMD2_MARKER, 1 + count, be); p[pos++] = u32xe(cmd->value); memset(p + pos, 0, count*4); @@ -1561,6 +1705,8 @@ pos = pos_save; p[pos++] = u32xe(cmd->value); p = encode_v2_cmd(l, blockend, &pos, be); + /* Update payload size incase it changed due to alignment */ + p[pos_save - 1] = u32xe(pos - pos_save); } l = blockend; if (l != lh) l = l->next; @@ -1593,6 +1739,42 @@ p[pos++] = u32xe(cmd->value); } break; + case CdoCmdOtCheck: + hdr2(&p, &pos, CMD2_OT_CHECK, 1, be); + p[pos++] = u32xe(cmd->value); + break; + case CdoCmdPsmSequence: { + uint32_t pos_save = pos; + uint32_t payload_start; + LINK * blockend = find_block_end(l, lh); + hdr2(&p, &pos, CMD2_PSM_SEQUENCE, 0, be); + payload_start = pos; + p = encode_v2_cmd(l, blockend, &pos, be); + hdr2(&p, &pos_save, CMD2_PSM_SEQUENCE, pos - payload_start, be); + if (pos_save != payload_start) { + /* Header grew, regenerate payload */ + pos = pos_save; + p = encode_v2_cmd(l, blockend, &pos, be); + } + l = blockend; + if (l != lh) l = l->next; + break; + } + case CdoCmdScatterWrite: + hdr2(&p, &pos, CMD2_SCATTER_WRITE, 1 + cmd->count, be); + p[pos++] = u32xe(cmd->value); + memcpy(p + pos, cmd->buf, cmd->count * sizeof(uint32_t)); + byte_swap_buffer(p + pos, cmd->count, be); + pos += cmd->count; + break; + case CdoCmdScatterWrite2: + hdr2(&p, &pos, CMD2_SCATTER_WRITE2, 2 + cmd->count, be); + p[pos++] = u32xe(cmd->value); + p[pos++] = u32xe(cmd->mask); + memcpy(p + pos, cmd->buf, cmd->count * sizeof(uint32_t)); + byte_swap_buffer(p + pos, cmd->count, be); + pos += cmd->count; + break; case CdoCmdNpiSeq: hdr2(&p, &pos, CMD2_NPI_SEQ, 2, be); @@ -1882,6 +2064,40 @@ p[pos++] = u32xe(cmd->id); p[pos++] = u32xe(cmd->value); break; + case CdoCmdPmBisr: + hdr2(&p, &pos, CMD2_PM_BISR, 1, be); + p[pos++] = u32xe(cmd->id); + break; + case CdoCmdPmApplyTrim: + hdr2(&p, &pos, CMD2_PM_APPLY_TRIM, 1, be); + p[pos++] = u32xe(cmd->id); + break; + case CdoCmdPmNocClockEnable: + hdr2(&p, &pos, CMD2_PM_NOC_CLOCK_ENABLE, 1 + cmd->count, be); + p[pos++] = u32xe(cmd->id); + memcpy(p + pos, cmd->buf, cmd->count * sizeof(uint32_t)); + byte_swap_buffer(p + pos, cmd->count, be); + pos += cmd->count; + break; + case CdoCmdPmIfNocClockEnable: + hdr2(&p, &pos, CMD2_PM_IF_NOC_CLOCK_ENABLE, cmd->flags != 1 ? 3 : 2, be); + p[pos++] = u32xe(cmd->id); + p[pos++] = u32xe(cmd->value); + if (cmd->flags != 1) { + p[pos++] = u32xe(cmd->flags); + } + break; + case CdoCmdPmActivateSubsystem: + hdr2(&p, &pos, CMD2_PM_ACTIVATE_SUBSYSTEM, 1, be); + p[pos++] = u32xe(cmd->id); + break; + case CdoCmdPmSetNodeAccess: + hdr2(&p, &pos, CMD2_PM_SET_NODE_ACCESS, 1 + cmd->count, be); + p[pos++] = u32xe(cmd->id); + memcpy(p + pos, cmd->buf, cmd->count * sizeof(uint32_t)); + byte_swap_buffer(p + pos, cmd->count, be); + pos += cmd->count; + break; case CdoCmdCfuSetCrc32: if (cmd->flags != 0) { hdr2(&p, &pos, CMD2_CFU_SET_CRC32, 2, be); @@ -1937,6 +2153,10 @@ p[pos++] = u32xe(cmd->mask); p[pos++] = u32xe(cmd->count); break; + case CdoCmdLdrCframeClearCheck: + hdr2(&p, &pos, CMD2_LDR_CFRAME_CLEAR_CHECK, 1, be); + p[pos++] = u32xe(cmd->id); + break; default: fprintf(stderr, "unknown command (%u)\n", cmd->type); break; @@ -1975,11 +2195,16 @@ } return encode(seq, sizep, be); } + void search_for_sync_points(void) { num_of_sync_points = 0; + num_start_markers = 0; + num_end_markers = 0; search_sync_points = 1; slr_sync_points = NULL; + noc_start_markers = NULL; + noc_end_markers = NULL; } uint32_t* get_slr_sync_point_offsets(void) @@ -1988,7 +2213,30 @@ return slr_sync_points; } +uint32_t* get_slr_start_marker_offsets(void) +{ + search_sync_points = 0; + return noc_start_markers; +} + +uint32_t* get_slr_end_marker_offsets(void) +{ + search_sync_points = 0; + return noc_end_markers; +} + size_t get_num_of_sync_points(void) { return num_of_sync_points; -} \ No newline at end of file +} + +size_t get_num_start_markers(void) +{ + return num_start_markers; +} + +size_t get_num_end_markers(void) +{ + return num_end_markers; +} + diff -Nru xilinx-bootgen-2021.2/cdo-binary.h xilinx-bootgen-2022.2/cdo-binary.h --- xilinx-bootgen-2021.2/cdo-binary.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-binary.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,28 @@ #include "cdo-command.h" -CDOUTIL_EXPORT void cdobinary_set_verbose(uint32_t verbose); -CDOUTIL_EXPORT void cdobinary_set_auto_align(uint32_t enable); -CDOUTIL_EXPORT void cdobinary_set_add_offset(uint32_t enable); -CDOUTIL_EXPORT CdoSequence * decode_cdo_binary(const void * data, size_t len); -CDOUTIL_EXPORT void * cdoseq_to_binary(CdoSequence * seq, size_t * sizep, uint32_t be); -CDOUTIL_EXPORT int is_cdo_data(void * data, size_t size); -CDOUTIL_EXPORT uint32_t* get_slr_sync_point_offsets(void); -CDOUTIL_EXPORT void search_for_sync_points(void); -CDOUTIL_EXPORT size_t get_num_of_sync_points(void); +typedef struct +{ + uint8_t cmd_id; + uint8_t module_id; + uint16_t reserved1; + uint8_t min_arg_cnt; + uint8_t max_arg_cnt; + uint16_t reserved2; +} XPlmi_CmdInfo; + +void cdobinary_set_verbose(uint32_t verbose); +void cdobinary_set_auto_align(uint32_t enable); +void cdobinary_set_add_offset(uint32_t enable); +CdoSequence * decode_cdo_binary(const void * data, size_t len); +void * cdoseq_to_binary(CdoSequence * seq, size_t * sizep, uint32_t be); +uint32_t check_cdo_commands(void* data, uint32_t l, uint32_t * xplm_data, uint32_t xplm_length); +int is_cdo_data(void * data, size_t size); +uint32_t* get_slr_sync_point_offsets(void); +uint32_t* get_slr_start_marker_offsets(void); +uint32_t* get_slr_end_marker_offsets(void); +void search_for_sync_points(void); +size_t get_num_of_sync_points(void); +size_t get_num_start_markers(void); +size_t get_num_end_markers(void); #endif /* D_cdo_binary */ diff -Nru xilinx-bootgen-2021.2/cdo-command.c xilinx-bootgen-2022.2/cdo-command.c --- xilinx-bootgen-2021.2/cdo-command.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-command.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,11 @@ #include #include #include +#include #include "cdo-alloc.h" #include "cdo-command.h" -UserKeys user_keys; +UserKeys user_keys; static CdoSequence * default_seq; #define USER_KEYS_BASE_ADDR 0xF11E0110 @@ -104,27 +105,39 @@ list_add_last(&newcmd->link_all, &cmd->link_all); } +static int myrand(void) +{ + static unsigned long next; + static int firsttime = 1; + if (firsttime) { + firsttime = 0; + next = time(NULL); + } + next = next * 1103515245 + 12345; + return((unsigned)(next/65536) % 32768); +} + static uint8_t randchar() { static char chrs[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - return chrs[rand() % (sizeof chrs - 1)]; + return chrs[myrand() % (sizeof chrs - 1)]; } static uint32_t randu32() { - uint32_t width = rand() & 3; - uint32_t value = rand() & 255; + uint32_t width = myrand() & 3; + uint32_t value = myrand() & 255; while (width-- > 0) { value <<= 8; - value |= rand() & 255; + value |= myrand() & 255; } return value; } static uint64_t randu64() { - uint64_t width = rand() & 7; - uint64_t value = rand() & 255; + uint64_t width = myrand() & 7; + uint64_t value = myrand() & 255; while (width-- > 0) { value <<= 8; - value |= rand() & 255; + value |= myrand() & 255; } return value; } @@ -141,6 +154,7 @@ type == CdoCmdComment || type == CdoCmdSetBaseAddress || (type == CdoCmdProc && level != 0) || + (type == CdoCmdPsmSequence && level != 0) || (type == CdoCmdBegin && level >= (randu32() & 3)) || (type == CdoCmdEnd && level == 0) || (type == CdoCmdBreak && level == 0)); @@ -167,6 +181,8 @@ cmd->type == CdoCmdCframeRead || cmd->type == CdoCmdNop || cmd->type == CdoCmdEventLogging || + cmd->type == CdoCmdScatterWrite || + cmd->type == CdoCmdScatterWrite2 || cmd->type == CdoCmdNpiWrite || cmd->type == CdoCmdPmIoctl || cmd->type == CdoCmdPmQueryData || @@ -174,7 +190,9 @@ cmd->type == CdoCmdPmAddNode || cmd->type == CdoCmdPmAddNodeParent || cmd->type == CdoCmdPmAddRequirement || - cmd->type == CdoCmdPmInitNode) { + cmd->type == CdoCmdPmInitNode || + cmd->type == CdoCmdPmSetNodeAccess || + cmd->type == CdoCmdPmNocClockEnable) { uint32_t * p; uint32_t i; cmd->count = (cmd->count & 15) + 1; @@ -183,7 +201,7 @@ p[i] = randu32(); } if (cmd->type == CdoCmdDmaXfer) { - if (rand() & 1) cmd->srcaddr = 0; + if (myrand() & 1) cmd->srcaddr = 0; if (cmd->srcaddr != 0) { free(cmd->buf); cmd->buf = NULL; @@ -208,6 +226,7 @@ cmd->value = (cmd->value % level) + 1; } if (cmd->type == CdoCmdProc) level++; + if (cmd->type == CdoCmdPsmSequence) level++; if (cmd->type == CdoCmdBegin) level++; if (cmd->type == CdoCmdEnd) level--; add_command(seq, cmd); @@ -277,7 +296,6 @@ } } } - cmd->buf = copy_buf(buf, count, be); return cmd; } @@ -710,6 +728,48 @@ add_command(seq, cmd); } +void cdocmd_add_pm_activate_subsystem(CdoSequence * seq, uint32_t ssid) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmActivateSubsystem); + cmd->id = ssid; + add_command(seq, cmd); +} + +void cdocmd_add_pm_set_node_access(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmSetNodeAccess); + cmd->id = nodeid; + cmd->count = count; + cmd->buf = copy_buf(buf, count, be); + add_command(seq, cmd); +} + +void cdocmd_add_pm_bisr(CdoSequence * seq, uint32_t tagid) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmBisr); + cmd->id = tagid; + add_command(seq, cmd); +} + +void cdocmd_add_pm_apply_trim(CdoSequence * seq, uint32_t trimtype) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmApplyTrim); + cmd->id = trimtype; + add_command(seq, cmd); +} + +void cdocmd_add_pm_noc_clock_enable(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmNocClockEnable); + cmd->id = nodeid; + cmd->count = count; + cmd->buf = copy_buf(buf, count, be); + add_command(seq, cmd); +} + +void cdocmd_add_pm_if_noc_clock_enable(CdoSequence * seq, uint32_t index, uint32_t state, uint32_t level) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPmIfNocClockEnable); + cmd->id = index; + cmd->value = state; + cmd->flags = level; + add_command(seq, cmd); +} + void cdocmd_add_cfu_set_crc32(CdoSequence * seq, uint32_t type, uint32_t value) { CdoCommand * cmd = cdocmd_alloc(CdoCmdCfuSetCrc32); cmd->flags = type; @@ -868,6 +928,34 @@ add_command(seq, cmd); } +void cdocmd_add_ot_check(CdoSequence * seq, uint32_t value) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdOtCheck); + cmd->value = value; + add_command(seq, cmd); +} + +void cdocmd_add_psm_sequence(CdoSequence * seq) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdPsmSequence); + add_command(seq, cmd); +} + +void cdocmd_add_scatter_write(CdoSequence * seq, uint32_t value, uint32_t count, void * buf, uint32_t be) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdScatterWrite); + cmd->value = value; + cmd->count = count; + cmd->buf = copy_buf(buf, count, be); + add_command(seq, cmd); +} + +void cdocmd_add_scatter_write2(CdoSequence * seq, uint32_t value1, uint32_t value2, uint32_t count, void * buf, uint32_t be) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdScatterWrite2); + cmd->value = value1; + cmd->mask = value2; + cmd->count = count; + cmd->buf = copy_buf(buf, count, be); + add_command(seq, cmd); +} + void cdocmd_add_pm_register_notifier(CdoSequence * seq, uint32_t nodeid, uint32_t mask, uint32_t arg1, uint32_t arg2) { CdoCommand * cmd = cdocmd_alloc(CdoCmdPmRegisterNotifier); cmd->id = nodeid; @@ -894,6 +982,12 @@ add_command(seq, cmd); } +void cdocmd_add_ldr_cframe_clear_check(CdoSequence * seq, uint32_t block_type) { + CdoCommand * cmd = cdocmd_alloc(CdoCmdLdrCframeClearCheck); + cmd->id = block_type; + add_command(seq, cmd); +} + void cdocmd_insert_seq(CdoCommand * cmd, CdoSequence * seq) { list_concat(&cmd->link_all, &seq->cmds); list_init(&seq->cmds); diff -Nru xilinx-bootgen-2021.2/cdo-command.h xilinx-bootgen-2022.2/cdo-command.h --- xilinx-bootgen-2021.2/cdo-command.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-command.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,6 @@ #include #include "link.h" -#include "dyn_link.h" - #define is_be_host() (0) #define DEFAULT_CDO_VERSION 0x200 @@ -77,6 +75,10 @@ CdoCmdBegin, CdoCmdEnd, CdoCmdBreak, + CdoCmdOtCheck, + CdoCmdPsmSequence, + CdoCmdScatterWrite, + CdoCmdScatterWrite2, CdoCmdNpiSeq, CdoCmdNpiPreCfg, CdoCmdNpiWrite, @@ -129,6 +131,12 @@ CdoCmdPmInitNode, CdoCmdPmFeatureCheck, CdoCmdPmIsoControl, + CdoCmdPmActivateSubsystem, + CdoCmdPmBisr, + CdoCmdPmApplyTrim, + CdoCmdPmNocClockEnable, + CdoCmdPmIfNocClockEnable, + CdoCmdPmSetNodeAccess, CdoCmdCfuSetCrc32, CdoCmdCfuDecompress, CdoCmdCfuCramRW, @@ -140,6 +148,7 @@ CdoCmdCfuCfiType, CdoCmdEmSetAction, CdoCmdLdrSetImageInfo, + CdoCmdLdrCframeClearCheck, /* The following line must be last */ CdoCmdLast @@ -159,115 +168,127 @@ void * buf; }; -CDOUTIL_EXPORT CdoSequence * cdocmd_create_sequence(void); -CDOUTIL_EXPORT void cdocmd_delete_sequence(CdoSequence * seq); -CDOUTIL_EXPORT CdoCommand * cdocmd_alloc(CdoCmdType type); -CDOUTIL_EXPORT void cdocmd_free(CdoCommand * cmd); -CDOUTIL_EXPORT CdoCommand * cdocmd_duplicate(CdoCommand * cmd); -CDOUTIL_EXPORT void cdocmd_set_default_sequence(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_append_command(CdoSequence * seq, CdoCommand * newcmd); -CDOUTIL_EXPORT void cdocmd_insert_command(CdoCommand * cmd, CdoCommand * newcmd); -CDOUTIL_EXPORT void cdocmd_add_random_command(CdoSequence * seq, uint32_t * levelp); -CDOUTIL_EXPORT void cdocmd_add_generic_command(CdoSequence * seq, uint32_t id, void * buf, uint32_t count, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_comment(CdoSequence * seq, const char * comment, ...); -CDOUTIL_EXPORT void cdocmd_add_section(CdoSequence * seq, uint32_t secid); -CDOUTIL_EXPORT void cdocmd_add_include(CdoSequence * seq, const char * name); -CDOUTIL_EXPORT void cdocmd_add_mask_poll(CdoSequence * seq, uint64_t addr, uint32_t mask, uint32_t value, uint32_t count, uint32_t flags); -CDOUTIL_EXPORT void cdocmd_add_mask_write(CdoSequence * seq, uint64_t addr, uint32_t mask, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_write(CdoSequence * seq, uint64_t addr, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_delay(CdoSequence * seq, uint32_t delay); -CDOUTIL_EXPORT void cdocmd_add_block_write(CdoSequence * seq, uint64_t addr, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_keyhole_write(CdoSequence * seq, uint64_t addr, uint32_t keyhole_size, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_block_set(CdoSequence * seq, uint64_t addr, uint32_t count, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_dma_xfer(CdoSequence * seq, uint64_t srcaddr, uint64_t dstaddr, uint32_t count, uint32_t flags, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_npi_seq(CdoSequence * seq, uint32_t addr, uint32_t flags); -CDOUTIL_EXPORT void cdocmd_add_npi_precfg(CdoSequence * seq, uint32_t addr, uint32_t flags); -CDOUTIL_EXPORT void cdocmd_add_npi_write(CdoSequence * seq, uint32_t addr, uint32_t flags, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_npi_shutdown(CdoSequence * seq, uint32_t addr, uint32_t flags); - -CDOUTIL_EXPORT void cdocmd_add_pm_get_api_version(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_add_pm_get_device_status(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_register_notifier(CdoSequence * seq, uint32_t nodeid, uint32_t mask, uint32_t arg1, uint32_t arg2); -CDOUTIL_EXPORT void cdocmd_add_pm_request_suspend(CdoSequence * seq, uint32_t nodeid, uint32_t ack, uint32_t latency, uint32_t state); -CDOUTIL_EXPORT void cdocmd_add_pm_self_suspend(CdoSequence * seq, uint32_t nodeid, uint32_t latency, uint32_t state, uint64_t addr); -CDOUTIL_EXPORT void cdocmd_add_pm_force_powerdown(CdoSequence * seq, uint32_t nodeid, uint32_t ack); -CDOUTIL_EXPORT void cdocmd_add_pm_abort_suspend(CdoSequence * seq, uint32_t reason, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_request_wakeup(CdoSequence * seq, uint32_t nodeid, uint64_t addr, uint32_t ack); -CDOUTIL_EXPORT void cdocmd_add_pm_set_wakeup_source(CdoSequence * seq, uint32_t target, uint32_t source, uint32_t enable); -CDOUTIL_EXPORT void cdocmd_add_pm_system_shutdown(CdoSequence * seq, uint32_t type, uint32_t subtype); -CDOUTIL_EXPORT void cdocmd_add_pm_request_device(CdoSequence * seq, uint32_t nodeid, uint32_t capabilities, uint32_t qos, uint32_t ack); -CDOUTIL_EXPORT void cdocmd_add_pm_release_device(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_set_requirement(CdoSequence * seq, uint32_t nodeid, uint32_t capabilities, uint32_t qos, uint32_t ack); -CDOUTIL_EXPORT void cdocmd_add_pm_set_max_latency(CdoSequence * seq, uint32_t nodeid, uint32_t latency); -CDOUTIL_EXPORT void cdocmd_add_pm_reset_assert(CdoSequence * seq, uint32_t nodeid, uint32_t action); -CDOUTIL_EXPORT void cdocmd_add_pm_reset_get_status(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_request(CdoSequence * seq, uint32_t pinid); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_release(CdoSequence * seq, uint32_t pinid); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_get_function(CdoSequence * seq, uint32_t pinid); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_set_function(CdoSequence * seq, uint32_t pinid, uint32_t funcid); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_config_param_get(CdoSequence * seq, uint32_t pinid, uint32_t param); -CDOUTIL_EXPORT void cdocmd_add_pm_pinctrl_config_param_set(CdoSequence * seq, uint32_t pinid, uint32_t param, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_pm_ioctl(CdoSequence * seq, uint32_t nodeid, uint32_t ioctlid, void * buf, uint32_t count, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_query_data(CdoSequence * seq, uint32_t id, void * buf, uint32_t count, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_enable(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_disable(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_getstate(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_setdivider(CdoSequence * seq, uint32_t nodeid, uint32_t div); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_getdivider(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_setrate(CdoSequence * seq, uint32_t nodeid, uint32_t rate); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_getrate(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_setparent(CdoSequence * seq, uint32_t nodeid, uint32_t parentid); -CDOUTIL_EXPORT void cdocmd_add_pm_clock_getparent(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_pll_set_parameter(CdoSequence * seq, uint32_t nodeid, uint32_t param, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_pm_pll_get_parameter(CdoSequence * seq, uint32_t nodeid, uint32_t param); -CDOUTIL_EXPORT void cdocmd_add_pm_pll_set_mode(CdoSequence * seq, uint32_t nodeid, uint32_t val); -CDOUTIL_EXPORT void cdocmd_add_pm_pll_get_mode(CdoSequence * seq, uint32_t nodeid); -CDOUTIL_EXPORT void cdocmd_add_pm_add_subsystem(CdoSequence * seq, uint32_t ssid); -CDOUTIL_EXPORT void cdocmd_add_pm_destroy_subsystem(CdoSequence * seq, uint32_t ssid); -CDOUTIL_EXPORT void cdocmd_add_pm_describe_nodes(CdoSequence * seq, void * buf, uint32_t count, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_add_node(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_add_node_parent(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_add_node_name(CdoSequence * seq, uint32_t nodeid, const char * name); -CDOUTIL_EXPORT void cdocmd_add_pm_add_requirement(CdoSequence * seq, uint32_t ssid, uint32_t nodeid, uint32_t flags, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_set_current_subsystem(CdoSequence * seq, uint32_t ssid); -CDOUTIL_EXPORT void cdocmd_add_pm_init_node(CdoSequence * seq, uint32_t nodeid, uint32_t function, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_pm_feature_check(CdoSequence * seq, uint32_t id); -CDOUTIL_EXPORT void cdocmd_add_pm_iso_control(CdoSequence * seq, uint32_t nodeid, uint32_t value); - -CDOUTIL_EXPORT void cdocmd_add_cfu_set_crc32(CdoSequence * seq, uint32_t type, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_decompress(CdoSequence * seq, uint32_t type); -CDOUTIL_EXPORT void cdocmd_add_cfu_cram_rw(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_seu_go(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_crc8_dis(CdoSequence * seq, uint32_t type); -CDOUTIL_EXPORT void cdocmd_add_cfu_ssi_per_slr_pr(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_gsr_gsc(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_gcap_clk_en(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cfu_cfi_type(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_cframe_read(CdoSequence * seq, uint32_t param, uint64_t addr, uint32_t read_count, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_ssit_sync_master(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_add_ssit_sync_slaves(CdoSequence * seq, uint32_t mask, uint32_t count); -CDOUTIL_EXPORT void cdocmd_add_ssit_wait_slaves(CdoSequence * seq, uint32_t mask, uint32_t count); -CDOUTIL_EXPORT void cdocmd_add_nop(CdoSequence * seq, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_event_logging(CdoSequence * seq, uint32_t subcmd, uint32_t count, void * buf, uint32_t be); -CDOUTIL_EXPORT void cdocmd_add_set_board(CdoSequence * seq, const char * name); -CDOUTIL_EXPORT void cdocmd_add_set_plm_wdt(CdoSequence * seq, uint32_t nodeid, uint32_t periodicity); -CDOUTIL_EXPORT void cdocmd_add_log_string(CdoSequence * seq, const char * str); -CDOUTIL_EXPORT void cdocmd_add_log_address(CdoSequence * seq, uint64_t srcaddr); -CDOUTIL_EXPORT void cdocmd_add_marker(CdoSequence * seq, uint32_t value, const char * str); -CDOUTIL_EXPORT void cdocmd_add_proc(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_begin(CdoSequence * seq, const char * str); -CDOUTIL_EXPORT void cdocmd_add_end(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_add_break(CdoSequence * seq, uint32_t value); -CDOUTIL_EXPORT void cdocmd_add_ldr_set_image_info(CdoSequence * seq, uint32_t nodeid, uint32_t uid, uint32_t puid, uint32_t funcid); -CDOUTIL_EXPORT void cdocmd_add_em_set_action(CdoSequence * seq, uint32_t nodeid, uint32_t action, uint32_t mask); -CDOUTIL_EXPORT void cdocmd_insert_seq(CdoCommand * cmd, CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_concat_seq(CdoSequence * seq, CdoSequence * seq2); - -CDOUTIL_EXPORT void cdocmd_rewrite_address(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_rewrite_block(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_rewrite_sequential(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_rewrite_repeat(CdoSequence * seq); -CDOUTIL_EXPORT void cdocmd_remove_comments(CdoSequence * seq); +CdoSequence * cdocmd_create_sequence(void); +void cdocmd_delete_sequence(CdoSequence * seq); +CdoCommand * cdocmd_alloc(CdoCmdType type); +void cdocmd_free(CdoCommand * cmd); +CdoCommand * cdocmd_duplicate(CdoCommand * cmd); +void cdocmd_set_default_sequence(CdoSequence * seq); +void cdocmd_append_command(CdoSequence * seq, CdoCommand * newcmd); +void cdocmd_insert_command(CdoCommand * cmd, CdoCommand * newcmd); +void cdocmd_add_random_command(CdoSequence * seq, uint32_t * levelp); +void cdocmd_add_generic_command(CdoSequence * seq, uint32_t id, void * buf, uint32_t count, uint32_t be); +void cdocmd_add_comment(CdoSequence * seq, const char * comment, ...); +void cdocmd_add_section(CdoSequence * seq, uint32_t secid); +void cdocmd_add_include(CdoSequence * seq, const char * name); +void cdocmd_add_mask_poll(CdoSequence * seq, uint64_t addr, uint32_t mask, uint32_t value, uint32_t count, uint32_t flags); +void cdocmd_add_mask_write(CdoSequence * seq, uint64_t addr, uint32_t mask, uint32_t value); +void cdocmd_add_write(CdoSequence * seq, uint64_t addr, uint32_t value); +void cdocmd_add_delay(CdoSequence * seq, uint32_t delay); +void cdocmd_add_block_write(CdoSequence * seq, uint64_t addr, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_keyhole_write(CdoSequence * seq, uint64_t addr, uint32_t keyhole_size, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_block_set(CdoSequence * seq, uint64_t addr, uint32_t count, uint32_t value); +void cdocmd_add_dma_xfer(CdoSequence * seq, uint64_t srcaddr, uint64_t dstaddr, uint32_t count, uint32_t flags, void * buf, uint32_t be); +void cdocmd_add_npi_seq(CdoSequence * seq, uint32_t addr, uint32_t flags); +void cdocmd_add_npi_precfg(CdoSequence * seq, uint32_t addr, uint32_t flags); +void cdocmd_add_npi_write(CdoSequence * seq, uint32_t addr, uint32_t flags, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_npi_shutdown(CdoSequence * seq, uint32_t addr, uint32_t flags); + +void cdocmd_add_scatter_write(CdoSequence * seq, uint32_t value, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_scatter_write2(CdoSequence * seq, uint32_t value1, uint32_t value2, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_bisr(CdoSequence * seq, uint32_t tagid); +void cdocmd_add_pm_apply_trim(CdoSequence * seq, uint32_t trimtype); + +void cdocmd_add_pm_get_api_version(CdoSequence * seq); +void cdocmd_add_pm_get_device_status(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_register_notifier(CdoSequence * seq, uint32_t nodeid, uint32_t mask, uint32_t arg1, uint32_t arg2); +void cdocmd_add_pm_request_suspend(CdoSequence * seq, uint32_t nodeid, uint32_t ack, uint32_t latency, uint32_t state); +void cdocmd_add_pm_self_suspend(CdoSequence * seq, uint32_t nodeid, uint32_t latency, uint32_t state, uint64_t addr); +void cdocmd_add_pm_force_powerdown(CdoSequence * seq, uint32_t nodeid, uint32_t ack); +void cdocmd_add_pm_abort_suspend(CdoSequence * seq, uint32_t reason, uint32_t nodeid); +void cdocmd_add_pm_request_wakeup(CdoSequence * seq, uint32_t nodeid, uint64_t addr, uint32_t ack); +void cdocmd_add_pm_set_wakeup_source(CdoSequence * seq, uint32_t target, uint32_t source, uint32_t enable); +void cdocmd_add_pm_system_shutdown(CdoSequence * seq, uint32_t type, uint32_t subtype); +void cdocmd_add_pm_request_device(CdoSequence * seq, uint32_t nodeid, uint32_t capabilities, uint32_t qos, uint32_t ack); +void cdocmd_add_pm_release_device(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_set_requirement(CdoSequence * seq, uint32_t nodeid, uint32_t capabilities, uint32_t qos, uint32_t ack); +void cdocmd_add_pm_set_max_latency(CdoSequence * seq, uint32_t nodeid, uint32_t latency); +void cdocmd_add_pm_reset_assert(CdoSequence * seq, uint32_t nodeid, uint32_t action); +void cdocmd_add_pm_reset_get_status(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_pinctrl_request(CdoSequence * seq, uint32_t pinid); +void cdocmd_add_pm_pinctrl_release(CdoSequence * seq, uint32_t pinid); +void cdocmd_add_pm_pinctrl_get_function(CdoSequence * seq, uint32_t pinid); +void cdocmd_add_pm_pinctrl_set_function(CdoSequence * seq, uint32_t pinid, uint32_t funcid); +void cdocmd_add_pm_pinctrl_config_param_get(CdoSequence * seq, uint32_t pinid, uint32_t param); +void cdocmd_add_pm_pinctrl_config_param_set(CdoSequence * seq, uint32_t pinid, uint32_t param, uint32_t value); +void cdocmd_add_pm_ioctl(CdoSequence * seq, uint32_t nodeid, uint32_t ioctlid, void * buf, uint32_t count, uint32_t be); +void cdocmd_add_pm_query_data(CdoSequence * seq, uint32_t id, void * buf, uint32_t count, uint32_t be); +void cdocmd_add_pm_clock_enable(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_clock_disable(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_clock_getstate(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_clock_setdivider(CdoSequence * seq, uint32_t nodeid, uint32_t div); +void cdocmd_add_pm_clock_getdivider(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_clock_setrate(CdoSequence * seq, uint32_t nodeid, uint32_t rate); +void cdocmd_add_pm_clock_getrate(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_clock_setparent(CdoSequence * seq, uint32_t nodeid, uint32_t parentid); +void cdocmd_add_pm_clock_getparent(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_pll_set_parameter(CdoSequence * seq, uint32_t nodeid, uint32_t param, uint32_t value); +void cdocmd_add_pm_pll_get_parameter(CdoSequence * seq, uint32_t nodeid, uint32_t param); +void cdocmd_add_pm_pll_set_mode(CdoSequence * seq, uint32_t nodeid, uint32_t val); +void cdocmd_add_pm_pll_get_mode(CdoSequence * seq, uint32_t nodeid); +void cdocmd_add_pm_add_subsystem(CdoSequence * seq, uint32_t ssid); +void cdocmd_add_pm_destroy_subsystem(CdoSequence * seq, uint32_t ssid); +void cdocmd_add_pm_describe_nodes(CdoSequence * seq, void * buf, uint32_t count, uint32_t be); +void cdocmd_add_pm_add_node(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_add_node_parent(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_add_node_name(CdoSequence * seq, uint32_t nodeid, const char * name); +void cdocmd_add_pm_add_requirement(CdoSequence * seq, uint32_t ssid, uint32_t nodeid, uint32_t flags, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_set_current_subsystem(CdoSequence * seq, uint32_t ssid); +void cdocmd_add_pm_init_node(CdoSequence * seq, uint32_t nodeid, uint32_t function, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_feature_check(CdoSequence * seq, uint32_t id); +void cdocmd_add_pm_iso_control(CdoSequence * seq, uint32_t nodeid, uint32_t value); +void cdocmd_add_pm_activate_subsystem(CdoSequence * seq, uint32_t ssid); +void cdocmd_add_pm_set_node_access(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_noc_clock_enable(CdoSequence * seq, uint32_t nodeid, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_pm_if_noc_clock_enable(CdoSequence * seq, uint32_t index, uint32_t state, uint32_t break_level); + +void cdocmd_add_cfu_set_crc32(CdoSequence * seq, uint32_t type, uint32_t value); +void cdocmd_add_cfu_decompress(CdoSequence * seq, uint32_t type); +void cdocmd_add_cfu_cram_rw(CdoSequence * seq, uint32_t value); +void cdocmd_add_cfu_seu_go(CdoSequence * seq, uint32_t value); +void cdocmd_add_cfu_crc8_dis(CdoSequence * seq, uint32_t type); +void cdocmd_add_cfu_ssi_per_slr_pr(CdoSequence * seq, uint32_t value); +void cdocmd_add_cfu_gsr_gsc(CdoSequence * seq, uint32_t value); +void cdocmd_add_cfu_gcap_clk_en(CdoSequence * seq, uint32_t value); +void cdocmd_add_cfu_cfi_type(CdoSequence * seq, uint32_t value); +void cdocmd_add_cframe_read(CdoSequence * seq, uint32_t param, uint64_t addr, uint32_t read_count, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_ssit_sync_master(CdoSequence * seq); +void cdocmd_add_ssit_sync_slaves(CdoSequence * seq, uint32_t mask, uint32_t count); +void cdocmd_add_ssit_wait_slaves(CdoSequence * seq, uint32_t mask, uint32_t count); +void cdocmd_add_nop(CdoSequence * seq, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_event_logging(CdoSequence * seq, uint32_t subcmd, uint32_t count, void * buf, uint32_t be); +void cdocmd_add_set_board(CdoSequence * seq, const char * name); +void cdocmd_add_set_plm_wdt(CdoSequence * seq, uint32_t nodeid, uint32_t periodicity); +void cdocmd_add_log_string(CdoSequence * seq, const char * str); +void cdocmd_add_log_address(CdoSequence * seq, uint64_t srcaddr); +void cdocmd_add_marker(CdoSequence * seq, uint32_t value, const char * str); +void cdocmd_add_proc(CdoSequence * seq, uint32_t value); +void cdocmd_add_begin(CdoSequence * seq, const char * str); +void cdocmd_add_end(CdoSequence * seq); +void cdocmd_add_break(CdoSequence * seq, uint32_t value); +void cdocmd_add_ot_check(CdoSequence * seq, uint32_t value); +void cdocmd_add_psm_sequence(CdoSequence * seq); +void cdocmd_add_ldr_set_image_info(CdoSequence * seq, uint32_t nodeid, uint32_t uid, uint32_t puid, uint32_t funcid); +void cdocmd_add_ldr_cframe_clear_check(CdoSequence * seq, uint32_t block_type); +void cdocmd_add_em_set_action(CdoSequence * seq, uint32_t nodeid, uint32_t action, uint32_t mask); +void cdocmd_insert_seq(CdoCommand * cmd, CdoSequence * seq); +void cdocmd_concat_seq(CdoSequence * seq, CdoSequence * seq2); + +void cdocmd_rewrite_address(CdoSequence * seq); +void cdocmd_rewrite_block(CdoSequence * seq); +void cdocmd_rewrite_sequential(CdoSequence * seq); +void cdocmd_rewrite_repeat(CdoSequence * seq); +void cdocmd_remove_comments(CdoSequence * seq); static inline uint16_t u16swap(uint16_t v) { return ((v >> 8) & 0xff) | ((v << 8) & 0xff00); diff -Nru xilinx-bootgen-2021.2/cdo-load.c xilinx-bootgen-2022.2/cdo-load.c --- xilinx-bootgen-2021.2/cdo-load.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-load.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,26 @@ #include #include #include +#include +#include #include "cdo-binary.h" #include "cdo-source.h" #include "cdo-raw.h" #include "cdo-load.h" +#define MAX_LINE_LENGTH 100 +static char slr_id_binary; + +char slr_id_from_binary(char ch) +{ + if (slr_id_binary != 0) + { + ch = slr_id_binary; + slr_id_binary = 0; + } + return ch; +} + void * file_to_buf(const char * path, size_t * sizep) { FILE * f = fopen(path, "rb"); void * buf = NULL; @@ -66,11 +81,12 @@ CdoSequence * cdoseq_load_cdo(const char * path) { CdoSequence * seq = NULL; + CdoSequence * hdr_seq = NULL; CdoRawInfo * raw = NULL; size_t size; void * data = file_to_buf(path, &size); if (data == NULL) goto done; - raw = decode_raw(data, size); + raw = decode_raw(&hdr_seq, data, size); if (raw != NULL) { free(data); data = raw->data; @@ -101,6 +117,11 @@ } else { free(data); } + if (hdr_seq && seq) { + cdocmd_concat_seq(hdr_seq, seq); + cdocmd_delete_sequence(seq); + seq = hdr_seq; + } return seq; } diff -Nru xilinx-bootgen-2021.2/cdo-load.h xilinx-bootgen-2022.2/cdo-load.h --- xilinx-bootgen-2021.2/cdo-load.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-load.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,14 @@ #include #include "cdo-command.h" +#define MARKER_DEVICE 0x1 +#define MARKER_SLRID 0x5 +#define MARKER_DATE 0x6 -CDOUTIL_EXPORT void * file_to_buf(const char * path, size_t * sizep); -CDOUTIL_EXPORT CdoSequence * cdoseq_load_cdo(const char * path); +void * file_to_buf(const char * path, size_t * sizep); +CdoSequence * cdoseq_load_cdo(const char * path); -CDOUTIL_EXPORT void cdoseq_extract_writes(CdoSequence * seq); -CDOUTIL_EXPORT CdoSequence* cdoseq_extract_cdo_till_ssit_sync_slaves(CdoSequence * seq, uint32_t sync_index); +char slr_id_from_binary(char ch); +void cdoseq_extract_writes(CdoSequence * seq); +CdoSequence* cdoseq_extract_cdo_till_ssit_sync_slaves(CdoSequence * seq, uint32_t sync_index); #endif /* D_cdo_load */ diff -Nru xilinx-bootgen-2021.2/cdo-npi.h xilinx-bootgen-2022.2/cdo-npi.h --- xilinx-bootgen-2021.2/cdo-npi.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-npi.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,26 @@ #include "cdo-command.h" -CDOUTIL_EXPORT int cdocmd_post_process_mode(const char * s, uint32_t verbose); -CDOUTIL_EXPORT void cdocmd_post_process_start(void); -CDOUTIL_EXPORT uint32_t cdocmd_post_process_end_seq(CdoSequence ** seqp); -CDOUTIL_EXPORT void cdocmd_post_process_end(void ** new_data, size_t * new_size); -CDOUTIL_EXPORT uint32_t cdocmd_post_process_cdo_seq(const void * data, size_t size, CdoSequence ** seqp); -CDOUTIL_EXPORT uint32_t cdocmd_post_process_cdo(const void * data, size_t size, void ** new_data, size_t * new_size); +enum { + houseclean_bypass_lpd = 1, + houseclean_bypass_fpd = 2, + houseclean_bypass_npd = 4, + houseclean_bypass_plpd = 8, + houseclean_bypass_cpm = 16, +}; + +int is_platform_spp(void); +int cdocmd_post_process_mode(const char * s, uint32_t verbose); +void set_cfu_stream_keyhole_size(uint64_t size); +void set_platform_spp(void); +void set_spp_ddr_enable(uint32_t enable); +void cdocmd_post_process_start(void); +uint32_t cdocmd_post_process_end_seq(CdoSequence ** seqp); +void cdocmd_post_process_end(void ** new_data, size_t * new_size); +uint32_t cdocmd_post_process_cdo_seq(const void * data, size_t size, CdoSequence ** seqp); +uint32_t cdocmd_post_process_cfi_seq(const void * data, size_t size, uint32_t is_gsc, CdoSequence ** seqp); +uint32_t cdocmd_post_process_cdo(const void * data, size_t size, void ** new_data, size_t * new_size); +uint32_t cdocmd_post_process_cfi(const void * data, size_t size, uint32_t is_gsc, void ** new_data, size_t * new_size); +void cdocmd_rewrite_address_filter(CdoSequence * seq, const char * address_filter_file); #endif /* D_cdo_npi */ diff -Nru xilinx-bootgen-2021.2/cdo-overlay.c xilinx-bootgen-2022.2/cdo-overlay.c --- xilinx-bootgen-2021.2/cdo-overlay.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-overlay.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,6 @@ CdoCommand * ovlcmd = NULL; if (dstentry->level != level) continue; more = 1; - fprintf(stdout, "check overlay \"%s\"\n", (char *)dstentry->start->buf); ovlentry = find_last_entry(ovl, dstentry->start->buf, 0); if (ovlentry == NULL) continue; diff -Nru xilinx-bootgen-2021.2/cdo-overlay.h xilinx-bootgen-2022.2/cdo-overlay.h --- xilinx-bootgen-2021.2/cdo-overlay.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-overlay.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff -Nru xilinx-bootgen-2021.2/cdo-raw.c xilinx-bootgen-2022.2/cdo-raw.c --- xilinx-bootgen-2021.2/cdo-raw.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-raw.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,7 @@ return 0; } -CdoRawInfo * decode_raw(void * data, size_t size) { +CdoRawInfo * decode_raw(CdoSequence ** seq, void * data, size_t size) { CdoRawInfo * raw = NULL; CdoRawType type; size_t offset = 0; @@ -147,10 +147,38 @@ goto error; } skipnewline(s, e); + *seq = cdocmd_create_sequence(); while (s < e) { + char buf[1024]; p = s; skipline(s, e); - if (s-p >= 5 && memcmp(p, "Bits:", 5) == 0) { + if (s-p >= 10 && memcmp(p, "Created by", 10) == 0) { + p += 10; + /*strncpy(buf, p, s - p); + buf[s - p] = '\0'; + cdocmd_add_marker(*seq, 1, buf);*/ + } else if (s-p >= 12 && memcmp(p, "Design name:", 12) == 0) { + // TODO: Design name includes SLR, add it as a separate marker + p += 12; + strncpy(buf, p, s - p); + buf[s - p] = '\0'; + cdocmd_add_marker(*seq, 2, buf); + } else if (s-p >= 13 && memcmp(p, "Architecture:", 13) == 0) { + p += 13; + strncpy(buf, p, s - p); + buf[s - p] = '\0'; + cdocmd_add_marker(*seq, 3, buf); + } else if (s-p >= 5 && memcmp(p, "Part:", 5) == 0) { + p += 5; + strncpy(buf, p, s - p); + buf[s - p] = '\0'; + cdocmd_add_marker(*seq, 4, buf); + } else if (s-p >= 5 && memcmp(p, "Date:", 5) == 0) { + p += 5; + /*strncpy(buf, p, s - p); + buf[s - p] = '\0'; + cdocmd_add_marker(*seq, 6, buf);*/ + } else if (s-p >= 5 && memcmp(p, "Bits:", 5) == 0) { uint64_t bytes; if (s >= e) goto error; p += 5; diff -Nru xilinx-bootgen-2021.2/cdo-raw.h xilinx-bootgen-2022.2/cdo-raw.h --- xilinx-bootgen-2021.2/cdo-raw.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-raw.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef D_cdo_raw #define D_cdo_raw -#include "dyn_link.h" +#include "cdo-command.h" typedef struct CdoRawInfo CdoRawInfo; @@ -33,7 +33,7 @@ uint32_t data[1]; /* Must be last */ }; -CDOUTIL_EXPORT CdoRawInfo * decode_raw(void * data, size_t size); -CDOUTIL_EXPORT void encode_raw(FILE * f, void * data, size_t size); +CdoRawInfo * decode_raw(CdoSequence ** seq, void * data, size_t size); +void encode_raw(FILE * f, void * data, size_t size); #endif /* D_cdo_raw */ diff -Nru xilinx-bootgen-2021.2/cdo-source.c xilinx-bootgen-2022.2/cdo-source.c --- xilinx-bootgen-2021.2/cdo-source.c 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-source.c 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2021 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,10 @@ #include #include "cdo-load.h" #include "cdo-source.h" +#include + +static char* slr_id_ptr; +static char slr_id; #if defined(_WIN32) #define strcasecmp(x,y) stricmp(x,y) @@ -71,6 +75,10 @@ { "begin", CdoCmdBegin }, { "end", CdoCmdEnd }, { "break", CdoCmdBreak }, + { "ot_check", CdoCmdOtCheck }, + { "psm_sequence", CdoCmdPsmSequence }, + { "scatter_write", CdoCmdScatterWrite }, + { "scatter_write2", CdoCmdScatterWrite2 }, { "npi_seq", CdoCmdNpiSeq }, { "npi_precfg", CdoCmdNpiPreCfg }, { "npi_write", CdoCmdNpiWrite }, @@ -123,6 +131,12 @@ { "pm_init_node", CdoCmdPmInitNode }, { "pm_feature_check", CdoCmdPmFeatureCheck }, { "pm_iso_control", CdoCmdPmIsoControl }, + { "pm_bisr", CdoCmdPmBisr }, + { "pm_apply_trim", CdoCmdPmApplyTrim }, + { "pm_noc_clock_enable", CdoCmdPmNocClockEnable }, + { "pm_if_noc_clock_enable", CdoCmdPmIfNocClockEnable }, + { "pm_activate_subsystem", CdoCmdPmActivateSubsystem }, + { "pm_set_node_access", CdoCmdPmSetNodeAccess }, { "cfu_set_crc32", CdoCmdCfuSetCrc32 }, { "cfu_decompress", CdoCmdCfuDecompress }, { "cfu_cram_rw", CdoCmdCfuCramRW }, @@ -134,9 +148,20 @@ { "cfu_cfi_type", CdoCmdCfuCfiType }, { "em_set_action", CdoCmdEmSetAction }, { "ldr_set_image_info", CdoCmdLdrSetImageInfo }, + { "cframe_clear_check", CdoCmdLdrCframeClearCheck }, { NULL, 0 } }; +char* marker_list[] = { + "PMC_DATA", + "LPD_DATA", + "FPD_DATA", + "PMC_DATA_SLR_1", + "PMC_DATA_SLR_2", + "PMC_DATA_SLR_3" +}; +int marker_count[sizeof(marker_list) / sizeof(marker_list[0])]; + static uint32_t iseol(char ** sp) { char * s = *sp; skipsp(s); @@ -248,6 +273,36 @@ return 1; } +char slr_id_from_source(char ch) +{ + if (slr_id != 0) + { + ch = slr_id; + slr_id = 0; + } + return ch; +} + +static void check_redundant_markers(char * marker_string) +{ + bool same_marker_found = false; + int i = 0; + for (; i < (sizeof(marker_list) / sizeof(marker_list[0])); i++) + { + if (strcasecmp(marker_string, marker_list[i]) == 0) + { + if (marker_count[i]++ > 2) + { + same_marker_found = true; + } + } + } + if (same_marker_found == true) + { + printf("[WARNING]: The marker %s is found more than once.\n", marker_string); + } +} + CdoSequence * cdoseq_from_source(FILE * f) { CdoSequence * seq = cdocmd_create_sequence(); uint32_t cap = 2; @@ -277,7 +332,7 @@ if (*s == '#') { s++; skipsp(s); - cdocmd_add_comment(seq, s); + cdocmd_add_comment(seq, "%s", s); } continue; } @@ -522,6 +577,16 @@ if (parse_u32(&s, &value)) goto syntax_error; if (iseol(&s)) goto syntax_error; if (parse_string(&s, &name)) goto syntax_error; + check_redundant_markers(name); + if (value == MARKER_DEVICE || value == MARKER_DATE) + { + break; + } + if (value == MARKER_SLRID) + { + slr_id_ptr = name; + slr_id = *slr_id_ptr; + } cdocmd_add_marker(seq, value, name); free(name); break; @@ -557,6 +622,40 @@ cdocmd_add_break(seq, value); break; } + case CdoCmdOtCheck: { + uint32_t value; + skipsp(s); + if (parse_u32(&s, &value)) goto syntax_error; + cdocmd_add_ot_check(seq, value); + break; + } + case CdoCmdPsmSequence: + cdocmd_add_psm_sequence(seq); + level++; + break; + case CdoCmdScatterWrite: { + uint32_t * buf; + uint32_t count; + uint32_t value; + if (parse_u32(&s, &value)) goto syntax_error; + if (parse_buf(&s, &buf, &count)) goto syntax_error; + cdocmd_add_scatter_write(seq, value, count, buf, is_be_host()); + free(buf); + break; + } + case CdoCmdScatterWrite2: { + uint32_t * buf; + uint32_t count; + uint32_t value1; + uint32_t value2; + if (parse_u32(&s, &value1)) goto syntax_error; + if (parse_u32(&s, &value2)) goto syntax_error; + if (parse_buf(&s, &buf, &count)) goto syntax_error; + cdocmd_add_scatter_write2(seq, value1, value2, count, buf, is_be_host()); + free(buf); + break; + } + case CdoCmdNpiSeq: case CdoCmdNpiPreCfg: case CdoCmdNpiShutdown: { @@ -981,6 +1080,59 @@ cdocmd_add_pm_iso_control(seq, nodeid, value); break; } + case CdoCmdPmBisr: { + uint32_t tagid; + if (parse_u32(&s, &tagid)) goto syntax_error; + cdocmd_add_pm_bisr(seq, tagid); + break; + } + + case CdoCmdPmApplyTrim: { + uint32_t trimtype; + if (parse_u32(&s, &trimtype)) goto syntax_error; + cdocmd_add_pm_apply_trim(seq, trimtype); + break; + } + + case CdoCmdPmNocClockEnable: { + uint32_t nodeid; + uint32_t count; + uint32_t * buf; + if (parse_u32(&s, &nodeid)) goto syntax_error; + if (parse_buf(&s, &buf, &count)) goto syntax_error; + cdocmd_add_pm_noc_clock_enable(seq, nodeid, count, buf, is_be_host()); + free(buf); + break; + } + + case CdoCmdPmIfNocClockEnable: { + uint32_t index; + uint32_t state; + uint32_t level = 1; + if (parse_u32(&s, &index)) goto syntax_error; + if (parse_u32(&s, &state)) goto syntax_error; + skipsp(s); + if (istok(*s) && parse_u32(&s, &level)) goto syntax_error; + cdocmd_add_pm_if_noc_clock_enable(seq, index, state, level); + break; + } + + case CdoCmdPmActivateSubsystem: { + uint32_t id; + if (parse_u32(&s, &id)) goto syntax_error; + cdocmd_add_pm_activate_subsystem(seq, id); + break; + } + case CdoCmdPmSetNodeAccess: { + uint32_t id; + uint32_t count; + uint32_t * buf; + if (parse_u32(&s, &id)) goto syntax_error; + if (parse_buf(&s, &buf, &count)) goto syntax_error; + cdocmd_add_pm_set_node_access(seq, id, count, buf, is_be_host()); + free(buf); + break; + } case CdoCmdCfuSetCrc32: { uint32_t flags; uint32_t value; @@ -1063,6 +1215,12 @@ cdocmd_add_ldr_set_image_info(seq, nodeid, uid, puid, funcid); break; } + case CdoCmdLdrCframeClearCheck: { + uint32_t id; + if (parse_u32(&s, &id)) goto syntax_error; + cdocmd_add_ldr_cframe_clear_check(seq, id); + break; + } default: goto syntax_error; } @@ -1308,6 +1466,31 @@ } fprintf(f, "\n"); break; + case CdoCmdOtCheck: + fprintf(f, "ot_check"); + fprintf(f, " "); + print_x64(f, cmd->value); + fprintf(f, "\n"); + break; + case CdoCmdPsmSequence: + fprintf(f, "psm_sequence\n"); + level++; + break; + case CdoCmdScatterWrite: + fprintf(f, "scatter_write "); + print_x64(f, cmd->value); + print_buf(f, cmd->buf, cmd->count); + fprintf(f, "\n"); + break; + case CdoCmdScatterWrite2: + fprintf(f, "scatter_write2 "); + print_x64(f, cmd->value); + fprintf(f, " "); + print_x64(f, cmd->mask); + print_buf(f, cmd->buf, cmd->count); + fprintf(f, "\n"); + break; + case CdoCmdNpiSeq: fprintf(f, "npi_seq "); print_x64(f, cmd->dstaddr); @@ -1664,6 +1847,44 @@ print_x64(f, cmd->value); fprintf(f, "\n"); break; + case CdoCmdPmBisr: + fprintf(f, "pm_bisr "); + print_x64(f, cmd->id); + fprintf(f, "\n"); + break; + case CdoCmdPmApplyTrim: + fprintf(f, "pm_apply_trim "); + print_x64(f, cmd->id); + fprintf(f, "\n"); + break; + case CdoCmdPmNocClockEnable: + fprintf(f, "pm_noc_clock_enable "); + print_x64(f, cmd->id); + print_buf(f, cmd->buf, cmd->count); + fprintf(f, "\n"); + break; + case CdoCmdPmIfNocClockEnable: + fprintf(f, "pm_if_noc_clock_enable "); + print_x64(f, cmd->id); + fprintf(f, " "); + print_x64(f, cmd->value); + if (cmd->flags != 1) { + fprintf(f, " "); + print_x64(f, cmd->flags); + } + fprintf(f, "\n"); + break; + case CdoCmdPmActivateSubsystem: + fprintf(f, "pm_activate_subsystem "); + print_x64(f, cmd->id); + fprintf(f, "\n"); + break; + case CdoCmdPmSetNodeAccess: + fprintf(f, "pm_set_node_access "); + print_x64(f, cmd->id); + print_buf(f, cmd->buf, cmd->count); + fprintf(f, "\n"); + break; case CdoCmdCfuSetCrc32: fprintf(f, "cfu_set_crc32 "); print_x64(f, cmd->flags); @@ -1733,6 +1954,11 @@ print_x64(f, cmd->count); fprintf(f, "\n"); break; + case CdoCmdLdrCframeClearCheck: + fprintf(f, "cframe_clear_check "); + print_x64(f, cmd->id); + fprintf(f, "\n"); + break; default: fprintf(f, "unknown command (%u)\n", cmd->type); break; diff -Nru xilinx-bootgen-2021.2/cdo-source.h xilinx-bootgen-2022.2/cdo-source.h --- xilinx-bootgen-2021.2/cdo-source.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cdo-source.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. +* Copyright 2019-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include #include "cdo-command.h" -CDOUTIL_EXPORT CdoSequence * cdoseq_from_source(FILE * f); -CDOUTIL_EXPORT void cdoseq_to_source(FILE * f, CdoSequence * seq); - +CdoSequence * cdoseq_from_source(FILE * f); +void cdoseq_to_source(FILE * f, CdoSequence * seq); +char slr_id_from_source(char ch); #endif /* D_cdo_source */ diff -Nru xilinx-bootgen-2021.2/checksum-versal.cpp xilinx-bootgen-2022.2/checksum-versal.cpp --- xilinx-bootgen-2021.2/checksum-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/checksum-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2019 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,16 +77,21 @@ for (std::list::iterator j = pHList.begin(); j != pHList.end(); j++) { PartitionHeader& partHdr(**j); + /* Do not calculate checksum on entire partition for VersalNet bootloader - hashing is calculated on the first chunk + hash of previous chunk in VersalNet + This is handled while doing the chunking of the partition. So need need to calculate again */ if (partHdr.IsBootloader()) { - // For FSBL, checksum should be like Bootimage Integrity, the checksum should be attached right at the end of the FSBL - partHdr.partition->section->IncreaseLengthAndPadTo(partHdr.partition->section->Length + hdr.GetChecksumContext()->Size(), 0); + if (!bi.options.IsVersalNetSeries()) + { + // For FSBL, checksum should be like Bootimage Integrity, the checksum should be attached right at the end of the FSBL + partHdr.partition->section->IncreaseLengthAndPadTo(partHdr.partition->section->Length + hdr.GetChecksumContext()->Size(), 0); + } } else { - // For other partitions, a new checksum section is created and added at the end of image. - Section* s = hdr.GetChecksumContext()->Build(partHdr.partition->section->Name); - partHdr.checksumSection = s; + // For other partitions, a new checksum section is created and added at the end of image. + Section* s = hdr.GetChecksumContext()->Build(partHdr.partition->section->Name); + partHdr.checksumSection = s; } } } @@ -103,9 +108,14 @@ for (std::list::iterator j = pHList.begin(); j != pHList.end(); j++) { PartitionHeader& partHdr(**j); + /* Do not calculate checksum on entire partition for VersalNet bootloader - hashing is calculated on the first chunk + hash of previous chunk in VersalNet + This is handled while doing the chunking of the partition. So need need to calculate again */ if (partHdr.IsBootloader()) { - hdr.GetChecksumContext()->Link(partHdr.IsBootloader(), partHdr.partition->section->Data, partHdr.partition->section->Length - hdr.GetChecksumContext()->Size(), partHdr.partition->section); + if (!bi.options.IsVersalNetSeries()) + { + hdr.GetChecksumContext()->Link(partHdr.IsBootloader(), partHdr.partition->section->Data, partHdr.partition->section->Length - hdr.GetChecksumContext()->Size(), partHdr.partition->section); + } } else { diff -Nru xilinx-bootgen-2021.2/cmdoptions.l xilinx-bootgen-2022.2/cmdoptions.l --- xilinx-bootgen-2021.2/cmdoptions.l 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cmdoptions.l 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,6 +120,7 @@ zynqmp return tok::ZYNQMP; versal return tok::VERSAL; fpga return tok::FPGA; + versalnet return tok::VERSALNET; \-r return tok::_R; @@ -167,6 +168,7 @@ read return tok::HREAD; dump return tok::HDUMP; dump_dir return tok::HDUMPDIR; +overlay_cdo return tok::HOVLCDO; aarch32_mode return tok::H_BIF_AARCH32; big_endian return tok::H_BIF_BIGENDIAN; diff -Nru xilinx-bootgen-2021.2/cmdoptions.tab.cpp xilinx-bootgen-2022.2/cmdoptions.tab.cpp --- xilinx-bootgen-2021.2/cmdoptions.tab.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cmdoptions.tab.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -760,392 +760,392 @@ case 80: /* Line 670 of lalr1.cc */ -#line 197 "../../s/cmdoptions.y" - { ShowBifHelp(0); exit(0); } +#line 195 "../../s/cmdoptions.y" + { ShowCmdHelp(CO::BisonParser::token::HOVLCDO); exit(0); } break; case 81: /* Line 670 of lalr1.cc */ #line 198 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_INIT); exit(0); } + { ShowBifHelp(0); exit(0); } break; case 82: /* Line 670 of lalr1.cc */ #line 199 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_UDFBH); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_INIT); exit(0); } break; case 83: /* Line 670 of lalr1.cc */ #line 200 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_AES); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_UDFBH); exit(0); } break; case 84: /* Line 670 of lalr1.cc */ #line 201 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PPK); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_AES); exit(0); } break; case 85: /* Line 670 of lalr1.cc */ #line 202 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PSK); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PPK); exit(0); } break; case 86: /* Line 670 of lalr1.cc */ #line 203 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_SPK); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PSK); exit(0); } break; case 87: /* Line 670 of lalr1.cc */ #line 204 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_SSK); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_SPK); exit(0); } break; case 88: /* Line 670 of lalr1.cc */ #line 205 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_SPKSIGN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_SSK); exit(0); } break; case 89: /* Line 670 of lalr1.cc */ #line 206 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_HDRSIGN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_SPKSIGN); exit(0); } break; case 90: /* Line 670 of lalr1.cc */ #line 207 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTIMAGE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_HDRSIGN); exit(0); } break; case 91: /* Line 670 of lalr1.cc */ #line 208 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BL); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTIMAGE); exit(0); } break; case 92: /* Line 670 of lalr1.cc */ #line 209 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_ENCR); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BL); exit(0); } break; case 93: /* Line 670 of lalr1.cc */ #line 210 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PID); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_ENCR); exit(0); } break; case 94: /* Line 670 of lalr1.cc */ #line 211 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_AUTH); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PID); exit(0); } break; case 95: /* Line 670 of lalr1.cc */ #line 212 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_CHKSM); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_AUTH); exit(0); } break; case 96: /* Line 670 of lalr1.cc */ #line 213 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_POWNER); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_CHKSM); exit(0); } break; case 97: /* Line 670 of lalr1.cc */ #line 214 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PRESIGN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_POWNER); exit(0); } break; case 98: /* Line 670 of lalr1.cc */ #line 215 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_UDF); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PRESIGN); exit(0); } break; case 99: /* Line 670 of lalr1.cc */ #line 216 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_XIP); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_UDF); exit(0); } break; case 100: /* Line 670 of lalr1.cc */ #line 217 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_ALIGN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_XIP); exit(0); } break; case 101: /* Line 670 of lalr1.cc */ #line 218 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_OFFSET); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_ALIGN); exit(0); } break; case 102: /* Line 670 of lalr1.cc */ #line 219 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_RES); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_OFFSET); exit(0); } break; case 103: /* Line 670 of lalr1.cc */ #line 220 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_LOAD); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_RES); exit(0); } break; case 104: /* Line 670 of lalr1.cc */ #line 221 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_STARTUP); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_LOAD); exit(0); } break; case 105: /* Line 670 of lalr1.cc */ #line 222 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_KEYSRC); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_STARTUP); exit(0); } break; case 106: /* Line 670 of lalr1.cc */ #line 223 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_FSBLCFG); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_KEYSRC); exit(0); } break; case 107: /* Line 670 of lalr1.cc */ #line 224 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTDEV); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_FSBLCFG); exit(0); } break; case 108: /* Line 670 of lalr1.cc */ #line 225 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_DESTCPU); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTDEV); exit(0); } break; case 109: /* Line 670 of lalr1.cc */ #line 226 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_DESTDEV); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_DESTCPU); exit(0); } break; case 110: /* Line 670 of lalr1.cc */ #line 227 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_EL); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_DESTDEV); exit(0); } break; case 111: /* Line 670 of lalr1.cc */ #line 228 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_TZ); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_EL); exit(0); } break; case 112: /* Line 670 of lalr1.cc */ #line 229 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_AUTHPARAM); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_TZ); exit(0); } break; case 113: /* Line 670 of lalr1.cc */ #line 230 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BHKEY); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_AUTHPARAM); exit(0); } break; case 114: /* Line 670 of lalr1.cc */ #line 231 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PFW); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BHKEY); exit(0); } break; case 115: /* Line 670 of lalr1.cc */ #line 232 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BLOCKS); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PFW); exit(0); } break; case 116: /* Line 670 of lalr1.cc */ #line 233 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BHIV); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BLOCKS); exit(0); } break; case 117: /* Line 670 of lalr1.cc */ #line 234 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_METAL); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BHIV); exit(0); } break; case 118: /* Line 670 of lalr1.cc */ #line 235 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_ELYHNDOFF); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_METAL); exit(0); } break; case 119: /* Line 670 of lalr1.cc */ #line 236 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_HIVEC); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_ELYHNDOFF); exit(0); } break; case 120: /* Line 670 of lalr1.cc */ #line 237 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BHSIGN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_HIVEC); exit(0); } break; case 121: /* Line 670 of lalr1.cc */ #line 238 "../../s/cmdoptions.y" - { ShowCommonHelp(CO::BisonParser::token::H_SPLIT,false); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BHSIGN); exit(0); } break; case 122: /* Line 670 of lalr1.cc */ #line 239 "../../s/cmdoptions.y" - { ShowCommonHelp(CO::BisonParser::token::H_SPKSIGN,false); exit(0); } + { ShowCommonHelp(CO::BisonParser::token::H_SPLIT,false); exit(0); } break; case 123: /* Line 670 of lalr1.cc */ #line 240 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTVEC); exit(0); } + { ShowCommonHelp(CO::BisonParser::token::H_SPKSIGN,false); exit(0); } break; case 124: /* Line 670 of lalr1.cc */ #line 241 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PUFDATA); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTVEC); exit(0); } break; case 125: /* Line 670 of lalr1.cc */ #line 242 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_AARCH32); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PUFDATA); exit(0); } break; case 126: /* Line 670 of lalr1.cc */ #line 243 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BIGENDIAN); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_AARCH32); exit(0); } break; case 127: /* Line 670 of lalr1.cc */ #line 244 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTCONFIG); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BIGENDIAN); exit(0); } break; case 128: /* Line 670 of lalr1.cc */ #line 245 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_COPY); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_BOOTCONFIG); exit(0); } break; case 129: /* Line 670 of lalr1.cc */ #line 246 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_CORE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_COPY); exit(0); } break; case 130: /* Line 670 of lalr1.cc */ #line 247 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_DELAY_HANDOFF); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_CORE); exit(0); } break; case 131: /* Line 670 of lalr1.cc */ #line 248 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_DELAY_LOAD); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_DELAY_HANDOFF); exit(0); } break; case 132: /* Line 670 of lalr1.cc */ #line 249 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_FILE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_DELAY_LOAD); exit(0); } break; case 133: /* Line 670 of lalr1.cc */ #line 250 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_ID); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_FILE); exit(0); } break; case 134: /* Line 670 of lalr1.cc */ #line 251 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_IMAGE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_ID); exit(0); } break; case 135: /* Line 670 of lalr1.cc */ #line 252 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_METAHDR); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_IMAGE); exit(0); } break; case 136: /* Line 670 of lalr1.cc */ #line 253 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_NAME); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_METAHDR); exit(0); } break; case 137: /* Line 670 of lalr1.cc */ #line 254 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PARENTID); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_NAME); exit(0); } break; case 138: /* Line 670 of lalr1.cc */ #line 255 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_PARTITION); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PARENTID); exit(0); } break; case 139: /* Line 670 of lalr1.cc */ #line 256 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_SLR); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_PARTITION); exit(0); } break; case 140: /* Line 670 of lalr1.cc */ #line 257 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_TYPE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_SLR); exit(0); } break; case 141: /* Line 670 of lalr1.cc */ #line 258 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_KEYSRCENCR); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_TYPE); exit(0); } break; case 142: /* Line 670 of lalr1.cc */ #line 259 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_DPACM_ENABLE); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_BIF_KEYSRCENCR); exit(0); } break; case 143: /* Line 670 of lalr1.cc */ #line 260 "../../s/cmdoptions.y" - { ShowBifHelp(CO::BisonParser::token::H_BIF_USERKEYS); exit(0); } + { ShowBifHelp(CO::BisonParser::token::H_DPACM_ENABLE); exit(0); } break; case 144: /* Line 670 of lalr1.cc */ -#line 263 "../../s/cmdoptions.y" - { options.SetOverwrite(true); } +#line 261 "../../s/cmdoptions.y" + { ShowBifHelp(CO::BisonParser::token::H_BIF_USERKEYS); exit(0); } break; case 145: @@ -1157,360 +1157,372 @@ case 146: /* Line 670 of lalr1.cc */ #line 265 "../../s/cmdoptions.y" - { options.SetOverwrite(false); } + { options.SetOverwrite(true); } break; - case 148: + case 147: /* Line 670 of lalr1.cc */ -#line 269 "../../s/cmdoptions.y" - { options.SetLogLevel(LogLevel::ERROR); } +#line 266 "../../s/cmdoptions.y" + { options.SetOverwrite(false); } break; case 149: /* Line 670 of lalr1.cc */ #line 270 "../../s/cmdoptions.y" - { options.SetLogLevel(LogLevel::WARNING); } + { options.SetLogLevel(LogLevel::ERROR); } break; case 150: /* Line 670 of lalr1.cc */ #line 271 "../../s/cmdoptions.y" - { options.SetLogLevel(LogLevel::INFO); } + { options.SetLogLevel(LogLevel::WARNING); } break; case 151: /* Line 670 of lalr1.cc */ #line 272 "../../s/cmdoptions.y" - { options.SetLogLevel(LogLevel::DEBUG); } + { options.SetLogLevel(LogLevel::INFO); } break; case 152: /* Line 670 of lalr1.cc */ #line 273 "../../s/cmdoptions.y" - { options.SetLogLevel(LogLevel::TRACE); } + { options.SetLogLevel(LogLevel::DEBUG); } break; case 153: /* Line 670 of lalr1.cc */ -#line 276 "../../s/cmdoptions.y" - { options.SetEncryptedKeySource(KeySource::BbramRedKey); } +#line 274 "../../s/cmdoptions.y" + { options.SetLogLevel(LogLevel::TRACE); } break; case 154: /* Line 670 of lalr1.cc */ #line 277 "../../s/cmdoptions.y" - { options.SetEncryptedKeySource(KeySource::EfuseRedKey); } + { options.SetEncryptedKeySource(KeySource::BbramRedKey); } break; - case 156: + case 155: /* Line 670 of lalr1.cc */ -#line 280 "../../s/cmdoptions.y" - { options.SetStartCbc((yysemantic_stack_[(3) - (3)].cstring));} +#line 278 "../../s/cmdoptions.y" + { options.SetEncryptedKeySource(KeySource::EfuseRedKey); } break; - case 158: + case 157: /* Line 670 of lalr1.cc */ #line 281 "../../s/cmdoptions.y" - { options.SetKey0((yysemantic_stack_[(3) - (3)].cstring));} + { options.SetStartCbc((yysemantic_stack_[(3) - (3)].cstring));} break; - case 160: + case 159: /* Line 670 of lalr1.cc */ #line 282 "../../s/cmdoptions.y" - { options.SetHmac((yysemantic_stack_[(3) - (3)].cstring));} + { options.SetKey0((yysemantic_stack_[(3) - (3)].cstring));} break; - case 162: + case 161: /* Line 670 of lalr1.cc */ #line 283 "../../s/cmdoptions.y" - { options.SetEncryptionKeyFile((yysemantic_stack_[(1) - (1)].cstring));} + { options.SetHmac((yysemantic_stack_[(3) - (3)].cstring));} break; - case 164: + case 163: /* Line 670 of lalr1.cc */ -#line 287 "../../s/cmdoptions.y" - { options.SetProcessBitstreamType(File::MCS); } +#line 284 "../../s/cmdoptions.y" + { options.SetEncryptionKeyFile((yysemantic_stack_[(1) - (1)].cstring));} break; case 165: /* Line 670 of lalr1.cc */ #line 288 "../../s/cmdoptions.y" - { options.SetProcessBitstreamType(File::BIN); } + { options.SetProcessBitstreamType(File::MCS); } break; case 166: /* Line 670 of lalr1.cc */ -#line 291 "../../s/cmdoptions.y" - { options.SetDualQspiMode(QspiMode::PARALLEL_LQSPI); } +#line 289 "../../s/cmdoptions.y" + { options.SetProcessBitstreamType(File::BIN); } break; case 167: /* Line 670 of lalr1.cc */ #line 292 "../../s/cmdoptions.y" - { options.SetDualQspiMode(QspiMode::STACKED); } + { options.SetDualQspiMode(QspiMode::PARALLEL_LQSPI); } break; case 168: /* Line 670 of lalr1.cc */ -#line 295 "../../s/cmdoptions.y" - { LOG_ERROR("'parallel' option is not supported with '-dual_ospi_mode'."); } +#line 293 "../../s/cmdoptions.y" + { options.SetDualQspiMode(QspiMode::STACKED); } break; case 169: /* Line 670 of lalr1.cc */ #line 296 "../../s/cmdoptions.y" - { options.SetDualQspiMode(QspiMode::STACKED); } + { LOG_ERROR("'parallel' option is not supported with '-dual_ospi_mode'."); } break; case 170: /* Line 670 of lalr1.cc */ -#line 299 "../../s/cmdoptions.y" - { options.SetQspiSize((uint16_t)(yysemantic_stack_[(1) - (1)].number)); } +#line 297 "../../s/cmdoptions.y" + { options.SetDualQspiMode(QspiMode::STACKED); } break; case 171: /* Line 670 of lalr1.cc */ #line 300 "../../s/cmdoptions.y" - { options.SetQspiSize((uint16_t)atoi((yysemantic_stack_[(1) - (1)].cstring))); } + { options.SetQspiSize((uint16_t)(yysemantic_stack_[(1) - (1)].number)); } break; case 172: /* Line 670 of lalr1.cc */ -#line 303 "../../s/cmdoptions.y" - { options.SetOspiSize((uint16_t)(yysemantic_stack_[(1) - (1)].number)); } +#line 301 "../../s/cmdoptions.y" + { options.SetQspiSize((uint16_t)atoi((yysemantic_stack_[(1) - (1)].cstring))); } break; case 173: /* Line 670 of lalr1.cc */ #line 304 "../../s/cmdoptions.y" - { options.SetOspiSize((uint16_t)atoi((yysemantic_stack_[(1) - (1)].cstring))); } + { options.SetOspiSize((uint16_t)(yysemantic_stack_[(1) - (1)].number)); } break; case 174: /* Line 670 of lalr1.cc */ -#line 307 "../../s/cmdoptions.y" - { options.SetArchType(Arch::ZYNQ); } +#line 305 "../../s/cmdoptions.y" + { options.SetOspiSize((uint16_t)atoi((yysemantic_stack_[(1) - (1)].cstring))); } break; case 175: /* Line 670 of lalr1.cc */ #line 308 "../../s/cmdoptions.y" - { options.SetArchType(Arch::ZYNQMP); } + { options.SetArchType(Arch::ZYNQ); } break; case 176: /* Line 670 of lalr1.cc */ #line 309 "../../s/cmdoptions.y" - { options.SetArchType(Arch::VERSAL); } + { options.SetArchType(Arch::ZYNQMP); } break; case 177: /* Line 670 of lalr1.cc */ #line 310 "../../s/cmdoptions.y" - { options.SetArchType(Arch::FPGA); } + { options.SetArchType(Arch::VERSAL); } break; - case 179: + case 178: /* Line 670 of lalr1.cc */ -#line 314 "../../s/cmdoptions.y" - { options.SetGreyKeyGeneration(true); } +#line 311 "../../s/cmdoptions.y" + { options.SetArchType(Arch::FPGA); } break; - case 180: + case 179: /* Line 670 of lalr1.cc */ -#line 315 "../../s/cmdoptions.y" - { options.SetMetalKeyGeneration(true); } +#line 312 "../../s/cmdoptions.y" + { options.SetArchType(Arch::VERSALNET); } break; case 181: /* Line 670 of lalr1.cc */ #line 316 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::PEM); } + { options.SetGreyKeyGeneration(true); } break; case 182: /* Line 670 of lalr1.cc */ #line 317 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::RSA); } + { options.SetMetalKeyGeneration(true); } break; case 183: /* Line 670 of lalr1.cc */ #line 318 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::ECDSA); } + { options.SetAuthKeyGeneration(GenAuthKeys::PEM); } break; case 184: /* Line 670 of lalr1.cc */ #line 319 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::ECDSAP521); } + { options.SetAuthKeyGeneration(GenAuthKeys::RSA); } break; case 185: /* Line 670 of lalr1.cc */ -#line 322 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::PEM); } +#line 320 "../../s/cmdoptions.y" + { options.SetAuthKeyGeneration(GenAuthKeys::ECDSA); } break; case 186: /* Line 670 of lalr1.cc */ -#line 323 "../../s/cmdoptions.y" - { options.SetAuthKeyGeneration(GenAuthKeys::RSA); } +#line 321 "../../s/cmdoptions.y" + { options.SetAuthKeyGeneration(GenAuthKeys::ECDSAP521); } break; case 187: /* Line 670 of lalr1.cc */ -#line 326 "../../s/cmdoptions.y" - { options.SetSecureDebugAuthType(Authentication::ECDSA); - options.SetSecureDebugImageFile("secureDebugImage-ecdsa.bin"); } +#line 324 "../../s/cmdoptions.y" + { options.SetAuthKeyGeneration(GenAuthKeys::PEM); } break; case 188: /* Line 670 of lalr1.cc */ +#line 325 "../../s/cmdoptions.y" + { options.SetAuthKeyGeneration(GenAuthKeys::RSA); } + break; + + case 189: +/* Line 670 of lalr1.cc */ #line 328 "../../s/cmdoptions.y" + { options.SetSecureDebugAuthType(Authentication::ECDSA); + options.SetSecureDebugImageFile("secureDebugImage-ecdsa.bin"); } + break; + + case 190: +/* Line 670 of lalr1.cc */ +#line 330 "../../s/cmdoptions.y" { options.SetSecureDebugAuthType(Authentication::RSA); options.SetSecureDebugImageFile("secureDebugImage-rsa.bin"); } break; - case 189: + case 191: /* Line 670 of lalr1.cc */ -#line 331 "../../s/cmdoptions.y" +#line 333 "../../s/cmdoptions.y" { options.SetSecureDebugImageFile((yysemantic_stack_[(2) - (2)].cstring)); } break; - case 191: + case 193: /* Line 670 of lalr1.cc */ -#line 334 "../../s/cmdoptions.y" +#line 336 "../../s/cmdoptions.y" { options.SetSecureDebugAuthType(Authentication::ECDSA); options.SetSecureDebugImageFile("authenticatedJtagImage-ecdsa.bin"); } break; - case 192: + case 194: /* Line 670 of lalr1.cc */ -#line 336 "../../s/cmdoptions.y" +#line 338 "../../s/cmdoptions.y" { options.SetSecureDebugAuthType(Authentication::RSA); options.SetSecureDebugImageFile("authenticatedJtagImage-rsa.bin"); } break; - case 193: + case 195: /* Line 670 of lalr1.cc */ -#line 340 "../../s/cmdoptions.y" +#line 342 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(1) - (1)].cstring)); options.SetVerifyImageOption(true); } break; - case 194: + case 196: /* Line 670 of lalr1.cc */ -#line 343 "../../s/cmdoptions.y" +#line 345 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(1) - (1)].cstring)); options.SetReadImageOption(ReadImageOption::ALL); } break; - case 195: + case 197: /* Line 670 of lalr1.cc */ -#line 345 "../../s/cmdoptions.y" +#line 347 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (1)].cstring)); } break; - case 196: + case 198: /* Line 670 of lalr1.cc */ -#line 348 "../../s/cmdoptions.y" +#line 350 "../../s/cmdoptions.y" { options.SetReadImageOption(ReadImageOption::BH); } break; - case 197: + case 199: /* Line 670 of lalr1.cc */ -#line 349 "../../s/cmdoptions.y" +#line 351 "../../s/cmdoptions.y" { options.SetReadImageOption(ReadImageOption::IHT); } break; - case 198: + case 200: /* Line 670 of lalr1.cc */ -#line 350 "../../s/cmdoptions.y" +#line 352 "../../s/cmdoptions.y" { options.SetReadImageOption(ReadImageOption::IH); } break; - case 199: + case 201: /* Line 670 of lalr1.cc */ -#line 351 "../../s/cmdoptions.y" +#line 353 "../../s/cmdoptions.y" { options.SetReadImageOption(ReadImageOption::PHT); } break; - case 200: + case 202: /* Line 670 of lalr1.cc */ -#line 352 "../../s/cmdoptions.y" +#line 354 "../../s/cmdoptions.y" { options.SetReadImageOption(ReadImageOption::AC); } break; - case 201: + case 203: /* Line 670 of lalr1.cc */ -#line 355 "../../s/cmdoptions.y" +#line 357 "../../s/cmdoptions.y" { options.SetDumpOption(DumpOption::BH); } break; - case 202: + case 204: /* Line 670 of lalr1.cc */ -#line 356 "../../s/cmdoptions.y" +#line 358 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (1)].cstring)); options.SetDumpOption(DumpOption::BH); } break; - case 203: + case 205: /* Line 670 of lalr1.cc */ -#line 358 "../../s/cmdoptions.y" +#line 360 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (2)].cstring)); options.SetDumpOption(DumpOption::BH); } break; - case 204: + case 206: /* Line 670 of lalr1.cc */ -#line 360 "../../s/cmdoptions.y" +#line 362 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(1) - (1)].cstring)); options.SetDumpOption(DumpOption::PARTITIONS); } break; - case 205: + case 207: /* Line 670 of lalr1.cc */ -#line 362 "../../s/cmdoptions.y" +#line 364 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (1)].cstring)); options.SetDumpOption(DumpOption::PLM); } break; - case 206: + case 208: /* Line 670 of lalr1.cc */ -#line 364 "../../s/cmdoptions.y" +#line 366 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (1)].cstring)); options.SetDumpOption(DumpOption::PMC_CDO); } break; - case 207: + case 209: /* Line 670 of lalr1.cc */ -#line 366 "../../s/cmdoptions.y" +#line 368 "../../s/cmdoptions.y" { options.SetReadImageFile((yysemantic_stack_[(2) - (1)].cstring)); options.SetDumpOption(DumpOption::BOOT_FILES); } break; - case 208: + case 210: /* Line 670 of lalr1.cc */ -#line 368 "../../s/cmdoptions.y" +#line 370 "../../s/cmdoptions.y" { options.SetDumpOption(DumpOption::SLAVE_PDIS); } break; - case 209: + case 211: /* Line 670 of lalr1.cc */ -#line 371 "../../s/cmdoptions.y" +#line 373 "../../s/cmdoptions.y" { options.SetEncryptionDump(true,"aes_log.txt"); } break; - case 210: + case 212: /* Line 670 of lalr1.cc */ -#line 372 "../../s/cmdoptions.y" +#line 374 "../../s/cmdoptions.y" { options.SetEncryptionDump(true,(yysemantic_stack_[(1) - (1)].cstring)); } break; /* Line 670 of lalr1.cc */ -#line 1514 "cmdoptions.tab.cpp" +#line 1526 "cmdoptions.tab.cpp" default: break; } @@ -1722,35 +1734,35 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const signed char BisonParser::yypact_ninf_ = -75; + const signed char BisonParser::yypact_ninf_ = -77; const short int BisonParser::yypact_[] = { - -75, 11, 113, -75, -45, -62, 28, 103, -75, -75, - -75, -47, -74, 149, 0, 3, 99, 38, 107, -75, - -10, 50, 72, -75, -75, -45, -45, -75, 31, -45, - -49, -44, -42, 68, 54, -45, -45, -45, -45, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -45, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -45, 15, -75, - -75, -75, -75, -75, -75, -75, -75, -67, -75, -75, - -65, -75, -75, -75, -75, -75, -75, -75, 52, -75, - -75, -75, -75, 80, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -45, -75, -75, 57, -75, 150, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, 60, 58, -75, -75, -75, -75, -75, - -75, 64, 66, 69, -75, 70, 84, -45, -75, 90, - -75, -75, -75 + -77, 17, 110, -77, -47, -56, 27, 101, -77, -77, + -77, -53, -76, 168, 0, 5, 96, -47, 131, -77, + 49, 87, 86, -77, -77, -47, -47, -77, 47, -47, + -50, -45, -43, 73, -40, -47, -47, -47, -47, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -47, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -47, 14, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -68, + -77, -77, -66, -77, -77, -77, -77, -77, -77, -77, + 28, -77, -77, -77, -77, 89, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -47, -77, -77, 29, + -77, 148, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, 51, 50, -77, -77, -77, + -77, -77, -77, 58, 59, 62, -77, 61, 64, -47, + -77, 67, -77, -77, -77 }; /* YYDEFACT[S] -- default reduction number in state S. Performed when @@ -1760,50 +1772,50 @@ BisonParser::yydefact_[] = { 3, 0, 2, 1, 0, 49, 0, 51, 32, 19, - 18, 0, 80, 147, 0, 0, 0, 0, 0, 29, - 0, 0, 144, 30, 34, 0, 0, 17, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 209, 4, - 7, 44, 45, 46, 43, 5, 163, 50, 0, 9, + 18, 0, 81, 148, 0, 0, 0, 0, 0, 29, + 0, 0, 145, 30, 34, 0, 0, 17, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 211, 4, + 7, 44, 45, 46, 43, 5, 164, 50, 0, 9, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 77, 76, 75, 78, 79, 56, 13, 27, - 122, 81, 82, 83, 84, 85, 86, 87, 88, 119, - 89, 90, 91, 93, 92, 94, 95, 118, 120, 96, - 97, 98, 99, 100, 101, 102, 103, 111, 104, 105, - 106, 107, 108, 109, 110, 121, 112, 113, 114, 115, - 117, 116, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, - 137, 142, 143, 14, 148, 149, 150, 151, 152, 12, - 47, 48, 6, 164, 165, 23, 208, 201, 204, 39, - 40, 174, 175, 176, 177, 28, 166, 0, 24, 168, - 0, 25, 145, 146, 11, 42, 16, 22, 0, 26, - 181, 182, 184, 0, 179, 180, 183, 31, 188, 187, - 35, 192, 191, 36, 190, 153, 154, 155, 10, 194, - 37, 193, 38, 41, 210, 33, 8, 203, 205, 206, - 207, 202, 170, 171, 167, 172, 173, 169, 21, 185, - 186, 178, 189, 0, 157, 196, 197, 198, 199, 200, - 195, 0, 0, 159, 156, 0, 0, 161, 158, 0, - 162, 15, 160 + 73, 74, 77, 76, 75, 78, 79, 80, 56, 13, + 27, 123, 82, 83, 84, 85, 86, 87, 88, 89, + 120, 90, 91, 92, 94, 93, 95, 96, 119, 121, + 97, 98, 99, 100, 101, 102, 103, 104, 112, 105, + 106, 107, 108, 109, 110, 111, 122, 113, 114, 115, + 116, 118, 117, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, + 142, 138, 143, 144, 14, 149, 150, 151, 152, 153, + 12, 47, 48, 6, 165, 166, 23, 210, 203, 206, + 39, 40, 175, 176, 177, 178, 179, 28, 167, 0, + 24, 169, 0, 25, 146, 147, 11, 42, 16, 22, + 0, 26, 183, 184, 186, 0, 181, 182, 185, 31, + 190, 189, 35, 194, 193, 36, 192, 154, 155, 156, + 10, 196, 37, 195, 38, 41, 212, 33, 8, 205, + 207, 208, 209, 204, 171, 172, 168, 173, 174, 170, + 21, 187, 188, 180, 191, 0, 158, 198, 199, 200, + 201, 202, 197, 0, 0, 160, 157, 0, 0, 162, + 159, 0, 163, 15, 161 }; /* YYPGOTO[NTERM-NUM]. */ const signed char BisonParser::yypgoto_[] = { - -75, -75, -75, -75, -6, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75 + -77, -77, -77, -77, -6, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77 }; /* YYDEFGOTO[NTERM-NUM]. */ const short int BisonParser::yydefgoto_[] = { - -1, 1, 2, 39, 45, 152, 40, 78, 143, 174, - 149, 197, 224, 233, 237, 241, 47, 155, 168, 171, - 214, 217, 165, 187, 221, 190, 193, 194, 202, 200, - 230, 159, 205 + -1, 1, 2, 39, 45, 153, 40, 79, 144, 176, + 150, 199, 226, 235, 239, 243, 47, 156, 170, 173, + 216, 219, 167, 189, 223, 192, 195, 196, 204, 202, + 232, 160, 207 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1813,64 +1825,64 @@ const unsigned char BisonParser::yytable_[] = { - 49, 180, 181, 182, 183, 184, 185, 188, 186, 191, - 158, 3, 212, 189, 215, 192, 213, 46, 216, 175, - 176, 150, 151, 179, 153, 154, 80, 166, 167, 199, - 201, 203, 204, 79, 48, 41, 42, 43, 44, 208, - 209, 210, 206, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 211, 169, 170, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 41, 42, - 43, 44, 172, 173, 177, 178, 4, 5, 6, 160, - 7, 8, 9, 10, 11, 12, 13, 156, 195, 196, - 219, 220, 14, 15, 198, 218, 16, 161, 162, 163, - 17, 164, 18, 223, 231, 232, 19, 234, 20, 21, - 235, 207, 22, 238, 236, 23, 24, 25, 26, 27, - 28, 29, 30, 144, 145, 146, 147, 148, 239, 31, - 157, 32, 33, 242, 0, 34, 0, 0, 0, 41, - 42, 43, 44, 35, 0, 0, 0, 0, 222, 36, - 37, 38, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 0, 71, 72, 73, 74, 75, 76, - 0, 225, 226, 227, 228, 229, 0, 0, 0, 0, - 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, + 49, 182, 183, 184, 185, 186, 187, 190, 188, 193, + 159, 161, 214, 191, 217, 194, 215, 3, 218, 177, + 178, 151, 152, 181, 46, 81, 154, 155, 80, 201, + 203, 205, 206, 48, 41, 42, 43, 44, 210, 211, + 212, 200, 208, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 213, 168, 169, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 41, 42, + 43, 44, 220, 4, 5, 6, 225, 7, 8, 9, + 10, 11, 12, 13, 157, 171, 172, 174, 175, 14, + 15, 179, 180, 16, 197, 198, 233, 17, 234, 18, + 221, 222, 236, 19, 237, 240, 20, 21, 238, 241, + 22, 244, 209, 23, 24, 25, 26, 27, 28, 29, + 30, 162, 163, 164, 0, 165, 166, 31, 158, 32, + 33, 0, 0, 34, 0, 0, 0, 41, 42, 43, + 44, 35, 145, 146, 147, 148, 149, 36, 37, 38, + 224, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 0, 71, 72, 73, 74, 75, 76, 77, + 227, 228, 229, 230, 231, 0, 0, 0, 0, 0, + 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77 + 0, 0, 0, 0, 78 }; /* YYCHECK. */ const short int BisonParser::yycheck_[] = { - 6, 50, 51, 52, 53, 54, 55, 51, 57, 51, - 16, 0, 79, 57, 79, 57, 83, 79, 83, 25, - 26, 21, 22, 29, 21, 22, 100, 37, 38, 35, - 36, 37, 38, 80, 6, 80, 81, 82, 83, 24, - 25, 26, 48, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 71, 37, 38, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 80, 81, - 82, 83, 40, 41, 83, 84, 3, 4, 5, 81, - 7, 8, 9, 10, 11, 12, 13, 28, 60, 61, - 50, 51, 19, 20, 80, 83, 23, 30, 31, 32, - 27, 34, 29, 86, 84, 87, 33, 83, 35, 36, - 84, 157, 39, 83, 85, 42, 43, 44, 45, 46, - 47, 48, 49, 14, 15, 16, 17, 18, 84, 56, - 71, 58, 59, 83, -1, 62, -1, -1, -1, 80, - 81, 82, 83, 70, -1, -1, -1, -1, 194, 76, - 77, 78, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, -1, 111, 112, 113, 114, 115, 116, - -1, 71, 72, 73, 74, 75, -1, -1, -1, -1, - -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, + 6, 51, 52, 53, 54, 55, 56, 52, 58, 52, + 16, 17, 80, 58, 80, 58, 84, 0, 84, 25, + 26, 21, 22, 29, 80, 101, 21, 22, 81, 35, + 36, 37, 38, 6, 81, 82, 83, 84, 24, 25, + 26, 81, 48, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 72, 38, 39, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 81, 82, + 83, 84, 84, 3, 4, 5, 87, 7, 8, 9, + 10, 11, 12, 13, 28, 38, 39, 41, 42, 19, + 20, 84, 85, 23, 61, 62, 85, 27, 88, 29, + 51, 52, 84, 33, 85, 84, 36, 37, 86, 85, + 40, 84, 158, 43, 44, 45, 46, 47, 48, 49, + 50, 30, 31, 32, -1, 34, 35, 57, 72, 59, + 60, -1, -1, 63, -1, -1, -1, 81, 82, 83, + 84, 71, 14, 15, 16, 17, 18, 77, 78, 79, + 196, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, -1, 112, 113, 114, 115, 116, 117, 118, + 72, 73, 74, 75, 76, -1, -1, -1, -1, -1, + -1, -1, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 151 + -1, -1, -1, -1, 153 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -1878,31 +1890,31 @@ const unsigned char BisonParser::yystos_[] = { - 0, 183, 184, 0, 3, 4, 5, 7, 8, 9, + 0, 185, 186, 0, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 19, 20, 23, 27, 29, 33, - 35, 36, 39, 42, 43, 44, 45, 46, 47, 48, - 49, 56, 58, 59, 62, 70, 76, 77, 78, 185, - 188, 80, 81, 82, 83, 186, 79, 198, 6, 186, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 111, 112, 113, 114, 115, 116, 151, 189, 80, - 100, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 190, 14, 15, 16, 17, 18, 192, - 21, 22, 187, 21, 22, 199, 28, 71, 186, 213, - 81, 30, 31, 32, 34, 204, 37, 38, 200, 37, - 38, 201, 40, 41, 191, 186, 186, 83, 84, 186, - 50, 51, 52, 53, 54, 55, 57, 205, 51, 57, - 207, 51, 57, 208, 209, 60, 61, 193, 80, 186, - 211, 186, 210, 186, 186, 214, 186, 186, 24, 25, - 26, 71, 79, 83, 202, 79, 83, 203, 83, 50, - 51, 206, 186, 86, 194, 71, 72, 73, 74, 75, - 212, 84, 87, 195, 83, 84, 85, 196, 83, 84, - 186, 197, 83 + 36, 37, 40, 43, 44, 45, 46, 47, 48, 49, + 50, 57, 59, 60, 63, 71, 77, 78, 79, 187, + 190, 81, 82, 83, 84, 188, 80, 200, 6, 188, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 112, 113, 114, 115, 116, 117, 118, 153, 191, + 81, 101, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 192, 14, 15, 16, 17, 18, + 194, 21, 22, 189, 21, 22, 201, 28, 72, 188, + 215, 188, 30, 31, 32, 34, 35, 206, 38, 39, + 202, 38, 39, 203, 41, 42, 193, 188, 188, 84, + 85, 188, 51, 52, 53, 54, 55, 56, 58, 207, + 52, 58, 209, 52, 58, 210, 211, 61, 62, 195, + 81, 188, 213, 188, 212, 188, 188, 216, 188, 188, + 24, 25, 26, 72, 80, 84, 204, 80, 84, 205, + 84, 51, 52, 208, 188, 87, 196, 72, 73, 74, + 75, 76, 214, 85, 88, 197, 84, 85, 86, 198, + 84, 85, 188, 199, 84 }; #if YYDEBUG @@ -1929,7 +1941,7 @@ 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436 + 435, 436, 437, 438 }; #endif @@ -1937,28 +1949,28 @@ const unsigned char BisonParser::yyr1_[] = { - 0, 182, 183, 184, 184, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 186, 186, 186, 186, 187, 187, 188, - 188, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 190, 190, 190, 190, 191, 191, 191, 192, 192, 192, - 192, 192, 192, 193, 193, 194, 194, 195, 195, 196, - 196, 197, 197, 198, 199, 199, 200, 200, 201, 201, - 202, 202, 203, 203, 204, 204, 204, 204, 205, 205, - 205, 205, 205, 205, 205, 206, 206, 207, 207, 208, - 208, 209, 209, 210, 211, 211, 212, 212, 212, 212, - 212, 213, 213, 213, 213, 213, 213, 213, 213, 214, - 214 + 0, 184, 185, 186, 186, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 188, 188, 188, 188, 189, 189, 190, + 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 193, 193, 193, 194, 194, + 194, 194, 194, 194, 195, 195, 196, 196, 197, 197, + 198, 198, 199, 199, 200, 201, 201, 202, 202, 203, + 203, 204, 204, 205, 205, 206, 206, 206, 206, 206, + 207, 207, 207, 207, 207, 207, 207, 208, 208, 209, + 209, 210, 210, 211, 211, 212, 213, 213, 214, 214, + 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, + 215, 216, 216 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1973,20 +1985,20 @@ 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 0, 3, 0, 3, 0, - 3, 0, 1, 1, 1, 1, 1, 2, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2, 2, 2, 1, 0, - 1 + 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 0, 3, 0, 3, + 0, 3, 0, 1, 1, 1, 1, 1, 2, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, + 1, 0, 1 }; #if YYDEBUG @@ -2000,43 +2012,43 @@ "_LOG", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE", "_SPLIT", "_PROCESS_BITSTREAM", "MCS", "BIN", "_DUMP", "DUMP_PLM", "DUMP_PMC_CDO", "DUMP_BOOT_FILES", "_DUMP_DIR", "DUMP_SLAVE_PDIS", "_ARCH", "ZYNQ", - "ZYNQMP", "VERSAL", "_R", "FPGA", "_DUAL_QSPI_MODE", "_DUAL_OSPI_MODE", - "PARALLEL", "STACKED", "_W", "ON", "OFF", "_NOAUTHBLOCKS", "_ZYNQMPES1", - "_OVERLAYCDO", "_EFUSEPPKBITS", "_GENERATE_HASHES", "_PADIMAGEHEADER", - "_SPKSIGNATURE", "_GENERATE_KEYS", "PEM", "RSA", "ECDSAP521", "AUTH", - "GREY", "METAL", "_SECUREDEBUG", "ECDSA", "_AUTHJTAG", "_ENCRYPT", - "BBRAM", "EFUSE", "_P_TOK", "_INTERFACE", "SMAPx8", "SMAPx16", "SMAPx32", - "SPI", "BPIx8", "BPIx16", "_READ", "READ_BH", "READ_IHT", "READ_IH", - "READ_PHT", "READ_AC", "_VERIFY", "_VERIFYKDF", "_ZYNQMPENCRDUMP", - "HEXVALUE", "IDENTIFIER", "FILENAME", "QFILENAME", "HEXSTRING", "EQUALS", - "HMAC", "STARTCBC", "KEY0", "COMMA", "HBIFHELP", "HARCH", "HIMAGE", - "HFILL", "HO", "HP", "HW", "HEFUSEPPKBITS", "HGENHASHES", "HLEGACY", - "HPADHDR", "H_SPKSIGN", "HPACKAGE", "HENCRYPT", "HGENKEYS", "HDQSPI", - "HLOG", "HZYNQMPES1", "HPROCESSBIT", "HNONBOOTING", "HENCRDUMP", - "HPOSTPROCESS", "HVERIFY", "HSECUREDEBUG", "HREAD", "HVERIFYKDF", - "HDUMP", "HDUMPDIR", "H_BIF_INIT", "H_BIF_UDFBH", "H_BIF_AES", - "H_BIF_PPK", "H_BIF_PSK", "H_BIF_SPK", "H_BIF_SSK", "H_BIF_SPKSIGN", - "H_BIF_HIVEC", "H_BIF_HDRSIGN", "H_BIF_BOOTIMAGE", "H_BIF_BL", - "H_BIF_PID", "H_BIF_ENCR", "H_BIF_AUTH", "H_BIF_CHKSM", - "H_BIF_ELYHNDOFF", "H_BIF_BHSIGN", "H_BIF_POWNER", "H_BIF_PRESIGN", - "H_BIF_UDF", "H_BIF_XIP", "H_BIF_ALIGN", "H_BIF_OFFSET", "H_BIF_RES", - "H_BIF_LOAD", "H_BIF_TZ", "H_BIF_STARTUP", "H_BIF_KEYSRC", - "H_BIF_FSBLCFG", "H_BIF_BOOTDEV", "H_BIF_DESTCPU", "H_BIF_DESTDEV", - "H_BIF_EL", "H_SPLIT", "H_BIF_AUTHPARAM", "H_BIF_BHKEY", "H_BIF_PFW", - "H_BIF_BLOCKS", "H_BIF_METAL", "H_BIF_BHIV", "H_BIF_BOOTVEC", - "H_BIF_PUFDATA", "H_BIF_PTYPE", "H_BIF_IMAGECFG", "H_BIF_PMCCONFIG", - "H_BIF_AARCH32", "H_BIF_BIGENDIAN", "H_BIF_BOOTCONFIG", "H_BIF_COPY", - "H_BIF_CORE", "H_BIF_DELAY_HANDOFF", "H_BIF_DELAY_LOAD", "H_BIF_FILE", - "H_BIF_ID", "H_BIF_IMAGE", "H_BIF_METAHDR", "H_BIF_NAME", - "H_BIF_PARTITION", "H_BIF_SLR", "H_BIF_TYPE", "H_BIF_KEYSRCENCR", - "H_BIF_PARENTID", "H_DPACM_ENABLE", "H_BIF_USERKEYS", "$accept", "top", - "option_list", "option", "filename", "memsplit", "filloption", - "helpoption", "bifhelpoption", "wopt", "loglevel", "keysource", - "startcbc", "key0", "hmac", "keyfile", "number", "bitfile_type", - "qpsi_mode", "opsi_mode", "qspi_size", "ospi_size", "archOptions", - "key_type", "auth_key_options", "auth_type", "authJtagOptions", - "authJtagType", "verifyImageOptions", "readImageOptions", "readType", - "dumpOptions", "encrDumpOptions", YY_NULL + "ZYNQMP", "VERSAL", "_R", "FPGA", "VERSALNET", "_DUAL_QSPI_MODE", + "_DUAL_OSPI_MODE", "PARALLEL", "STACKED", "_W", "ON", "OFF", + "_NOAUTHBLOCKS", "_ZYNQMPES1", "_OVERLAYCDO", "_EFUSEPPKBITS", + "_GENERATE_HASHES", "_PADIMAGEHEADER", "_SPKSIGNATURE", "_GENERATE_KEYS", + "PEM", "RSA", "ECDSAP521", "AUTH", "GREY", "METAL", "_SECUREDEBUG", + "ECDSA", "_AUTHJTAG", "_ENCRYPT", "BBRAM", "EFUSE", "_P_TOK", + "_INTERFACE", "SMAPx8", "SMAPx16", "SMAPx32", "SPI", "BPIx8", "BPIx16", + "_READ", "READ_BH", "READ_IHT", "READ_IH", "READ_PHT", "READ_AC", + "_VERIFY", "_VERIFYKDF", "_ZYNQMPENCRDUMP", "HEXVALUE", "IDENTIFIER", + "FILENAME", "QFILENAME", "HEXSTRING", "EQUALS", "HMAC", "STARTCBC", + "KEY0", "COMMA", "HBIFHELP", "HARCH", "HIMAGE", "HFILL", "HO", "HP", + "HW", "HEFUSEPPKBITS", "HGENHASHES", "HLEGACY", "HPADHDR", "H_SPKSIGN", + "HPACKAGE", "HENCRYPT", "HGENKEYS", "HDQSPI", "HLOG", "HZYNQMPES1", + "HPROCESSBIT", "HNONBOOTING", "HENCRDUMP", "HPOSTPROCESS", "HVERIFY", + "HSECUREDEBUG", "HREAD", "HVERIFYKDF", "HDUMP", "HDUMPDIR", "HOVLCDO", + "H_BIF_INIT", "H_BIF_UDFBH", "H_BIF_AES", "H_BIF_PPK", "H_BIF_PSK", + "H_BIF_SPK", "H_BIF_SSK", "H_BIF_SPKSIGN", "H_BIF_HIVEC", + "H_BIF_HDRSIGN", "H_BIF_BOOTIMAGE", "H_BIF_BL", "H_BIF_PID", + "H_BIF_ENCR", "H_BIF_AUTH", "H_BIF_CHKSM", "H_BIF_ELYHNDOFF", + "H_BIF_BHSIGN", "H_BIF_POWNER", "H_BIF_PRESIGN", "H_BIF_UDF", + "H_BIF_XIP", "H_BIF_ALIGN", "H_BIF_OFFSET", "H_BIF_RES", "H_BIF_LOAD", + "H_BIF_TZ", "H_BIF_STARTUP", "H_BIF_KEYSRC", "H_BIF_FSBLCFG", + "H_BIF_BOOTDEV", "H_BIF_DESTCPU", "H_BIF_DESTDEV", "H_BIF_EL", "H_SPLIT", + "H_BIF_AUTHPARAM", "H_BIF_BHKEY", "H_BIF_PFW", "H_BIF_BLOCKS", + "H_BIF_METAL", "H_BIF_BHIV", "H_BIF_BOOTVEC", "H_BIF_PUFDATA", + "H_BIF_PTYPE", "H_BIF_IMAGECFG", "H_BIF_PMCCONFIG", "H_BIF_AARCH32", + "H_BIF_BIGENDIAN", "H_BIF_BOOTCONFIG", "H_BIF_COPY", "H_BIF_CORE", + "H_BIF_DELAY_HANDOFF", "H_BIF_DELAY_LOAD", "H_BIF_FILE", "H_BIF_ID", + "H_BIF_IMAGE", "H_BIF_METAHDR", "H_BIF_NAME", "H_BIF_PARTITION", + "H_BIF_SLR", "H_BIF_TYPE", "H_BIF_KEYSRCENCR", "H_BIF_PARENTID", + "H_DPACM_ENABLE", "H_BIF_USERKEYS", "$accept", "top", "option_list", + "option", "filename", "memsplit", "filloption", "helpoption", + "bifhelpoption", "wopt", "loglevel", "keysource", "startcbc", "key0", + "hmac", "keyfile", "number", "bitfile_type", "qpsi_mode", "opsi_mode", + "qspi_size", "ospi_size", "archOptions", "key_type", "auth_key_options", + "auth_type", "authJtagOptions", "authJtagType", "verifyImageOptions", + "readImageOptions", "readType", "dumpOptions", "encrDumpOptions", YY_NULL }; @@ -2044,53 +2056,53 @@ const BisonParser::rhs_number_type BisonParser::yyrhs_[] = { - 183, 0, -1, 184, -1, -1, 184, 185, -1, 3, - 186, -1, 19, 187, -1, 188, -1, 5, 6, 186, - -1, 5, 186, -1, 62, 80, -1, 39, 191, -1, - 13, 192, -1, 7, 189, -1, 12, 190, -1, 59, - 193, 194, 195, 196, 197, -1, 45, 186, -1, 46, - -1, 10, -1, 9, -1, 47, -1, 47, 84, 83, - -1, 47, 83, -1, 20, 199, -1, 35, 200, -1, - 36, 201, -1, 48, 186, -1, 11, 80, -1, 29, - 204, -1, 33, -1, 42, -1, 49, 205, -1, 8, - -1, 78, 214, -1, 43, -1, 56, 207, -1, 58, - 208, -1, 70, 211, -1, 76, 210, -1, 23, 213, - -1, 27, 81, -1, 77, 186, -1, 44, 186, -1, - 83, -1, 80, -1, 81, -1, 82, -1, 21, -1, - 22, -1, 4, -1, 4, 198, -1, -1, 89, -1, - 90, -1, 91, -1, 92, -1, 151, -1, 93, -1, - 94, -1, 95, -1, 96, -1, 97, -1, 98, -1, - 99, -1, 100, -1, 101, -1, 102, -1, 103, -1, - 104, -1, 105, -1, 106, -1, 107, -1, 108, -1, - 109, -1, 111, -1, 114, -1, 113, -1, 112, -1, - 115, -1, 116, -1, -1, 117, -1, 118, -1, 119, - -1, 120, -1, 121, -1, 122, -1, 123, -1, 124, - -1, 126, -1, 127, -1, 128, -1, 130, -1, 129, - -1, 131, -1, 132, -1, 135, -1, 136, -1, 137, - -1, 138, -1, 139, -1, 140, -1, 141, -1, 142, - -1, 144, -1, 145, -1, 146, -1, 147, -1, 148, - -1, 149, -1, 150, -1, 143, -1, 152, -1, 153, - -1, 154, -1, 155, -1, 157, -1, 156, -1, 133, - -1, 125, -1, 134, -1, 151, -1, 100, -1, 158, - -1, 159, -1, 163, -1, 164, -1, 165, -1, 166, - -1, 167, -1, 168, -1, 169, -1, 170, -1, 171, - -1, 172, -1, 173, -1, 174, -1, 179, -1, 175, - -1, 176, -1, 177, -1, 178, -1, 180, -1, 181, - -1, -1, 40, -1, 41, -1, -1, 14, -1, 15, - -1, 16, -1, 17, -1, 18, -1, 60, -1, 61, - -1, -1, 86, 84, 83, -1, -1, 87, 84, 83, - -1, -1, 85, 84, 83, -1, -1, 186, -1, 79, - -1, 21, -1, 22, -1, 37, -1, 38, 202, -1, - 37, -1, 38, 203, -1, 79, -1, 83, -1, 79, - -1, 83, -1, 30, -1, 31, -1, 32, -1, 34, - -1, 53, 206, -1, 54, -1, 55, -1, 50, -1, - 51, -1, 57, -1, 52, -1, 50, -1, 51, -1, - 57, -1, 51, -1, 209, 186, -1, 209, -1, 57, - -1, 51, -1, 186, -1, 186, -1, 186, 212, -1, - 71, -1, 72, -1, 73, -1, 74, -1, 75, -1, - 71, -1, 186, 71, -1, 71, 186, -1, 186, -1, - 186, 24, -1, 186, 25, -1, 186, 26, -1, 28, - -1, -1, 186, -1 + 185, 0, -1, 186, -1, -1, 186, 187, -1, 3, + 188, -1, 19, 189, -1, 190, -1, 5, 6, 188, + -1, 5, 188, -1, 63, 81, -1, 40, 193, -1, + 13, 194, -1, 7, 191, -1, 12, 192, -1, 60, + 195, 196, 197, 198, 199, -1, 46, 188, -1, 47, + -1, 10, -1, 9, -1, 48, -1, 48, 85, 84, + -1, 48, 84, -1, 20, 201, -1, 36, 202, -1, + 37, 203, -1, 49, 188, -1, 11, 81, -1, 29, + 206, -1, 33, -1, 43, -1, 50, 207, -1, 8, + -1, 79, 216, -1, 44, -1, 57, 209, -1, 59, + 210, -1, 71, 213, -1, 77, 212, -1, 23, 215, + -1, 27, 188, -1, 78, 188, -1, 45, 188, -1, + 84, -1, 81, -1, 82, -1, 83, -1, 21, -1, + 22, -1, 4, -1, 4, 200, -1, -1, 90, -1, + 91, -1, 92, -1, 93, -1, 153, -1, 94, -1, + 95, -1, 96, -1, 97, -1, 98, -1, 99, -1, + 100, -1, 101, -1, 102, -1, 103, -1, 104, -1, + 105, -1, 106, -1, 107, -1, 108, -1, 109, -1, + 110, -1, 112, -1, 115, -1, 114, -1, 113, -1, + 116, -1, 117, -1, 118, -1, -1, 119, -1, 120, + -1, 121, -1, 122, -1, 123, -1, 124, -1, 125, + -1, 126, -1, 128, -1, 129, -1, 130, -1, 132, + -1, 131, -1, 133, -1, 134, -1, 137, -1, 138, + -1, 139, -1, 140, -1, 141, -1, 142, -1, 143, + -1, 144, -1, 146, -1, 147, -1, 148, -1, 149, + -1, 150, -1, 151, -1, 152, -1, 145, -1, 154, + -1, 155, -1, 156, -1, 157, -1, 159, -1, 158, + -1, 135, -1, 127, -1, 136, -1, 153, -1, 101, + -1, 160, -1, 161, -1, 165, -1, 166, -1, 167, + -1, 168, -1, 169, -1, 170, -1, 171, -1, 172, + -1, 173, -1, 174, -1, 175, -1, 176, -1, 181, + -1, 177, -1, 178, -1, 179, -1, 180, -1, 182, + -1, 183, -1, -1, 41, -1, 42, -1, -1, 14, + -1, 15, -1, 16, -1, 17, -1, 18, -1, 61, + -1, 62, -1, -1, 87, 85, 84, -1, -1, 88, + 85, 84, -1, -1, 86, 85, 84, -1, -1, 188, + -1, 80, -1, 21, -1, 22, -1, 38, -1, 39, + 204, -1, 38, -1, 39, 205, -1, 80, -1, 84, + -1, 80, -1, 84, -1, 30, -1, 31, -1, 32, + -1, 34, -1, 35, -1, 54, 208, -1, 55, -1, + 56, -1, 51, -1, 52, -1, 58, -1, 53, -1, + 51, -1, 52, -1, 58, -1, 52, -1, 211, 188, + -1, 211, -1, 58, -1, 52, -1, 188, -1, 188, + -1, 188, 214, -1, 72, -1, 73, -1, 74, -1, + 75, -1, 76, -1, 72, -1, 188, 72, -1, 72, + 188, -1, 188, -1, 188, 24, -1, 188, 25, -1, + 188, 26, -1, 28, -1, -1, 188, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -2106,20 +2118,20 @@ 134, 137, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, - 194, 195, 197, 199, 201, 203, 205, 207, 209, 211, + 194, 196, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, - 313, 315, 317, 319, 321, 322, 324, 326, 327, 329, - 331, 333, 335, 337, 339, 341, 342, 346, 347, 351, - 352, 356, 357, 359, 361, 363, 365, 367, 370, 372, - 375, 377, 379, 381, 383, 385, 387, 389, 391, 394, - 396, 398, 400, 402, 404, 406, 408, 410, 412, 414, - 417, 419, 421, 423, 425, 427, 430, 432, 434, 436, - 438, 440, 442, 445, 448, 450, 453, 456, 459, 461, - 462 + 313, 315, 317, 319, 321, 323, 324, 326, 328, 329, + 331, 333, 335, 337, 339, 341, 343, 344, 348, 349, + 353, 354, 358, 359, 361, 363, 365, 367, 369, 372, + 374, 377, 379, 381, 383, 385, 387, 389, 391, 393, + 395, 398, 400, 402, 404, 406, 408, 410, 412, 414, + 416, 418, 421, 423, 425, 427, 429, 431, 434, 436, + 438, 440, 442, 444, 446, 449, 452, 454, 457, 460, + 463, 465, 466 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ @@ -2134,20 +2146,20 @@ 159, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 195, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 263, 264, 265, 268, 269, 270, - 271, 272, 273, 276, 277, 280, 280, 281, 281, 282, - 282, 283, 283, 285, 287, 288, 291, 292, 295, 296, - 299, 300, 303, 304, 307, 308, 309, 310, 313, 314, - 315, 316, 317, 318, 319, 322, 323, 326, 328, 331, - 332, 334, 336, 340, 343, 345, 348, 349, 350, 351, - 352, 355, 356, 358, 360, 362, 364, 366, 368, 371, - 372 + 257, 258, 259, 260, 261, 264, 265, 266, 269, 270, + 271, 272, 273, 274, 277, 278, 281, 281, 282, 282, + 283, 283, 284, 284, 286, 288, 289, 292, 293, 296, + 297, 300, 301, 304, 305, 308, 309, 310, 311, 312, + 315, 316, 317, 318, 319, 320, 321, 324, 325, 328, + 330, 333, 334, 336, 338, 342, 345, 347, 350, 351, + 352, 353, 354, 357, 358, 360, 362, 364, 366, 368, + 370, 373, 374 }; // Print the state stack on the debug stream. @@ -2230,7 +2242,7 @@ 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181 + 175, 176, 177, 178, 179, 180, 181, 182, 183 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; @@ -2245,18 +2257,18 @@ const int BisonParser::yyfinal_ = 3; const int BisonParser::yyterror_ = 1; const int BisonParser::yyerrcode_ = 256; - const int BisonParser::yyntokens_ = 182; + const int BisonParser::yyntokens_ = 184; - const unsigned int BisonParser::yyuser_token_number_max_ = 436; + const unsigned int BisonParser::yyuser_token_number_max_ = 438; const BisonParser::token_number_type BisonParser::yyundef_token_ = 2; /* Line 1141 of lalr1.cc */ #line 23 "../../s/cmdoptions.y" } // CO /* Line 1141 of lalr1.cc */ -#line 2258 "cmdoptions.tab.cpp" +#line 2270 "cmdoptions.tab.cpp" /* Line 1142 of lalr1.cc */ -#line 375 "../../s/cmdoptions.y" +#line 377 "../../s/cmdoptions.y" @@ -2401,6 +2413,10 @@ std::cout << DUMPDIRHELP << std::endl; break; + case CO::BisonParser::token::HOVLCDO: + std::cout << OVERLAYCDO << std::endl; + break; + case 0: std::cout << HELP << std::endl; break; diff -Nru xilinx-bootgen-2021.2/cmdoptions.tab.hpp xilinx-bootgen-2022.2/cmdoptions.tab.hpp --- xilinx-bootgen-2021.2/cmdoptions.tab.hpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cmdoptions.tab.hpp 2022-09-26 06:24:42.000000000 +0000 @@ -134,153 +134,155 @@ VERSAL = 287, _R = 288, FPGA = 289, - _DUAL_QSPI_MODE = 290, - _DUAL_OSPI_MODE = 291, - PARALLEL = 292, - STACKED = 293, - _W = 294, - ON = 295, - OFF = 296, - _NOAUTHBLOCKS = 297, - _ZYNQMPES1 = 298, - _OVERLAYCDO = 299, - _EFUSEPPKBITS = 300, - _GENERATE_HASHES = 301, - _PADIMAGEHEADER = 302, - _SPKSIGNATURE = 303, - _GENERATE_KEYS = 304, - PEM = 305, - RSA = 306, - ECDSAP521 = 307, - AUTH = 308, - GREY = 309, - METAL = 310, - _SECUREDEBUG = 311, - ECDSA = 312, - _AUTHJTAG = 313, - _ENCRYPT = 314, - BBRAM = 315, - EFUSE = 316, - _P_TOK = 317, - _INTERFACE = 318, - SMAPx8 = 319, - SMAPx16 = 320, - SMAPx32 = 321, - SPI = 322, - BPIx8 = 323, - BPIx16 = 324, - _READ = 325, - READ_BH = 326, - READ_IHT = 327, - READ_IH = 328, - READ_PHT = 329, - READ_AC = 330, - _VERIFY = 331, - _VERIFYKDF = 332, - _ZYNQMPENCRDUMP = 333, - HEXVALUE = 334, - IDENTIFIER = 335, - FILENAME = 336, - QFILENAME = 337, - HEXSTRING = 338, - EQUALS = 339, - HMAC = 340, - STARTCBC = 341, - KEY0 = 342, - COMMA = 343, - HBIFHELP = 344, - HARCH = 345, - HIMAGE = 346, - HFILL = 347, - HO = 348, - HP = 349, - HW = 350, - HEFUSEPPKBITS = 351, - HGENHASHES = 352, - HLEGACY = 353, - HPADHDR = 354, - H_SPKSIGN = 355, - HPACKAGE = 356, - HENCRYPT = 357, - HGENKEYS = 358, - HDQSPI = 359, - HLOG = 360, - HZYNQMPES1 = 361, - HPROCESSBIT = 362, - HNONBOOTING = 363, - HENCRDUMP = 364, - HPOSTPROCESS = 365, - HVERIFY = 366, - HSECUREDEBUG = 367, - HREAD = 368, - HVERIFYKDF = 369, - HDUMP = 370, - HDUMPDIR = 371, - H_BIF_INIT = 372, - H_BIF_UDFBH = 373, - H_BIF_AES = 374, - H_BIF_PPK = 375, - H_BIF_PSK = 376, - H_BIF_SPK = 377, - H_BIF_SSK = 378, - H_BIF_SPKSIGN = 379, - H_BIF_HIVEC = 380, - H_BIF_HDRSIGN = 381, - H_BIF_BOOTIMAGE = 382, - H_BIF_BL = 383, - H_BIF_PID = 384, - H_BIF_ENCR = 385, - H_BIF_AUTH = 386, - H_BIF_CHKSM = 387, - H_BIF_ELYHNDOFF = 388, - H_BIF_BHSIGN = 389, - H_BIF_POWNER = 390, - H_BIF_PRESIGN = 391, - H_BIF_UDF = 392, - H_BIF_XIP = 393, - H_BIF_ALIGN = 394, - H_BIF_OFFSET = 395, - H_BIF_RES = 396, - H_BIF_LOAD = 397, - H_BIF_TZ = 398, - H_BIF_STARTUP = 399, - H_BIF_KEYSRC = 400, - H_BIF_FSBLCFG = 401, - H_BIF_BOOTDEV = 402, - H_BIF_DESTCPU = 403, - H_BIF_DESTDEV = 404, - H_BIF_EL = 405, - H_SPLIT = 406, - H_BIF_AUTHPARAM = 407, - H_BIF_BHKEY = 408, - H_BIF_PFW = 409, - H_BIF_BLOCKS = 410, - H_BIF_METAL = 411, - H_BIF_BHIV = 412, - H_BIF_BOOTVEC = 413, - H_BIF_PUFDATA = 414, - H_BIF_PTYPE = 415, - H_BIF_IMAGECFG = 416, - H_BIF_PMCCONFIG = 417, - H_BIF_AARCH32 = 418, - H_BIF_BIGENDIAN = 419, - H_BIF_BOOTCONFIG = 420, - H_BIF_COPY = 421, - H_BIF_CORE = 422, - H_BIF_DELAY_HANDOFF = 423, - H_BIF_DELAY_LOAD = 424, - H_BIF_FILE = 425, - H_BIF_ID = 426, - H_BIF_IMAGE = 427, - H_BIF_METAHDR = 428, - H_BIF_NAME = 429, - H_BIF_PARTITION = 430, - H_BIF_SLR = 431, - H_BIF_TYPE = 432, - H_BIF_KEYSRCENCR = 433, - H_BIF_PARENTID = 434, - H_DPACM_ENABLE = 435, - H_BIF_USERKEYS = 436 + VERSALNET = 290, + _DUAL_QSPI_MODE = 291, + _DUAL_OSPI_MODE = 292, + PARALLEL = 293, + STACKED = 294, + _W = 295, + ON = 296, + OFF = 297, + _NOAUTHBLOCKS = 298, + _ZYNQMPES1 = 299, + _OVERLAYCDO = 300, + _EFUSEPPKBITS = 301, + _GENERATE_HASHES = 302, + _PADIMAGEHEADER = 303, + _SPKSIGNATURE = 304, + _GENERATE_KEYS = 305, + PEM = 306, + RSA = 307, + ECDSAP521 = 308, + AUTH = 309, + GREY = 310, + METAL = 311, + _SECUREDEBUG = 312, + ECDSA = 313, + _AUTHJTAG = 314, + _ENCRYPT = 315, + BBRAM = 316, + EFUSE = 317, + _P_TOK = 318, + _INTERFACE = 319, + SMAPx8 = 320, + SMAPx16 = 321, + SMAPx32 = 322, + SPI = 323, + BPIx8 = 324, + BPIx16 = 325, + _READ = 326, + READ_BH = 327, + READ_IHT = 328, + READ_IH = 329, + READ_PHT = 330, + READ_AC = 331, + _VERIFY = 332, + _VERIFYKDF = 333, + _ZYNQMPENCRDUMP = 334, + HEXVALUE = 335, + IDENTIFIER = 336, + FILENAME = 337, + QFILENAME = 338, + HEXSTRING = 339, + EQUALS = 340, + HMAC = 341, + STARTCBC = 342, + KEY0 = 343, + COMMA = 344, + HBIFHELP = 345, + HARCH = 346, + HIMAGE = 347, + HFILL = 348, + HO = 349, + HP = 350, + HW = 351, + HEFUSEPPKBITS = 352, + HGENHASHES = 353, + HLEGACY = 354, + HPADHDR = 355, + H_SPKSIGN = 356, + HPACKAGE = 357, + HENCRYPT = 358, + HGENKEYS = 359, + HDQSPI = 360, + HLOG = 361, + HZYNQMPES1 = 362, + HPROCESSBIT = 363, + HNONBOOTING = 364, + HENCRDUMP = 365, + HPOSTPROCESS = 366, + HVERIFY = 367, + HSECUREDEBUG = 368, + HREAD = 369, + HVERIFYKDF = 370, + HDUMP = 371, + HDUMPDIR = 372, + HOVLCDO = 373, + H_BIF_INIT = 374, + H_BIF_UDFBH = 375, + H_BIF_AES = 376, + H_BIF_PPK = 377, + H_BIF_PSK = 378, + H_BIF_SPK = 379, + H_BIF_SSK = 380, + H_BIF_SPKSIGN = 381, + H_BIF_HIVEC = 382, + H_BIF_HDRSIGN = 383, + H_BIF_BOOTIMAGE = 384, + H_BIF_BL = 385, + H_BIF_PID = 386, + H_BIF_ENCR = 387, + H_BIF_AUTH = 388, + H_BIF_CHKSM = 389, + H_BIF_ELYHNDOFF = 390, + H_BIF_BHSIGN = 391, + H_BIF_POWNER = 392, + H_BIF_PRESIGN = 393, + H_BIF_UDF = 394, + H_BIF_XIP = 395, + H_BIF_ALIGN = 396, + H_BIF_OFFSET = 397, + H_BIF_RES = 398, + H_BIF_LOAD = 399, + H_BIF_TZ = 400, + H_BIF_STARTUP = 401, + H_BIF_KEYSRC = 402, + H_BIF_FSBLCFG = 403, + H_BIF_BOOTDEV = 404, + H_BIF_DESTCPU = 405, + H_BIF_DESTDEV = 406, + H_BIF_EL = 407, + H_SPLIT = 408, + H_BIF_AUTHPARAM = 409, + H_BIF_BHKEY = 410, + H_BIF_PFW = 411, + H_BIF_BLOCKS = 412, + H_BIF_METAL = 413, + H_BIF_BHIV = 414, + H_BIF_BOOTVEC = 415, + H_BIF_PUFDATA = 416, + H_BIF_PTYPE = 417, + H_BIF_IMAGECFG = 418, + H_BIF_PMCCONFIG = 419, + H_BIF_AARCH32 = 420, + H_BIF_BIGENDIAN = 421, + H_BIF_BOOTCONFIG = 422, + H_BIF_COPY = 423, + H_BIF_CORE = 424, + H_BIF_DELAY_HANDOFF = 425, + H_BIF_DELAY_LOAD = 426, + H_BIF_FILE = 427, + H_BIF_ID = 428, + H_BIF_IMAGE = 429, + H_BIF_METAHDR = 430, + H_BIF_NAME = 431, + H_BIF_PARTITION = 432, + H_BIF_SLR = 433, + H_BIF_TYPE = 434, + H_BIF_KEYSRCENCR = 435, + H_BIF_PARENTID = 436, + H_DPACM_ENABLE = 437, + H_BIF_USERKEYS = 438 }; }; @@ -457,7 +459,7 @@ #line 23 "../../s/cmdoptions.y" } // CO /* Line 33 of lalr1.cc */ -#line 461 "cmdoptions.tab.hpp" +#line 463 "cmdoptions.tab.hpp" diff -Nru xilinx-bootgen-2021.2/cmdoptions.y xilinx-bootgen-2022.2/cmdoptions.y --- xilinx-bootgen-2021.2/cmdoptions.y 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cmdoptions.y 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ %token _LOG ERROR WARNING INFO DEBUG TRACE %token _SPLIT _PROCESS_BITSTREAM MCS BIN %token _DUMP DUMP_PLM DUMP_PMC_CDO DUMP_BOOT_FILES _DUMP_DIR DUMP_SLAVE_PDIS -%token _ARCH ZYNQ ZYNQMP VERSAL _R FPGA +%token _ARCH ZYNQ ZYNQMP VERSAL _R FPGA VERSALNET %token _DUAL_QSPI_MODE _DUAL_OSPI_MODE PARALLEL STACKED %token _W ON OFF %token _NOAUTHBLOCKS _ZYNQMPES1 _OVERLAYCDO @@ -89,7 +89,7 @@ %token HBIFHELP HARCH HIMAGE HFILL HO HP HW HEFUSEPPKBITS HGENHASHES HLEGACY HPADHDR H_SPKSIGN %token HPACKAGE HENCRYPT HGENKEYS HDQSPI HLOG HZYNQMPES1 HPROCESSBIT HNONBOOTING HENCRDUMP HPOSTPROCESS -%token HVERIFY HSECUREDEBUG HREAD HVERIFYKDF HDUMP HDUMPDIR +%token HVERIFY HSECUREDEBUG HREAD HVERIFYKDF HDUMP HDUMPDIR HOVLCDO %token H_BIF_INIT H_BIF_UDFBH H_BIF_AES H_BIF_PPK H_BIF_PSK H_BIF_SPK H_BIF_SSK H_BIF_SPKSIGN H_BIF_HIVEC %token H_BIF_HDRSIGN H_BIF_BOOTIMAGE H_BIF_BL H_BIF_PID H_BIF_ENCR H_BIF_AUTH H_BIF_CHKSM H_BIF_ELYHNDOFF H_BIF_BHSIGN @@ -142,7 +142,7 @@ | _READ readImageOptions | _VERIFY verifyImageOptions | _DUMP dumpOptions - | _DUMP_DIR FILENAME { options.SetDumpDirectory($2); } + | _DUMP_DIR filename { options.SetDumpDirectory($2); } | _VERIFYKDF filename { options.SetKDFTestVectorFile($2); } | _OVERLAYCDO filename { options.SetOverlayCDOFileName($2); } ; @@ -192,6 +192,7 @@ | HSECUREDEBUG { ShowCmdHelp(CO::BisonParser::token::HSECUREDEBUG); exit(0); } | HDUMP { ShowCmdHelp(CO::BisonParser::token::HDUMP); exit(0); } | HDUMPDIR { ShowCmdHelp(CO::BisonParser::token::HDUMPDIR); exit(0); } + | HOVLCDO { ShowCmdHelp(CO::BisonParser::token::HOVLCDO); exit(0); } ; bifhelpoption : /* empty */ { ShowBifHelp(0); exit(0); } @@ -308,6 +309,7 @@ | ZYNQMP { options.SetArchType(Arch::ZYNQMP); } | VERSAL { options.SetArchType(Arch::VERSAL); } | FPGA { options.SetArchType(Arch::FPGA); } + | VERSALNET { options.SetArchType(Arch::VERSALNET); } ; key_type : AUTH auth_key_options @@ -516,6 +518,10 @@ std::cout << DUMPDIRHELP << std::endl; break; + case CO::BisonParser::token::HOVLCDO: + std::cout << OVERLAYCDO << std::endl; + break; + case 0: std::cout << HELP << std::endl; break; diff -Nru xilinx-bootgen-2021.2/cmdoptions.yy.cpp xilinx-bootgen-2022.2/cmdoptions.yy.cpp --- xilinx-bootgen-2021.2/cmdoptions.yy.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/cmdoptions.yy.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -406,8 +406,8 @@ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 181 -#define YY_END_OF_BUFFER 182 +#define YY_NUM_RULES 183 +#define YY_END_OF_BUFFER 184 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -415,119 +415,121 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1010] = +static yyconst flex_int16_t yy_accept[1023] = { 0, - 0, 0, 182, 180, 178, 179, 176, 180, 37, 175, - 175, 176, 174, 174, 36, 174, 175, 175, 175, 175, - 174, 174, 174, 174, 174, 174, 175, 175, 7, 175, - 175, 175, 175, 87, 88, 175, 175, 175, 175, 175, - 89, 175, 175, 178, 179, 176, 0, 0, 175, 175, - 175, 175, 175, 175, 175, 175, 81, 175, 175, 175, - 6, 8, 68, 175, 175, 9, 175, 1, 176, 174, - 175, 0, 175, 175, 175, 174, 74, 174, 175, 175, - 175, 174, 70, 175, 175, 175, 175, 175, 174, 175, - 175, 174, 174, 174, 175, 175, 175, 174, 175, 175, - - 175, 175, 175, 175, 175, 119, 72, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 10, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 177, 0, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 0, - 2, 176, 3, 0, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 31, 175, 175, - 175, 175, 175, 174, 175, 175, 175, 175, 175, 175, - - 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 71, 175, 175, 175, 175, 175, 175, - 99, 30, 175, 175, 175, 175, 11, 175, 175, 175, - 175, 53, 73, 140, 40, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 54, 175, 175, 125, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 0, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 12, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 22, 26, - 175, 175, 175, 175, 84, 52, 175, 175, 175, 175, - - 175, 175, 175, 175, 114, 115, 175, 175, 175, 175, - 175, 109, 175, 175, 175, 175, 175, 175, 175, 118, - 86, 67, 175, 175, 175, 175, 23, 175, 15, 128, - 27, 175, 175, 151, 175, 122, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 108, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 126, 175, 175, 175, 175, 175, - 175, 64, 63, 175, 175, 175, 175, 39, 175, 175, - 5, 175, 82, 175, 175, 175, 175, 175, 175, 175, - 175, 69, 175, 175, 175, 175, 175, 175, 175, 175, - - 175, 175, 175, 20, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 16, 175, 175, 175, 175, 175, - 175, 57, 21, 175, 13, 175, 175, 175, 175, 175, - 167, 85, 175, 175, 175, 175, 175, 175, 143, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 169, 175, 175, 175, - 17, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 38, 175, 175, 175, 175, 175, 4, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 28, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - - 175, 163, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 127, 92, 175, 175, 175, 149, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 129, 175, 175, 104, 66, 175, 175, 65, 175, - 175, 175, 175, 175, 175, 175, 175, 45, 175, 175, - 175, 175, 175, 175, 175, 175, 76, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - - 175, 175, 175, 175, 175, 96, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 41, 175, 131, 145, 175, 132, 175, 150, 175, 175, - 133, 175, 134, 35, 175, 152, 175, 175, 175, 175, - 14, 175, 175, 175, 175, 175, 175, 175, 175, 19, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 24, 175, 175, 175, 175, 175, 175, 175, 175, - 83, 175, 175, 175, 175, 175, 175, 175, 142, 175, - 175, 175, 175, 175, 110, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - - 175, 34, 175, 175, 175, 175, 171, 175, 175, 175, - 25, 175, 146, 173, 175, 147, 175, 175, 18, 175, - 175, 44, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 148, 175, 175, - 164, 175, 175, 175, 175, 175, 175, 137, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 56, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 124, 123, 175, 175, 175, 175, 175, 159, 175, - 100, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 79, 175, 130, 175, - - 175, 161, 175, 112, 175, 175, 42, 138, 175, 175, - 117, 175, 175, 175, 175, 58, 59, 175, 139, 175, - 175, 175, 175, 175, 175, 121, 102, 175, 175, 175, - 175, 175, 175, 175, 43, 175, 105, 175, 175, 175, - 175, 175, 175, 175, 175, 60, 175, 175, 175, 175, - 175, 175, 75, 175, 160, 175, 168, 113, 155, 170, - 175, 175, 175, 175, 175, 175, 175, 175, 154, 175, - 175, 175, 175, 175, 95, 175, 175, 162, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 80, - 62, 175, 175, 175, 175, 111, 175, 175, 175, 175, - - 172, 175, 175, 90, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 94, 175, 175, 175, 47, - 175, 175, 175, 78, 175, 175, 175, 61, 175, 175, - 116, 175, 175, 175, 166, 175, 175, 175, 97, 175, - 175, 55, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 51, 175, 175, 175, 175, 141, 175, 175, 98, - 175, 175, 175, 175, 175, 93, 175, 175, 175, 175, - 33, 32, 175, 175, 46, 175, 175, 175, 156, 175, - 103, 158, 91, 136, 175, 144, 175, 175, 175, 77, - 48, 175, 175, 175, 175, 175, 175, 106, 175, 175, - - 49, 107, 175, 153, 101, 50, 29, 157, 0 + 0, 0, 184, 182, 180, 181, 178, 182, 37, 177, + 177, 178, 176, 176, 36, 176, 177, 177, 177, 177, + 176, 176, 176, 176, 176, 176, 177, 177, 7, 177, + 177, 177, 177, 88, 89, 177, 177, 177, 177, 177, + 90, 177, 177, 180, 181, 178, 0, 0, 177, 177, + 177, 177, 177, 177, 177, 177, 82, 177, 177, 177, + 6, 8, 69, 177, 177, 9, 177, 1, 178, 176, + 177, 0, 177, 177, 177, 176, 75, 176, 177, 177, + 177, 176, 71, 177, 177, 177, 177, 177, 176, 177, + 177, 176, 176, 176, 177, 177, 177, 176, 177, 177, + + 177, 177, 177, 177, 177, 121, 73, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 10, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 179, 0, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 0, 2, 178, 3, 0, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 31, 177, + 177, 177, 177, 177, 176, 177, 177, 177, 177, 177, + + 177, 176, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 72, 177, 177, 177, 177, 177, + 177, 100, 30, 177, 177, 177, 177, 11, 177, 177, + 177, 177, 177, 53, 74, 142, 40, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 54, 177, 177, 127, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 0, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 12, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 22, 26, 177, 177, 177, 177, 85, 52, 177, 177, + + 177, 177, 177, 177, 177, 177, 116, 117, 177, 177, + 177, 177, 177, 110, 177, 177, 177, 177, 177, 177, + 177, 120, 87, 67, 177, 177, 177, 177, 23, 177, + 15, 130, 27, 177, 177, 153, 177, 124, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 109, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 128, 177, 177, + 177, 177, 177, 177, 64, 63, 177, 177, 177, 177, + 39, 177, 177, 5, 177, 83, 177, 177, 177, 177, + 177, 177, 177, 177, 70, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 177, 20, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 16, 177, 177, + 177, 177, 177, 177, 57, 21, 177, 13, 177, 177, + 177, 177, 177, 169, 86, 177, 177, 177, 177, 177, + 177, 177, 145, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 171, 177, 177, 177, 17, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 38, 177, 177, 177, + 177, 177, 4, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 28, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 165, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 129, 93, 177, + 177, 177, 151, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 131, 177, 177, 105, + 66, 177, 177, 65, 177, 177, 177, 177, 177, 177, + 177, 177, 45, 177, 177, 177, 177, 177, 177, 177, + 177, 77, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 97, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 41, 177, 133, 147, + 177, 134, 177, 152, 177, 177, 135, 177, 136, 35, + 177, 154, 177, 177, 177, 177, 177, 14, 177, 177, + 177, 177, 177, 177, 177, 177, 19, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 24, 177, + 177, 177, 177, 177, 177, 177, 177, 84, 177, 177, + 177, 177, 177, 177, 177, 144, 177, 177, 177, 177, + 177, 111, 177, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 177, 177, 177, 177, 34, + 177, 177, 177, 177, 173, 177, 177, 177, 25, 177, + 148, 175, 177, 177, 149, 177, 177, 18, 177, 177, + 44, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 150, 177, 177, 166, + 177, 177, 177, 177, 177, 177, 139, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 56, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 126, 125, 177, 177, 177, 177, 177, 161, 177, + 68, 101, 177, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 177, 177, 80, 177, 132, + 177, 177, 163, 177, 114, 177, 177, 42, 140, 177, + 177, 119, 177, 177, 177, 177, 58, 59, 177, 141, + 177, 177, 177, 177, 177, 177, 123, 103, 177, 177, + 177, 177, 177, 177, 177, 177, 43, 177, 106, 177, + 177, 177, 177, 177, 177, 177, 177, 60, 177, 177, + 177, 177, 177, 177, 76, 177, 162, 177, 170, 115, + 157, 172, 177, 177, 177, 177, 177, 177, 177, 177, + 156, 177, 177, 177, 177, 177, 112, 96, 177, 177, + 164, 177, 177, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 81, 62, 177, 177, 177, 177, 113, 177, + 177, 177, 177, 174, 177, 177, 91, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 95, 177, + 177, 177, 47, 177, 177, 177, 79, 177, 177, 177, + 61, 177, 177, 118, 177, 177, 177, 168, 177, 177, + 177, 98, 177, 177, 55, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 51, 177, 177, 177, 177, 143, + 177, 177, 99, 177, 177, 177, 177, 177, 94, 177, + 177, 177, 177, 33, 32, 177, 177, 46, 177, 177, + 177, 158, 177, 104, 160, 92, 138, 177, 146, 177, + + 177, 177, 78, 48, 177, 177, 177, 177, 177, 177, + 107, 177, 177, 49, 108, 177, 155, 102, 50, 29, + 159, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -572,132 +574,133 @@ 6, 6, 6, 6, 6, 6, 6, 6, 6 } ; -static yyconst flex_int16_t yy_base[1016] = +static yyconst flex_int16_t yy_base[1029] = { 0, - 0, 0, 1234, 1235, 58, 1230, 0, 59, 0, 88, - 114, 54, 162, 51, 1235, 137, 1212, 59, 46, 130, + 0, 0, 1247, 1248, 58, 1243, 0, 59, 0, 88, + 114, 54, 162, 51, 1248, 137, 1225, 59, 46, 130, 200, 182, 184, 172, 213, 235, 47, 170, 226, 144, - 202, 169, 61, 239, 276, 223, 245, 242, 251, 168, - 60, 238, 151, 85, 1228, 0, 1224, 152, 0, 0, - 32, 1187, 157, 209, 1186, 1189, 1188, 1179, 180, 1176, - 1168, 234, 1184, 204, 1183, 0, 1162, 1235, 330, 245, - 340, 203, 1197, 1160, 1183, 248, 250, 288, 1174, 1179, - 1161, 258, 249, 273, 1165, 1164, 1173, 255, 335, 1176, - 277, 310, 311, 315, 1173, 1157, 1171, 340, 1161, 1165, - - 1169, 1156, 1168, 1146, 1166, 0, 1146, 1164, 287, 1139, - 1156, 309, 1143, 1141, 1147, 1145, 1152, 1151, 0, 1142, - 345, 1142, 1134, 1149, 1139, 337, 1140, 345, 1139, 1143, - 350, 1147, 1144, 257, 344, 1135, 1144, 290, 1128, 1137, - 1137, 1123, 1122, 1123, 1124, 1235, 328, 1134, 1116, 1129, - 1132, 301, 1112, 1129, 1119, 1116, 1117, 1127, 1120, 1119, - 351, 1120, 358, 1109, 1122, 1119, 355, 1103, 1106, 1149, - 1235, 402, 0, 0, 1127, 1138, 1098, 1112, 1103, 1106, - 1104, 1103, 1109, 1098, 1099, 1107, 1106, 0, 1102, 1084, - 1100, 1077, 1096, 359, 1099, 1079, 1095, 1085, 1080, 1083, - - 376, 1075, 1075, 1077, 1086, 1081, 122, 1088, 1076, 1082, - 1082, 1080, 1081, 0, 1076, 1067, 1061, 389, 1079, 1075, - 0, 0, 1077, 1072, 1074, 1054, 1055, 1068, 1061, 1062, - 377, 0, 0, 0, 0, 1070, 1063, 1062, 1048, 1063, - 1059, 1064, 1059, 1057, 0, 1040, 1038, 0, 373, 1050, - 1052, 378, 1054, 1037, 1050, 1054, 1035, 375, 1038, 1051, - 1033, 1076, 1040, 1039, 1046, 1024, 1032, 1027, 1023, 1023, - 1028, 1034, 1022, 1030, 1035, 0, 1014, 1032, 1015, 1021, - 1022, 1027, 1025, 1007, 1008, 1017, 1016, 1007, 0, 0, - 1003, 1014, 1016, 1006, 0, 386, 1006, 1013, 1010, 1008, - - 1010, 1003, 393, 1002, 0, 0, 1005, 986, 1001, 996, - 1008, 1007, 981, 1004, 999, 978, 984, 985, 988, 0, - 0, 0, 999, 980, 992, 993, 0, 990, 0, 0, - 0, 976, 990, 0, 984, 0, 976, 971, 984, 970, - 986, 973, 973, 970, 974, 979, 958, 971, 970, 973, - 968, 970, 0, 957, 956, 968, 963, 962, 950, 960, - 957, 947, 961, 945, 0, 383, 953, 957, 961, 952, - 947, 946, 0, 953, 949, 949, 955, 954, 948, 927, - 0, 933, 0, 945, 946, 928, 932, 934, 944, 931, - 938, 0, 924, 932, 920, 933, 925, 946, 954, 910, - - 921, 917, 918, 0, 906, 916, 924, 914, 908, 395, - 913, 910, 919, 904, 0, 922, 907, 920, 902, 914, - 917, 940, 899, 898, 0, 893, 887, 908, 909, 891, - 0, 0, 905, 882, 901, 890, 901, 883, 0, 895, - 900, 888, 879, 878, 893, 896, 883, 887, 874, 880, - 882, 868, 884, 888, 875, 879, 0, 873, 879, 385, - 0, 857, 874, 880, 875, 854, 866, 863, 861, 859, - 860, 868, 0, 392, 868, 855, 854, 868, 0, 843, - 859, 851, 864, 857, 862, 843, 856, 853, 0, 834, - 842, 867, 875, 849, 849, 852, 832, 404, 850, 838, - - 845, 0, 833, 842, 837, 844, 843, 840, 821, 404, - 840, 835, 820, 829, 829, 820, 819, 814, 824, 821, - 816, 810, 810, 828, 0, 826, 806, 824, 0, 819, - 816, 817, 821, 811, 804, 809, 812, 802, 796, 809, - 801, 807, 807, 794, 804, 794, 802, 802, 803, 788, - 788, 0, 782, 776, 800, 0, 792, 794, 792, 776, - 783, 775, 774, 783, 775, 770, 769, 0, 786, 767, - 761, 780, 777, 764, 778, 767, 780, 774, 787, 777, - 767, 761, 756, 764, 763, 762, 750, 753, 759, 753, - 744, 753, 757, 759, 742, 748, 759, 744, 738, 743, - - 740, 737, 753, 429, 742, 743, 736, 745, 735, 743, - 738, 741, 741, 735, 723, 728, 736, 728, 730, 723, - 0, 724, 0, 0, 736, 0, 730, 0, 729, 729, - 0, 731, 0, 0, 728, 0, 716, 728, 709, 716, - 0, 721, 706, 715, 707, 706, 705, 702, 708, 709, - 712, 704, 706, 714, 699, 707, 711, 705, 708, 697, - 675, 0, 674, 674, 662, 680, 54, 136, 192, 262, - 0, 402, 408, 408, 413, 414, 415, 406, 0, 408, - 422, 415, 424, 417, 0, 413, 442, 448, 428, 416, - 418, 408, 428, 435, 429, 423, 433, 425, 435, 440, - - 434, 0, 439, 430, 444, 444, 0, 445, 439, 429, - 0, 445, 0, 0, 447, 0, 472, 450, 0, 445, - 446, 0, 454, 442, 458, 444, 446, 458, 461, 455, - 462, 463, 446, 463, 488, 454, 465, 0, 458, 471, - 0, 468, 456, 461, 467, 474, 459, 0, 461, 462, - 477, 478, 468, 482, 485, 482, 504, 508, 480, 476, - 491, 0, 483, 485, 480, 492, 479, 491, 495, 487, - 496, 0, 502, 496, 495, 484, 487, 486, 0, 502, - 0, 508, 510, 511, 503, 499, 506, 512, 509, 514, - 506, 515, 512, 501, 502, 518, 0, 521, 0, 507, - - 507, 0, 523, 0, 522, 525, 0, 0, 512, 517, - 0, 519, 522, 522, 521, 0, 0, 517, 538, 527, - 533, 540, 537, 542, 526, 0, 0, 534, 541, 546, - 533, 544, 530, 544, 0, 534, 0, 533, 541, 542, - 536, 557, 557, 554, 549, 0, 546, 557, 562, 544, - 558, 548, 0, 562, 0, 563, 0, 0, 0, 0, - 563, 570, 566, 558, 568, 556, 572, 572, 0, 559, - 554, 560, 556, 577, 0, 579, 561, 0, 566, 577, - 582, 583, 574, 575, 572, 588, 574, 569, 576, 0, - 0, 592, 578, 589, 594, 0, 596, 586, 596, 600, - - 0, 601, 600, 0, 586, 586, 601, 591, 590, 596, - 588, 609, 601, 596, 604, 0, 614, 615, 616, 0, - 600, 614, 604, 0, 619, 605, 613, 0, 617, 614, - 0, 613, 625, 626, 0, 619, 628, 629, 0, 617, - 616, 0, 619, 633, 621, 639, 631, 637, 638, 631, - 640, 0, 628, 629, 647, 629, 0, 629, 629, 0, - 636, 641, 635, 650, 647, 0, 639, 653, 652, 640, - 0, 0, 645, 643, 0, 658, 657, 664, 0, 657, - 0, 0, 0, 0, 652, 0, 667, 664, 669, 0, - 0, 670, 667, 666, 671, 661, 663, 0, 670, 665, - - 0, 0, 674, 0, 0, 0, 0, 0, 1235, 710, - 715, 717, 722, 728, 734 + 202, 169, 61, 239, 276, 223, 259, 242, 228, 168, + 60, 248, 151, 85, 1241, 0, 1237, 152, 0, 0, + 32, 1200, 157, 242, 1199, 1202, 1201, 1192, 180, 1189, + 1181, 237, 1197, 204, 1196, 0, 1175, 1248, 330, 225, + 340, 203, 1210, 1173, 1196, 252, 245, 267, 1187, 1192, + 1174, 284, 268, 266, 1178, 1177, 1186, 291, 335, 1189, + 314, 292, 336, 314, 1186, 1170, 1184, 315, 1174, 1178, + + 1182, 1169, 1181, 1159, 1179, 0, 1159, 1177, 287, 1152, + 1169, 251, 1156, 1154, 1160, 1158, 1165, 1164, 0, 1164, + 1154, 345, 1154, 1146, 1161, 1151, 347, 1152, 346, 1151, + 1155, 351, 1159, 1156, 265, 344, 1147, 1156, 352, 1140, + 1149, 1149, 1135, 1134, 1135, 1136, 1248, 226, 1146, 1128, + 1141, 1144, 356, 1124, 1141, 1131, 1128, 1129, 1139, 1132, + 1131, 357, 1132, 361, 1121, 1134, 1131, 355, 1115, 1118, + 1161, 1248, 406, 0, 0, 1139, 1150, 1110, 1124, 1115, + 1118, 1116, 1115, 1121, 1110, 1111, 1119, 1118, 0, 1114, + 1096, 1112, 1089, 1108, 364, 1111, 1091, 1107, 1097, 1092, + + 1095, 380, 1087, 1087, 1089, 1098, 1093, 122, 1100, 1088, + 1094, 1094, 1092, 1093, 0, 1088, 1079, 1073, 295, 1091, + 1087, 0, 0, 1089, 1084, 1086, 1066, 1067, 1067, 1079, + 1072, 1073, 381, 0, 0, 0, 0, 1081, 1074, 1073, + 1059, 1074, 1070, 1075, 1070, 1068, 0, 1051, 1049, 0, + 377, 1061, 1063, 369, 1065, 1048, 1061, 1065, 1046, 381, + 1049, 1062, 1044, 1087, 1051, 1050, 1057, 1035, 1043, 1038, + 1034, 1034, 1039, 1045, 1033, 1041, 1046, 0, 1025, 1043, + 1026, 1032, 1033, 1038, 1036, 1018, 1019, 1028, 1027, 1018, + 0, 0, 1014, 1025, 1027, 1017, 0, 306, 1017, 1024, + + 1021, 1019, 1021, 1014, 397, 1013, 0, 0, 1016, 997, + 1012, 1007, 1019, 1018, 992, 1015, 1010, 989, 995, 996, + 999, 0, 0, 0, 1010, 991, 1003, 1004, 0, 1001, + 0, 0, 0, 987, 1001, 0, 995, 0, 987, 982, + 995, 987, 980, 996, 983, 983, 980, 984, 989, 968, + 981, 980, 983, 978, 980, 0, 967, 966, 978, 973, + 972, 960, 970, 967, 957, 971, 955, 0, 387, 963, + 967, 971, 962, 957, 956, 0, 963, 959, 959, 965, + 964, 958, 937, 0, 943, 0, 955, 956, 938, 942, + 944, 954, 941, 948, 0, 934, 942, 930, 943, 935, + + 956, 964, 920, 931, 927, 928, 0, 916, 926, 934, + 924, 918, 399, 923, 920, 929, 914, 0, 932, 917, + 930, 912, 924, 927, 950, 909, 908, 0, 903, 897, + 918, 919, 901, 0, 0, 915, 892, 911, 900, 911, + 893, 911, 0, 904, 909, 897, 888, 887, 902, 905, + 892, 896, 883, 889, 891, 877, 893, 897, 884, 888, + 0, 882, 888, 389, 0, 866, 883, 889, 884, 863, + 875, 872, 870, 868, 869, 877, 0, 396, 877, 864, + 863, 877, 0, 852, 868, 860, 873, 866, 871, 852, + 865, 862, 0, 843, 851, 876, 884, 858, 858, 861, + + 841, 408, 859, 847, 854, 0, 842, 851, 846, 853, + 852, 849, 830, 404, 849, 844, 829, 838, 838, 829, + 828, 823, 833, 830, 825, 819, 819, 837, 0, 835, + 815, 833, 0, 808, 827, 824, 825, 829, 819, 812, + 817, 820, 810, 804, 817, 809, 815, 815, 802, 812, + 802, 810, 810, 811, 796, 796, 0, 790, 784, 808, + 793, 799, 801, 799, 783, 790, 782, 781, 790, 782, + 777, 776, 0, 793, 774, 768, 787, 784, 771, 785, + 774, 787, 781, 794, 784, 774, 768, 763, 771, 770, + 769, 757, 760, 766, 760, 751, 760, 764, 766, 749, + + 755, 766, 751, 745, 750, 747, 744, 760, 433, 749, + 750, 743, 752, 742, 750, 745, 748, 748, 742, 730, + 749, 734, 742, 734, 736, 729, 0, 730, 0, 0, + 742, 0, 736, 0, 735, 735, 0, 737, 0, 0, + 734, 0, 722, 734, 715, 722, 727, 0, 726, 711, + 720, 712, 711, 710, 707, 713, 714, 717, 709, 698, + 700, 685, 690, 694, 52, 157, 325, 365, 0, 382, + 386, 387, 417, 417, 399, 410, 402, 0, 423, 419, + 417, 422, 423, 424, 415, 0, 417, 431, 424, 433, + 426, 0, 422, 451, 457, 437, 425, 427, 417, 437, + + 444, 438, 432, 442, 434, 444, 447, 450, 444, 0, + 449, 440, 454, 454, 0, 455, 449, 439, 0, 455, + 0, 0, 457, 442, 0, 483, 461, 0, 456, 457, + 0, 465, 453, 469, 455, 457, 469, 472, 466, 473, + 474, 457, 474, 499, 465, 476, 0, 469, 482, 0, + 479, 467, 472, 478, 485, 470, 0, 472, 473, 488, + 489, 479, 493, 496, 493, 515, 519, 491, 487, 502, + 0, 494, 496, 491, 503, 490, 502, 506, 507, 499, + 508, 0, 514, 508, 507, 496, 499, 498, 0, 514, + 0, 0, 520, 522, 523, 515, 511, 518, 524, 521, + + 526, 518, 527, 524, 513, 514, 530, 0, 533, 0, + 519, 519, 0, 535, 0, 534, 537, 0, 0, 524, + 529, 0, 531, 534, 534, 533, 0, 0, 529, 550, + 539, 545, 552, 549, 554, 538, 0, 0, 546, 543, + 554, 559, 546, 557, 543, 557, 0, 547, 0, 546, + 554, 555, 549, 570, 570, 567, 562, 0, 559, 570, + 575, 557, 571, 561, 0, 575, 0, 576, 0, 0, + 0, 0, 576, 583, 579, 571, 581, 569, 585, 585, + 0, 572, 567, 573, 569, 590, 0, 0, 592, 574, + 0, 579, 590, 595, 596, 587, 588, 585, 601, 587, + + 582, 589, 0, 0, 605, 591, 602, 607, 0, 609, + 599, 609, 613, 0, 614, 613, 0, 599, 599, 614, + 604, 603, 609, 601, 622, 614, 609, 617, 0, 627, + 628, 629, 0, 613, 627, 617, 0, 632, 618, 626, + 0, 630, 627, 0, 626, 638, 639, 0, 632, 641, + 642, 0, 630, 629, 0, 632, 646, 634, 652, 644, + 650, 651, 644, 653, 0, 641, 642, 660, 642, 0, + 642, 642, 0, 649, 654, 648, 663, 660, 0, 652, + 666, 665, 653, 0, 0, 658, 656, 0, 671, 670, + 677, 0, 670, 0, 0, 0, 0, 665, 0, 680, + + 677, 682, 0, 0, 683, 680, 679, 684, 674, 676, + 0, 683, 678, 0, 0, 687, 0, 0, 0, 0, + 0, 1248, 723, 728, 730, 735, 741, 747 } ; -static yyconst flex_int16_t yy_def[1016] = +static yyconst flex_int16_t yy_def[1029] = { 0, - 1009, 1, 1009, 1009, 1009, 1009, 1010, 1011, 1012, 1009, - 10, 1010, 11, 13, 1009, 13, 11, 11, 11, 11, + 1022, 1, 1022, 1022, 1022, 1022, 1023, 1024, 1025, 1022, + 10, 1023, 11, 13, 1022, 13, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 1009, 1009, 1010, 1013, 1013, 1012, 11, + 11, 11, 11, 1022, 1022, 1023, 1026, 1026, 1025, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 1009, 1014, 13, - 11, 1009, 11, 11, 11, 13, 13, 13, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 1022, 1027, 13, + 11, 1022, 11, 11, 11, 13, 13, 13, 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, 13, 11, 11, 13, 13, 13, 11, 11, 11, 13, 11, 11, @@ -705,20 +708,20 @@ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 1009, 1009, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 1022, 1022, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 1015, - 1009, 1014, 71, 1010, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, + 1028, 1022, 1027, 71, 1023, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 13, 11, 11, 11, 11, 11, - 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 1013, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 1026, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -800,11 +803,12 @@ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 0, 1009, - 1009, 1009, 1009, 1009, 1009 + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 0, 1022, 1022, 1022, 1022, 1022, 1022 } ; -static yyconst flex_int16_t yy_nxt[1295] = +static yyconst flex_int16_t yy_nxt[1308] = { 0, 4, 5, 6, 5, 7, 8, 4, 9, 10, 11, 12, 13, 14, 14, 14, 14, 14, 14, 14, 4, @@ -814,48 +818,48 @@ 36, 37, 38, 39, 40, 41, 42, 17, 43, 44, 68, 44, 47, 47, 69, 72, 72, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 72, 72, - 72, 50, 148, 74, 102, 149, 44, 73, 44, 740, - 47, 47, 46, 143, 115, 49, 50, 50, 46, 50, + 72, 50, 149, 74, 102, 150, 44, 73, 44, 741, + 47, 47, 46, 144, 115, 49, 50, 50, 46, 50, 50, 50, 50, 50, 50, 50, 50, 50, 116, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 46, 50, 51, 52, 50, 53, 54, 55, 56, 57, 58, 50, 50, 59, 50, 60, 61, 62, 50, 63, 64, 50, 50, 65, 66, 50, 50, 67, 50, 50, 72, - 50, 50, 50, 50, 50, 50, 72, 146, 50, 320, - 50, 50, 50, 72, 50, 50, 321, 50, 50, 50, - 72, 147, 50, 70, 70, 70, 70, 70, 70, 70, + 50, 50, 50, 50, 50, 50, 72, 147, 50, 322, + 50, 50, 50, 72, 50, 50, 323, 50, 50, 50, + 72, 148, 50, 70, 70, 70, 70, 70, 70, 70, 70, 110, 75, 70, 70, 70, 70, 72, 72, 72, - 741, 72, 71, 50, 151, 70, 70, 70, 70, 70, + 742, 72, 71, 50, 152, 70, 70, 70, 70, 70, - 70, 72, 50, 72, 113, 142, 114, 103, 145, 89, - 152, 104, 50, 174, 50, 105, 82, 159, 71, 72, - 90, 72, 83, 84, 87, 91, 85, 160, 50, 86, - 50, 88, 72, 76, 174, 77, 742, 78, 50, 111, - 50, 166, 72, 50, 79, 72, 92, 153, 93, 112, - 80, 94, 167, 81, 72, 154, 50, 72, 72, 95, - 131, 72, 106, 96, 72, 50, 107, 163, 98, 97, - 72, 108, 109, 117, 132, 50, 99, 118, 50, 144, - 50, 184, 133, 100, 164, 119, 101, 140, 50, 134, - 247, 50, 138, 135, 120, 72, 136, 137, 178, 139, - - 185, 50, 141, 192, 50, 193, 50, 248, 183, 121, - 198, 186, 187, 122, 50, 743, 123, 124, 50, 188, - 125, 126, 199, 253, 127, 216, 128, 129, 217, 130, - 170, 170, 171, 170, 267, 170, 170, 170, 262, 179, - 50, 50, 220, 254, 50, 50, 268, 201, 221, 170, - 170, 173, 173, 173, 173, 173, 173, 173, 173, 262, - 200, 173, 173, 173, 173, 50, 50, 50, 202, 194, - 50, 50, 236, 173, 173, 173, 173, 173, 173, 195, - 229, 230, 239, 243, 277, 206, 196, 249, 250, 50, - 237, 50, 240, 280, 281, 231, 50, 278, 285, 286, - - 331, 244, 170, 170, 171, 170, 50, 170, 170, 170, - 343, 357, 307, 361, 344, 50, 368, 463, 402, 464, - 549, 170, 170, 403, 358, 410, 369, 314, 362, 345, - 503, 504, 50, 505, 411, 744, 585, 412, 550, 562, - 332, 563, 586, 687, 597, 688, 745, 413, 598, 746, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 70, 72, 50, 72, 113, 143, 114, 103, 146, 89, + 153, 104, 50, 175, 50, 105, 82, 160, 71, 72, + 90, 72, 83, 84, 87, 91, 85, 161, 50, 86, + 50, 88, 72, 76, 175, 77, 264, 78, 50, 111, + 50, 167, 72, 50, 79, 72, 92, 72, 93, 112, + 80, 94, 168, 81, 72, 50, 50, 264, 72, 95, + 132, 72, 106, 96, 141, 50, 107, 72, 98, 97, + 164, 108, 109, 117, 133, 50, 99, 118, 72, 142, + 154, 50, 50, 100, 221, 119, 101, 165, 155, 145, + 222, 50, 139, 120, 121, 72, 134, 50, 249, 140, + + 185, 50, 179, 135, 187, 188, 333, 136, 50, 122, + 137, 138, 189, 123, 50, 250, 124, 125, 180, 186, + 126, 127, 50, 50, 128, 217, 129, 130, 218, 131, + 171, 171, 172, 171, 184, 171, 171, 171, 405, 193, + 50, 194, 201, 406, 50, 50, 334, 199, 50, 171, + 171, 174, 174, 174, 174, 174, 174, 174, 174, 200, + 207, 174, 174, 174, 174, 50, 50, 203, 743, 195, + 50, 50, 202, 174, 174, 174, 174, 174, 174, 196, + 231, 232, 238, 241, 245, 255, 197, 251, 252, 269, + 279, 50, 50, 242, 50, 233, 282, 283, 287, 288, + + 239, 270, 246, 280, 364, 256, 171, 171, 172, 171, + 50, 171, 171, 171, 346, 360, 744, 309, 347, 365, + 50, 467, 371, 468, 554, 171, 171, 745, 361, 413, + 746, 316, 372, 348, 507, 508, 50, 509, 414, 747, + 590, 415, 555, 567, 602, 568, 591, 694, 603, 695, + 748, 416, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, @@ -863,17 +867,17 @@ 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, - 817, 818, 819, 820, 821, 822, 824, 825, 823, 826, - 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, - 837, 838, 839, 840, 841, 842, 843, 845, 846, 844, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, - 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, + 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, + 827, 828, 829, 830, 831, 832, 833, 835, 836, 834, + 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 857, + 858, 856, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, - 897, 899, 900, 901, 898, 902, 903, 904, 905, 906, - 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, + 907, 908, 909, 910, 912, 913, 914, 911, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, @@ -884,74 +888,75 @@ 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, - 1007, 1008, 46, 739, 738, 46, 48, 48, 737, 736, - 48, 49, 49, 47, 47, 47, 735, 47, 172, 172, - 172, 172, 172, 172, 170, 170, 170, 170, 170, 170, - 734, 733, 732, 731, 730, 729, 728, 727, 726, 725, - 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, - 714, 713, 712, 711, 710, 709, 708, 707, 706, 705, - 704, 703, 702, 701, 700, 699, 698, 697, 696, 695, - 694, 693, 692, 691, 690, 689, 686, 685, 684, 683, - 682, 681, 680, 679, 678, 677, 676, 675, 674, 673, - - 672, 671, 670, 669, 668, 667, 666, 665, 664, 663, - 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, - 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, - 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, - 632, 631, 630, 629, 628, 627, 626, 625, 624, 623, - 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, - 612, 611, 610, 609, 608, 607, 606, 605, 604, 603, - 602, 601, 600, 599, 596, 595, 594, 593, 592, 591, - 590, 589, 588, 587, 584, 583, 582, 581, 580, 579, - 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, - - 568, 567, 566, 565, 564, 561, 560, 559, 558, 557, - 556, 555, 554, 553, 552, 551, 548, 547, 546, 545, - 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, - 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, - 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 506, 502, - 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, - 471, 470, 469, 468, 467, 466, 465, 462, 461, 460, - - 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, - 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, - 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, - 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, - 419, 418, 417, 416, 415, 414, 409, 408, 407, 406, - 405, 404, 401, 400, 399, 398, 397, 396, 395, 394, - 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, - 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, - 373, 1009, 372, 371, 370, 367, 366, 365, 364, 363, - 360, 359, 356, 355, 354, 353, 352, 351, 350, 349, - - 348, 347, 346, 342, 341, 340, 339, 338, 337, 336, - 335, 334, 333, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 318, 317, 316, 315, 313, 312, 311, - 310, 309, 308, 306, 305, 304, 303, 302, 301, 300, - 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, - 289, 171, 288, 287, 284, 283, 282, 279, 276, 275, - 274, 273, 272, 271, 270, 269, 266, 265, 264, 263, - 261, 260, 259, 258, 257, 256, 255, 252, 251, 246, - 245, 242, 241, 238, 235, 234, 233, 232, 228, 227, - 226, 225, 224, 223, 222, 219, 218, 215, 214, 213, - - 212, 211, 210, 209, 208, 207, 205, 204, 203, 197, - 191, 190, 189, 182, 181, 180, 177, 176, 175, 169, - 168, 165, 162, 161, 158, 157, 156, 155, 150, 146, - 45, 72, 45, 1009, 3, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009 + 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, + 1017, 1018, 1019, 1020, 1021, 46, 740, 739, 46, 48, + 48, 738, 737, 48, 49, 49, 47, 47, 47, 736, + 47, 173, 173, 173, 173, 173, 173, 171, 171, 171, + 171, 171, 171, 735, 734, 733, 732, 731, 730, 729, + 728, 727, 726, 725, 724, 723, 722, 721, 720, 719, + 718, 717, 716, 715, 714, 713, 712, 711, 710, 709, + 708, 707, 706, 705, 704, 703, 702, 701, 700, 699, + 698, 697, 696, 693, 692, 691, 690, 689, 688, 687, + + 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, + 676, 675, 674, 673, 672, 671, 670, 669, 668, 667, + 666, 665, 664, 663, 662, 661, 660, 659, 658, 657, + 656, 655, 654, 653, 652, 651, 650, 649, 648, 647, + 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, + 636, 635, 634, 633, 632, 631, 630, 629, 628, 627, + 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, + 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, + 606, 605, 604, 601, 600, 599, 598, 597, 596, 595, + 594, 593, 592, 589, 588, 587, 586, 585, 584, 583, + + 582, 581, 580, 579, 578, 577, 576, 575, 574, 573, + 572, 571, 570, 569, 566, 565, 564, 563, 562, 561, + 560, 559, 558, 557, 556, 553, 552, 551, 550, 549, + 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, + 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, + 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, + 518, 517, 516, 515, 514, 513, 512, 511, 510, 506, + 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, + 495, 494, 493, 492, 491, 490, 489, 488, 487, 486, + 485, 484, 483, 482, 481, 480, 479, 478, 477, 476, + + 475, 474, 473, 472, 471, 470, 469, 466, 465, 464, + 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, + 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, + 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, + 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, + 423, 422, 421, 420, 419, 418, 417, 412, 411, 410, + 409, 408, 407, 404, 403, 402, 401, 400, 399, 398, + 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, + 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, + 377, 376, 1022, 375, 374, 373, 370, 369, 368, 367, + + 366, 363, 362, 359, 358, 357, 356, 355, 354, 353, + 352, 351, 350, 349, 345, 344, 343, 342, 341, 340, + 339, 338, 337, 336, 335, 332, 331, 330, 329, 328, + 327, 326, 325, 324, 321, 320, 319, 318, 317, 315, + 314, 313, 312, 311, 310, 308, 307, 306, 305, 304, + 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, + 293, 292, 291, 172, 290, 289, 286, 285, 284, 281, + 278, 277, 276, 275, 274, 273, 272, 271, 268, 267, + 266, 265, 263, 262, 261, 260, 259, 258, 257, 254, + 253, 248, 247, 244, 243, 240, 237, 236, 235, 234, + + 230, 229, 228, 227, 226, 225, 224, 223, 220, 219, + 216, 215, 214, 213, 212, 211, 210, 209, 208, 206, + 205, 204, 198, 192, 191, 190, 183, 182, 181, 178, + 177, 176, 170, 169, 166, 163, 162, 159, 158, 157, + 156, 151, 147, 45, 72, 45, 1022, 3, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022 } ; -static yyconst flex_int16_t yy_chk[1295] = +static yyconst flex_int16_t yy_chk[1308] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -961,7 +966,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 12, 5, 8, 8, 12, 19, 27, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 18, 41, - 33, 14, 51, 19, 27, 51, 44, 18, 44, 667, + 33, 14, 51, 19, 27, 51, 44, 18, 44, 665, 8, 8, 10, 41, 33, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 14, 33, 10, @@ -969,136 +974,137 @@ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 20, - 11, 11, 11, 11, 11, 11, 16, 48, 11, 207, - 11, 11, 11, 30, 11, 11, 207, 16, 11, 11, + 11, 11, 11, 11, 11, 11, 16, 48, 11, 208, + 11, 11, 11, 30, 11, 11, 208, 16, 11, 11, 43, 48, 11, 13, 13, 13, 13, 13, 13, 13, 13, 30, 20, 13, 13, 13, 13, 40, 32, 28, - 668, 24, 13, 16, 53, 13, 13, 13, 13, 13, + 666, 24, 13, 16, 53, 13, 13, 13, 13, 13, 13, 22, 24, 23, 32, 40, 32, 28, 43, 24, 53, 28, 22, 72, 23, 28, 22, 59, 13, 21, 24, 31, 22, 22, 23, 24, 22, 59, 24, 22, - 21, 23, 25, 21, 72, 21, 669, 21, 22, 31, - 23, 64, 36, 25, 21, 29, 25, 54, 25, 31, - 21, 25, 64, 21, 26, 54, 21, 42, 34, 25, - 36, 38, 29, 25, 37, 26, 29, 62, 26, 25, - 39, 29, 29, 34, 36, 70, 26, 34, 76, 42, - 77, 83, 37, 26, 62, 34, 26, 39, 82, 37, - 134, 26, 38, 37, 34, 35, 37, 37, 76, 38, - - 83, 70, 39, 88, 76, 88, 77, 134, 82, 35, - 91, 84, 84, 35, 82, 670, 35, 35, 78, 84, - 35, 35, 91, 138, 35, 109, 35, 35, 109, 35, - 69, 69, 69, 69, 152, 69, 69, 69, 147, 78, - 92, 93, 112, 138, 78, 94, 152, 93, 112, 69, - 69, 71, 71, 71, 71, 71, 71, 71, 71, 147, - 92, 71, 71, 71, 71, 89, 92, 93, 94, 89, - 98, 94, 126, 71, 71, 71, 71, 71, 71, 89, - 121, 121, 128, 131, 161, 98, 89, 135, 135, 194, - 126, 89, 128, 163, 163, 121, 98, 161, 167, 167, - - 218, 131, 172, 172, 172, 172, 201, 172, 172, 172, - 231, 249, 194, 252, 231, 194, 258, 366, 296, 366, - 460, 172, 172, 296, 249, 303, 258, 201, 252, 231, - 410, 410, 201, 410, 303, 672, 498, 303, 460, 474, - 218, 474, 498, 604, 510, 604, 673, 303, 510, 674, - 675, 676, 677, 678, 680, 681, 682, 683, 684, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, - 697, 698, 699, 700, 701, 703, 704, 705, 706, 708, - 709, 710, 712, 715, 717, 718, 720, 721, 723, 724, - 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - - 735, 736, 737, 739, 740, 742, 743, 744, 745, 746, - 747, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 763, 764, 765, 766, 764, 767, - 768, 769, 770, 771, 773, 774, 775, 776, 777, 778, - 780, 782, 783, 784, 785, 786, 787, 788, 789, 787, - 790, 791, 792, 793, 794, 795, 796, 798, 800, 801, - 803, 805, 806, 809, 810, 812, 813, 814, 815, 818, - 819, 820, 821, 822, 823, 824, 825, 828, 829, 830, - 831, 832, 833, 834, 836, 838, 839, 840, 841, 842, - 843, 844, 845, 847, 848, 849, 850, 851, 852, 854, - - 856, 861, 862, 863, 856, 864, 865, 866, 867, 868, - 870, 871, 872, 873, 874, 876, 877, 879, 880, 881, - 882, 883, 884, 885, 886, 887, 888, 889, 892, 893, - 894, 895, 897, 898, 899, 900, 900, 902, 903, 905, - 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, - 917, 918, 919, 921, 922, 923, 925, 926, 927, 929, - 930, 932, 933, 934, 936, 937, 938, 940, 941, 943, - 944, 945, 946, 947, 948, 949, 950, 951, 953, 954, - 955, 956, 958, 959, 961, 962, 963, 964, 965, 967, - 968, 969, 970, 973, 974, 976, 977, 978, 980, 985, - - 987, 988, 989, 992, 993, 994, 995, 996, 997, 999, - 1000, 1003, 1010, 666, 665, 1010, 1011, 1011, 664, 663, - 1011, 1012, 1012, 1013, 1013, 1013, 661, 1013, 1014, 1014, - 1014, 1014, 1014, 1014, 1015, 1015, 1015, 1015, 1015, 1015, - 660, 659, 658, 657, 656, 655, 654, 653, 652, 651, - 650, 649, 648, 647, 646, 645, 644, 643, 642, 640, - 639, 638, 637, 635, 632, 630, 629, 627, 625, 622, - 620, 619, 618, 617, 616, 615, 614, 613, 612, 611, - 610, 609, 608, 607, 606, 605, 603, 602, 601, 600, - 599, 598, 597, 596, 595, 594, 593, 592, 591, 590, - - 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, - 579, 578, 577, 576, 575, 574, 573, 572, 571, 570, - 569, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 555, 554, 553, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 528, 527, 526, - 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, - 514, 513, 512, 511, 509, 508, 507, 506, 505, 504, - 503, 501, 500, 499, 497, 496, 495, 494, 493, 492, - 491, 490, 488, 487, 486, 485, 484, 483, 482, 481, - - 480, 478, 477, 476, 475, 472, 471, 470, 469, 468, - 467, 466, 465, 464, 463, 462, 459, 458, 456, 455, - 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, - 444, 443, 442, 441, 440, 438, 437, 436, 435, 434, - 433, 430, 429, 428, 427, 426, 424, 423, 422, 421, - 420, 419, 418, 417, 416, 414, 413, 412, 411, 409, - 408, 407, 406, 405, 403, 402, 401, 400, 399, 398, - 397, 396, 395, 394, 393, 391, 390, 389, 388, 387, - 386, 385, 384, 382, 380, 379, 378, 377, 376, 375, - 374, 372, 371, 370, 369, 368, 367, 364, 363, 362, - - 361, 360, 359, 358, 357, 356, 355, 354, 352, 351, - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - 340, 339, 338, 337, 335, 333, 332, 328, 326, 325, - 324, 323, 319, 318, 317, 316, 315, 314, 313, 312, - 311, 310, 309, 308, 307, 304, 302, 301, 300, 299, - 298, 297, 294, 293, 292, 291, 288, 287, 286, 285, - 284, 283, 282, 281, 280, 279, 278, 277, 275, 274, - 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, - 263, 262, 261, 260, 259, 257, 256, 255, 254, 253, - 251, 250, 247, 246, 244, 243, 242, 241, 240, 239, - - 238, 237, 236, 230, 229, 228, 227, 226, 225, 224, - 223, 220, 219, 217, 216, 215, 213, 212, 211, 210, - 209, 208, 206, 205, 204, 203, 202, 200, 199, 198, - 197, 196, 195, 193, 192, 191, 190, 189, 187, 186, - 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, - 175, 170, 169, 168, 166, 165, 164, 162, 160, 159, - 158, 157, 156, 155, 154, 153, 151, 150, 149, 148, - 145, 144, 143, 142, 141, 140, 139, 137, 136, 133, - 132, 130, 129, 127, 125, 124, 123, 122, 120, 118, - 117, 116, 115, 114, 113, 111, 110, 108, 107, 105, - - 104, 103, 102, 101, 100, 99, 97, 96, 95, 90, - 87, 86, 85, 81, 80, 79, 75, 74, 73, 67, - 65, 63, 61, 60, 58, 57, 56, 55, 52, 47, - 45, 17, 6, 3, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, - 1009, 1009, 1009, 1009 + 21, 23, 25, 21, 72, 21, 148, 21, 22, 31, + 23, 64, 36, 25, 21, 29, 25, 39, 25, 31, + 21, 25, 64, 21, 26, 70, 21, 148, 34, 25, + 36, 38, 29, 25, 39, 26, 29, 42, 26, 25, + 62, 29, 29, 34, 36, 77, 26, 34, 37, 39, + 54, 70, 76, 26, 112, 34, 26, 62, 54, 42, + 112, 26, 38, 34, 34, 35, 37, 78, 135, 38, + + 83, 77, 76, 37, 84, 84, 219, 37, 76, 35, + 37, 37, 84, 35, 82, 135, 35, 35, 78, 83, + 35, 35, 92, 78, 35, 109, 35, 35, 109, 35, + 69, 69, 69, 69, 82, 69, 69, 69, 298, 88, + 82, 88, 92, 298, 94, 98, 219, 91, 92, 69, + 69, 71, 71, 71, 71, 71, 71, 71, 71, 91, + 98, 71, 71, 71, 71, 89, 93, 94, 667, 89, + 94, 98, 93, 71, 71, 71, 71, 71, 71, 89, + 122, 122, 127, 129, 132, 139, 89, 136, 136, 153, + 162, 89, 93, 129, 195, 122, 164, 164, 168, 168, + + 127, 153, 132, 162, 254, 139, 173, 173, 173, 173, + 202, 173, 173, 173, 233, 251, 668, 195, 233, 254, + 195, 369, 260, 369, 464, 173, 173, 670, 251, 305, + 671, 202, 260, 233, 413, 413, 202, 413, 305, 672, + 502, 305, 464, 478, 514, 478, 502, 609, 514, 609, + 673, 305, 674, 675, 676, 677, 679, 680, 681, 682, + 683, 684, 685, 687, 688, 689, 690, 691, 693, 694, + 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 711, 712, 713, 714, 716, + 717, 718, 720, 723, 724, 726, 727, 729, 730, 732, + + 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, + 743, 744, 745, 746, 748, 749, 751, 752, 753, 754, + 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, + 766, 767, 768, 769, 770, 772, 773, 774, 775, 773, + 776, 777, 778, 779, 780, 781, 783, 784, 785, 786, + 787, 788, 790, 793, 794, 795, 796, 797, 798, 799, + 800, 798, 801, 802, 803, 804, 805, 806, 807, 809, + 811, 812, 814, 816, 817, 820, 821, 823, 824, 825, + 826, 829, 830, 831, 832, 833, 834, 835, 836, 839, + 840, 841, 842, 843, 844, 845, 846, 848, 850, 851, + + 852, 853, 854, 855, 856, 857, 859, 860, 861, 862, + 863, 864, 866, 868, 873, 874, 875, 868, 876, 877, + 878, 879, 880, 882, 883, 884, 885, 886, 889, 890, + 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, + 902, 905, 906, 907, 908, 910, 911, 912, 913, 913, + 915, 916, 918, 919, 920, 921, 922, 923, 924, 925, + 926, 927, 928, 930, 931, 932, 934, 935, 936, 938, + 939, 940, 942, 943, 945, 946, 947, 949, 950, 951, + 953, 954, 956, 957, 958, 959, 960, 961, 962, 963, + 964, 966, 967, 968, 969, 971, 972, 974, 975, 976, + + 977, 978, 980, 981, 982, 983, 986, 987, 989, 990, + 991, 993, 998, 1000, 1001, 1002, 1005, 1006, 1007, 1008, + 1009, 1010, 1012, 1013, 1016, 1023, 664, 663, 1023, 1024, + 1024, 662, 661, 1024, 1025, 1025, 1026, 1026, 1026, 660, + 1026, 1027, 1027, 1027, 1027, 1027, 1027, 1028, 1028, 1028, + 1028, 1028, 1028, 659, 658, 657, 656, 655, 654, 653, + 652, 651, 650, 649, 647, 646, 645, 644, 643, 641, + 638, 636, 635, 633, 631, 628, 626, 625, 624, 623, + 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, + 612, 611, 610, 608, 607, 606, 605, 604, 603, 602, + + 601, 600, 599, 598, 597, 596, 595, 594, 593, 592, + 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, + 581, 580, 579, 578, 577, 576, 575, 574, 572, 571, + 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, + 560, 559, 558, 556, 555, 554, 553, 552, 551, 550, + 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, + 539, 538, 537, 536, 535, 534, 532, 531, 530, 528, + 527, 526, 525, 524, 523, 522, 521, 520, 519, 518, + 517, 516, 515, 513, 512, 511, 510, 509, 508, 507, + 505, 504, 503, 501, 500, 499, 498, 497, 496, 495, + + 494, 492, 491, 490, 489, 488, 487, 486, 485, 484, + 482, 481, 480, 479, 476, 475, 474, 473, 472, 471, + 470, 469, 468, 467, 466, 463, 462, 460, 459, 458, + 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, + 447, 446, 445, 444, 442, 441, 440, 439, 438, 437, + 436, 433, 432, 431, 430, 429, 427, 426, 425, 424, + 423, 422, 421, 420, 419, 417, 416, 415, 414, 412, + 411, 410, 409, 408, 406, 405, 404, 403, 402, 401, + 400, 399, 398, 397, 396, 394, 393, 392, 391, 390, + 389, 388, 387, 385, 383, 382, 381, 380, 379, 378, + + 377, 375, 374, 373, 372, 371, 370, 367, 366, 365, + 364, 363, 362, 361, 360, 359, 358, 357, 355, 354, + 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, + 343, 342, 341, 340, 339, 337, 335, 334, 330, 328, + 327, 326, 325, 321, 320, 319, 318, 317, 316, 315, + 314, 313, 312, 311, 310, 309, 306, 304, 303, 302, + 301, 300, 299, 296, 295, 294, 293, 290, 289, 288, + 287, 286, 285, 284, 283, 282, 281, 280, 279, 277, + 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, + 266, 265, 264, 263, 262, 261, 259, 258, 257, 256, + + 255, 253, 252, 249, 248, 246, 245, 244, 243, 242, + 241, 240, 239, 238, 232, 231, 230, 229, 228, 227, + 226, 225, 224, 221, 220, 218, 217, 216, 214, 213, + 212, 211, 210, 209, 207, 206, 205, 204, 203, 201, + 200, 199, 198, 197, 196, 194, 193, 192, 191, 190, + 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, + 178, 177, 176, 171, 170, 169, 167, 166, 165, 163, + 161, 160, 159, 158, 157, 156, 155, 154, 152, 151, + 150, 149, 146, 145, 144, 143, 142, 141, 140, 138, + 137, 134, 133, 131, 130, 128, 126, 125, 124, 123, + + 121, 120, 118, 117, 116, 115, 114, 113, 111, 110, + 108, 107, 105, 104, 103, 102, 101, 100, 99, 97, + 96, 95, 90, 87, 86, 85, 81, 80, 79, 75, + 74, 73, 67, 65, 63, 61, 60, 58, 57, 56, + 55, 52, 47, 45, 17, 6, 3, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, + 1022, 1022, 1022, 1022, 1022, 1022, 1022 } ; -static yyconst flex_int16_t yy_rule_linenum[181] = +static yyconst flex_int16_t yy_rule_linenum[183] = { 0, 42, 43, 45, 48, 49, 50, 51, 52, 54, 55, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, @@ -1106,19 +1112,20 @@ 80, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 114, - 115, 116, 118, 119, 120, 121, 122, 124, 126, 127, - 128, 129, 130, 131, 133, 134, 135, 136, 137, 138, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 115, 116, 118, 119, 120, 121, 122, 123, 125, 127, + 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, + 139, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 237, 238, 239, 240, 243, 244, 245 + 231, 232, 233, 234, 235, 239, 240, 241, 242, 245, + 246, 247 } ; /* The intent behind this definition is that it'll catch @@ -1130,7 +1137,7 @@ #define YY_RESTORE_YY_MORE_OFFSET #line 1 "../s/cmdoptions.l" /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1154,7 +1161,7 @@ typedef CO::BisonParser::token tok; #line 31 "../s/cmdoptions.l" # define YY_USER_ACTION yylloc->columns (yyleng); -#line 1158 "../bisonflex/cmdoptions.yy.cpp" +#line 1165 "../bisonflex/cmdoptions.yy.cpp" #define INITIAL 0 @@ -1320,7 +1327,7 @@ -#line 1324 "../bisonflex/cmdoptions.yy.cpp" +#line 1331 "../bisonflex/cmdoptions.yy.cpp" if ( !(yy_init) ) { @@ -1383,13 +1390,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1010 ) + if ( yy_current_state >= 1023 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 1009 ); + while ( yy_current_state != 1022 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1408,12 +1415,12 @@ { if ( yy_act == 0 ) std::cerr << "--scanner backing up\n"; - else if ( yy_act < 181 ) + else if ( yy_act < 183 ) std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << "(\"" << yytext << "\")\n"; - else if ( yy_act == 181 ) + else if ( yy_act == 183 ) std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; - else if ( yy_act == 182 ) + else if ( yy_act == 184 ) std::cerr << "--(end of buffer or a NUL)\n"; else std::cerr << "--EOF (start condition " << YY_START << ")\n"; @@ -1767,73 +1774,73 @@ YY_BREAK case 68: YY_RULE_SETUP -#line 124 "../s/cmdoptions.l" -return tok::_R; +#line 123 "../s/cmdoptions.l" +return tok::VERSALNET; YY_BREAK case 69: YY_RULE_SETUP -#line 126 "../s/cmdoptions.l" -return tok::_READ; +#line 125 "../s/cmdoptions.l" +return tok::_R; YY_BREAK case 70: YY_RULE_SETUP #line 127 "../s/cmdoptions.l" -return tok::READ_BH; +return tok::_READ; YY_BREAK case 71: YY_RULE_SETUP #line 128 "../s/cmdoptions.l" -return tok::READ_IHT; +return tok::READ_BH; YY_BREAK case 72: YY_RULE_SETUP #line 129 "../s/cmdoptions.l" -return tok::READ_IH; +return tok::READ_IHT; YY_BREAK case 73: YY_RULE_SETUP #line 130 "../s/cmdoptions.l" -return tok::READ_PHT; +return tok::READ_IH; YY_BREAK case 74: YY_RULE_SETUP #line 131 "../s/cmdoptions.l" -return tok::READ_AC; +return tok::READ_PHT; YY_BREAK case 75: YY_RULE_SETUP -#line 133 "../s/cmdoptions.l" -return tok::_VERIFYKDF; +#line 132 "../s/cmdoptions.l" +return tok::READ_AC; YY_BREAK case 76: YY_RULE_SETUP #line 134 "../s/cmdoptions.l" -return tok::_VERIFY; +return tok::_VERIFYKDF; YY_BREAK case 77: YY_RULE_SETUP #line 135 "../s/cmdoptions.l" -return tok::_ZYNQMPENCRDUMP; +return tok::_VERIFY; YY_BREAK case 78: YY_RULE_SETUP #line 136 "../s/cmdoptions.l" -return tok::_NOAUTHBLOCKS; +return tok::_ZYNQMPENCRDUMP; YY_BREAK case 79: YY_RULE_SETUP #line 137 "../s/cmdoptions.l" -return tok::_ZYNQMPES1; +return tok::_NOAUTHBLOCKS; YY_BREAK case 80: YY_RULE_SETUP #line 138 "../s/cmdoptions.l" -return tok::_OVERLAYCDO; +return tok::_ZYNQMPES1; YY_BREAK case 81: YY_RULE_SETUP -#line 140 "../s/cmdoptions.l" -return tok::_H; +#line 139 "../s/cmdoptions.l" +return tok::_OVERLAYCDO; YY_BREAK case 82: YY_RULE_SETUP @@ -1843,122 +1850,122 @@ case 83: YY_RULE_SETUP #line 142 "../s/cmdoptions.l" -return tok::HBIFHELP; +return tok::_H; YY_BREAK case 84: YY_RULE_SETUP #line 143 "../s/cmdoptions.l" -return tok::HARCH; +return tok::HBIFHELP; YY_BREAK case 85: YY_RULE_SETUP #line 144 "../s/cmdoptions.l" -return tok::HIMAGE; +return tok::HARCH; YY_BREAK case 86: YY_RULE_SETUP #line 145 "../s/cmdoptions.l" -return tok::HFILL; +return tok::HIMAGE; YY_BREAK case 87: YY_RULE_SETUP #line 146 "../s/cmdoptions.l" -return tok::HO; +return tok::HFILL; YY_BREAK case 88: YY_RULE_SETUP #line 147 "../s/cmdoptions.l" -return tok::HP; +return tok::HO; YY_BREAK case 89: YY_RULE_SETUP #line 148 "../s/cmdoptions.l" -return tok::HW; +return tok::HP; YY_BREAK case 90: YY_RULE_SETUP #line 149 "../s/cmdoptions.l" -return tok::HEFUSEPPKBITS; +return tok::HW; YY_BREAK case 91: YY_RULE_SETUP #line 150 "../s/cmdoptions.l" -return tok::HGENHASHES; +return tok::HEFUSEPPKBITS; YY_BREAK case 92: YY_RULE_SETUP #line 151 "../s/cmdoptions.l" -return tok::HLEGACY; +return tok::HGENHASHES; YY_BREAK case 93: YY_RULE_SETUP #line 152 "../s/cmdoptions.l" -return tok::HPADHDR; +return tok::HLEGACY; YY_BREAK case 94: YY_RULE_SETUP #line 153 "../s/cmdoptions.l" -return tok::H_SPKSIGN; +return tok::HPADHDR; YY_BREAK case 95: YY_RULE_SETUP #line 154 "../s/cmdoptions.l" -return tok::HPACKAGE; +return tok::H_SPKSIGN; YY_BREAK case 96: YY_RULE_SETUP #line 155 "../s/cmdoptions.l" -return tok::HENCRYPT; +return tok::HPACKAGE; YY_BREAK case 97: YY_RULE_SETUP #line 156 "../s/cmdoptions.l" -return tok::HGENKEYS; +return tok::HENCRYPT; YY_BREAK case 98: YY_RULE_SETUP #line 157 "../s/cmdoptions.l" -return tok::HDQSPI; +return tok::HGENKEYS; YY_BREAK case 99: YY_RULE_SETUP #line 158 "../s/cmdoptions.l" -return tok::HLOG; +return tok::HDQSPI; YY_BREAK case 100: YY_RULE_SETUP #line 159 "../s/cmdoptions.l" -return tok::HZYNQMPES1; +return tok::HLOG; YY_BREAK case 101: YY_RULE_SETUP #line 160 "../s/cmdoptions.l" -return tok::HPROCESSBIT; +return tok::HZYNQMPES1; YY_BREAK case 102: YY_RULE_SETUP #line 161 "../s/cmdoptions.l" -return tok::HNONBOOTING; +return tok::HPROCESSBIT; YY_BREAK case 103: YY_RULE_SETUP #line 162 "../s/cmdoptions.l" -return tok::HENCRDUMP; +return tok::HNONBOOTING; YY_BREAK case 104: YY_RULE_SETUP #line 163 "../s/cmdoptions.l" -return tok::HVERIFY; +return tok::HENCRDUMP; YY_BREAK case 105: YY_RULE_SETUP #line 164 "../s/cmdoptions.l" -return tok::HVERIFYKDF; +return tok::HVERIFY; YY_BREAK case 106: YY_RULE_SETUP #line 165 "../s/cmdoptions.l" -return tok::HSECUREDEBUG; +return tok::HVERIFYKDF; YY_BREAK case 107: YY_RULE_SETUP @@ -1968,375 +1975,385 @@ case 108: YY_RULE_SETUP #line 167 "../s/cmdoptions.l" -return tok::HREAD; +return tok::HSECUREDEBUG; YY_BREAK case 109: YY_RULE_SETUP #line 168 "../s/cmdoptions.l" -return tok::HDUMP; +return tok::HREAD; YY_BREAK case 110: YY_RULE_SETUP #line 169 "../s/cmdoptions.l" -return tok::HDUMPDIR; +return tok::HDUMP; YY_BREAK case 111: YY_RULE_SETUP -#line 171 "../s/cmdoptions.l" -return tok::H_BIF_AARCH32; +#line 170 "../s/cmdoptions.l" +return tok::HDUMPDIR; YY_BREAK case 112: YY_RULE_SETUP -#line 172 "../s/cmdoptions.l" -return tok::H_BIF_BIGENDIAN; +#line 171 "../s/cmdoptions.l" +return tok::HOVLCDO; YY_BREAK case 113: YY_RULE_SETUP #line 173 "../s/cmdoptions.l" -return tok::H_BIF_BOOTCONFIG; +return tok::H_BIF_AARCH32; YY_BREAK case 114: YY_RULE_SETUP #line 174 "../s/cmdoptions.l" -return tok::H_BIF_COPY; +return tok::H_BIF_BIGENDIAN; YY_BREAK case 115: YY_RULE_SETUP #line 175 "../s/cmdoptions.l" -return tok::H_BIF_CORE; +return tok::H_BIF_BOOTCONFIG; YY_BREAK case 116: YY_RULE_SETUP #line 176 "../s/cmdoptions.l" -return tok::H_BIF_DELAY_HANDOFF; +return tok::H_BIF_COPY; YY_BREAK case 117: YY_RULE_SETUP #line 177 "../s/cmdoptions.l" -return tok::H_BIF_DELAY_LOAD; +return tok::H_BIF_CORE; YY_BREAK case 118: YY_RULE_SETUP #line 178 "../s/cmdoptions.l" -return tok::H_BIF_FILE; +return tok::H_BIF_DELAY_HANDOFF; YY_BREAK case 119: YY_RULE_SETUP #line 179 "../s/cmdoptions.l" -return tok::H_BIF_ID; +return tok::H_BIF_DELAY_LOAD; YY_BREAK case 120: YY_RULE_SETUP #line 180 "../s/cmdoptions.l" -return tok::H_BIF_IMAGE; +return tok::H_BIF_FILE; YY_BREAK case 121: YY_RULE_SETUP #line 181 "../s/cmdoptions.l" -return tok::H_BIF_METAHDR; +return tok::H_BIF_ID; YY_BREAK case 122: YY_RULE_SETUP #line 182 "../s/cmdoptions.l" -return tok::H_BIF_NAME; +return tok::H_BIF_IMAGE; YY_BREAK case 123: YY_RULE_SETUP #line 183 "../s/cmdoptions.l" -return tok::H_BIF_PARTITION; +return tok::H_BIF_METAHDR; YY_BREAK case 124: YY_RULE_SETUP #line 184 "../s/cmdoptions.l" -return tok::H_BIF_PARENTID; +return tok::H_BIF_NAME; YY_BREAK case 125: YY_RULE_SETUP #line 185 "../s/cmdoptions.l" -return tok::H_BIF_SLR; +return tok::H_BIF_PARTITION; YY_BREAK case 126: YY_RULE_SETUP #line 186 "../s/cmdoptions.l" -return tok::H_BIF_TYPE; +return tok::H_BIF_PARENTID; YY_BREAK case 127: YY_RULE_SETUP #line 187 "../s/cmdoptions.l" -return tok::H_BIF_KEYSRC; +return tok::H_BIF_SLR; YY_BREAK case 128: YY_RULE_SETUP #line 188 "../s/cmdoptions.l" -return tok::H_BIF_INIT; +return tok::H_BIF_TYPE; YY_BREAK case 129: YY_RULE_SETUP #line 189 "../s/cmdoptions.l" -return tok::H_BIF_UDFBH; +return tok::H_BIF_KEYSRC; YY_BREAK case 130: YY_RULE_SETUP #line 190 "../s/cmdoptions.l" -return tok::H_BIF_AES; +return tok::H_BIF_INIT; YY_BREAK case 131: YY_RULE_SETUP #line 191 "../s/cmdoptions.l" -return tok::H_BIF_PPK; +return tok::H_BIF_UDFBH; YY_BREAK case 132: YY_RULE_SETUP #line 192 "../s/cmdoptions.l" -return tok::H_BIF_PSK; +return tok::H_BIF_AES; YY_BREAK case 133: YY_RULE_SETUP #line 193 "../s/cmdoptions.l" -return tok::H_BIF_SPK; +return tok::H_BIF_PPK; YY_BREAK case 134: YY_RULE_SETUP #line 194 "../s/cmdoptions.l" -return tok::H_BIF_SSK; +return tok::H_BIF_PSK; YY_BREAK case 135: YY_RULE_SETUP #line 195 "../s/cmdoptions.l" -return tok::H_BIF_SPKSIGN; +return tok::H_BIF_SPK; YY_BREAK case 136: YY_RULE_SETUP #line 196 "../s/cmdoptions.l" -return tok::H_BIF_HDRSIGN; +return tok::H_BIF_SSK; YY_BREAK case 137: YY_RULE_SETUP #line 197 "../s/cmdoptions.l" -return tok::H_BIF_BOOTIMAGE; +return tok::H_BIF_SPKSIGN; YY_BREAK case 138: YY_RULE_SETUP #line 198 "../s/cmdoptions.l" -return tok::H_BIF_BL; +return tok::H_BIF_HDRSIGN; YY_BREAK case 139: YY_RULE_SETUP #line 199 "../s/cmdoptions.l" -return tok::H_BIF_ENCR; +return tok::H_BIF_BOOTIMAGE; YY_BREAK case 140: YY_RULE_SETUP #line 200 "../s/cmdoptions.l" -return tok::H_BIF_PID; +return tok::H_BIF_BL; YY_BREAK case 141: YY_RULE_SETUP #line 201 "../s/cmdoptions.l" -return tok::H_BIF_AUTH; +return tok::H_BIF_ENCR; YY_BREAK case 142: YY_RULE_SETUP #line 202 "../s/cmdoptions.l" -return tok::H_BIF_CHKSM; +return tok::H_BIF_PID; YY_BREAK case 143: YY_RULE_SETUP #line 203 "../s/cmdoptions.l" -return tok::H_BIF_POWNER; +return tok::H_BIF_AUTH; YY_BREAK case 144: YY_RULE_SETUP #line 204 "../s/cmdoptions.l" -return tok::H_BIF_POWNER; +return tok::H_BIF_CHKSM; YY_BREAK case 145: YY_RULE_SETUP #line 205 "../s/cmdoptions.l" -return tok::H_BIF_PRESIGN; +return tok::H_BIF_POWNER; YY_BREAK case 146: YY_RULE_SETUP #line 206 "../s/cmdoptions.l" -return tok::H_BIF_UDF; +return tok::H_BIF_POWNER; YY_BREAK case 147: YY_RULE_SETUP #line 207 "../s/cmdoptions.l" -return tok::H_BIF_XIP; +return tok::H_BIF_PRESIGN; YY_BREAK case 148: YY_RULE_SETUP #line 208 "../s/cmdoptions.l" -return tok::H_BIF_ALIGN; +return tok::H_BIF_UDF; YY_BREAK case 149: YY_RULE_SETUP #line 209 "../s/cmdoptions.l" -return tok::H_BIF_OFFSET; +return tok::H_BIF_XIP; YY_BREAK case 150: YY_RULE_SETUP #line 210 "../s/cmdoptions.l" -return tok::H_BIF_RES; +return tok::H_BIF_ALIGN; YY_BREAK case 151: YY_RULE_SETUP #line 211 "../s/cmdoptions.l" -return tok::H_BIF_LOAD; +return tok::H_BIF_OFFSET; YY_BREAK case 152: YY_RULE_SETUP #line 212 "../s/cmdoptions.l" -return tok::H_BIF_STARTUP; +return tok::H_BIF_RES; YY_BREAK case 153: YY_RULE_SETUP #line 213 "../s/cmdoptions.l" -return tok::H_BIF_KEYSRCENCR; +return tok::H_BIF_LOAD; YY_BREAK case 154: YY_RULE_SETUP #line 214 "../s/cmdoptions.l" -return tok::H_BIF_FSBLCFG; +return tok::H_BIF_STARTUP; YY_BREAK case 155: YY_RULE_SETUP #line 215 "../s/cmdoptions.l" -return tok::H_BIF_BOOTDEV; +return tok::H_BIF_KEYSRCENCR; YY_BREAK case 156: YY_RULE_SETUP #line 216 "../s/cmdoptions.l" -return tok::H_BIF_DESTCPU; +return tok::H_BIF_FSBLCFG; YY_BREAK case 157: YY_RULE_SETUP #line 217 "../s/cmdoptions.l" -return tok::H_BIF_DESTDEV; +return tok::H_BIF_BOOTDEV; YY_BREAK case 158: YY_RULE_SETUP #line 218 "../s/cmdoptions.l" -return tok::H_BIF_EL; +return tok::H_BIF_DESTCPU; YY_BREAK case 159: YY_RULE_SETUP #line 219 "../s/cmdoptions.l" -return tok::H_BIF_TZ; +return tok::H_BIF_DESTDEV; YY_BREAK case 160: YY_RULE_SETUP #line 220 "../s/cmdoptions.l" -return tok::H_BIF_AUTHPARAM; +return tok::H_BIF_EL; YY_BREAK case 161: YY_RULE_SETUP #line 221 "../s/cmdoptions.l" -return tok::H_BIF_BHKEY; +return tok::H_BIF_TZ; YY_BREAK case 162: YY_RULE_SETUP #line 222 "../s/cmdoptions.l" -return tok::H_BIF_PFW; +return tok::H_BIF_AUTHPARAM; YY_BREAK case 163: YY_RULE_SETUP #line 223 "../s/cmdoptions.l" -return tok::H_BIF_BLOCKS; +return tok::H_BIF_BHKEY; YY_BREAK case 164: YY_RULE_SETUP #line 224 "../s/cmdoptions.l" -return tok::H_BIF_BHIV; +return tok::H_BIF_PFW; YY_BREAK case 165: YY_RULE_SETUP #line 225 "../s/cmdoptions.l" -return tok::H_BIF_METAL; +return tok::H_BIF_BLOCKS; YY_BREAK case 166: YY_RULE_SETUP #line 226 "../s/cmdoptions.l" -return tok::H_BIF_ELYHNDOFF; +return tok::H_BIF_BHIV; YY_BREAK case 167: YY_RULE_SETUP #line 227 "../s/cmdoptions.l" -return tok::H_BIF_HIVEC; +return tok::H_BIF_METAL; YY_BREAK case 168: YY_RULE_SETUP #line 228 "../s/cmdoptions.l" -return tok::H_BIF_BHSIGN; +return tok::H_BIF_ELYHNDOFF; YY_BREAK case 169: YY_RULE_SETUP #line 229 "../s/cmdoptions.l" -return tok::H_SPLIT; +return tok::H_BIF_HIVEC; YY_BREAK case 170: YY_RULE_SETUP #line 230 "../s/cmdoptions.l" -return tok::H_BIF_BOOTVEC; +return tok::H_BIF_BHSIGN; YY_BREAK case 171: YY_RULE_SETUP #line 231 "../s/cmdoptions.l" -return tok::H_BIF_PUFDATA; +return tok::H_SPLIT; YY_BREAK case 172: YY_RULE_SETUP #line 232 "../s/cmdoptions.l" -return tok::H_DPACM_ENABLE; +return tok::H_BIF_BOOTVEC; YY_BREAK case 173: YY_RULE_SETUP #line 233 "../s/cmdoptions.l" -return tok::H_BIF_USERKEYS; +return tok::H_BIF_PUFDATA; YY_BREAK case 174: YY_RULE_SETUP -#line 237 "../s/cmdoptions.l" -yylval->cstring=strdup(yytext); return tok::HEXSTRING; +#line 234 "../s/cmdoptions.l" +return tok::H_DPACM_ENABLE; YY_BREAK case 175: YY_RULE_SETUP -#line 238 "../s/cmdoptions.l" -yylval->cstring=strdup(yytext); return tok::IDENTIFIER; +#line 235 "../s/cmdoptions.l" +return tok::H_BIF_USERKEYS; YY_BREAK case 176: YY_RULE_SETUP #line 239 "../s/cmdoptions.l" -yylval->cstring=strdup(yytext); return tok::FILENAME; +yylval->cstring=strdup(yytext); return tok::HEXSTRING; YY_BREAK case 177: YY_RULE_SETUP #line 240 "../s/cmdoptions.l" -yylval->cstring=strdup(yytext+1); yylval->cstring[strlen(yytext)-2]=0; return tok::QFILENAME; +yylval->cstring=strdup(yytext); return tok::IDENTIFIER; YY_BREAK case 178: YY_RULE_SETUP -#line 243 "../s/cmdoptions.l" -yylloc->step (); +#line 241 "../s/cmdoptions.l" +yylval->cstring=strdup(yytext); return tok::FILENAME; YY_BREAK case 179: -/* rule 179 can match eol */ YY_RULE_SETUP -#line 244 "../s/cmdoptions.l" -yylloc->lines (yyleng); yylloc->step (); +#line 242 "../s/cmdoptions.l" +yylval->cstring=strdup(yytext+1); yylval->cstring[strlen(yytext)-2]=0; return tok::QFILENAME; YY_BREAK case 180: YY_RULE_SETUP #line 245 "../s/cmdoptions.l" -LOG_ERROR("Unknown option on command line: %s\n",yytext); +yylloc->step (); YY_BREAK case 181: +/* rule 181 can match eol */ YY_RULE_SETUP #line 246 "../s/cmdoptions.l" +yylloc->lines (yyleng); yylloc->step (); + YY_BREAK +case 182: +YY_RULE_SETUP +#line 247 "../s/cmdoptions.l" +LOG_ERROR("Unknown option on command line: %s\n",yytext); + YY_BREAK +case 183: +YY_RULE_SETUP +#line 248 "../s/cmdoptions.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2340 "../bisonflex/cmdoptions.yy.cpp" +#line 2357 "../bisonflex/cmdoptions.yy.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2738,7 +2755,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1010 ) + if ( yy_current_state >= 1023 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2771,11 +2788,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1010 ) + if ( yy_current_state >= 1023 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1009); + yy_is_jam = (yy_current_state == 1022); return yy_is_jam ? 0 : yy_current_state; } @@ -3385,7 +3402,7 @@ /* %ok-for-header */ -#line 246 "../s/cmdoptions.l" +#line 248 "../s/cmdoptions.l" diff -Nru xilinx-bootgen-2021.2/debian/changelog xilinx-bootgen-2022.2/debian/changelog --- xilinx-bootgen-2021.2/debian/changelog 2021-11-24 11:26:47.000000000 +0000 +++ xilinx-bootgen-2022.2/debian/changelog 2023-02-07 10:06:59.000000000 +0000 @@ -1,8 +1,43 @@ -xilinx-bootgen (2021.2-1build1) jammy; urgency=medium +xilinx-bootgen (2022.2-2ubuntu1~22.04) jammy; urgency=medium - * No-change rebuild against openssl3 + * Backport to jammy (LP: #1998732) - -- Simon Chopin Wed, 24 Nov 2021 12:26:47 +0100 + -- Ethan Hsieh Tue, 07 Feb 2023 10:06:59 +0000 + +xilinx-bootgen (2022.2-2ubuntu1) lunar; urgency=medium + + * d/rules, d/control: Place Breaks, Replaces in d/control and add + transitional definition for xlnx-bootgen. This delta can be removed after + lunar's release (LP: #1998728, LP: #2000774) + + -- Dave Jones Thu, 12 Jan 2023 17:45:38 +0000 + +xilinx-bootgen (2022.2-2) unstable; urgency=medium + + * d/rules: Add bootgen-xlnx to Breaks, Replaces and Provides in the case + of Ubuntu. (Closes: LP: 2000774) + + -- Nobuhiro Iwamatsu Thu, 12 Jan 2023 11:25:15 +0900 + +xilinx-bootgen (2022.2-1) unstable; urgency=medium + + * New upstream release. + * d/control: Update standards version to 4.6.1, no changes needed. + * d/copyright: Update copyright year. + + -- Nobuhiro Iwamatsu Sat, 07 Jan 2023 19:27:07 +0900 + +xilinx-bootgen (2022.1-1) unstable; urgency=medium + + * New upstream release. + * Update d/control. + - Bump Standards-Version to 4.6.0.1. + * Update d/copyright. + - Update copyright year. + * Update d/watch. + - Update to v4. + + -- Nobuhiro Iwamatsu Wed, 01 Jun 2022 14:12:44 +0900 xilinx-bootgen (2021.2-1) unstable; urgency=medium diff -Nru xilinx-bootgen-2021.2/debian/control xilinx-bootgen-2022.2/debian/control --- xilinx-bootgen-2021.2/debian/control 2021-11-09 04:18:46.000000000 +0000 +++ xilinx-bootgen-2022.2/debian/control 2023-01-12 17:45:38.000000000 +0000 @@ -1,11 +1,12 @@ Source: xilinx-bootgen -Maintainer: Debian Xilinx Package Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Xilinx Package Maintainers Uploaders: Punit Agrawal , Nobuhiro Iwamatsu Priority: optional Section: devel Build-Depends: debhelper-compat (= 13), libssl-dev -Standards-Version: 4.5.1 +Standards-Version: 4.6.1 Rules-Requires-Root: no Homepage: https://github.com/Xilinx/bootgen Vcs-Browser: https://salsa.debian.org/xilinx-packages-team/xilinx-bootgen @@ -14,8 +15,17 @@ Package: xilinx-bootgen Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: bootgen-xlnx (<< 2022.2-1~) +Breaks: bootgen-xlnx (<< 2022.2-1~) Description: boot image converter for Xilinx ARM SoCs xilinx-bootgen provides tools to generate a boot image (BOOT.BIN) for Xilinx ARM SoC (Zynq-7000, Zynq UltraScale + MPSoC, etc) devices. This also provides features such as boot authentication and OpenSSL-based encryption. + +Package: bootgen-xlnx +Architecture: any +Depends: xilinx-bootgen, ${misc:Depends} +Section: oldlibs +Description: transitional package + This is a transitional package. It can be safely removed. diff -Nru xilinx-bootgen-2021.2/debian/copyright xilinx-bootgen-2022.2/debian/copyright --- xilinx-bootgen-2021.2/debian/copyright 2021-11-09 04:18:46.000000000 +0000 +++ xilinx-bootgen-2022.2/debian/copyright 2023-01-12 16:04:20.000000000 +0000 @@ -47,7 +47,7 @@ License: OpenSSL Files: debian/* -Copyright: 2021, Nobuhiro Iwamatsu +Copyright: 2021-2023, Nobuhiro Iwamatsu License: Apache-2.0 License: Apache-2.0 diff -Nru xilinx-bootgen-2021.2/debian/rules xilinx-bootgen-2022.2/debian/rules --- xilinx-bootgen-2021.2/debian/rules 2021-11-09 04:18:46.000000000 +0000 +++ xilinx-bootgen-2022.2/debian/rules 2023-01-12 17:44:06.000000000 +0000 @@ -7,11 +7,3 @@ override_dh_auto_configure: dh_auto_configure -- --enable-static - -override_dh_auto_test: - # Note: Currently, following tests fail on Debian. This is an - # environmental problem to test. The debian/rules ignores - # the test error by dh_auto_test to ignore these. - # FAIL: unit/test-dbus-message-fds - # FAIL: unit/test-dbus-properties - -dh_auto_test diff -Nru xilinx-bootgen-2021.2/debian/watch xilinx-bootgen-2022.2/debian/watch --- xilinx-bootgen-2021.2/debian/watch 2021-11-09 04:18:46.000000000 +0000 +++ xilinx-bootgen-2022.2/debian/watch 2023-01-12 16:04:20.000000000 +0000 @@ -1,3 +1,3 @@ -version=3 -opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/bar-$1.tar.gz/,dversionmangle=s/\+dfsg// \ - https://github.com/Xilinx/bootgen/tags .*/v?(\d\S*)\.tar\.gz +version=4 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/bootgen-$1.tar.gz/,dversionmangle=s/\+dfsg// \ + https://github.com/Xilinx/bootgen/tags .*/xilinx_v?(\d\S*)\.tar\.gz diff -Nru xilinx-bootgen-2021.2/dyn_link.h xilinx-bootgen-2022.2/dyn_link.h --- xilinx-bootgen-2021.2/dyn_link.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/dyn_link.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 -/****************************************************************************** -* Copyright 2019-2020 Xilinx, Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -******************************************************************************/ - -#ifndef D_cdo_dyn_link -#define D_cdo_dyn_link - -#ifdef _MSC_VER -# define CDOUTIL_EXPORT __declspec(dllexport) -#endif -#ifdef __GNUC__ -# define CDOUTIL_EXPORT __attribute__ ((visibility("default"))) -#endif - -#ifndef CDOUTIL_EXPORT -# define CDOUTIL_EXPORT -#endif - -#endif /* D_cdo_dyn_link */ diff -Nru xilinx-bootgen-2021.2/elftools.cpp xilinx-bootgen-2022.2/elftools.cpp --- xilinx-bootgen-2021.2/elftools.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/elftools.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,12 +29,25 @@ static bool gEndianessInitialized = false; - /* ------------------------------------------------------------------------------- ***************************************************** F U N C T I O N S *** ------------------------------------------------------------------------------- */ + +uint32_t ComputeWordChecksum(void* firstWordPtr, size_t length) +{ + uint32_t checksum = 0; + size_t numChecksumedWords = length / sizeof(uint32_t); + for (size_t i = 0; i< numChecksumedWords; i++) + { + checksum += ((uint32_t*)firstWordPtr)[i]; + } + /* Invert the Checksum value */ + checksum ^= 0xFFFFFFFF; + return checksum; +} + /******************************************************************************/ Endianness::Type EndianMachine( void ) { @@ -166,9 +179,49 @@ /* Index from the beginning of the ELF file with the offset index in the String Table Section. */ stringTableSection = (StringTableSectionTbl *)(start+ sectionHdrTbl[header.e_shstrndx].sh_offset); - stringTableSectionSize = sectionHdrTbl[header.e_shstrndx].sh_size; } + + for (unsigned int index = 0; index < sectionHdrEntryCount; index++) + { + stringTableSection = (StringTableSectionTbl *)(start + sectionHdrTbl[header.e_shstrndx].sh_offset); + std::string sectn_name = (char*)stringTableSection + sectionHdrTbl[index].sh_name; + if (sectn_name == ".struct_info" || sectn_name == ".xplm_modules") + { + uint32_t sectn_size_id = 0; + /* Optional Data Header + Optional Data Actual size + Checksum */ + uint16_t sectn_length = sizeof(uint32_t) + sectionHdrTbl[index].sh_size + sizeof(uint32_t); + + if (sectn_name == ".xplm_modules") + { + sectn_size_id = (uint32_t)((sectn_length / 4) << 16) | DATA_ID_XPLM_MODULES; + + xplm_modules_data_size = sectionHdrTbl[index].sh_size; + xplm_modules_data = (uint32_t*)malloc(xplm_modules_data_size); + memcpy(xplm_modules_data, start + sectionHdrTbl[index].sh_offset, xplm_modules_data_size); + } + if (sectn_name == ".struct_info") + { + sectn_size_id = (uint32_t)((sectn_length / 4) << 16) | DATA_ID_STRUCT_INFO; + } + + iht_optional_data = (uint32_t*) realloc(iht_optional_data, iht_optional_data_size + sectn_length); + memcpy(iht_optional_data + (iht_optional_data_size / 4), §n_size_id, sizeof(uint32_t)); + memcpy(iht_optional_data + (iht_optional_data_size / 4) + sizeof(uint32_t)/4, (start + sectionHdrTbl[index].sh_offset), (sectionHdrTbl[index].sh_size)); + + uint32_t checksum = ComputeWordChecksum(iht_optional_data + (iht_optional_data_size / 4), sectn_length - sizeof(uint32_t)); + memcpy(iht_optional_data + (iht_optional_data_size / 4) + (sectn_length - sizeof(uint32_t)) / 4, &checksum, sizeof(uint32_t)); + + iht_optional_data_size += sectn_length; + } + } + if (iht_optional_data_size != 0) + { + uint32_t padLength = (iht_optional_data_size % 64 != 0) ? 64 - (iht_optional_data_size % 64) : 0; + iht_optional_data = (uint32_t*)realloc(iht_optional_data, iht_optional_data_size + padLength); + memset(iht_optional_data + (iht_optional_data_size / 4), 0xFF, padLength); + iht_optional_data_size += padLength; + } } /* If a Program header is defined, get its pointer and its record size @@ -502,6 +555,41 @@ stringTableSectionSize = sectionHdrTbl[header.e_shstrndx].sh_size; } + + uint64_t dataSecAddr = 0; + uint64_t dataSecOff = 0; + + for(unsigned int index = 0; index < sectionHdrEntryCount; index++) + { + stringTableSection = (StringTableSectionTbl *)(start + sectionHdrTbl[header.e_shstrndx].sh_offset); + char* name = (char*) stringTableSection; + std::string sectn = name + sectionHdrTbl[index].sh_name; + + if(sectn == ".data") + { + dataSecAddr = sectionHdrTbl[index].sh_addr; + dataSecOff = sectionHdrTbl[index].sh_offset; + } + if(sectionHdrTbl[index].sh_type == SHT_SYMTAB) + { + symbolTableSection = (Elf64Symbol_t *)((char *)start + sectionHdrTbl[index].sh_offset); + int count = sectionHdrTbl[index].sh_size / sectionHdrTbl[index].sh_entsize; + char *symbol_names = (char *)(start + sectionHdrTbl[sectionHdrTbl[index].sh_link].sh_offset); + + for (int symb = 0; symb < count; symb++) + { + std::string name = symbol_names + symbolTableSection[symb].st_name; + + if(name == "bif_atf_handoff_params") + { + atf_handoff_params_found = true; + uint64_t symbValue = symbolTableSection[symb].st_value; + uint64_t offset = symbValue - dataSecAddr; + atf_handoff_params_offset = dataSecOff + offset; + } + } + } + } } /* If a Program header is defined, get its pointer and its record size @@ -535,6 +623,11 @@ prgHdr.data = new uint8_t[prgHdr.p_filesz]; memcpy( prgHdr.data,( start + prgHdr.p_offset ),prgHdr.p_filesz); + if((atf_handoff_params_offset >= prgHdr.p_offset) && (atf_handoff_params_offset <= (prgHdr.p_offset + prgHdr.p_filesz))) + { + atf_handoff_params_offset -= prgHdr.p_offset; + atf_handoff_params_prg_hdr_count = index; + } if( index == 0 ) { diff -Nru xilinx-bootgen-2021.2/elftools.h xilinx-bootgen-2022.2/elftools.h --- xilinx-bootgen-2021.2/elftools.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/elftools.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,10 @@ /* Forward Class Declarations */ class Elf32SectionHdr_t; class Elf64SectionHdr_t; +class Elf64Symbol_t; + +#define DATA_ID_STRUCT_INFO 2 +#define DATA_ID_XPLM_MODULES 1 /* ------------------------------------------------------------------------------- @@ -231,6 +235,13 @@ , lowestProgramAddress(0xFFFFFFFF) , highestProgramAddress(0) , endian(Endianness::NotEndian) + , atf_handoff_params_offset(0) + , atf_handoff_params_prg_hdr_count(0) + , atf_handoff_params_found(false) + , iht_optional_data_size(0) + , iht_optional_data(NULL) + , xplm_modules_data(NULL) + , xplm_modules_data_size(0) { }; ~ElfFormat() {}; @@ -255,6 +266,37 @@ uint64_t stringTableSectionSize; uint64_t lowestProgramAddress; uint64_t highestProgramAddress; + + uint32_t* iht_optional_data; + uint32_t* xplm_modules_data; + uint32_t xplm_modules_data_size; + uint16_t iht_optional_data_size; + + uint64_t atf_handoff_params_offset; + uint64_t atf_handoff_params_prg_hdr_count; + bool atf_handoff_params_found; +}; + +/*************************************************************************************/ +class Elf32Symbol_t +{ +public: + Elf32Symbol_t() {} + Elf32Symbol_t(Elf32Symbol_t* sym_t) + { + st_name = sym_t->st_name; + st_info = sym_t->st_info; + st_other = sym_t->st_other; + st_shndx = sym_t->st_shndx; + st_value = sym_t->st_value; + st_size = sym_t->st_size; + } + Elf32_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; + Elf32_Addr st_value; + Elf32_Xword st_size; }; /******************************************************************************/ @@ -272,9 +314,10 @@ uint8_t* GetProgramHeaderData(uint8_t index); uint32_t ELFHdrEntrySize() { return header.e_ehsize;} + Elf32_Ehdr header; std::vector programHeaders; Elf32SectionHdr_t* sectionHdrTbl; - Elf32_Ehdr header; + Elf32Symbol_t* symbolTableSection; private: void TrimUnwantedELFHeaders( Elf32ProgramHeader& prgHeader, uint8_t* elfStart ); void DeendianELFHdr(uint8_t*); @@ -298,6 +341,7 @@ Elf64_Ehdr header; std::vector programHeaders; Elf64SectionHdr_t* sectionHdrTbl; + Elf64Symbol_t* symbolTableSection; private: void TrimUnwantedELFHeaders( Elf64ProgramHeader& prgHeader, uint8_t* elfStart ); void DeendianELFHdr(uint8_t*); @@ -400,4 +444,26 @@ sh_entsize= DeendianUInt64(endian, sh_entsize); } }; + +/*************************************************************************************/ +class Elf64Symbol_t +{ + public: + Elf64Symbol_t() {} + Elf64Symbol_t(Elf64Symbol_t* sym_t) + { + st_name = sym_t->st_name; + st_info = sym_t->st_info; + st_other = sym_t->st_other; + st_shndx = sym_t->st_shndx; + st_value = sym_t->st_value; + st_size = sym_t->st_size; + } + Elf64_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf64_Half st_shndx; + Elf64_Addr st_value; + Elf64_Xword st_size; +}; #endif diff -Nru xilinx-bootgen-2021.2/elftypes.h xilinx-bootgen-2022.2/elftypes.h --- xilinx-bootgen-2021.2/elftypes.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/elftypes.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2019 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ typedef uint16_t Elf32_Half; typedef uint32_t Elf32_Off; typedef int32_t Elf32_Sword; +typedef uint32_t Elf32_Xword; typedef uint32_t Elf32_Word; /* ELF 64-bit */ diff -Nru xilinx-bootgen-2021.2/encryption-versal.cpp xilinx-bootgen-2022.2/encryption-versal.cpp --- xilinx-bootgen-2021.2/encryption-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -527,12 +527,14 @@ if (GetAesSeed() == NULL) { aesSeed = new uint32_t[WORDS_PER_AES_KEY]; + memset(aesSeed, 0, WORDS_PER_AES_KEY); GenerateAesSeed(); } if (GetFixedInputData() == NULL) { fixedInputData = new uint32_t[WORDS_PER_FID]; + memset(fixedInputData, 0, WORDS_PER_FID); GenerateAesFixedInputData(); } @@ -822,8 +824,8 @@ /* Note that the last block will always be based on the partition length.*/ std::vector secureChunkEncrBlocks; - uint32_t actualSecureChunkSize = VersalPartition::GetSecureChunkSize() - overhead; - if (partHdr->imageHeader->GetAuthenticationType() == Authentication::None) + uint32_t actualSecureChunkSize = bi.GetSecureChunkSize(partHdr->IsBootloader()) - overhead; + if (partHdr->imageHeader->GetAuthenticationType() == Authentication::None && !partHdr->imageHeader->GetDelayAuthFlag()) { actualSecureChunkSize += SHA3_LENGTH_BYTES; } @@ -1053,6 +1055,8 @@ { aesKey = aesIv = aesSeed = NULL; fixedInputData = NULL; + aesSeedexits = false; + fixedInputDataExits = false; SetAesFileName(options.bifOptions->pmcDataAesFile); LOG_INFO("Key file - %s", aesFilename.c_str()); std::ifstream keyFile(aesFilename); @@ -1362,7 +1366,7 @@ dataBuffer, (uint32_t)size, bi.imageHeaderTable->section->Data, - sizeof(VersalImageHeaderTableStructure), + sizeof(VersalImageHeaderTableStructure) + bi.imageHeaderTable->iht_optional_data_length, encryptedDataBuffer /* out*/, encryptedLength /* out */); diff -Nru xilinx-bootgen-2021.2/encryption-versal.h xilinx-bootgen-2022.2/encryption-versal.h --- xilinx-bootgen-2021.2/encryption-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,11 @@ void Process(BootImage& bi, PartitionHeader* partition); void Process(BootImage& bi); + //VersalNet defines + uint32_t ConfigureEncryptionBlocksforPmcData(BootImage& bi, PartitionHeader * partHdr); + uint32_t ConfigureEncryptionBlocksforPartition(BootImage & bi, PartitionHeader * partHdr); + void ChunkifyAndProcess(BootImage & bi, PartitionHeader * partHdr); + void SetAesSeedString(const std::string & key); void SetAesSeed(const uint8_t * key); const uint32_t* GetAesSeed(void); diff -Nru xilinx-bootgen-2021.2/encryption-versalnet.cpp xilinx-bootgen-2022.2/encryption-versalnet.cpp --- xilinx-bootgen-2021.2/encryption-versalnet.cpp 1970-01-01 00:00:00.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption-versalnet.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -0,0 +1,863 @@ + +/****************************************************************************** +* Copyright 2015-2022 Xilinx, Inc. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +******************************************************************************/ + +/* +------------------------------------------------------------------------------- +*********************************************** H E A D E R F I L E S *** +------------------------------------------------------------------------------- +*/ +#include "encryption-versal.h" +#include "bootimage.h" +#include "encryptutils.h" +#include "options.h" +#include "imageheadertable-versal.h" +#include "bootheader-versal.h" +#include "partitionheadertable-versal.h" +#include + +/* +------------------------------------------------------------------------------- +***************************************************** F U N C T I O N S *** +------------------------------------------------------------------------------- +*/ + +uint32_t VersalEncryptionContext::ConfigureEncryptionBlocksforPmcData(BootImage& bi, PartitionHeader* partHdr) +{ + uint32_t totalencrBlocks = 0; + Binary::Length_t lastBlock = 0; + std::vector encrBlocks = partHdr->imageHeader->GetEncrBlocksList(); + + totalencrBlocks = encrBlocks.size(); + uint32_t overhead = (totalencrBlocks) * (SECURE_HDR_SZ + AES_GCM_TAG_SZ); + + /* Due to encryption over head, the actual default size on which the partition needs to be Key rolled is always less than 64KB. + So first calculate the default key roll data size by substracting the overhead. */ + /* Then calculate the number of such blocks possible on a given partition. */ + /* Note that the last block will always be based on the partition length.*/ + + std::vector secureChunkEncrBlocks; + uint32_t actualSecureChunkSize = bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader()) - overhead; + if (partHdr->imageHeader->GetAuthenticationType() == Authentication::None && !partHdr->imageHeader->GetDelayAuthFlag()) + { + actualSecureChunkSize += SHA3_LENGTH_BYTES; + } + + uint32_t totalKeyRollencrBlocks = GetTotalEncryptionBlocks(partHdr->imageHeader->GetTotalPmcFwSizeIh(), secureChunkEncrBlocks, actualSecureChunkSize, &lastBlock); + secureChunkEncrBlocks.clear(); + + for (uint32_t itr = 0; itr < totalKeyRollencrBlocks; itr++) + { + if ((itr == totalKeyRollencrBlocks - 1) && (lastBlock != 0)) + { + secureChunkEncrBlocks.push_back(lastBlock); + lastBlock = 0; + } + else + { + secureChunkEncrBlocks.push_back(actualSecureChunkSize); + } + } + + /* Now chunk each default key roll data size, based on user encryption blocks. + Note that the last block will always be based on the partition length.*/ + //std::vector blocks; + for (uint32_t itr1 = 0; itr1 < totalKeyRollencrBlocks; itr1++) + { + if ((itr1 == totalKeyRollencrBlocks - 1) && (secureChunkEncrBlocks[itr1] != actualSecureChunkSize)) + { + Binary::Length_t encrBlocksSize = 0; + for (uint32_t itr = 0; itr < encrBlocks.size(); itr++) + { + encrBlocksSize += encrBlocks[itr]; + if (secureChunkEncrBlocks[itr1] > encrBlocksSize) + { + bi.options.bifOptions->pmcdataBlocks.push_back(encrBlocks[itr]); + } + else + { + bi.options.bifOptions->pmcdataBlocks.push_back(secureChunkEncrBlocks[itr1] - (encrBlocksSize - encrBlocks[itr])); + break; + } + } + } + else + { + for (uint32_t itr = 0; itr < encrBlocks.size(); itr++) + { + bi.options.bifOptions->pmcdataBlocks.push_back(encrBlocks[itr]); + } + } + } + totalencrBlocks = bi.options.bifOptions->pmcdataBlocks.size(); + return totalencrBlocks; +} + +uint32_t VersalEncryptionContext::ConfigureEncryptionBlocksforPartition(BootImage& bi, PartitionHeader* partHdr) +{ + Options& options = bi.options; + uint32_t totalencrBlocks = 0; + Binary::Length_t lastBlock = 0; + std::vector encrBlocks = partHdr->imageHeader->GetEncrBlocksList(); + + totalencrBlocks = encrBlocks.size(); + uint32_t overhead = (totalencrBlocks) * (SECURE_HDR_SZ + AES_GCM_TAG_SZ); + + /* Due to encryption over head, the actual default size on which the partition needs to be Key rolled is always less than 64KB. + So first calculate the default key roll data size by substracting the overhead. */ + /* Then calculate the number of such blocks possible on a given partition. */ + /* Note that the last block will always be based on the partition length.*/ + + std::vector secureChunkEncrBlocks; + uint32_t actualSecureChunkSize = bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader()) - overhead; + if (partHdr->imageHeader->GetAuthenticationType() == Authentication::None && !partHdr->imageHeader->GetDelayAuthFlag()) + { + actualSecureChunkSize += SHA3_LENGTH_BYTES; + } + + uint32_t totalKeyRollencrBlocks = 0; + if (partHdr->imageHeader->IsBootloader()) + { + totalKeyRollencrBlocks = GetTotalEncryptionBlocks(partHdr->imageHeader->GetFsblFwSizeIh(), secureChunkEncrBlocks, actualSecureChunkSize, &lastBlock); + } + else + { + totalKeyRollencrBlocks = GetTotalEncryptionBlocks(partHdr->partition->section->Length, secureChunkEncrBlocks, actualSecureChunkSize, &lastBlock); + } + + secureChunkEncrBlocks.clear(); + + for (uint32_t itr = 0; itr < totalKeyRollencrBlocks; itr++) + { + if ((itr == totalKeyRollencrBlocks - 1) && (lastBlock != 0)) + { + secureChunkEncrBlocks.push_back(lastBlock); + lastBlock = 0; + } + else + { + secureChunkEncrBlocks.push_back(actualSecureChunkSize); + } + } + + /* Now chunk each default key roll data size, based on user encryption blocks. + Note that the last block will always be based on the partition length.*/ + options.bifOptions->GetEncryptionBlocksList().clear(); + for (uint32_t itr1 = 0; itr1 < totalKeyRollencrBlocks; itr1++) + { + if ((itr1 == totalKeyRollencrBlocks - 1) && (secureChunkEncrBlocks[itr1] != actualSecureChunkSize)) + { + Binary::Length_t encrBlocksSize = 0; + for (uint32_t itr = 0; itr < encrBlocks.size(); itr++) + { + encrBlocksSize += encrBlocks[itr]; + if (secureChunkEncrBlocks[itr1] > encrBlocksSize) + { + options.bifOptions->InsertEncryptionBlock(encrBlocks[itr]); + } + else + { + options.bifOptions->InsertEncryptionBlock(secureChunkEncrBlocks[itr1] - (encrBlocksSize - encrBlocks[itr])); + break; + } + } + } + else + { + for (uint32_t itr = 0; itr < encrBlocks.size(); itr++) + { + options.bifOptions->InsertEncryptionBlock(encrBlocks[itr]); + } + } + } + totalencrBlocks = options.bifOptions->GetEncryptionBlocksList().size(); + return totalencrBlocks; +} + +/******************************************************************************/ +static std::string ReadIV0(const std::string& inputFileName) +{ + std::ifstream keyFile(inputFileName.c_str()); + int aesKeyNum = 0; + int aesIvNum = 0; + + if (!keyFile) + { + LOG_ERROR("Failure reading AES key file - %s", inputFileName.c_str()); + } + + while (keyFile) + { + std::string word; + keyFile >> word; + if (word == "") + { + return ""; + } + + char c = ' '; + if (word == "Device") + { + word = ""; + keyFile >> word; + c = word[word.size() - 1]; + word.erase(word.size() - 1); + } + else if (word == "Key") + { + keyFile >> word; + if (word == "Opt") + { + LOG_ERROR("The key word 'Key Opt' is not supported in VERSAL architecture"); + } + if (word != "" && isalnum(word[0])) + { + /* Second Word is "0" or "1" or "2" ...*/ + int index = std::stoi(word); + if (aesKeyNum != index) + { + LOG_DEBUG(DEBUG_STAMP, "Key order incorrect."); + LOG_ERROR("Error parsing AES key file - %s.", inputFileName.c_str()); + } + aesKeyNum++; + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + } + else + { + /* Second Word other than "0", - throw error */ + LOG_DEBUG(DEBUG_STAMP, "Unknown key type - '%s' in %s", word.c_str(), inputFileName.c_str()); + LOG_ERROR("Error parsing AES key file - %s", inputFileName.c_str()); + } + } + else if (word == "IV") + { + keyFile >> word; + if (word != "") + { + if (word.size() == ((BYTES_PER_IV * 2) + 1)) + { + c = word[word.size() - 1]; + word.erase(word.size() - 1); + return word; + } + else + { + int index = std::stoi(word); + if (aesIvNum != index) + { + LOG_DEBUG(DEBUG_STAMP, "Iv order incorrect."); + LOG_ERROR("Error parsing AES key file - %s.", inputFileName.c_str()); + } + aesIvNum++; + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + if (index == 0) + { + return word; + } + } + } + } + else if (word == "Seed") + { + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + } + else if (word == "Label") + { + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + } + else if (word == "Context") + { + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + } + else if (word == "FixedInputData") + { + word = ""; + while ((keyFile >> c) && isalnum(c)) + { + word.push_back(c); + } + } + else + { + /* If the word is neither of the above */ + LOG_DEBUG(DEBUG_STAMP, "'Key' or 'Device' identifier expected, '%s' found instead", word.c_str()); + LOG_ERROR("Error parsing AES key file - %s", inputFileName.c_str()); + } + if (c != ';') + { + /* Semicolons expected at end of every line */ + while ((keyFile >> c) && isspace(c)) + { + word.push_back(c); + } + } + if (c != ';') + { + LOG_DEBUG(DEBUG_STAMP, "Terminating ';' expected. Last word read was '%s'", word.c_str()); + LOG_ERROR("Error parsing AES key file - %s", inputFileName.c_str()); + } + } + return ""; +} + + +/******************************************************************************/ +void VersalEncryptionContext::ChunkifyAndProcess(BootImage& bi, PartitionHeader* partHdr) +{ + Options& options = bi.options; + + LOG_INFO("Encrypting the partition - %s", partHdr->partition->section->Name.c_str()); + + WarnforDPACMImpactonBootTime(partHdr->imageHeader->GetEncrBlocksList().size() != 0, partHdr->imageHeader->GetDpacm() == DpaCM::DpaCMEnable); + + uint32_t totalencrBlocks = ConfigureEncryptionBlocksforPartition(bi, partHdr); + LOG_TRACE("Total no. of Key/IV pairs needed to encrypt - %d", totalencrBlocks + 1); + + /* Get the key file */ + SetAesFileName(partHdr->partitionAesKeyFile); + LOG_INFO("Key file - %s", aesFilename.c_str()); + if (partHdr->generateAesKeyFile) + { + std::ifstream keyFile(aesFilename); + bool fileExists = keyFile.good(); + if (!fileExists) + { + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + aesKey = new uint32_t[AES_GCM_KEY_SZ / 4]; + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + break; + } + } + } + GenerateEncryptionKeyFile(aesFilename, options); + } + else + { + LOG_ERROR("Key Generation Error !!!\n File - %s already exists.", aesFilename.c_str()); + } + } + + bi.InsertEncryptionKeyFile(aesFilename); + CheckForSameAesKeyFiles(bi.GetEncryptionKeyFileVec()); + + ReadEncryptionKeyFile(aesFilename); + + std::pair asesKeyandKeySrcPair(partHdr->imageHeader->GetEncryptionKeySrc(), aesKey); + bi.aesKeyandKeySrc.push_back(asesKeyandKeySrcPair); + bi.bifOptions->CheckForBadKeyandKeySrcPair(bi.aesKeyandKeySrc, aesFilename); + + options.SetDevicePartName(deviceName); + + CheckForExtraKeyIVPairs(totalencrBlocks, partHdr->partition->section->Name); + + if (!aesSeedexits && aesKeyVec.size() != 1) + { + if (totalencrBlocks + 1 > aesKeyVec.size()) + { + LOG_ERROR("AES Key file has less keys than the number of blocks to be encrypted in %s.", partHdr->partition->section->Name.c_str()); + } + if (totalencrBlocks + 1 > aesIvVec.size()) + { + LOG_ERROR("AES Key file has less IVs than the number of blocks to be encrypted in %s.", partHdr->partition->section->Name.c_str()); + } + } + else + { + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + if (aesKey == NULL) + { + aesKey = new uint32_t[AES_GCM_KEY_SZ / 4]; + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + } + if (aesKeyVec.size() == 0) + { + aesKeyVec.push_back(ConvertKeyIvToString((uint8_t *)aesKey, AES_GCM_KEY_SZ).c_str()); + } + break; + } + } + } + GenerateRemainingKeys(options); + } + + CheckForRepeatedKeyIVPairs(bi.GetEncryptionKeyFileVec(), false); + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + if (aesKey != NULL) + { + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + } + break; + } + } + } + + // For copying SCR HDR IV into Boot Header + const uint32_t* tmpIv = GetIv(); + if (tmpIv != NULL) + { + if (partHdr->IsBootloader()) + { + if (options.secHdrIv == NULL) + { + options.secHdrIv = (uint8_t*)malloc(BYTES_PER_IV); + } + memcpy_be(options.secHdrIv, tmpIv, BYTES_PER_IV); + } + if (partHdr->partitionSecHdrIv == NULL) + { + partHdr->partitionSecHdrIv = (uint8_t*)malloc(BYTES_PER_IV); + } + memcpy_be(partHdr->partitionSecHdrIv, tmpIv, BYTES_PER_IV); + } + + uint32_t totalBlocksOverhead = (totalencrBlocks + 1) * 64; //64 = AES_GCM_IV_SZ+AES_GCM_KEY_SZ+NUM_BYTES_PER_WORD+AES_GCM_TAG_SZ + + if (!Binary::CheckAddress(partHdr->partition->section->Length)) + { + LOG_ERROR("Partition too large to encrypt"); + } + + isBootloader = partHdr->imageHeader->IsBootloader(); + if (options.GetEncryptionDumpFlag()) + { + bi.options.aesLogFile.open(bi.options.aesLogFilename, std::fstream::app); + VERBOSE_OUT << std::endl << "------------------------------------"; + VERBOSE_OUT << std::endl << " Partition Name : " << partHdr->partition->section->Name; + VERBOSE_OUT << std::endl << " Key file : " << StringUtils::BaseName(aesFilename); + VERBOSE_OUT << std::endl << "------------------------------------"; + } + + /* Encrypt the stream */ + if (isBootloader && partHdr->imageHeader->GetPmcFwSizeIh() != 0) + { + // BootLoader Encryption + uint32_t encrFsblByteLength; + uint32_t estimatedEncrFsblLength = partHdr->imageHeader->GetFsblFwSizeIh() + totalBlocksOverhead; + uint32_t estimatedTotalFsblLength = estimatedEncrFsblLength; + uint8_t* encrFsblDataBuffer = new uint8_t[estimatedEncrFsblLength]; + + uint32_t totalpmcdataencrBlocks = ConfigureEncryptionBlocksforPmcData(bi, partHdr); + uint32_t estimatedtotalPmcCdoLength = partHdr->imageHeader->GetTotalPmcFwSizeIh() + (totalpmcdataencrBlocks + 1) * 64; + + LOG_INFO("Encrypting Bootloader"); + + if (partHdr->imageHeader->GetAuthenticationType() != Authentication::None) + { + Binary::Length_t dataChunksCount = 0; + // PLM + dataChunksCount = ((estimatedEncrFsblLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) / bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) + + ((((estimatedEncrFsblLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) % bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) == 0 ? 0 : 1)); + // If PMC CDO present, need to calculate the hash, so include hash + if (partHdr->imageHeader->GetTotalPmcFwSizeIh()) + { + estimatedTotalFsblLength += SHA3_LENGTH_BYTES; + } + + if (dataChunksCount != 1) + { + for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) + { + estimatedTotalFsblLength += SHA3_LENGTH_BYTES; + } + } + + // PMC DATA + dataChunksCount = 0; + + dataChunksCount = ((estimatedtotalPmcCdoLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) / bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) + + ((((estimatedtotalPmcCdoLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) % bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) == 0 ? 0 : 1)); + + if (dataChunksCount != 1) + { + for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) + { + estimatedtotalPmcCdoLength += SHA3_LENGTH_BYTES; + } + } + } + + uint32_t* tmpIvPMCDATA = new uint32_t[WORDS_PER_IV]; + memset(tmpIvPMCDATA, 0, WORDS_PER_IV); + // PMC Data Encryption + if (options.bifOptions->pmcDataAesFile != "") + { + //aesKey = NULL; + aesSeedexits = false; + fixedInputDataExits = false; + SetAesFileName(options.bifOptions->pmcDataAesFile); + LOG_INFO("Key file - %s", aesFilename.c_str()); + std::ifstream keyFile(aesFilename); + bool fileExists = keyFile.good(); + if (!fileExists) + { + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + aesKey = new uint32_t[AES_GCM_KEY_SZ / 4]; + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + break; + } + } + } + + std::vector blocks = options.bifOptions->GetEncryptionBlocksList(); + options.bifOptions->GetEncryptionBlocksList().clear(); + for (uint32_t itr = 0; itr < options.bifOptions->pmcdataBlocks.size(); itr++) + { + options.bifOptions->InsertEncryptionBlock(options.bifOptions->pmcdataBlocks[itr]); + } + + GenerateEncryptionKeyFile(aesFilename, options); + + options.bifOptions->GetEncryptionBlocksList().clear(); + for (uint32_t itr = 0; itr < blocks.size(); itr++) + { + options.bifOptions->InsertEncryptionBlock(blocks[itr]); + } + blocks.clear(); + } + + std::string iv0 = ReadIV0(aesFilename); + uint8_t hexData[256]; + + if (iv0.size() != (BYTES_PER_IV * 2)) + { + LOG_DEBUG(DEBUG_STAMP, "IV = %s, IV Size = %d", iv0.c_str(), iv0.size()); + LOG_ERROR("Encryption Error !!!\n An IV key must be 12 bytes long"); + } + PackHex(iv0, hexData); + + const uint8_t* iv = hexData; + for (uint32_t index = 0; index < WORDS_PER_IV; index++) + { + tmpIvPMCDATA[index] = ReadBigEndian32(iv); + iv += sizeof(uint32_t); + } + } + else + { + LOG_ERROR("Key Generation Error !!!\n Key File doesnot exist to encrypt PMC CDO "); + } + + VersalBootHeaderStructure* bh = (VersalBootHeaderStructure*)bi.bootHeader->section->Data; + bh->plmLength = partHdr->imageHeader->GetFsblFwSizeIh(); + bh->pmcCdoLength = partHdr->imageHeader->GetTotalPmcFwSizeIh(); + bh->totalPlmLength = estimatedTotalFsblLength + partHdr->imageHeader->GetAuthContext()->GetCertificateSize(); + bh->totalPmcCdoLength = estimatedtotalPmcCdoLength; + + memcpy_be((uint8_t*)bh->plmSecureHdrIv, tmpIv, BYTES_PER_IV); + memcpy_be((uint8_t*)bh->pmcCdoSecureHdrIv, tmpIvPMCDATA, BYTES_PER_IV); + + if (bi.imageList.size() != 0) + { + uint8_t cksumType = 0; + cksumType = bi.partitionHeaderList.front()->imageHeader->GetChecksumContext()->Type(); + + bh->bhAttributes = bi.partitionHeaderList.front()->imageHeader->GetPufHdLocation() << PUF_HD_BIT_SHIFT; + bh->bhAttributes |= cksumType << BI_HASH_BIT_SHIFT; + bh->bhAttributes |= bi.partitionHeaderList.front()->imageHeader->GetDpacm() << DPA_CM_BIT_SHIFT; + bh->bhAttributes |= bi.bifOptions->GetBhRsa() << BH_RSA_BIT_SHIFT; + bh->bhAttributes |= bi.bifOptions->GetPufMode() << BH_PUF_MODE_BIT_SHIFT; + + if (bi.partitionHeaderList.front()->imageHeader->GetAuthenticationType() != Authentication::None) + { + bh->bhAttributes |= BH_RSA_SINGED_BIT_MASK << BH_RSA_SINGED_BIT_SHIFT; + } + bh->bhAttributes |= bi.bifOptions->GetDice() << BH_DICE_BIT_SHIFT; + } + + bh->sourceOffset = sizeof(VersalBootHeaderStructure) + partHdr->imageHeader->GetAuthContext()->GetCertificateSize(); + bh->imageHeaderByteOffset = sizeof(VersalBootHeaderStructure) + bh->totalPlmLength + bh->totalPmcCdoLength; + bh->headerChecksum = bi.bootHeader->ComputeWordChecksum(&bh->widthDetectionWord, 3872); + + ChunkifyAndEncrypt(options, + partHdr->partition->section->Data, + partHdr->imageHeader->GetFsblFwSizeIh(), + (uint8_t*)bh + sizeof(VersalSmapWidthTable), + sizeof(VersalBootHeaderStructure) - sizeof(VersalSmapWidthTable), + encrFsblDataBuffer /* out*/, + encrFsblByteLength /* out */); + + if (estimatedEncrFsblLength < encrFsblByteLength) + { + LOG_ERROR("Encryption Error!!! - PmcFw Buffer overflow"); + } + + // PMC Data Encryption + totalencrBlocks = totalpmcdataencrBlocks; + totalBlocksOverhead = (totalencrBlocks + 1) * 64; //64 = AES_GCM_IV_SZ+AES_GCM_KEY_SZ+NUM_BYTES_PER_WORD+AES_GCM_TAG_SZ + + options.bifOptions->GetEncryptionBlocksList().clear(); + for (uint32_t itr = 0; itr < options.bifOptions->pmcdataBlocks.size(); itr++) + { + options.bifOptions->InsertEncryptionBlock(options.bifOptions->pmcdataBlocks[itr]); + } + + if (options.bifOptions->pmcDataAesFile != "") + { + aesKey = aesIv = aesSeed = NULL; + fixedInputData = NULL; + SetAesFileName(options.bifOptions->pmcDataAesFile); + LOG_INFO("Key file - %s", aesFilename.c_str()); + std::ifstream keyFile(aesFilename); + bool fileExists = keyFile.good(); + if (!fileExists) + { + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + aesKey = new uint32_t[AES_GCM_KEY_SZ / 4]; + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + break; + } + } + } + GenerateEncryptionKeyFile(aesFilename, options); + } + + bi.InsertEncryptionKeyFile(aesFilename); + CheckForSameAesKeyFiles(bi.GetEncryptionKeyFileVec()); + + ReadEncryptionKeyFile(aesFilename); + + std::pair asesKeyandKeySrcPair(partHdr->imageHeader->GetEncryptionKeySrc(), aesKey); + bi.aesKeyandKeySrc.push_back(asesKeyandKeySrcPair); + bi.bifOptions->CheckForBadKeyandKeySrcPair(bi.aesKeyandKeySrc, aesFilename); + + options.SetDevicePartName(deviceName); + CheckForExtraKeyIVPairs(totalencrBlocks, partHdr->partition->section->Name); + + if (!aesSeedexits && aesKeyVec.size() != 1) + { + if (totalencrBlocks + 1 > aesKeyVec.size()) + { + LOG_ERROR("AES Key file has less keys than the number of blocks to be encrypted in %s.", partHdr->partition->section->Name.c_str()); + } + if (totalencrBlocks + 1 > aesIvVec.size()) + { + LOG_ERROR("AES Key file has less IVs than the number of blocks to be encrypted in %s.", partHdr->partition->section->Name.c_str()); + } + } + else + { + if (bi.aesKeyandKeySrc.size() != 0) + { + for (uint32_t i = 0; i < bi.aesKeyandKeySrc.size(); i++) + { + if (partHdr->imageHeader->GetEncryptionKeySrc() == bi.aesKeyandKeySrc[i].first) + { + if (aesKey == NULL) + { + aesKey = new uint32_t[AES_GCM_KEY_SZ / 4]; + memcpy(aesKey, bi.aesKeyandKeySrc[i].second, AES_GCM_KEY_SZ); + } + if (aesKeyVec.size() == 0) + { + aesKeyVec.push_back(ConvertKeyIvToString((uint8_t *)aesKey, AES_GCM_KEY_SZ).c_str()); + } + break; + } + } + } + GenerateRemainingKeys(options); + } + + tmpIv = GetIv(); + if (tmpIv != NULL) + { + if (options.secHdrIvPmcData == NULL) + { + options.secHdrIvPmcData = (uint8_t*)malloc(BYTES_PER_IV); + } + memcpy_be(options.secHdrIvPmcData, tmpIv, BYTES_PER_IV); + } + } + else + { + LOG_ERROR("Key Generation Error !!!\n Key File doesnot exist to encrypt PMC CDO "); + } + + CheckForRepeatedKeyIVPairs(bi.GetEncryptionKeyFileVec(), false); + isPmcData = true; + uint32_t encrPmcByteLength; + uint32_t estimatedEncrPmcLength = partHdr->imageHeader->GetTotalPmcFwSizeIh() + totalBlocksOverhead; + uint8_t* encrPmcDataBuffer = new uint8_t[estimatedEncrPmcLength]; + LOG_INFO("Encrypting the PMC Data"); + + ChunkifyAndEncrypt(options, + partHdr->partition->section->Data + partHdr->imageHeader->GetFsblFwSizeIh(), + partHdr->imageHeader->GetTotalPmcFwSizeIh(), + NULL, 0, + encrPmcDataBuffer /* out*/, + encrPmcByteLength /* out */); + + if (estimatedEncrPmcLength < encrPmcByteLength) + { + LOG_ERROR("Encryption Error!!! - PMC Buffer overflow"); + } + + partHdr->partition->section->IncreaseLengthAndPadTo(encrFsblByteLength + encrPmcByteLength, 0x0); + memset(partHdr->partition->section->Data, 0, encrFsblByteLength + encrPmcByteLength); + memcpy(partHdr->partition->section->Data, encrFsblDataBuffer, encrFsblByteLength); + memcpy(partHdr->partition->section->Data + encrFsblByteLength, encrPmcDataBuffer, encrPmcByteLength); + + partHdr->imageHeader->SetTotalPmcFwSizeIh(encrPmcByteLength); + partHdr->imageHeader->SetTotalFsblFwSizeIh(encrFsblByteLength); + partHdr->partition->section->Length = encrFsblByteLength + encrPmcByteLength; + + LOG_INFO("Encrypted the partition - %s", partHdr->partition->section->Name.c_str()); + bi.options.CloseEncryptionDumpFile(); + delete[] encrFsblDataBuffer; + delete[] encrPmcDataBuffer; + return; + } + else if(isBootloader && partHdr->imageHeader->GetPmcFwSizeIh() == 0) + { + uint32_t encryptedLength; + uint32_t estimatedEncrLength = partHdr->partition->section->Length + totalBlocksOverhead; + uint8_t* encryptedDataBuffer = new uint8_t[estimatedEncrLength]; + + + uint32_t estimatedTotalFsblLength = estimatedEncrLength; + if (partHdr->imageHeader->GetAuthenticationType() != Authentication::None) + { + Binary::Length_t dataChunksCount = 0; + + dataChunksCount = ((estimatedEncrLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) / bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) + + ((((estimatedEncrLength - (SECURE_HDR_SZ + AES_GCM_TAG_SZ)) % bi.GetSecureChunkSize(partHdr->imageHeader->IsBootloader())) == 0 ? 0 : 1)); + + if (dataChunksCount != 1) + { + for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) + { + estimatedTotalFsblLength += SHA3_LENGTH_BYTES; + } + } + } + + VersalBootHeaderStructure* bh = (VersalBootHeaderStructure*)bi.bootHeader->section->Data; + bh->plmLength = partHdr->imageHeader->GetFsblFwSizeIh(); + bh->pmcCdoLength = 0; + bh->totalPlmLength = estimatedTotalFsblLength + partHdr->imageHeader->GetAuthContext()->GetCertificateSize(); + bh->totalPmcCdoLength = 0; + + memcpy_be((uint8_t*)bh->plmSecureHdrIv, tmpIv, BYTES_PER_IV); + memset((uint8_t*)bh->pmcCdoSecureHdrIv, 0, BYTES_PER_IV); + + if (bi.imageList.size() != 0) + { + uint8_t cksumType = 0; + cksumType = bi.partitionHeaderList.front()->imageHeader->GetChecksumContext()->Type(); + + bh->bhAttributes = bi.partitionHeaderList.front()->imageHeader->GetPufHdLocation() << PUF_HD_BIT_SHIFT; + bh->bhAttributes |= cksumType << BI_HASH_BIT_SHIFT; + bh->bhAttributes |= bi.partitionHeaderList.front()->imageHeader->GetDpacm() << DPA_CM_BIT_SHIFT; + bh->bhAttributes |= bi.bifOptions->GetBhRsa() << BH_RSA_BIT_SHIFT; + bh->bhAttributes |= bi.bifOptions->GetPufMode() << BH_PUF_MODE_BIT_SHIFT; + + if (bi.partitionHeaderList.front()->imageHeader->GetAuthenticationType() != Authentication::None) + { + bh->bhAttributes |= BH_RSA_SINGED_BIT_MASK << BH_RSA_SINGED_BIT_SHIFT; + } + bh->bhAttributes |= bi.bifOptions->GetDice() << BH_DICE_BIT_SHIFT; + } + bh->sourceOffset = sizeof(VersalBootHeaderStructure) + partHdr->imageHeader->GetAuthContext()->GetCertificateSize(); + bh->imageHeaderByteOffset = sizeof(VersalBootHeaderStructure) + bh->totalPlmLength + bh->totalPmcCdoLength; + bh->headerChecksum = bi.bootHeader->ComputeWordChecksum(&bh->widthDetectionWord, 3872); + + ChunkifyAndEncrypt(options, + partHdr->partition->section->Data, + partHdr->imageHeader->GetFsblFwSizeIh(), + bi.bootHeader->section->Data + sizeof(VersalSmapWidthTable), + sizeof(VersalBootHeaderStructure) - sizeof(VersalSmapWidthTable), + encryptedDataBuffer /* out*/, + encryptedLength /* out */); + + partHdr->partition->section->IncreaseLengthAndPadTo(encryptedLength, 0x0); + memcpy(partHdr->partition->section->Data, encryptedDataBuffer, encryptedLength); + partHdr->partition->section->Length = encryptedLength; + partHdr->imageHeader->SetTotalFsblFwSizeIh(encryptedLength); + + LOG_INFO("Encrypted the partition - %s", partHdr->partition->section->Name.c_str()); + bi.options.CloseEncryptionDumpFile(); + delete[] encryptedDataBuffer; + return; + } + else + { + uint32_t encryptedLength; + uint32_t estimatedEncrLength = partHdr->partition->section->Length + totalBlocksOverhead; + uint8_t* encryptedDataBuffer = new uint8_t[estimatedEncrLength]; + + ChunkifyAndEncrypt(options, + partHdr->partition->section->Data, + (uint32_t)partHdr->partition->section->Length, + NULL, 0, + encryptedDataBuffer /* out*/, + encryptedLength /* out */); + + partHdr->partition->section->IncreaseLengthAndPadTo(encryptedLength, 0x0); + memcpy(partHdr->partition->section->Data, encryptedDataBuffer, encryptedLength); + partHdr->partition->section->Length = encryptedLength; + partHdr->imageHeader->SetTotalFsblFwSizeIh(encryptedLength); + + LOG_INFO("Encrypted the partition - %s", partHdr->partition->section->Name.c_str()); + bi.options.CloseEncryptionDumpFile(); + delete[] encryptedDataBuffer; + return; + } +} \ No newline at end of file diff -Nru xilinx-bootgen-2021.2/encryption-zynq.cpp xilinx-bootgen-2022.2/encryption-zynq.cpp --- xilinx-bootgen-2021.2/encryption-zynq.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption-zynq.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2019 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -897,7 +897,7 @@ break; } - char c; + char c = ' '; if (word == "Key") { // First Word is "Key" diff -Nru xilinx-bootgen-2021.2/encryption-zynqmp.cpp xilinx-bootgen-2022.2/encryption-zynqmp.cpp --- xilinx-bootgen-2021.2/encryption-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -700,12 +700,14 @@ if (GetAesSeed() == NULL) { aesSeed = new uint32_t[WORDS_PER_AES_KEY]; + memset(aesSeed, 0, WORDS_PER_AES_KEY); GenerateAesSeed(); } if (GetFixedInputData() == NULL) { fixedInputData = new uint32_t[WORDS_PER_FID]; + memset(fixedInputData, 0, WORDS_PER_FID); GenerateAesFixedInputData(); } diff -Nru xilinx-bootgen-2021.2/encryption.cpp xilinx-bootgen-2022.2/encryption.cpp --- xilinx-bootgen-2021.2/encryption.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,12 @@ /******************************************************************************/ void EncryptionContext::GenerateEncryptionKeyFile(const std::string & baseFileName, Options & options) { + static bool kdfVersion = false; + if (!kdfVersion) + { + LOG_INFO("KDF Version : %s", kdf->GetVersion().c_str()); + kdfVersion = true; + } LOG_TRACE("Generating the AES key file"); std::string devicePartName = options.GetDevicePartName(); if (devicePartName != "") @@ -50,12 +56,14 @@ if (GetAesSeed() == NULL) { aesSeed = new uint32_t[WORDS_PER_AES_KEY]; + memset(aesSeed, 0, WORDS_PER_AES_KEY); } GenerateAesSeed(); if (GetFixedInputData() == NULL) { fixedInputData = new uint32_t[WORDS_PER_FID]; + memset(fixedInputData, 0, WORDS_PER_FID); } GenerateAesFixedInputData(); @@ -292,13 +300,26 @@ } /******************************************************************************/ +static int myrand(void) +{ + static unsigned long next; + static int firsttime = 1; + if (firsttime) { + firsttime = 0; + next = time(NULL); + } + next = next * 1103515245 + 12345; + return((unsigned)(next / 65536) % 32768); +} + +/******************************************************************************/ static uint32_t GetRandomValue(uint32_t maxValue) { uint32_t returnValue; do { - returnValue = (rand() / (int)(((unsigned)RAND_MAX + 1) / maxValue)); + returnValue = (myrand() / (int)(((unsigned)RAND_MAX + 1) / maxValue)); } while (returnValue > maxValue); return returnValue; diff -Nru xilinx-bootgen-2021.2/encryption.h xilinx-bootgen-2022.2/encryption.h --- xilinx-bootgen-2021.2/encryption.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/encryption.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ , fixedInputDataExits(false) { kdf = new Kdf(); - LOG_TRACE("KDF Version : 0x%X", kdf->GetVersion()); }; virtual ~EncryptionContext() @@ -113,7 +112,7 @@ return Encryption::None; } virtual void Process(BootImage& bi, PartitionHeader* partition) {}; - virtual void Process(BootImage & bi, PartitionHeader * partHdr, bool chunkbootloader) {}; + virtual void ChunkifyAndProcess(BootImage & bi, PartitionHeader * partHdr) {}; virtual void Process(BootImage& bi) {}; virtual void WriteEncryptionKeyFile(const std::string& baseFileName, bool useOptionalKey, uint32_t blocks) {}; virtual void ReadEncryptionKeyFile(const std::string& keyFileName) {}; diff -Nru xilinx-bootgen-2021.2/help.h xilinx-bootgen-2022.2/help.h --- xilinx-bootgen-2021.2/help.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/help.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -506,6 +506,30 @@ -------------+----------------------------------------------------------------+\n" /****************************************************************************** + overlay_cdo +******************************************************************************/ +#define OVERLAYCDO "\ +-------------+----------------------------------------------------------------+\n\ + OPTION | overlay_cdo |\n\ +-------------+----------------------------------------------------------------+\n\ + SUPPORTED | versal |\n\ +-------------+----------------------------------------------------------------+\n\ + DESCRIPTION | CDO overlay option provides a way to modify CDO files |\n\ + | after they are generated. |\n\ +-------------+----------------------------------------------------------------+\n\ + SYNOPSIS | -overlay_cdo |\n\ +-------------+----------------------------------------------------------------+\n\ + USAGE | bootgen -arch versal -image test.bif |\n\ + | -o test.bin -overlay_cdo ovl.cdo |\n\ +-------------+----------------------------------------------------------------+\n\ + EXPLANATION | The input file used with overlay_cdo command would have markers|\n\ + | and content which needs to be overlayed. |\n\ + | Bootgen searches for similar markers in all the cdo files |\n\ + | present inside BIF, when found the content in that cdo will be |\n\ + | replaced with the content from overlay cdo. |\n\ +-------------+----------------------------------------------------------------+\n" + +/****************************************************************************** p ******************************************************************************/ #define PHELP "\ diff -Nru xilinx-bootgen-2021.2/imageheadertable-versal.cpp xilinx-bootgen-2022.2/imageheadertable-versal.cpp --- xilinx-bootgen-2021.2/imageheadertable-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/imageheadertable-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ extern "C" { #include "cdo-npi.h" #include "cdo-source.h" +#include "cdo-command.h" #include "cdo-binary.h" #include "cdo-load.h" #include "cdo-overlay.h" @@ -57,6 +58,32 @@ */ /******************************************************************************/ +CdoSsitSyncMaster* CdoCmdWriteSsitSyncMaster() +{ + CdoSsitSyncMaster* cdoCmd = new CdoSsitSyncMaster; + cdoCmd->header.reserved = 0x00; + cdoCmd->header.length = 0x0; + cdoCmd->header.handler_id = 1; + cdoCmd->header.cmd_id = CdoCmds::SSIT_SYNC_MASTER; + LOG_TRACE("CDO_CMD_SSIT_SYNC_MASTER"); + return cdoCmd; +} + +/******************************************************************************/ +CdoCommandNop* CdoCmdNoOperation2(size_t size) +{ + CdoCommandNop* cdoCmd = new CdoCommandNop; + uint32_t length = size - CDO_CMD_NOP_SIZE - 4; /* consider the NOP command header and length as 2 NOPs */ + cdoCmd->header.reserved = 0x00; + cdoCmd->header.length = 0xff; + cdoCmd->header.handler_id = 1; + cdoCmd->header.cmd_id = CdoCmds::NOP; + cdoCmd->length = (length / CDO_CMD_NOP_SIZE); + LOG_TRACE(" CDO_CMD_NOP - %d", cdoCmd->length + 2); + return cdoCmd; +} + +/******************************************************************************/ VersalImageHeaderTable::VersalImageHeaderTable() : kekIvMust(false) , bootDevice(0) @@ -124,7 +151,7 @@ SetHeaderTablesSize(); SetTotalMetaHdrLength(0); SetIdentificationString(bi.IsBootloaderFound()); - SetIds(); + SetIds(bi.imageList.size() != 0); metaHdrKeySrc = bi.options.bifOptions->metaHdrAttributes.encrKeySource; SetMetaHdrSecureHdrIv(metaHdrSecHdrIv); dpacm = bi.bifOptions->metaHdrAttributes.dpaCM; @@ -160,7 +187,7 @@ } SetIdentificationString(bi.IsBootloaderFound()); - SetIds(); + SetIds(bi.imageList.size() != 0); if (bi.bifOptions->metaHdrAttributes.encrKeySource != KeySource::None) { @@ -324,6 +351,7 @@ SetMetaHdrGreyOrBlackIv(kekIvFile); SetImageHeaderTableAttributes(); SetReservedFields(); + SetOptionalDataSize(); SetChecksum(); } @@ -384,9 +412,9 @@ } /******************************************************************************/ -void VersalImageHeaderTable::SetIds() +void VersalImageHeaderTable::SetIds(bool warnIdCode) { - if (idCode == 0) + if (idCode == 0 && warnIdCode) { LOG_WARNING("id_code is not specified in BIF, default id code is 0x04ca8093 (s80 device)"); idCode = DEFAULT_ID_CODE_S80; @@ -581,6 +609,40 @@ } /******************************************************************************/ +void VersalImageHeaderTable::SetOptionalDataSize() +{ + iHTable->optionalDataSize = iht_optional_data_length / 4; +} + +/******************************************************************************/ +void VersalImageHeaderTable::SetXplmModulesData(BootImage& bi, uint32_t * data, uint32_t size) +{ + if (size != 0) + { + bi.xplm_modules_data_length = size; + bi.xplm_modules_data = (uint32_t*)malloc(bi.xplm_modules_data_length); + memcpy(bi.xplm_modules_data, data, bi.xplm_modules_data_length); + } +} + +/******************************************************************************/ +void VersalImageHeaderTable::SetOptionalData(uint32_t * data, uint32_t size) +{ + iht_optional_data_length = size; + if (size != 0) + { + iht_optional_data = (uint32_t*)malloc(iht_optional_data_length); + memcpy(iht_optional_data, data, iht_optional_data_length); + + section->IncreaseLengthAndPadTo(sizeof(VersalImageHeaderTableStructure) + iht_optional_data_length, 0); + memcpy(section->Data + sizeof(VersalImageHeaderTableStructure), iht_optional_data, iht_optional_data_length); + + iHTable = (VersalImageHeaderTableStructure*)section->Data; + } + iHTable->optionalDataSize = iht_optional_data_length / 4; +} + +/******************************************************************************/ void VersalImageHeaderTable::RealignSectionDataPtr(void) { iHTable = (VersalImageHeaderTableStructure*)section->Data; @@ -719,10 +781,16 @@ section = new Section("ImageHeader " + Name, size); imageHeader = (VersalImageHeaderStructure*)section->Data; ifs.read((char*)imageHeader, size); - long count = imageHeader->dataSectionCount; - long offset = imageHeader->partitionHeaderWordOffset * sizeof(uint32_t); - for (uint8_t index = 0; indexdataSectionCount < 32) + { + count = imageHeader->dataSectionCount; + } + + uint32_t offset = imageHeader->partitionHeaderWordOffset * sizeof(uint32_t); + + for (uint8_t index = 0; index < count; index++) { Bootloader = IsBootloader; @@ -778,15 +846,21 @@ imageHeader = (VersalImageHeaderStructure*)section->Data; memcpy(imageHeader, importedIH, size); - long offset = (imageHeader->partitionHeaderWordOffset * sizeof(uint32_t)) + (img_index * sizeof(VersalPartitionHeaderTableStructure)); + uint32_t offset = (imageHeader->partitionHeaderWordOffset * sizeof(uint32_t)) + (img_index * sizeof(VersalPartitionHeaderTableStructure)); VersalPartitionHeaderTableStructure* tempPHT = new VersalPartitionHeaderTableStructure; ifs.seekg(offset); ifs.read((char*)tempPHT, sizeof(VersalPartitionHeaderTableStructure)); - uint32_t count = tempPHT->dataSectionCount; + + uint32_t count = 0; + if (imageHeader->dataSectionCount < 32) + { + count = tempPHT->dataSectionCount; + } + delete tempPHT; - for (uint8_t index = 0; index 0) { - ParseCdos(bi, filelist, &buffer, &size); + if ((bi.bifOptions->pdiType == PartitionType::SLR_SLAVE_CONFIG) && (getenv("BOOTGEN_PROCESS_NOC_MARKERS") != NULL)) + { + ParseSlaveSlrConfigCdos(bi, filelist, &buffer, &size, false); + } + else + { + ParseCdos(bi, filelist, &buffer, &size, false); + } } SetPartitionType(PartitionType::CONFIG_DATA_OBJ); PartitionHeader* hdr = new VersalPartitionHeader(this, 0); @@ -1633,6 +1714,9 @@ /* For bootloader, all the sections are combined by padding the gaps to create only partition */ if (Bootloader) { + bi.imageHeaderTable->SetOptionalData(elf->iht_optional_data, elf->iht_optional_data_size); + bi.imageHeaderTable->SetXplmModulesData(bi, elf->xplm_modules_data, elf->xplm_modules_data_size); + /* Only loadable sections with non-size are considered */ if ((elf->GetProgramHeaderType(iprog) == xPT_LOAD) && (size > 0)) { @@ -1700,7 +1784,8 @@ LOG_INFO("File for merging - %s ", bi.bifOptions->GetPmcCdoFileList().at(0).c_str()); } - ParseCdos(bi, bi.bifOptions->GetPmcCdoFileList(), &cdo_partition, &cdo_length); + bool add_ssit_sync_master_cmd = (bi.bifOptions->pdiType == PartitionType::SLR_SLAVE_BOOT); + ParseCdos(bi, bi.bifOptions->GetPmcCdoFileList(), &cdo_partition, &cdo_length, add_ssit_sync_master_cmd); /* Calculate pad bytes for aligning PMC CDO for 16 byte-alignment */ uint32_t total_cdo_pad_bytes = 0; if (cdo_length % 16 != 0) @@ -1772,6 +1857,11 @@ partHdr->execAddress = exec_addr; partHdr->loadAddress = load_addr; partHdr->execState = proc_state; + if (elf->atf_handoff_params_prg_hdr_count == iprog && elf->atf_handoff_params_found) + { + partHdr->atf_handoff_params_offset = elf->atf_handoff_params_offset; + partHdr->update_atf_handoff_params = true; + } partHdr->partition = new VersalPartition(partHdr, partition_data, total_size); @@ -1787,12 +1877,178 @@ } /******************************************************************************/ -void VersalImageHeader::ParseCdos(BootImage& bi, std::vector filelist, uint8_t** cdo_data, size_t* cdo_size) +void VersalImageHeader::ParseSlaveSlrConfigCdos(BootImage& bi, std::vector filelist, uint8_t** cdo_data, size_t* cdo_size, bool add_ssit_sync_master) +{ + uint8_t* total_cdo_data = NULL; + uint8_t* cdo_padded_buffer = NULL; + size_t cdo_padded_buffer_length = 0; + uint64_t total_cdo_length = 0; + + uint32_t* start_marker_offsets = NULL; + uint8_t num_start_markers = 0; + uint32_t* end_marker_offsets = NULL; + uint8_t num_end_markers = 0; + + if (filelist.size() > 0) + { + /* Offset and length are set to CDO header size, to take into account the addition of + merged CDO header which will be added at the end */ + uint64_t offset = sizeof(VersalCdoHeader); + total_cdo_length = sizeof(VersalCdoHeader); + + for (uint8_t idx = 0; idx != filelist.size(); idx++) + { + void* cdo_data = NULL; + size_t cdo_length = 0; + uint64_t actual_cdo_size = 0; + const char* cdo_filename = filelist.at(idx).c_str(); + CdoSequence * cdo_seq; + CdoSequence * cdo_seq1; + if (add_ssit_sync_master) + { + /* Add SSIT Sync Master command */ + cdo_seq1 = cdoseq_load_cdo(cdo_filename); + if (cdo_seq1 == NULL) + { + LOG_ERROR("Error parsing CDO file"); + } + cdo_seq = cdocmd_create_sequence(); + cdocmd_add_ssit_sync_master(cdo_seq); + cdocmd_concat_seq(cdo_seq, cdo_seq1); + add_ssit_sync_master = false; + } + else + { + cdo_seq = cdoseq_load_cdo(cdo_filename); + if (cdo_seq == NULL) + { + LOG_ERROR("Error parsing CDO file"); + } + } + + if (bi.overlayCDO && cdooverlay_apply(cdo_seq, (CdoOverlayInfo *)(bi.overlayCDO))) + { + LOG_ERROR("Error applying overlay CDO file"); + } + + /* Enable the search for sync points - only needs to be done for SSIT devices */ + search_for_sync_points(); + cdo_data = cdoseq_to_binary(cdo_seq, &cdo_length, 0); + CheckIdsInCdo(cdo_seq); + + if (cdo_length != 0) + { + actual_cdo_size = cdo_length - sizeof(VersalCdoHeader); + } + else + { + LOG_ERROR("Incorrect CDO length read from : %s", cdo_filename); + } + + total_cdo_length += (actual_cdo_size); + total_cdo_data = (uint8_t*)realloc(total_cdo_data, total_cdo_length); + memcpy(total_cdo_data + offset, (uint8_t*)cdo_data + sizeof(VersalCdoHeader), actual_cdo_size); + offset += actual_cdo_size; + //delete cdo_data; + } + + num_start_markers = get_num_start_markers(); + start_marker_offsets = get_slr_start_marker_offsets(); + num_end_markers = get_num_end_markers(); + end_marker_offsets = get_slr_end_marker_offsets(); + + if (num_start_markers != num_end_markers) + { + LOG_ERROR("Number of start and end markers for NoC startup sequence is not same."); + } + + if (num_start_markers > 0) + { + size_t size = 0, prev_start = 0; + size_t start = 0, end = 0; + uint32_t p_offset = 0; + size_t copied_offset = 0; + size_t pad_bytes = 0; + LOG_TRACE(" markers found at offsets -"); + for (int i = 0; i < num_start_markers; i++) + { + start = *(start_marker_offsets + i) * 4; + end = *(end_marker_offsets + i) * 4; + /* Create a new chunk at start only if start and end are not in same 32K data */ + if (start / SSIT_CHUNK_SIZE != end / SSIT_CHUNK_SIZE) + { + size = start - prev_start; + + pad_bytes = SSIT_CHUNK_SIZE - (size % SSIT_CHUNK_SIZE); + cdo_padded_buffer_length += (size + pad_bytes); + + cdo_padded_buffer = (uint8_t*)realloc(cdo_padded_buffer, cdo_padded_buffer_length); + memcpy(cdo_padded_buffer + p_offset, total_cdo_data + copied_offset, size); + p_offset += size; + copied_offset += size; + + if (pad_bytes != 0) + { + CdoCommandNop* cdoCmd = CdoCmdNoOperation2(pad_bytes); + memcpy(cdo_padded_buffer + p_offset, cdoCmd, CDO_CMD_NOP_SIZE + 4); + p_offset += (CDO_CMD_NOP_SIZE + 4); + if (cdoCmd->length > 0) + { + memset(cdo_padded_buffer + p_offset, 0, cdoCmd->length * sizeof(uint32_t)); + p_offset += (cdoCmd->length * sizeof(uint32_t)); + } + } + + prev_start = start; + LOG_TRACE(" offset = 0x%lx, end = 0x%lx", start, end); + } + else + { + LOG_TRACE(" skipping marker at 0x%lx since end marker (0x%lx) is in same chunk", start, end); + } + } + /* Remaining data after last marker */ + size = total_cdo_length - prev_start; + cdo_padded_buffer_length += size; + cdo_padded_buffer = (uint8_t*)realloc(cdo_padded_buffer, cdo_padded_buffer_length); + memcpy(cdo_padded_buffer + p_offset, total_cdo_data + copied_offset, size); + + delete start_marker_offsets; + if (end_marker_offsets) delete end_marker_offsets; + + total_cdo_length = (cdo_padded_buffer_length); + total_cdo_data = (uint8_t*)realloc(total_cdo_data, total_cdo_length); + memcpy(total_cdo_data, cdo_padded_buffer, total_cdo_length); + delete cdo_padded_buffer; + } + + VersalCdoHeader* cdo_header = new VersalCdoHeader; + cdo_header->remaining_words = 0x04; + cdo_header->id_word = 0x004f4443; /* CDO */ + cdo_header->version = 0x00000200; /* Version - 2.0 */ + cdo_header->length = (total_cdo_length - sizeof(VersalCdoHeader)) / 4; + cdo_header->checksum = ~(cdo_header->remaining_words + cdo_header->id_word + cdo_header->version + cdo_header->length); + memcpy(total_cdo_data, cdo_header, sizeof(VersalCdoHeader)); + delete cdo_header; + } + + *cdo_size = total_cdo_length; + *cdo_data = total_cdo_data; +} + +/******************************************************************************/ +void VersalImageHeader::ParseCdos(BootImage& bi, std::vector filelist, uint8_t** cdo_data, size_t* cdo_size, bool add_ssit_sync_master) { uint8_t* total_cdo_data = NULL; uint64_t total_cdo_length = 0; void *cdo_data_pp = NULL; size_t cdo_data_pp_length = 0; + char slrid_from_source = 0; + char slrid_from_binary = 0; + char input_ch_souce = 0; + char input_ch_binary = 0; + bool is_source_cdo = false; + bool is_binary_cdo = false; if (filelist.size() > 0) { @@ -1807,10 +2063,63 @@ uint64_t actual_cdo_size = 0; const char* cdo_filename = filelist.at(idx).c_str(); CdoSequence * cdo_seq; - cdo_seq = cdoseq_load_cdo(cdo_filename); - if (cdo_seq == NULL) + CdoSequence * cdo_seq1; + + if (add_ssit_sync_master) + { + /* Add SSIT Sync Master command */ + cdo_seq1 = cdoseq_load_cdo(cdo_filename); + if (cdo_seq1 == NULL) + { + LOG_ERROR("Error parsing CDO file"); + } + cdo_seq = cdocmd_create_sequence(); + cdocmd_add_ssit_sync_master(cdo_seq); + cdocmd_concat_seq(cdo_seq, cdo_seq1); + add_ssit_sync_master = false; + } + else + { + cdo_seq = cdoseq_load_cdo(cdo_filename); + if (cdo_seq == NULL) + { + LOG_ERROR("Error parsing CDO file"); + } + } + + slrid_from_source = slr_id_from_source(input_ch_souce); + if (slrid_from_source != 0) { - LOG_ERROR("Error parsing CDO file"); + if (bi.globalSlrId != 0) + { + is_source_cdo = (bi.globalSlrId == slrid_from_source); + if (is_source_cdo == false) + { + LOG_WARNING("Mismatch between SLR ID of %s and rest of the CDOs. This may cause runtime issues. \n Please ensure that all the CDOs used for creating the pdi are for the same SLR/device", cdo_filename); + } + bi.globalSlrId = 0; + } + bi.globalSlrId = slrid_from_source; + } + else + { + slrid_from_binary = slr_id_from_binary(input_ch_binary); + if (slrid_from_binary != 0) + { + if (bi.globalSlrId != 0) + { + is_binary_cdo = (bi.globalSlrId == slrid_from_binary); + if (is_binary_cdo == false) + { + LOG_WARNING("Mismatch between SLR ID of %s and rest of the CDOs. This may cause runtime issues. \n Please ensure that all the CDOs used for creating the pdi are for the same SLR/device", cdo_filename); + } + bi.globalSlrId = 0; + } + else + { + bi.globalSlrId = slrid_from_binary; + } + } } if (bi.overlayCDO && cdooverlay_apply(cdo_seq, (CdoOverlayInfo *)(bi.overlayCDO))) { @@ -1818,13 +2127,19 @@ } cdo_data = cdoseq_to_binary(cdo_seq, &cdo_length, 0); CheckIdsInCdo(cdo_seq); + // TODO: Call this only for v2 + const char * env = getenv("BOOTGEN_CHECK_CDO_COMMANDS"); + if (env && *env != '\0') { + if (check_cdo_commands(cdo_data, cdo_length, bi.xplm_modules_data, bi.xplm_modules_data_length) < 0) { + LOG_WARNING("Invalid PLM cdo command is found in input cdo file"); + } + } //cdocmd_delete_sequence(cdo_seq); if (cdocmd_post_process_cdo(cdo_data, cdo_length, &cdo_data_pp, &cdo_data_pp_length)) { LOG_ERROR("PMC CDO post process error"); } - if (cdo_data_pp != NULL) { //delete cdo_data; @@ -1832,7 +2147,15 @@ cdo_length = cdo_data_pp_length; } - actual_cdo_size = cdo_length - sizeof(VersalCdoHeader); + if (cdo_length > sizeof(VersalCdoHeader)) + { + actual_cdo_size = cdo_length - sizeof(VersalCdoHeader); + } + else + { + LOG_ERROR("Incorrect cdo length read from : %s", cdo_filename); + } + total_cdo_length += (actual_cdo_size); total_cdo_data = (uint8_t*)realloc(total_cdo_data, total_cdo_length); memcpy(total_cdo_data + offset, (uint8_t*)cdo_data + sizeof(VersalCdoHeader), actual_cdo_size); @@ -2470,14 +2793,14 @@ } /******************************************************************************/ -CdoSsitSlaves* CdoCmdWriteSsitSyncSlaves(uint8_t num_slrs) +CdoSsitSlaves* CdoCmdWriteSsitSyncSlaves(uint8_t mask) { CdoSsitSlaves* cdoCmd = new CdoSsitSlaves; cdoCmd->header.reserved = 0x00; cdoCmd->header.length = 0x2; cdoCmd->header.handler_id = 1; cdoCmd->header.cmd_id = CdoCmds::SSIT_SYNC_SLAVES; - cdoCmd->mask = 0x7 >> (MAX_SLAVE_SLRS - num_slrs); + cdoCmd->mask = mask; cdoCmd->timeout_ms = 0xFFFF; LOG_TRACE("CDO_CMD_SSIT_SYNC_SLAVES - %d, %x", cdoCmd->mask, cdoCmd->timeout_ms); return cdoCmd; @@ -2606,9 +2929,16 @@ //cdocmd_delete_sequence(golden_cdo_seq); const size_t header_size = 20; - if (user_cdo_size == golden_cdo_size && memcmp(user_cdo_buffer + header_size, golden_cdo_buffer + header_size, golden_cdo_size - header_size) == 0) + if (golden_cdo_size != 0) { - return true; + if (user_cdo_size == golden_cdo_size && memcmp(user_cdo_buffer + header_size, golden_cdo_buffer + header_size, golden_cdo_size - header_size) == 0) + { + return true; + } + } + else + { + LOG_ERROR("Incorrect length read from : %s", golden_cdo_filename.c_str()); } return false; @@ -2738,6 +3068,10 @@ { LOG_ERROR("Error parsing CDO file"); } + if (bi.overlayCDO && cdooverlay_apply(cdo_seq, (CdoOverlayInfo *)(bi.overlayCDO))) + { + LOG_ERROR("Error applying overlay CDO file : %s", cdo_filename); + } cdo_buffer = (uint8_t*)cdoseq_to_binary(cdo_seq, &size, 0); partHdr->partitionSize = size; partHdr->partition = new VersalPartition(partHdr, cdo_buffer, size); @@ -2768,22 +3102,26 @@ slrBootPdiInfo.sort(SortByIndex); num_of_slrs = GetTotalSlrCount(slrBootPdiInfo); + char * do_ssit_check = getenv("BOOTGEN_DO_SSIT_NOC_CHECK"); + bool master_cdo_verified = 0; std::string device_name = ""; - switch (bi.bifOptions->idCode) { - case 0x04d14093: /* h50 */ - device_name = "xcvp1802"; - break; - default: - LOG_WARNING("Unknown SSIT device IDCODE 0x%08x, skipping verification of NoC configuration", bi.bifOptions->idCode); + + if (do_ssit_check != NULL) + { + switch (bi.bifOptions->idCode) { + case 0x04d14093: + device_name = "xcvp1802"; + break; + default: + LOG_WARNING("Skipping NoC configuration verification for the SSIT device. Device IDCODE 0x%08x, ", bi.bifOptions->idCode); + } } /* Add CDO Write Keyhole commands */ - char * do_ssit_check = getenv("BOOTGEN_DO_SSIT_NOC_CHECK"); - bool master_cdo_verified = 0; for (std::list::iterator slr_id = slrBootPdiInfo.begin(); slr_id != slrBootPdiInfo.end(); slr_id++) { - uint32_t file_size; - uint32_t pad_size; + uint32_t file_size = 0; + uint32_t pad_size = 0; std::ifstream stream((*slr_id)->file.c_str(), std::ios_base::binary); if (!stream) { @@ -2797,6 +3135,7 @@ file_size = slr_boot_data.len; pad_size = file_size + ((4 - (file_size & 3)) & 3); uint32_t bh_offset = 0; + uint32_t ih_offset = *((uint32_t *)(slr_boot_data.bytes + bh_offset + 0xc4)); /* Remove the 16-bytes of SMAP bus width from start of PDI */ uint32_t smap_data = (slr_boot_data.bytes[0]) + (slr_boot_data.bytes[1] << 8) + (slr_boot_data.bytes[2] << 16) + (slr_boot_data.bytes[3] << 24); if ((smap_data == 0xDD000000) || (smap_data == 0x00DD0000) || (smap_data == 0x000000DD)) @@ -2804,6 +3143,13 @@ bh_offset = (SMAP_BUS_WIDTH * 4); file_size -= (SMAP_BUS_WIDTH * 4); pad_size -= (SMAP_BUS_WIDTH * 4); + ih_offset -= (SMAP_BUS_WIDTH * 4); + } + + uint32_t p1_size = ih_offset, p2_size = file_size - p1_size; + //if (getenv("BOOTGEN_SPLIT_SSIT_SLAVE_BOOT_PDI") != NULL) + { + pad_size = p1_size + ((4 - (p1_size & 3)) & 3); } if ((device_name != "") && (do_ssit_check != NULL)) @@ -2870,14 +3216,53 @@ CdoCommandWriteKeyhole* cdoCmd = CdoCmdWriteKeyHole(pad_size, (*slr_id)->index); memcpy(p_buffer + p_offset, cdoCmd, CDO_CMD_WRITE_KEYHOLE_SIZE); p_offset += CDO_CMD_WRITE_KEYHOLE_SIZE; - delete cdoCmd; - memcpy(p_buffer + p_offset, slr_boot_data.bytes + bh_offset, file_size); - p_offset += file_size; - if ((pad_size - file_size) != 0) + { - memset(p_buffer + p_offset, 0, pad_size - file_size); - p_offset += pad_size; + memcpy(p_buffer + p_offset, slr_boot_data.bytes + bh_offset, p1_size); + p_offset += p1_size; + if ((pad_size - p1_size) != 0) + { + memset(p_buffer + p_offset, 0, pad_size - p1_size); + p_offset += pad_size - p1_size; + } + + /* Add SSIT Sync Slave command */ + size += sizeof(CdoSsitSlaves); + p_buffer = (uint8_t*)realloc(p_buffer, size); + CdoSsitSlaves *ssit_sync_slaves_cmd = CdoCmdWriteSsitSyncSlaves(1 << ((*slr_id)->index - 1) & 0xFF); + memcpy(p_buffer + p_offset, ssit_sync_slaves_cmd, sizeof(CdoSsitSlaves)); + p_offset += sizeof(CdoSsitSlaves); + delete ssit_sync_slaves_cmd; + /* Add part 2 write keyhole*/ + pad_size = p2_size + ((4 - (p2_size & 3)) & 3); + pad_bytes = ((16 - ((p_offset + CDO_CMD_WRITE_KEYHOLE_SIZE) & 15)) & 15); + size += (CDO_CMD_WRITE_KEYHOLE_SIZE + pad_size + pad_bytes); + p_buffer = (uint8_t*)realloc(p_buffer, size); + if (pad_bytes != 0) + { + CdoCommandNop* cdoCmd = CdoCmdNoOperation(pad_bytes); + LOG_TRACE("NOP - 0x%x", p_offset); + memcpy(p_buffer + p_offset, cdoCmd, CDO_CMD_NOP_SIZE); + p_offset += CDO_CMD_NOP_SIZE; + if (cdoCmd->header.length > 0) + { + memset(p_buffer + p_offset, 0, cdoCmd->header.length * sizeof(uint32_t)); + p_offset += (cdoCmd->header.length * sizeof(uint32_t)); + } + } + CdoCommandWriteKeyhole* cdoCmd2 = CdoCmdWriteKeyHole(pad_size, (*slr_id)->index); + memcpy(p_buffer + p_offset, cdoCmd2, CDO_CMD_WRITE_KEYHOLE_SIZE); + p_offset += CDO_CMD_WRITE_KEYHOLE_SIZE; + memcpy(p_buffer + p_offset, slr_boot_data.bytes + ih_offset + (SMAP_BUS_WIDTH * 4), p2_size); + p_offset += p2_size; + if ((pad_size - p2_size) != 0) + { + memset(p_buffer + p_offset, 0, pad_size - p2_size); + p_offset += pad_size - p2_size; + } + delete cdoCmd2; } + delete cdoCmd; /* Add SSIT Wait Slave command */ size += sizeof(CdoSsitSlaves); @@ -2893,7 +3278,7 @@ /* Add SSIT Sync Slave command */ size += sizeof(CdoSsitSlaves); p_buffer = (uint8_t*)realloc(p_buffer, size); - CdoSsitSlaves *ssit_sync_slaves_cmd = CdoCmdWriteSsitSyncSlaves(num_of_slrs); + CdoSsitSlaves *ssit_sync_slaves_cmd = CdoCmdWriteSsitSyncSlaves(((1 << num_of_slrs) - 1) & 0xFF); memcpy(p_buffer + p_offset, ssit_sync_slaves_cmd, sizeof(CdoSsitSlaves)); p_offset += sizeof(CdoSsitSlaves); delete ssit_sync_slaves_cmd; @@ -2913,6 +3298,10 @@ LOG_ERROR("Error parsing CDO file : %s", cdo_filename); } + if (bi.overlayCDO && cdooverlay_apply(cdo_seq, (CdoOverlayInfo *)(bi.overlayCDO))) + { + LOG_ERROR("Error applying overlay CDO file : %s", cdo_filename); + } if ((master_cdo_verified == 0) && (device_name != "") && (do_ssit_check != NULL)) { std::string golden_cdo_filename = device_name + "_boot_0.rnpi"; @@ -2933,9 +3322,17 @@ uint8_t* cdo_buffer = (uint8_t*)cdoseq_to_binary(cdo_seq, &cdo_size, 0); file_size = cdo_size; - pad_size = file_size + ((4 - (file_size & 3)) & 3); - file_size -= sizeof(VersalCdoHeader); - pad_size -= sizeof(VersalCdoHeader); + if (file_size > sizeof(VersalCdoHeader)) + { + pad_size = file_size + ((4 - (file_size & 3)) & 3); + file_size -= sizeof(VersalCdoHeader); + pad_size -= sizeof(VersalCdoHeader); + } + else + { + LOG_ERROR("Incorrect CDO length read from : %s", cdo_filename); + } + if (IsCdoCmdEndFound(cdo_buffer, file_size)) { file_size -= +sizeof(CdoCommandHeader); @@ -2958,7 +3355,7 @@ p_buffer = (uint8_t*)realloc(p_buffer, size); /* Add SSIT Sync Slave command */ - CdoSsitSlaves *ssit_sync_slaves_cmd = CdoCmdWriteSsitSyncSlaves(num_of_slrs); + CdoSsitSlaves *ssit_sync_slaves_cmd = CdoCmdWriteSsitSyncSlaves(((1 << num_of_slrs) - 1) & 0xFF); memcpy(p_buffer + p_offset, ssit_sync_slaves_cmd, sizeof(CdoSsitSlaves)); p_offset += sizeof(CdoSsitSlaves); delete ssit_sync_slaves_cmd; @@ -2997,7 +3394,7 @@ size_t num_bytes = 0; static bool chunk_size_info_printed = false; /* Default chunk size - 32KB */ - uint64_t chunk_size = 0x8000; + uint64_t chunk_size = SSIT_CHUNK_SIZE; char * ssit_chunk_size = getenv("BOOTGEN_SSIT_CHUNK_SIZE"); if (ssit_chunk_size != NULL) { @@ -3222,10 +3619,15 @@ const char* cdo_filename = (*slr_info)->file.c_str(); CdoSequence * master_cdo_seq; master_cdo_seq = cdoseq_load_cdo(cdo_filename); + CheckIdsInCdo(master_cdo_seq); if (master_cdo_seq == NULL) { LOG_ERROR("Error parsing CDO file"); } + if (bi.overlayCDO && cdooverlay_apply(master_cdo_seq, (CdoOverlayInfo *)(bi.overlayCDO))) + { + LOG_ERROR("Error applying overlay CDO file : %s", cdo_filename); + } size_t part_size = 0; /* Pass the complete CDO sequence and SYNC point index */ @@ -3264,8 +3666,14 @@ CdoCommandNop* cdoCmd = CdoCmdNoOperation(sizeof(VersalCdoHeader)); memcpy(p_buffer + p_offset, cdoCmd, CDO_CMD_NOP_SIZE); memset(p_buffer + p_offset + CDO_CMD_NOP_SIZE, 0, sizeof(VersalCdoHeader) - CDO_CMD_NOP_SIZE); - memcpy(p_buffer + p_offset + sizeof(VersalCdoHeader), part_data + sizeof(VersalCdoHeader), part_size - sizeof(VersalCdoHeader)); - + if (part_size > sizeof(VersalCdoHeader)) + { + memcpy(p_buffer + p_offset + sizeof(VersalCdoHeader), part_data + sizeof(VersalCdoHeader), part_size - sizeof(VersalCdoHeader)); + } + else + { + LOG_ERROR("Incorrect CDO length read from : %s", cdo_filename); + } p_offset += (master_chunk_size); (*slr_info)->offset += (master_chunk_size); master_file_size += master_chunk_size; @@ -3339,16 +3747,63 @@ bool info_display = true; VersalImageHeaderTableStructure* iHT = (VersalImageHeaderTableStructure*)data; size_t offset = iHT->firstPartitionHeaderWordOffset * 4; - slr_info->partition_sizes.push_back(sizeof(VersalImageHeaderTableStructure) + (iHT->totalMetaHdrLength * 4)); + slr_info->partition_sizes.push_back(sizeof(VersalImageHeaderTableStructure) + (iHT->optionalDataSize * 4) + (iHT->totalMetaHdrLength * 4)); + for (uint8_t index = 0; index < iHT->partitionTotalCount; index++) { VersalPartitionHeaderTableStructure* pHT = (VersalPartitionHeaderTableStructure*)(data + offset); - slr_info->partition_sizes.push_back(pHT->totalPartitionLength * 4); + /* TotalPartitionLength includes AC + partition + hashes if authenticated.*/ + if (pHT->checksumWordOffset != 0) + { + slr_info->partition_sizes.push_back((pHT->totalPartitionLength * 4) + SHA3_LENGTH_BYTES); + } + else + { + slr_info->partition_sizes.push_back(pHT->totalPartitionLength * 4); + } + offset += sizeof(VersalPartitionHeaderTableStructure); if (((pHT->partitionAttributes >> vphtPartitionTypeShift) & vphtPartitionTypeMask) == PartitionType::CONFIG_DATA_OBJ) { CdoSequence * cdo_seq; - cdo_seq = decode_cdo_binary(data + pHT->partitionWordOffset*4, pHT->totalPartitionLength*4); + if (pHT->checksumWordOffset != 0 || pHT->authCertificateOffset != 0) + { + uint8_t* partition_data = NULL; + uint32_t partition_length = pHT->encryptedPartitionLength * 4; + uint64_t data_chunk = SECURE_32K_CHUNK - SHA3_LENGTH_BYTES; + uint32_t partition_data_offset = (pHT->partitionWordOffset * 4); + + partition_data = (uint8_t*)malloc(partition_length); + memset(partition_data, 0x00, partition_length); + + if (partition_length <= data_chunk) + { + memcpy(partition_data, data + partition_data_offset, partition_length); + } + else + { + int num_secure_chunks = partition_length / data_chunk; + if (partition_length % data_chunk != 0) + { + num_secure_chunks++; + } + uint32_t lastChunkSize = partition_length - ((num_secure_chunks - 1) * data_chunk); + + for (int i = 1; i < num_secure_chunks; i++) + { + memcpy(partition_data + ((i - 1) * data_chunk), data + partition_data_offset, data_chunk); + partition_data_offset += (data_chunk + SHA3_LENGTH_BYTES); + } + + memcpy(partition_data + ((num_secure_chunks - 1) * data_chunk), data + partition_data_offset, lastChunkSize); + } + cdo_seq = decode_cdo_binary(partition_data, partition_length); + } + else + { + cdo_seq = decode_cdo_binary(data + pHT->partitionWordOffset * 4, pHT->totalPartitionLength * 4); + } + if (cdo_seq == NULL) { LOG_ERROR("decode_cdo_binary failed - %s", slr_info->file.c_str()); @@ -3506,7 +3961,7 @@ */ for (uint32_t ix = 0; ix < slr_info->sync_addresses.size(); ix++) { - if ((slr_info->sync_addresses[ix] > slr_info->offset) && (slr_info->sync_addresses[ix] < (slr_info->offset + size))) + if ((slr_info->sync_addresses[ix] >= slr_info->offset) && (slr_info->sync_addresses[ix] < (slr_info->offset + size))) { slr_info->sync_points++; LOG_TRACE(" sync point - %d",slr_info->sync_points); @@ -3892,7 +4347,13 @@ /* Find the no. of image headers to be created */ num_of_images = 0; uint32_t num_of_sections = 0; - uint32_t p_count = subSysImageHeaderTable->dataSectionCount; + + uint32_t p_count = 0; + if (subSysImageHeaderTable->dataSectionCount < 32) + { + p_count = subSysImageHeaderTable->dataSectionCount; + } + uint32_t p_offset = subSysImageHeaderTable->partitionHeaderWordOffset * sizeof(uint32_t); p_offset += 0x28; for (uint32_t i = 0; i < p_count; i++) diff -Nru xilinx-bootgen-2021.2/imageheadertable-versal.h xilinx-bootgen-2022.2/imageheadertable-versal.h --- xilinx-bootgen-2021.2/imageheadertable-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/imageheadertable-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,10 @@ #include "imageheadertable.h" #include "bootheader.h" +extern "C" { #include "cdo-command.h" +} + class ImageBifOptions; class SubSysImageHeader; class BifOptions; @@ -35,14 +38,15 @@ ********************************************* P R E P R O C E S S O R S *** ------------------------------------------------------------------------------- */ -#define MAX_NUM_PARTITIONS_VERSAL 32 +#define MAX_NUM_PARTITIONS_VERSAL 20 +#define MAX_NUM_IMAGES_VERSAL 10 /* 128MB Linear QSPI range */ #define LQSPI_BASE_ADDR_VERSAL (0xC0000000) #define LQSPI_SIZE_VERSAL (0x8000000) #define LQSPI_RANGE_MASK_VERSAL (0x7FFFFFF) -#define MAX_IHT_RESERVED_VERSAL 9 +#define MAX_IHT_RESERVED_VERSAL 8 #define MAX_SLAVE_SLRS 3 #define CDO_COMMAND_SIZE 16 @@ -60,6 +64,8 @@ #define SBI_KEYHOLE_SIZE 0x10000 #define AIE_BASE_ADDR 0x20000000000 +#define SSIT_CHUNK_SIZE 0x8000 + typedef enum { vihImageOwnerShift = 3, @@ -145,9 +151,10 @@ uint32_t extendedIdCode; // 0x44 uint32_t headerAuthCertificateWordOffset; // 0x48 uint32_t metaHdrGreyOrBlackIV[IV_LENGTH]; // 0x4C - uint32_t reserved[MAX_IHT_RESERVED_VERSAL]; // Reserved + uint32_t optionalDataSize; // 0x58 + uint32_t reserved[MAX_IHT_RESERVED_VERSAL]; // 0x5C - 0x78 uint32_t ihtChecksum; // 0x7C -}VersalImageHeaderTableStructure; +} VersalImageHeaderTableStructure; typedef struct { @@ -225,6 +232,7 @@ typedef struct { CdoCommandHeader header; + uint32_t length; } CdoCommandNop; #define CDO_CMD_NOP_SIZE 4 @@ -311,7 +319,7 @@ void SetFirstPartitionHeaderOffset(uint32_t offset); void SetPartitionCount(uint32_t count); void SetBootDeviceAddress(uint32_t address); - void SetIds(void); + void SetIds(bool warnIdCode); void SetIdentificationString(bool bootloader); void SetImageHeaderTableAttributes(); void SetTotalMetaHdrLength(uint32_t size); @@ -321,6 +329,9 @@ void SetHeaderAuthCertificateOffset(uint32_t offset); void SetReservedFields(void); void SetChecksum(void); + void SetOptionalDataSize(void); + void SetOptionalData(uint32_t*, uint32_t); + void SetXplmModulesData(BootImage& bi, uint32_t*, uint32_t); uint32_t GetImageHeaderTableVersion(void); uint32_t GetPartitionCount(void); @@ -384,7 +395,8 @@ uint32_t CheckAieEngineDataMemoryBoundary(Binary::Address_t globalAddr, Binary::Length_t pSize); void CreateSlrBootPartition(BootImage& bi); void CreateSlrConfigPartition(BootImage& bi); - void ParseCdos(BootImage& bi, std::vector filelist, uint8_t**, size_t*); + void ParseCdos(BootImage& bi, std::vector filelist, uint8_t**, size_t*, bool); + void ParseSlaveSlrConfigCdos(BootImage & bi, std::vector filelist, uint8_t **, size_t *, bool); //post-processing bool PostProcessCdo(const uint8_t* cdo_data, Binary::Length_t cdo_size); bool PostProcessCfi(const uint8_t* cdo_data, Binary::Length_t cdo_size); diff -Nru xilinx-bootgen-2021.2/imageheadertable-zynqmp.cpp xilinx-bootgen-2022.2/imageheadertable-zynqmp.cpp --- xilinx-bootgen-2021.2/imageheadertable-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/imageheadertable-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -276,7 +276,7 @@ /* Override the exec and load address, if startup & load are set through BIF attributes */ Startup.IsSet() ? (exec_addr = Startup.Value()) : (exec_addr = elf->GetStartUpAddress()); - if (Load.IsSet()) + if (Load.IsSet() && iprog == 0) { load_addr = Load.Value(); } @@ -459,7 +459,32 @@ { hdr->execState = A53ExecState::AARCH32; } - if(updateReserveInPh == true) + + if (Bootloader) + { + /* PMUFW + SPL */ + std::string pmu_fw = bi.bifOptions->GetPmuFwImageFile(); + ByteFile pmu_fw_data(pmu_fw); + Binary::Length_t pmu_size = pmu_fw_data.len; + uint8_t *partition_data = (uint8_t *)malloc(pmu_size); + memcpy(partition_data, pmu_fw_data.bytes, pmu_size); + + uint8_t pmu_padding = (4 - (pmu_size & 3)) & 3; + pmuFwSize = totalPmuFwSize = pmu_size + pmu_padding; + + partition_data = (uint8_t *)realloc(partition_data, pmuFwSize + data.len); + memset(partition_data + pmu_size, 0, pmu_padding); + memcpy(partition_data + pmuFwSize, data.bytes, data.len); + + data.bytes = partition_data; + fsblFwSize = totalFsblFwSize = data.len + ((4 - (data.len & 3)) & 3); + data.len += pmuFwSize; + + if (Load.IsSet()) + hdr->execAddress = Load.Value(); + } + + if (updateReserveInPh == true) { if(Reserve.IsSet()) { diff -Nru xilinx-bootgen-2021.2/imageheadertable.cpp xilinx-bootgen-2022.2/imageheadertable.cpp --- xilinx-bootgen-2021.2/imageheadertable.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/imageheadertable.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ cache.Sections.push_back(section); } - SetImageHeaderTableVersion(0x01020000); + SetImageHeaderTableVersion(VERSION_ZYNQ_ZYNQMP); for(std::list::iterator image = bi.imageList.begin(); image != bi.imageList.end(); image++) @@ -216,6 +216,9 @@ , isIhLowPowerDomain(false) , isIhPLPowerDomain(false) , isIhSystemPowerDomain(false) + , lockstep(false) + , cluster(0) + , delayAuth(false) { } /******************************************************************************/ @@ -284,6 +287,9 @@ , isIhLowPowerDomain(false) , isIhPLPowerDomain(false) , isIhSystemPowerDomain(false) + , lockstep(false) + , cluster(0) + , delayAuth(false) { } /******************************************************************************/ @@ -352,6 +358,9 @@ , isIhLowPowerDomain(false) , isIhPLPowerDomain(false) , isIhSystemPowerDomain(false) + , lockstep(false) + , cluster(0) + , delayAuth(false) { } diff -Nru xilinx-bootgen-2021.2/imageheadertable.h xilinx-bootgen-2022.2/imageheadertable.h --- xilinx-bootgen-2021.2/imageheadertable.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/imageheadertable.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,9 @@ #ifndef _IMAGEHEADERTABLE_H_ #define _IMAGEHEADERTABLE_H_ +/* Zynq/ZynqMp Version Updates */ +#define VERSION_ZYNQ_ZYNQMP 0x01020000 + /* ------------------------------------------------------------------------------- *********************************************** H E A D E R F I L E S *** @@ -143,6 +146,9 @@ virtual void SetA32ExecMode(bool) { }; virtual void SetDpacm(DpaCM::Type) { }; virtual void SetPufHdLocation(PufHdLoc::Type type) { }; + virtual void SetClusterNum(uint8_t num) { cluster = num; } + virtual void SetLockStepFlag(bool flag) { lockstep = flag; } + virtual void SetDelayAuthFlag (bool flag) { delayAuth = flag; } virtual void SetEncryptionKeySrc(KeySource::Type type) { }; virtual void SetPartitionRevocationId(uint32_t id) { }; @@ -200,6 +206,9 @@ virtual std::string GetKekIV() { return ""; } virtual PufHdLoc::Type GetPufHdLocation(void) { return PufHdLoc::PUFinEFuse; } std::vector GetFileList(void) { return filelist; } + virtual uint8_t GetClusterNum(void) { return cluster; } + virtual bool GetLockStepFlag(void) { return lockstep; } + virtual bool GetDelayAuthFlag(void) { return delayAuth; } // For multiple key files and auth parameters void SetAesKeyFile(std::string filename) { aesKeyFile = filename; } @@ -274,6 +283,8 @@ bool xipMode; bool early_handoff; bool hivec; + bool lockstep; + uint32_t cluster; uint32_t pmuFwSize; uint32_t pmcdataSize; uint32_t fsblFwSize; @@ -304,6 +315,7 @@ uint32_t spkSelect; uint32_t spkId; + bool delayAuth; Authentication::Type authType; AuthenticationContext* Auth; EncryptionContext* Encrypt; @@ -371,6 +383,8 @@ , metaHdrSecHdrIv(NULL) , metaHdrKeySrc(KeySource::None) , encrypt(NULL) + , iht_optional_data(NULL) + , iht_optional_data_length(0) { } virtual ~ImageHeaderTable() {} @@ -396,6 +410,8 @@ virtual void SetBootDevice(BootDevice::Type type) {}; virtual void SetBootDeviceAddress(uint32_t address) {}; virtual void ValidateSecurityCombinations(Authentication::Type, Encryption::Type, Checksum::Type) = 0; + virtual void SetOptionalData(uint32_t*, uint32_t) {}; + virtual void SetXplmModulesData(BootImage& bi, uint32_t*, uint32_t) {}; virtual uint32_t GetImageHeaderTableVersion(void) { return 0; } virtual uint32_t GetPartitionCount(void) { return 0; } @@ -412,6 +428,8 @@ uint32_t metaHeaderLength; KeySource::Type metaHdrKeySrc; uint8_t* metaHdrSecHdrIv; + uint32_t* iht_optional_data; + uint32_t iht_optional_data_length; protected: bool slaveBootSplitMode; diff -Nru xilinx-bootgen-2021.2/kdf.cpp xilinx-bootgen-2022.2/kdf.cpp --- xilinx-bootgen-2021.2/kdf.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/kdf.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,6 +1,5 @@ -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -580,7 +579,7 @@ } /******************************************************************************/ -uint32_t Kdf::GetVersion(void) +std::string Kdf::GetVersion(void) { return VERSION; } @@ -704,8 +703,16 @@ if (word == "=") { testFile >> word; - fixed_input_data = new uint8_t[fixed_input_data_byte_length]; - pack_hex(word, fixed_input_data); + if (fixed_input_data_byte_length > 0) + { + fixed_input_data = new uint8_t[fixed_input_data_byte_length]; + pack_hex(word, fixed_input_data); + } + else + { + std::cout << "FixedInputDataByteLen is expected prior to FixedInputData" << std::endl; + exit(KDF_CAVP_KI_LENGTH_IMPROPER); + } } else { @@ -746,7 +753,6 @@ return ret_value; } - bool verified = false; std::cout << "Generating Ko using Counter-Mode KDF..." << std::endl; std::cout << "KO = "; uint32_t number_of_Ko_bytes = key_out_length / 8; @@ -764,23 +770,17 @@ if (memcmp(key_out, verify_ko, number_of_Ko_bytes) == 0) { std::cout << "Verified with given Ko" << std::endl; - verified = true; + return 0; } else { std::cout << "Failed to verify with given Ko" << std::endl; + return KDF_CAVP_VERIFY_KO_FAILED; } } std::cout << std::endl; - if (verified) - { - return 0; - } - else - { - return KDF_CAVP_VERIFY_KO_FAILED; - } + return 0; } /******************************************************************************/ diff -Nru xilinx-bootgen-2021.2/kdf.h xilinx-bootgen-2022.2/kdf.h --- xilinx-bootgen-2021.2/kdf.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/kdf.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,6 +1,5 @@ -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +38,7 @@ #include #include -#define VERSION 0x00010000 +#define VERSION "v1.0" #define BYTES_PER_AES_SEED 32 #define KDF_COUNTER_BYTES 4 @@ -53,6 +52,7 @@ #define KDF_CAVP_KI_LENGTH_IMPROPER 0x00010003 #define KDF_CAVP_HEXKEY_IMPROPER 0x00010004 #define KDF_CAVP_VERIFY_KO_FAILED 0x00010005 +#define KDF_CAVP_FID_LENGTH_IMPROPER 0x00010006 /********************************************************************************/ class Kdf @@ -94,7 +94,7 @@ void SetKdfLogFilename(std::string filename); std::string GetKdfLogFilename(void); - uint32_t GetVersion(void); + std::string GetVersion(void); private: uint8_t* key_out; diff -Nru xilinx-bootgen-2021.2/main.cpp xilinx-bootgen-2022.2/main.cpp --- xilinx-bootgen-2021.2/main.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/main.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ LOG_MSG("\n"); LOG_MSG("****** %s v%s", PROGRAMNAME, RDI_VERSION); LOG_MSG(" **** Build date : %s-%s", date_stamp, time_stamp); - LOG_MSG(" ** Copyright 1986-%s Xilinx, Inc. All Rights Reserved.\n", year ? year : "2018"); + LOG_MSG(" ** Copyright 1986-%s Xilinx, Inc. All Rights Reserved.\n", year ? year : "2022"); } /******************************************************************************/ diff -Nru xilinx-bootgen-2021.2/options.cpp xilinx-bootgen-2022.2/options.cpp --- xilinx-bootgen-2021.2/options.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/options.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ else { Kdf* kdfCtx = new Kdf; - LOG_TRACE("KDF Version : 0x%X", kdfCtx->GetVersion()); + LOG_INFO("KDF Version : %s", kdfCtx->GetVersion().c_str()); uint32_t ret_value = kdfCtx->CAVPonCounterModeKDF(GetKDFTestVectorFile()); delete kdfCtx; if (ret_value != 0) @@ -322,6 +322,11 @@ void Options::SetArchType(Arch::Type type) { archType = type; + if (archType == Arch::VERSALNET) + { + archType = Arch::VERSAL; + versalNetSeries = true; + } } /******************************************************************************/ @@ -714,4 +719,19 @@ std::string Options::GetOverlayCDOFileName(void) { return overlayCDOFile; -} \ No newline at end of file +} + +/******************************************************************************/ +bool Options::IsSsitBif() +{ + bool ssit_bif = false; + for (std::vector::iterator bifoptions = bifOptionsList.begin(); bifoptions != bifOptionsList.end(); bifoptions++) + { + if ((*bifoptions)->slrBootCnt != 0 || (*bifoptions)->slrConfigCnt != 0) + { + ssit_bif = true; + break; + } + } + return ssit_bif; +} diff -Nru xilinx-bootgen-2021.2/options.h xilinx-bootgen-2022.2/options.h --- xilinx-bootgen-2021.2/options.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/options.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ ZYNQMP, FPGA, VERSAL, + VERSALNET } Type; }; @@ -103,7 +104,7 @@ , qspiSize(0) , logLevel(LogLevel::WARNING) , outputFmt(File::Unknown) - , readImageOption(ReadImageOption::ALL) + , readImageOption(ReadImageOption::NONE) , readImageFile("") , verifyImage(false) , bifOptions(NULL) @@ -114,6 +115,7 @@ , dumpOption(DumpOption::NONE) , dumpPath("") , deviceKeyStored(false) + , versalNetSeries(false) { cmdEncryptOptions = new CommndLineEncryptOptions(); }; @@ -230,6 +232,8 @@ Authentication::Type GetSecureDebugAuthType(void); std::string GetSecureDebugImageFile(void); std::string GetOverlayCDOFileName (void); + bool IsSsitBif(void); + bool IsVersalNetSeries(void) { return versalNetSeries; } uint32_t totalHeadersSize; uint32_t bootheaderSize; @@ -280,10 +284,13 @@ CommndLineEncryptOptions *cmdEncryptOptions; BifOptions* bifOptions; std::vector bifOptionsList; + std::list includeBifOptionsList; std::string fsblFilename; Authentication::Type secureDebugAuthType; std::string secureDebugImageFilename; std::string overlayCDOFile; +private: + bool versalNetSeries; }; #endif diff -Nru xilinx-bootgen-2021.2/partition-versal.cpp xilinx-bootgen-2022.2/partition-versal.cpp --- xilinx-bootgen-2021.2/partition-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partition-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,8 @@ : Partition(header0, section0) , header(header0) , firstChunkSize(0) + , versalNetSeries(false) + , secureChunkSize(SECURE_32K_CHUNK) { section = section0; @@ -54,6 +56,8 @@ : Partition(header0, data, length) , header(header0) , firstChunkSize(0) + , versalNetSeries(false) + , secureChunkSize(SECURE_32K_CHUNK) { std::string partition_name = ""; for (size_t i = 0; i < header->imageHeader->GetFileList().size(); i++) @@ -95,15 +99,15 @@ { chunkOnlength -= (SECURE_HDR_SZ + AES_GCM_TAG_SZ); } - dataChunksCount = (chunkOnlength / GetSecureChunkSize()) + (((chunkOnlength % GetSecureChunkSize()) == 0 ? 0 : 1)); + dataChunksCount = (chunkOnlength / secureChunkSize) + (((chunkOnlength % secureChunkSize) == 0 ? 0 : 1)); - if (chunkOnlength % GetSecureChunkSize() != 0) + if (chunkOnlength % secureChunkSize != 0) { - dataChunks.push_back(((chunkOnlength)-((dataChunksCount - 1) * GetSecureChunkSize()))); + dataChunks.push_back(((chunkOnlength)-((dataChunksCount - 1) * secureChunkSize))); } else { - dataChunks.push_back(GetSecureChunkSize()); + dataChunks.push_back(secureChunkSize); } for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) @@ -114,21 +118,209 @@ { if (encryptionFlag) { - dataChunks.push_back(GetSecureChunkSize() + SECURE_HDR_SZ + AES_GCM_TAG_SZ); - firstChunkSize = GetSecureChunkSize() + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + dataChunks.push_back(secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ; } else { - dataChunks.push_back(GetSecureChunkSize()); - firstChunkSize = GetSecureChunkSize(); + dataChunks.push_back(secureChunkSize); + firstChunkSize = secureChunkSize; } } else { - dataChunks.push_back(GetSecureChunkSize()); + dataChunks.push_back(secureChunkSize); } } + return newSectionLength; +} + +/******************************************************************************/ +size_t VersalPartition::GetBootloaderTotalDataChunks(Binary::Length_t partitionSize, std::vector& dataChunks, bool encryptionFlag) +{ + size_t newSectionLength = partitionSize; + size_t chunkOnlength = 0; + Binary::Length_t dataChunksCount = 0; + + //PMC DATA + if (header->imageHeader->GetTotalPmcFwSizeIh() != 0) + { + chunkOnlength = header->imageHeader->GetTotalPmcFwSizeIh(); + if (encryptionFlag) + { + chunkOnlength -= (SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + dataChunksCount = (chunkOnlength / secureChunkSize) + (((chunkOnlength % secureChunkSize) == 0 ? 0 : 1)); + if (dataChunksCount == 1) + { + if (chunkOnlength % secureChunkSize != 0) + { + size_t singleChunklength = (chunkOnlength)-((dataChunksCount - 1) * secureChunkSize); + if (encryptionFlag) + { + dataChunks.push_back(singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + LOG_TRACE("length of pmc data remaining length 0x%X:", singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + else + { + dataChunks.push_back(singleChunklength); + firstChunkSize = singleChunklength; + LOG_TRACE("length of pmc data remaining length 0x%X:", singleChunklength); + } + } + else + { + if (encryptionFlag) + { + dataChunks.push_back(secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + LOG_TRACE("length of pmc data remaining length 0x%X:", secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + else + { + dataChunks.push_back(secureChunkSize); + firstChunkSize = secureChunkSize; + LOG_TRACE("length of pmc data remaining length 0x%X:", secureChunkSize); + } + } + } + else + { + if (chunkOnlength % secureChunkSize != 0) + { + dataChunks.push_back(((chunkOnlength)-((dataChunksCount - 1) * secureChunkSize))); + LOG_TRACE("length of pmc data remaining length %d:", ((chunkOnlength)-((dataChunksCount - 1) * secureChunkSize))); + } + else + { + dataChunks.push_back(secureChunkSize); + LOG_TRACE("length of pmc data remaining length %d:", secureChunkSize); + } + for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) + { + dataChunks.push_back(SHA3_LENGTH_BYTES); + newSectionLength += SHA3_LENGTH_BYTES; + header->imageHeader->SetTotalPmcFwSizeIh(header->imageHeader->GetTotalPmcFwSizeIh() + SHA3_LENGTH_BYTES); + if (itr == dataChunksCount - 2) + { + if (encryptionFlag) + { + dataChunks.push_back(secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + } + else + { + dataChunks.push_back(secureChunkSize); + firstChunkSize = secureChunkSize; + } + } + else + { + dataChunks.push_back(secureChunkSize); + } + } + } + } + + //PLM + chunkOnlength = header->imageHeader->GetTotalFsblFwSizeIh(); + if (encryptionFlag) + { + chunkOnlength -= (SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + dataChunksCount = (chunkOnlength / secureChunkSize) + (((chunkOnlength % secureChunkSize) == 0 ? 0 : 1)); + if (dataChunksCount == 1) + { + // If PMC CDO present, need to calculate the hash, so include hash + if (header->imageHeader->GetTotalPmcFwSizeIh()) + { + dataChunks.push_back(SHA3_LENGTH_BYTES); + newSectionLength += SHA3_LENGTH_BYTES; + header->imageHeader->SetTotalFsblFwSizeIh(header->imageHeader->GetTotalFsblFwSizeIh() + SHA3_LENGTH_BYTES); + } + if (chunkOnlength % secureChunkSize != 0) + { + size_t singleChunklength = (chunkOnlength) - ((dataChunksCount - 1) * secureChunkSize); + if (encryptionFlag) + { + dataChunks.push_back(singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + LOG_TRACE("length of plm data remaining length 0x%X:", singleChunklength + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + else + { + dataChunks.push_back(singleChunklength); + firstChunkSize = singleChunklength; + LOG_TRACE("length of plm data remaining length 0x%X:", singleChunklength); + } + } + else + { + if (encryptionFlag) + { + dataChunks.push_back(secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + LOG_TRACE("length of plm data remaining length 0x%X:", secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + else + { + dataChunks.push_back(secureChunkSize); + firstChunkSize = secureChunkSize; + LOG_TRACE("length of plm data remaining length 0x%X:", secureChunkSize); + } + } + } + else + { + // If PMC CDO present, need to calculate the hash, so include hash + if (header->imageHeader->GetTotalPmcFwSizeIh()) + { + dataChunks.push_back(SHA3_LENGTH_BYTES); + newSectionLength += SHA3_LENGTH_BYTES; + header->imageHeader->SetTotalFsblFwSizeIh(header->imageHeader->GetTotalFsblFwSizeIh() + SHA3_LENGTH_BYTES); + } + if (chunkOnlength % secureChunkSize != 0) + { + dataChunks.push_back(((chunkOnlength)-((dataChunksCount - 1) * secureChunkSize))); + LOG_TRACE("length of plm data remaining length 0x%X:", ((chunkOnlength)-((dataChunksCount - 1) * secureChunkSize))); + } + else + { + dataChunks.push_back(secureChunkSize); + LOG_TRACE("length of plm data remaining length 0x%X:", secureChunkSize); + } + + for (uint32_t itr = 0; itr < dataChunksCount - 1; itr++) + { + dataChunks.push_back(SHA3_LENGTH_BYTES); + newSectionLength += SHA3_LENGTH_BYTES; + header->imageHeader->SetTotalFsblFwSizeIh(header->imageHeader->GetTotalFsblFwSizeIh() + SHA3_LENGTH_BYTES); + if (itr == dataChunksCount - 2) + { + if (encryptionFlag) + { + dataChunks.push_back(secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ); + firstChunkSize = secureChunkSize + SECURE_HDR_SZ + AES_GCM_TAG_SZ; + } + else + { + dataChunks.push_back(secureChunkSize); + firstChunkSize = secureChunkSize; + } + } + else + { + dataChunks.push_back(secureChunkSize); + } + } + } + if ((header->imageHeader->GetChecksumContext()->Type() != Checksum::None)) + { + newSectionLength += SHA3_LENGTH_BYTES; + header->imageHeader->SetTotalFsblFwSizeIh(header->imageHeader->GetTotalFsblFwSizeIh() + SHA3_LENGTH_BYTES); + } return newSectionLength; } @@ -141,7 +333,23 @@ int tempBufferSize = 0; /* Get the number/size data chunks and claculate the new section length*/ size_t length = section->Length; - size_t newLength = GetTotalDataChunks(length, dataChunks, encryptionFlag); + size_t newLength = 0; + bool checksum_bootloader = false; + + if (section->isBootloader && versalNetSeries) + { + if (header->imageHeader->GetChecksumContext()->Type() != Checksum::None) + { + /* If checksum is enabled for VersalNet bootloader, then add the final checksum here only. + VersalChecksumTable::Build & VersalChecksumTable::Link will not process anything for bootloader checksum */ + checksum_bootloader = true; + } + newLength = GetBootloaderTotalDataChunks(length, dataChunks, encryptionFlag); + } + else + { + newLength = GetTotalDataChunks(length, dataChunks, encryptionFlag); + } int itr = (dataChunks.size() - 3); @@ -225,6 +433,18 @@ delete[] tempBuffer; /*-------------------------------CHUNK 1------------------------------------*/ + if (checksum_bootloader) + { + /* Calculate hash of top chunk and previous hash */ + shaHash = new uint8_t[SHA3_LENGTH_BYTES]; + Versalcrypto_hash(shaHash, newDataPtr, tempBufferSize + SHA3_LENGTH_BYTES, true); + + /* Place the final hash at the start of PLM partition */ + newDataPtr -= SHA3_LENGTH_BYTES; + memcpy(newDataPtr, shaHash, SHA3_LENGTH_BYTES); + delete[] shaHash; + } + delete[] dataPtr; delete[] section->Data; @@ -237,6 +457,8 @@ /******************************************************************************/ void VersalPartition::Build(BootImage& bi, Binary& cache) { + versalNetSeries = bi.options.IsVersalNetSeries(); + secureChunkSize = bi.GetSecureChunkSize(this->header->imageHeader->IsBootloader()); /* Get the image header from this partition header */ ImageHeader& imageHeader(*this->header->imageHeader); /* Get the contexts for Authentication & Encryption */ @@ -304,7 +526,14 @@ { LOG_ERROR("Cannot reencrypt a partition that is already encrypted for %s", section->Name.c_str()); } - encryptCtx->Process(bi, header); + if (versalNetSeries) + { + encryptCtx->ChunkifyAndProcess(bi, header); + } + else + { + encryptCtx->Process(bi, header); + } uint32_t padLength = 0; @@ -323,7 +552,7 @@ if ((imageHeader.GetChecksumContext()->Type() == Checksum::SHA3) || (currentAuthCtx->authAlgorithm->Type() != Authentication::None)) { /* No chunking on bootloader for versal - Data should be alligned to 104 bytes before calculating the hash */ - if (imageHeader.IsBootloader()) + if (imageHeader.IsBootloader() && !(versalNetSeries)) { Binary::Length_t shaPadOnLength = header->partition->section->Length; if (currentAuthCtx->authAlgorithm->Type() != Authentication::None) @@ -353,7 +582,73 @@ header->transferSize = section->Length - imageHeader.GetChecksumContext()->Size(); /* Checksum length is added to the partition length, in case of bootloader. Partiton length should not include checksum length, so substarct*/ - + } + else if (imageHeader.IsBootloader() && versalNetSeries) + { + if (header->imageHeader->GetTotalPmcFwSizeIh() != 0) + { + ChunkifyAndHash(section, (encryptCtx->Type() != Encryption::None || header->preencrypted)); + currentAuthCtx->SetFirstChunkSize(firstChunkSize); + header->firstChunkSize = currentAuthCtx->GetFirstChunkSize(); + header->partition->section->firstChunkSize = header->firstChunkSize; + } + else + { + Binary::Length_t chunkOnLength = header->partition->section->Length; + if (encryptCtx->Type() != Encryption::None || header->preencrypted) + { + chunkOnLength -= (SECURE_HDR_SZ + AES_GCM_TAG_SZ); + } + else if (imageHeader.GetChecksumContext()->Type() != Checksum::None) + { + /* Checksum length is not added to the partition length, in case of bootloader for VersalNet. + Hence don't substract the checksum length, since it should not be included in hash calculation */ + //chunkOnLength -= imageHeader.GetChecksumContext()->Size(); + } + Binary::Length_t dataChunksCount = (chunkOnLength / secureChunkSize) + ((((chunkOnLength) % secureChunkSize) == 0 ? 0 : 1)); + if (dataChunksCount != 1) + { + ChunkifyAndHash(section, (encryptCtx->Type() != Encryption::None || header->preencrypted)); + currentAuthCtx->SetFirstChunkSize(firstChunkSize); + header->firstChunkSize = currentAuthCtx->GetFirstChunkSize(); + header->partition->section->firstChunkSize = header->firstChunkSize; + } + else if (dataChunksCount == 1 && imageHeader.GetChecksumContext()->Type() != Checksum::None) + { + size_t newLength = section->Length + SHA3_LENGTH_BYTES; + uint8_t* newDataPtr = new uint8_t[newLength]; + memset(newDataPtr, 0, newLength); + newDataPtr += SHA3_LENGTH_BYTES; + memcpy(newDataPtr, section->Data, section->Length); + + /* Calculate hash */ + uint8_t* shaHash; + shaHash = new uint8_t[SHA3_LENGTH_BYTES]; + Versalcrypto_hash(shaHash, newDataPtr, section->Length, true); + + /* Place the final hash at the start of PLM partition */ + newDataPtr -= SHA3_LENGTH_BYTES; + memcpy(newDataPtr, shaHash, SHA3_LENGTH_BYTES); + header->imageHeader->SetTotalFsblFwSizeIh(header->imageHeader->GetTotalFsblFwSizeIh() + SHA3_LENGTH_BYTES); + + delete[] shaHash; + delete[] section->Data; + section->Data = newDataPtr; + section->Length = newLength; + } + } + + if (bi.bifOptions->GetPmcdataFile() == "") + { + //imageHeader.SetTotalFsblFwSizeIh(section->Length); + } + else + { + //imageHeader.SetTotalPmcFwSizeIh(imageHeader.GetTotalPmcFwSizeIh() + shaPadLength); + } + header->transferSize = section->Length - imageHeader.GetChecksumContext()->Size(); + /* Checksum length is added to the partition length, in case of bootloader. + Partiton length should not include checksum length, so substarct*/ } /* Chunk the data into fixed 64KB/32KB */ else @@ -363,7 +658,7 @@ { chunkOnLength -= (SECURE_HDR_SZ + AES_GCM_TAG_SZ); } - Binary::Length_t dataChunksCount = (chunkOnLength / GetSecureChunkSize()) + ((((chunkOnLength) % GetSecureChunkSize()) == 0 ? 0 : 1)); + Binary::Length_t dataChunksCount = (chunkOnLength / secureChunkSize) + ((((chunkOnLength) % secureChunkSize) == 0 ? 0 : 1)); if (dataChunksCount != 1) { ChunkifyAndHash(section, (encryptCtx->Type() != Encryption::None || header->preencrypted)); @@ -376,7 +671,11 @@ if((imageHeader.IsBootloader() && imageHeader.GetChecksumContext()->Type() != Checksum::None)) { - padLength = imageHeader.GetChecksumContext()->Size(); + if (!versalNetSeries) + { + padLength = imageHeader.GetChecksumContext()->Size(); + } + /* Don't add checksum length here, as the checksum calculation and insertion happen in ChunkifyAndHash() for VersalNet */ } else { @@ -459,8 +758,3 @@ } } -/******************************************************************************/ -uint64_t VersalPartition::GetSecureChunkSize() -{ - return SECURE_32K_CHUNK - SHA3_LENGTH_BYTES; -} diff -Nru xilinx-bootgen-2021.2/partition.cpp xilinx-bootgen-2022.2/partition.cpp --- xilinx-bootgen-2021.2/partition.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partition.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,12 +28,6 @@ #include "authentication-zynq.h" #include "authentication-zynqmp.h" -/* TCM address for R5 */ -#define R5_TCM_START_ADDRESS 0x0000 -#define R5_BTCM_START_ADDRESS 0x20000 -#define R5_TCM_BANK_LENGTH 0x10000 -#define PMU_RAM_END_ADDRESS 0xFFDDFFFF - /* ------------------------------------------------------------------------------- ***************************************************** F U N C T I O N S *** @@ -49,7 +43,7 @@ } /******************************************************************************/ -Partition::Partition(PartitionHeader* header0, const uint8_t* data, Binary::Length_t length) +Partition::Partition(PartitionHeader* header0, const uint8_t* data, Binary::Length_t length) : header(header0) { std::string partName = header->imageHeader->GetName() + StringUtils::Format(".%d",header->index); diff -Nru xilinx-bootgen-2021.2/partitionheadertable-versal.cpp xilinx-bootgen-2022.2/partitionheadertable-versal.cpp --- xilinx-bootgen-2021.2/partitionheadertable-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partitionheadertable-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +23,29 @@ #include "bootheader-versal.h" #include "authentication-versal.h" +typedef enum +{ + atfHandoffExecStateShift = 0, + atfHandoffEndiannessShift = 1, + atfHandoffTrustzoneShift = 2, + atfHandoffExceptionLevelShift = 3, + atfHandoffDestCpuShift = 5, +} atf_handoff_partition_attributes; + +#define FSBL_MAX_PARTITIONS 6 + +/* Structure corresponding to each partition entry */ +struct atf_handoff_partition { + uint64_t entry_point; + uint64_t flags; +}; + +/* Structure for hand off parameters to ARM Trusted Firmware (ATF) */ +struct atf_handoff_params_struct { + uint8_t magic[4]; + uint32_t num_entries; + struct atf_handoff_partition handoff_partition[FSBL_MAX_PARTITIONS]; +} atf_handoff_params ; /* ------------------------------------------------------------------------------- @@ -37,6 +61,8 @@ , dpaCM(DpaCM::DpaCMDisable) , pufHdLoc(PufHdLoc::PUFinEFuse) , kekIvFile("") + , lockstep(Lockstep::LockstepDisable) + , cluster(0) { std::string name; slr = 0; @@ -376,7 +402,7 @@ break; case KeySource::EfuseUserGryKey1: - pHTable->partitionKeySource = EFUSE_USER_BLK_KEY1; + pHTable->partitionKeySource = EFUSE_USER_GRY_KEY1; kekIvFile = bifOptions->GetEfuseUserKek1IVFile(); if (kekIvFile == "") { @@ -511,6 +537,11 @@ authBlock = imageHeader->GetAuthBlock(); dpaCM = imageHeader->GetDpacm(); pufHdLoc = imageHeader->GetPufHdLocation(); + cluster = imageHeader->GetClusterNum(); + if (imageHeader->GetLockStepFlag() == true) + { + lockstep = Lockstep::LockstepEnable; + } if (hivec) { @@ -577,7 +608,9 @@ (endian << vphtEndiannessShift) | (partitionType << vphtPartitionTypeShift) | (hivec << vphtHivecShift) | - (dpaCM << vphtDpaCMShift) ; + (dpaCM << vphtDpaCMShift) | + (cluster << vNetphtClusterShift) | + (lockstep << vNetphtlockStepShift); } /******************************************************************************/ @@ -882,11 +915,32 @@ { LOG_INFO("Building the Partition Header Table"); + if (!bi.options.IsVersalNetSeries()) + { + if (getenv("BOOTGEN_SKIP_MAX_PARTITIONS_CHECK") == NULL) + { + if (bi.subSysImageList.size() > MAX_NUM_IMAGES_VERSAL) + { + LOG_ERROR("The maximum number of images supported for Versal is %d.\n No. of images found : %d", MAX_NUM_IMAGES_VERSAL, bi.imageList.size()); + } + if (bi.partitionHeaderList.size() > MAX_NUM_PARTITIONS_VERSAL) + { + LOG_ERROR("The maximum number of partitions supported for Versal is %d.\n No. of partitions found : %d", MAX_NUM_PARTITIONS_VERSAL, bi.partitionHeaderList.size()); + } + } + else + { + LOG_WARNING("The ENV BOOTGEN_SKIP_MAX_PARTITIONS_CHECK is set. Skipping check for maximum number of partitions/images."); + } + } + for (std::list::iterator partHdr = bi.partitionHeaderList.begin(); partHdr != bi.partitionHeaderList.end(); partHdr++) { (*partHdr)->Build(bi, cache); } + UpdateAtfHandoffParams(bi); + if (bi.partitionHeaderList.size() > 0) { bi.partitionHeaderTable->firstSection = bi.partitionHeaderList.front()->section; @@ -937,7 +991,7 @@ int32_t defaultEncrBlockSize = bi.options.bifOptions->metaHdrAttributes.defEncrBlockSize; Binary::Length_t encrBlocksSize = 0; Binary::Length_t encrOverhead = 0; - Binary::Length_t secureChunkSize = VersalPartition::GetSecureChunkSize(); + Binary::Length_t secureChunkSize = bi.GetSecureChunkSize(true); bi.options.bifOptions->metaHdrAttributes.encrBlocks.clear(); @@ -1017,7 +1071,7 @@ /* Note that the last block will always be based on the partition length.*/ std::vector secureChunkEncrBlocks; - uint32_t actualSecureChunkSize = VersalPartition::GetSecureChunkSize() - overhead; + uint32_t actualSecureChunkSize = bi.GetSecureChunkSize(true) - overhead; uint32_t totalKeyRollencrBlocks = EncryptionContext::GetTotalEncryptionBlocks(bi.imageHeaderTable->metaHeaderLength, secureChunkEncrBlocks, actualSecureChunkSize, &lastBlock); secureChunkEncrBlocks.clear(); @@ -1167,6 +1221,55 @@ } } +/******************************************************************************/ +void VersalPartitionHeaderTable::UpdateAtfHandoffParams(BootImage & bi) +{ + memset(&atf_handoff_params, 0, sizeof(atf_handoff_params_struct)); + atf_handoff_params.magic[0] = 'X'; + atf_handoff_params.magic[1] = 'L'; + atf_handoff_params.magic[2] = 'N'; + atf_handoff_params.magic[3] = 'X'; + + atf_handoff_params.num_entries = 0; + + for (std::list::iterator partHdr = bi.partitionHeaderList.begin(); partHdr != bi.partitionHeaderList.end(); partHdr++) + { + DestinationCPU::Type core = (*partHdr)->imageHeader->GetDestCpu(); + ExceptionLevel::Type exceptionLevel = (*partHdr)->imageHeader->GetExceptionLevel(); + TrustZone::Type trustzone = (*partHdr)->imageHeader->GetTrustZone(); + + //if((core = a72 - 0 or a72 - 1) && ((EL = EL2 && trustzone = non - secure) || (EL = EL1 && trustzone = secure) || (EL = EL1 && trustzone = non - secure))) + bool valid_core = ((core == DestinationCPU::A53_0) || (core == DestinationCPU::A53_1)); + bool valid_entry1 = ((exceptionLevel == ExceptionLevel::EL2) && (trustzone == TrustZone::NonSecure)); + bool valid_entry2 = (exceptionLevel == ExceptionLevel::EL1); + + if (valid_core && (valid_entry1 || valid_entry2)) + { + atf_handoff_params.handoff_partition[atf_handoff_params.num_entries].entry_point = (*partHdr)->execAddress; + + uint8_t execState = (*partHdr)->execState; + uint8_t endian = ((*partHdr)->elfEndianess == Endianness::BigEndian) ? 1 : 0; + uint8_t destCpu = (core == DestinationCPU::A53_0) ? 0 : 1; + + atf_handoff_params.handoff_partition[atf_handoff_params.num_entries].flags = (execState << atfHandoffExecStateShift) | + (endian << atfHandoffEndiannessShift) | + (trustzone << atfHandoffTrustzoneShift) | + (exceptionLevel << atfHandoffExceptionLevelShift) | + (destCpu << atfHandoffDestCpuShift); + + atf_handoff_params.num_entries++; + } + } + + for (std::list::iterator partHdr = bi.partitionHeaderList.begin(); partHdr != bi.partitionHeaderList.end(); partHdr++) + { + if ((*partHdr)->update_atf_handoff_params) + { + memcpy((*partHdr)->partition->section->Data + (*partHdr)->atf_handoff_params_offset, &atf_handoff_params, sizeof(atf_handoff_params_struct)); + } + } +} + /******************************************************************************/ void VersalPartitionHeaderTable::Link(BootImage & bi) { diff -Nru xilinx-bootgen-2021.2/partitionheadertable-versal.h xilinx-bootgen-2022.2/partitionheadertable-versal.h --- xilinx-bootgen-2021.2/partitionheadertable-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partitionheadertable-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,12 @@ vphtExecStateShift = 3, vphtExecStateMask = 0x1, + vNetphtlockStepShift = 4, + vNetphtlockStepMask = 0x3, + + vNetphtClusterShift = 6, + vNetphtClusterMask = 0x3, + vphtDestCpuShift = 8, vphtDestCpuMask = 0xF, @@ -99,6 +105,7 @@ #define EFUSE_USER_BLK_KEY1 0xC3A5C5A5 #define EFUSE_USER_GRY_KEY1 0xC3A5C5A7 +#define SECURE_16K_CHUNK 0x4000 #define SECURE_32K_CHUNK 0x8000 /* 32 KB = 32*1024 B */ #define SECURE_64K_CHUNK 0x10000 /* 64 KB = 64*1024 B */ @@ -207,6 +214,8 @@ private: uint8_t partitionEncrypted; uint8_t slr; + uint8_t cluster; + Lockstep::Type lockstep; uint32_t partitionUid; KeySource::Type partitionKeySrc; bool kekIvMust; @@ -222,6 +231,7 @@ public: void Build(BootImage& bi, Binary& cache); void ConfigureMetaHdrAuthenticationContext(BootImage& bi); + void UpdateAtfHandoffParams(BootImage& bi); void Link(BootImage& bi); Section* firstSection; }; @@ -233,13 +243,15 @@ VersalPartition(PartitionHeader* hdr, Section* section0); VersalPartition(PartitionHeader* hdr, const uint8_t* data, Binary::Length_t length); size_t GetTotalDataChunks(Binary::Length_t partitionSize, std::vector& dataChunks, bool encryptionFlag); + size_t GetBootloaderTotalDataChunks(Binary::Length_t partitionSize, std::vector& dataChunks, bool encryptionFlag); void ChunkifyAndHash(Section * section, bool encryptionFlag); void Build(BootImage& bi, Binary& cache); void Link(BootImage& bi); - static uint64_t GetSecureChunkSize(void); private: PartitionHeader* header; uint64_t firstChunkSize; + bool versalNetSeries; + uint64_t secureChunkSize; }; #endif diff -Nru xilinx-bootgen-2021.2/partitionheadertable.cpp xilinx-bootgen-2022.2/partitionheadertable.cpp --- xilinx-bootgen-2021.2/partitionheadertable.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partitionheadertable.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -236,6 +236,53 @@ { bi.headerAC->Link(bi, bi.imageHeaderTable->section); } + + std::list::iterator partHdr = bi.partitionHeaderList.begin(); + for (uint32_t currHdr = 0; currHdr < bi.partitionHeaderList.size(); currHdr++, partHdr++) + { + uint8_t currCpu = (*partHdr)->GetDestinationCpu(); + uint64_t currStrtAddr = (*partHdr)->GetLoadAddress(); + uint64_t currEndAddr = currStrtAddr + (*partHdr)->GetPartitionSize(); + if((*partHdr)->imageHeader->IsBootloader()) + { + currEndAddr = currStrtAddr + (*partHdr)->imageHeader->GetTotalFsblFwSizeIh(); + } + bool currCpuR5 = (currCpu == DestinationCPU :: R5_0 || currCpu == DestinationCPU :: R5_1 || currCpu == DestinationCPU :: R5_lockstep); + bool isCurrPartitionOnTcm = false; + + std::list::iterator nextPartHdr = bi.partitionHeaderList.begin(); + std::advance(nextPartHdr, currHdr + 1); + for (uint32_t nxtHdr = currHdr + 1; nxtHdr < bi.partitionHeaderList.size(); nxtHdr++) + { + uint8_t nxtCpu = (*nextPartHdr)->GetDestinationCpu(); + uint64_t nxtStrtAddr = (*nextPartHdr)->GetLoadAddress(); + uint64_t nxtEndAddr = nxtStrtAddr + (*nextPartHdr)->GetPartitionSize(); + if((*nextPartHdr)->imageHeader->IsBootloader()) + { + nxtEndAddr = nxtStrtAddr + (*nextPartHdr)->imageHeader->GetTotalFsblFwSizeIh(); + } + bool nxtCpuR5 = (nxtCpu == DestinationCPU :: R5_0 || nxtCpu == DestinationCPU :: R5_1 || nxtCpu == DestinationCPU :: R5_lockstep); + bool isNxtPartitionOnTcm = false; + + if (currCpuR5 != nxtCpuR5) + { + isCurrPartitionOnTcm = IsTcmMemoryRange((currCpu == DestinationCPU :: R5_lockstep) ? true:false, currStrtAddr, currEndAddr); + isNxtPartitionOnTcm = IsTcmMemoryRange((nxtCpu == DestinationCPU :: R5_lockstep) ? true:false, nxtStrtAddr, nxtEndAddr); + if (isCurrPartitionOnTcm || isNxtPartitionOnTcm) + { + std::advance(nextPartHdr, 1); + continue; + } + } + + if ((nxtEndAddr >= currStrtAddr) && (nxtStrtAddr < currEndAddr)) + { + LOG_WARNING("Partition %s range is overlapped with partition %s memory range", (*partHdr)->partition->section->Name.c_str(), (*nextPartHdr)->partition->section->Name.c_str()); + LOG_TRACE("Current Partition %s Start Address is %X and End Address is %X ,Next Partition %s Start Address is %X and End Address %X",(*partHdr)->partition->section->Name.c_str(), currStrtAddr, currEndAddr, (*nextPartHdr)->partition->section->Name.c_str(),nxtStrtAddr, nxtEndAddr); + } + std::advance(nextPartHdr, 1); + } + } } /******************************************************************************/ @@ -249,12 +296,12 @@ /******************************************************************************/ PartitionHeader::PartitionHeader(ImageHeader* imageheader, int index) - : imageHeader(imageheader) + : imageHeader(imageheader) , index(index) , partition(NULL) , checksumSection(NULL) , headAlignment(0) - , tailAlignment(0) + , tailAlignment(0) , authCertPresent(0) , encryptFlag(0) , checksumType(0) @@ -288,6 +335,8 @@ , firstChunkSize(0) , isPmcdata(false) , partitionType(PartitionType::RESERVED) + , update_atf_handoff_params(false) + , atf_handoff_params_offset(0) { if(imageheader != NULL) { @@ -338,3 +387,20 @@ SetPartitionNumber(partitionNum); SetChecksum(); } + +/****************************************************************************************************************/ +bool PartitionHeaderTable::IsTcmMemoryRange(bool isR5LockStep, uint64_t strtAddr, uint64_t endAddr) +{ + bool tcm_R5 = false; + if (isR5LockStep) + { + tcm_R5 = ((strtAddr > R5_BTCM_START_ADDRESS) && (strtAddr < (R5_TCM_START_ADDRESS + R5_TCM_BANK_LENGTH * 4)) && (endAddr <= (R5_TCM_START_ADDRESS + R5_TCM_BANK_LENGTH * 4))); + } + else + { + bool Tcm = (strtAddr >= R5_TCM_START_ADDRESS) && (strtAddr < (R5_TCM_START_ADDRESS + R5_TCM_BANK_LENGTH)) && (endAddr <= (R5_TCM_START_ADDRESS + R5_TCM_BANK_LENGTH)); + bool Btcm = ((strtAddr > R5_BTCM_START_ADDRESS) && (strtAddr < (R5_BTCM_START_ADDRESS + R5_TCM_BANK_LENGTH)) && (endAddr <= (R5_BTCM_START_ADDRESS + R5_TCM_BANK_LENGTH))); + tcm_R5 = (Tcm || Btcm); + } + return tcm_R5; +} diff -Nru xilinx-bootgen-2021.2/partitionheadertable.h xilinx-bootgen-2022.2/partitionheadertable.h --- xilinx-bootgen-2021.2/partitionheadertable.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/partitionheadertable.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,6 +166,8 @@ uint8_t authBlock; uint64_t firstChunkSize; + uint64_t atf_handoff_params_offset; + bool update_atf_handoff_params; protected: bool slaveBootSplitMode; uint32_t fullBhSize; @@ -186,6 +188,7 @@ virtual void BuildPartitions(BootImage& bi, Binary& cache); virtual void Link(BootImage& bi); virtual void LinkPartitions(BootImage& bi); + bool IsTcmMemoryRange(bool isR5LockStep, uint64_t strtAddr, uint64_t endAddr); Section* firstSection; }; @@ -207,4 +210,3 @@ #endif -// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689 diff -Nru xilinx-bootgen-2021.2/readimage-versal.cpp xilinx-bootgen-2022.2/readimage-versal.cpp --- xilinx-bootgen-2021.2/readimage-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,26 +69,117 @@ } } -/******************************************************************************/ -void VersalReadImage::ReadBinaryFile(DumpOption::Type dump, std::string path) +/**********************************************************************************************/ +void VersalReadImage::ReadPartitions() { size_t result; uint64_t offset = 0; - uint32_t index = 0; - bool smap_header_found = false; - dumpType = dump; - dumpPath = path; + uint32_t cnt_index = 0; + FILE *binFile = fopen(binFilename.c_str(), "rb"); - if (StringUtils::GetExtension(binFilename) == ".mcs") + if (!binFile) { - LOG_ERROR("The option '-read' is not supported on mcs format file : %s", binFilename.c_str()); + fclose(binFile); + LOG_ERROR("Cannot read file %s", binFilename.c_str()); } + std::list::iterator pHT = pHTs.begin(); + for (std::list::iterator iH = iHs.begin(); iH != iHs.end(); iH++) + { + uint32_t prev_id = 0xffffffff; + uint32_t section_count = 0; + + for (cnt_index = 0; cnt_index < (*iH)->dataSectionCount; cnt_index++) + { + uint32_t length = (*pHT)->encryptedPartitionLength * 4; + uint8_t* buffer = new uint8_t[length]; + uint32_t id = (*pHT)->puid & 0xFFFF; + offset = (*pHT)->partitionWordOffset * 4; + if (!(fseek(binFile, offset, SEEK_SET))) + { + result = fread(buffer, 1, length, binFile); + if (result != length) + { + LOG_ERROR("Error parsing partitions from PDI file"); + } + if (dumpType == DumpOption::PARTITIONS) + { + if (bH && bH->sourceOffset == offset) + { + length = bH->totalPlmLength; + } + if (prev_id == id) + { + section_count++; + } + DumpPartitions(buffer, length, (*iH)->imageName, id, section_count); + } + else + { + /* Bootloader - compare address offset from BH and PHT */ + if (bH && bH->sourceOffset == offset) + { + length = bH->totalPlmLength; + } + if ((dumpType == DumpOption::PLM) || (dumpType == DumpOption::BOOT_FILES)) + { + DumpPartitions(buffer, length, "plm", id, section_count); + if (dumpType == DumpOption::PLM) + { + delete[] buffer; + fclose(binFile); + return; + } + } + } + /* For extracting PMC DATA, Bootloader - compare address offset from BH and PHT */ + if (bH && bH->sourceOffset == offset) + { + if (bH && bH->totalPmcCdoLength != 0) + { + if ((dumpType == DumpOption::PARTITIONS) || (dumpType == DumpOption::PMC_CDO) || (dumpType == DumpOption::BOOT_FILES)) + { + DumpPartitions(buffer + bH->plmLength, bH->totalPmcCdoLength, "pmc_cdo"); + if ((dumpType == DumpOption::PMC_CDO) || (dumpType == DumpOption::BOOT_FILES)) + { + // if dump boot files, the return from here + delete[] buffer; + fclose(binFile); + return; + } + } + } + if (bH && bH->totalPmcCdoLength == 0 && dumpType == DumpOption::PMC_CDO) + { + LOG_ERROR("PMC_CDO partition is not available in the PDI"); + } + } + } + else + { + LOG_ERROR("Error parsing Partition Headers from bin file"); + } + pHT++; + prev_id = id; + delete[] buffer; + } + } + fclose(binFile); +} + +/******************************************************************************/ +void VersalReadImage::ReadHeaderTableDetails() +{ + size_t result; + uint64_t offset = 0; + uint32_t index = 0; + bool smap_header_found = false; FILE *binFile; binFile = fopen(binFilename.c_str(), "rb"); if (!binFile) { + fclose(binFile); LOG_ERROR("Cannot read file %s", binFilename.c_str()); } @@ -104,7 +196,7 @@ bH = NULL; } - if ((dump == DumpOption::BH) || (dump == DumpOption::BOOT_FILES)) + if ((dumpType == DumpOption::BH) || (dumpType == DumpOption::BOOT_FILES)) { if (bH == NULL) { @@ -159,6 +251,10 @@ { LOG_ERROR("Error parsing Image Header Table from PDI file"); } + if (!((iHT->partitionTotalCount > 0) && (iHT->partitionTotalCount < 0xFF))) + { + LOG_ERROR("Number of partitions read from PDI is more than number of supported partititon count."); + } } else { @@ -242,96 +338,27 @@ aCs.push_back(aC); } } - else + + fclose(binFile); + return; +} + +/******************************************************************************/ +void VersalReadImage::ReadBinaryFile(DumpOption::Type dump, std::string path) +{ + if (StringUtils::GetExtension(binFilename) == ".mcs") { - fclose(binFile); - return; + LOG_ERROR("The option '-read/-dump' is not supported on mcs format file : %s", binFilename.c_str()); } + dumpType = dump; + dumpPath = path; - uint32_t cnt_index = 0; - std::list::iterator pHT = pHTs.begin(); - for (std::list::iterator iH = iHs.begin(); iH != iHs.end(); iH++) + ReadHeaderTableDetails(); + if (readType != ReadImageOption::NONE) { - uint32_t prev_id = 0xffffffff; - uint32_t section_count = 0; - - for (cnt_index = 0; cnt_index < (*iH)->dataSectionCount; cnt_index++) - { - uint32_t length = (*pHT)->encryptedPartitionLength * 4; - uint8_t* buffer = new uint8_t[length]; - uint32_t id = (*pHT)->puid & 0xFFFF; - offset = (*pHT)->partitionWordOffset * 4; - if (!(fseek(binFile, offset, SEEK_SET))) - { - result = fread(buffer, 1, length, binFile); - if (result != length) - { - LOG_ERROR("Error parsing partitions from PDI file"); - } - if (dump == DumpOption::PARTITIONS) - { - if (bH && bH->sourceOffset == offset) - { - length = bH->totalPlmLength; - } - if (prev_id == id) - { - section_count++; - } - DumpPartitions(buffer, length, (*iH)->imageName, id, section_count); - } - else - { - /* Bootloader - compare address offset from BH and PHT */ - if (bH && bH->sourceOffset == offset) - { - length = bH->totalPlmLength; - } - if ((dump == DumpOption::PLM) || (dump == DumpOption::BOOT_FILES)) - { - DumpPartitions(buffer, length, "plm", id, section_count); - if (dump == DumpOption::PLM) - { - delete[] buffer; - fclose(binFile); - return; - } - } - } - /* For extracting PMC DATA - Bootloader - compare address offset from BH and PHT */ - if (bH && bH->sourceOffset == offset) - { - if (bH && bH->totalPmcCdoLength != 0) - { - if ((dump == DumpOption::PARTITIONS) || (dump == DumpOption::PMC_CDO) || (dump == DumpOption::BOOT_FILES)) - { - DumpPartitions(buffer + bH->plmLength, bH->totalPmcCdoLength, "pmc_cdo"); - if ((dump == DumpOption::PMC_CDO) || (dump == DumpOption::BOOT_FILES)) - { - // if dump boot files, the return from here - delete[] buffer; - fclose(binFile); - return; - } - } - } - if (bH && bH->totalPmcCdoLength == 0 && dump == DumpOption::PMC_CDO) - { - LOG_ERROR("PMC_CDO partition is not available in the PDI"); - } - } - } - else - { - LOG_ERROR("Error parsing Partition Headers from bin file"); - } - pHT++; - prev_id = id; - delete[] buffer; - } + DisplayHeaderTableDetails(readType); } - fclose(binFile); + ReadPartitions(); } /******************************************************************************/ @@ -353,41 +380,8 @@ } /******************************************************************************/ -void VersalReadImage::DisplayImageDetails(ReadImageOption::Type type, DumpOption::Type dump, std::string dump_dir) +void VersalReadImage::DisplayHeaderTableDetails(ReadImageOption::Type type) { - ReadBinaryFile(dump, dump_dir); - if (dump != DumpOption::NONE) - { - if (iHT->metaHdrKeySource != KeySource::None) - { - switch (dump) - { - case DumpOption::BH: - break; - - case DumpOption::PLM: - LOG_ERROR("Cannot dump PLM from an encrypted PDI."); - break; - - case DumpOption::PMC_CDO: - LOG_ERROR("Cannot dump PMC_CDO from an encrypted PDI."); - break; - - case DumpOption::PARTITIONS: - LOG_ERROR("Cannot dump partitions from an encrypted PDI."); - break; - - case DumpOption::BOOT_FILES: - LOG_MSG("\n[INFO] : Cannot dump PLM/ PMC_CDO/ partitions from an encrypted PDI."); - break; - - default: - break; - } - } - return; - } - switch (type) { case ReadImageOption::BH: @@ -438,6 +432,46 @@ } /******************************************************************************/ +void VersalReadImage::DisplayImageDetails(ReadImageOption::Type type, DumpOption::Type dump, std::string dump_dir) +{ + readType = type; + + ReadBinaryFile(dump, dump_dir); + + if (dump != DumpOption::NONE) + { + if (iHT->metaHdrKeySource != KeySource::None) + { + switch (dump) + { + case DumpOption::BH: + break; + + case DumpOption::PLM: + LOG_ERROR("Cannot dump PLM from an encrypted PDI."); + break; + + case DumpOption::PMC_CDO: + LOG_ERROR("Cannot dump PMC_CDO from an encrypted PDI."); + break; + + case DumpOption::PARTITIONS: + LOG_ERROR("Cannot dump partitions from an encrypted PDI."); + break; + + case DumpOption::BOOT_FILES: + LOG_MSG("\n[INFO] : Cannot dump PLM/ PMC_CDO/ partitions from an encrypted PDI."); + break; + + default: + break; + } + } + return; + } +} + +/******************************************************************************/ void VersalReadImage::DisplayBootHeader(void) { Separator(); @@ -465,6 +499,9 @@ DisplayIV("plm_sec_hdr_iv (0x64) : ", bH->plmSecureHdrIv); DisplayValue("puf_shutter (0x70) : ", bH->shutterValue); DisplayIV("pmccdo_sec_hdr_iv (0x74) : ", bH->pmcCdoSecureHdrIv); + //VersalNet + DisplayValue("puf_ro_swap (0x80) : ", bH->pufRoSwapConfigVal); + DisplayValue("revoke_id (0x84) : ", bH->revokeId); DisplayValue("metahdr_offset (0xc4) : ", bH->imageHeaderByteOffset); DisplayKey("puf_data (0x928) : ", bH->puf); DisplayValue("checksum (0xf30) : ", bH->headerChecksum); @@ -525,8 +562,9 @@ DisplayValue("hdr_sizes (0x2C) : ", iHT->headerSizes, "mhdr_total_length (0x30) : ", iHT->totalMetaHdrLength); DisplayIV("mhdr_sec_hdr_iv (0x34) : ", iHT->metaHdrSecureHdrIv); DisplayValue("mhdr_encrkey_store (0x40) : ", iHT->metaHdrKeySource, "extended_id_code (0x44) : ", iHT->extendedIdCode); - DisplayValue("hdr_ac (0x48) : ", iHT->headerAuthCertificateWordOffset, "checksum (0x7c) : ", iHT->ihtChecksum); + DisplayValue("hdr_ac (0x48) : ", iHT->headerAuthCertificateWordOffset); DisplayIV("grey/black_iv (0x4C) : ", iHT->metaHdrGreyOrBlackIV); + DisplayValue("optional_data_size (0x58) : ", iHT->optionalDataSize, "checksum(0x7c) : ", iHT->ihtChecksum); std::cout << " attribute list - " << std::endl; DisplayIhtAttributes(iHT->imageHeaderTableAttributes); } @@ -753,6 +791,21 @@ default: val = "[invalid]"; break; } DisplayAttributes("bh_auth ", val1, "puf_mode ", val); + + //VersalNet + switch ((value >> BH_RSA_SINGED_BIT_SHIFT) & BH_RSA_SINGED_BIT_MASK) + { + case 3: val = "[yes]"; break; + default: val = "[no]"; break; + } + val1 = val; + + switch ((value >> BH_DICE_BIT_SHIFT) & BH_DICE_BIT_MASK) + { + case 3: val = "[enabled]"; break; + default: val = "[disabled]"; break; + } + DisplayAttributes("rsa_signed ", val1, "dice ", val); } /*********************************************************************************/ @@ -880,7 +933,7 @@ { uint32_t core = (value >> vphtDestCpuShift) & vphtDestCpuMask; uint32_t arch = (value >> vphtExecStateShift) & vphtExecStateMask; - uint32_t is_a72 = (core == 1 || core == 2 || core == 3 || core == 4); + uint32_t is_a72 = (core == 1 || core == 2); bool is_armv8 = (arch == 0 && is_a72 == 1); bool is_armv7 = ((arch == 1 && is_a72 == 1) || core == 5 || core == 6 || core == 7); bool is_elf = (((value >> vphtPartitionTypeShift) & vphtPartitionTypeMask) == 1); @@ -926,13 +979,11 @@ case 0: val = "[none]"; break; case 1: val = "[a72-0]"; break; case 2: val = "[a72-1]"; break; - case 3: val = "[a72-2]"; break; - case 4: val = "[a72-3]"; break; case 5: val = "[r5-0]"; break; case 6: val = "[r5-1]"; break; case 7: val = "[r5-lockstep]"; break; case 8: val = "[psm]"; break; - case 9: val = "[me]"; break; + case 9: val = "[aie]"; break; default: val = "[invalid]"; break; } if (!is_elf) @@ -942,6 +993,25 @@ DisplayAttributes("exec_state ", val1, "core ", val); + //VersalNet + switch ((value >> vNetphtlockStepShift) & vNetphtlockStepMask) + { + case 0: val = "[disabled]"; break; + case 3: val = "[enabled]"; break; + default: val = "[invalid]"; break; + } + val1 = val; + switch ((value >> vNetphtClusterShift) & vNetphtClusterMask) + { + case 0: val = "[0]"; break; + case 1: val = "[1]"; break; + case 2: val = "[2]"; break; + case 3: val = "[3]"; break; + default: val = "[invalid]"; break; + } + + DisplayAttributes("lockstep ", val1, "cluster", val); + switch ((value >> vphtChecksumTypeShift) & vphtChecksumTypeMask) { case 0: val = "[none]"; break; diff -Nru xilinx-bootgen-2021.2/readimage-versal.h xilinx-bootgen-2022.2/readimage-versal.h --- xilinx-bootgen-2021.2/readimage-versal.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-versal.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,6 +59,7 @@ bH = NULL; iHT = NULL; dumpType = DumpOption::NONE; + readType = ReadImageOption::NONE; iHs.clear(); pHTs.clear(); partitionBuffers.clear(); @@ -68,7 +69,10 @@ ~VersalReadImage(); void ReadBinaryFile(DumpOption::Type dump=DumpOption::NONE, std::string path=""); + void ReadHeaderTableDetails(); + void ReadPartitions(); void DisplayImageDetails(ReadImageOption::Type type, DumpOption::Type dump, std::string path=""); + void DisplayHeaderTableDetails(ReadImageOption::Type type); void DisplayBootHeader(void); void DisplayImageHeaderTable(void); void DisplayImageHeaders(void); @@ -97,6 +101,7 @@ protected: std::string binFilename; DumpOption::Type dumpType; + ReadImageOption::Type readType; std::string dumpPath; VersalBootHeaderStructure* bH; VersalImageHeaderTableStructure* iHT; diff -Nru xilinx-bootgen-2021.2/readimage-zynq.cpp xilinx-bootgen-2022.2/readimage-zynq.cpp --- xilinx-bootgen-2021.2/readimage-zynq.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-zynq.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +86,14 @@ { LOG_ERROR("Error reading Image header table"); } + if ((iHT->version != VERSION_ZYNQ_ZYNQMP)) + { + LOG_ERROR("Improper version (0x%.8x) read from Image Header Table of the boot image file.", iHT->version); + } + if (!((iHT->partitionTotalCount > 0) && (iHT->partitionTotalCount < 0xFF))) + { + LOG_ERROR("Number of partitions read is more than number of supported partititon count."); + } } else { @@ -248,7 +257,6 @@ Separator(); DisplayValue("next_ih(W) (0x00) : ", (*iH)->nextImageHeaderWordOffset); DisplayValue("next_pht(W) (0x04) : ", (*iH)->partitionHeaderWordOffset); - DisplayValue("total_partitions (0x08) : ", (*iH)->dataSectionCount); DisplayValue("total_partitions (0x0c) : ", (*iH)->imageNameLength); DisplayAscii("name (0x10) : ", *name); } diff -Nru xilinx-bootgen-2021.2/readimage-zynq.h xilinx-bootgen-2022.2/readimage-zynq.h --- xilinx-bootgen-2021.2/readimage-zynq.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-zynq.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,3 +1,4 @@ + /****************************************************************************** * Copyright 2015-2020 Xilinx, Inc. * @@ -45,6 +46,8 @@ { bH = NULL; iHT = NULL; + iH = NULL; + pHT = NULL; iHs.clear(); pHTs.clear(); } diff -Nru xilinx-bootgen-2021.2/readimage-zynqmp.cpp xilinx-bootgen-2022.2/readimage-zynqmp.cpp --- xilinx-bootgen-2021.2/readimage-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,6 +88,14 @@ { LOG_ERROR("Error reading Image header table"); } + if ((iHT->version != VERSION_ZYNQ_ZYNQMP)) + { + LOG_ERROR("Improper version (0x%.8x) read from Image Header Table of the boot image file.", iHT->version); + } + if (!((iHT->partitionTotalCount > 0) && (iHT->partitionTotalCount < 0xFF))) + { + LOG_ERROR("Number of partitions read is more than number of supported partiiton count."); + } } else { @@ -287,7 +296,6 @@ Separator(); DisplayValue("next_ih(W) (0x00) : ", (*iH)->nextImageHeaderWordOffset); DisplayValue("next_pht(W) (0x04) : ", (*iH)->partitionHeaderWordOffset); - DisplayValue("total_partitions (0x08) : ", (*iH)->dataSectionCount); DisplayValue("total_partitions (0x0c) : ", (*iH)->imageNameLength); DisplayAscii("name (0x10) : ", *name); } diff -Nru xilinx-bootgen-2021.2/readimage-zynqmp.h xilinx-bootgen-2022.2/readimage-zynqmp.h --- xilinx-bootgen-2021.2/readimage-zynqmp.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/readimage-zynqmp.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,3 +1,4 @@ + /****************************************************************************** * Copyright 2015-2021 Xilinx, Inc. * @@ -48,6 +49,8 @@ { bH = NULL; iHT = NULL; + iH = NULL; + pHT = NULL; iHs.clear(); pHTs.clear(); authenticationVerified = true; diff -Nru xilinx-bootgen-2021.2/regdefs.h xilinx-bootgen-2022.2/regdefs.h --- xilinx-bootgen-2021.2/regdefs.h 1970-01-01 00:00:00.000000000 +0000 +++ xilinx-bootgen-2022.2/regdefs.h 2022-09-26 06:24:42.000000000 +0000 @@ -0,0 +1,233 @@ +/* +####################################################################### +# Copyright (c) 2022 AMD, Inc. All rights reserved. +# +# This document contains proprietary information which is +# protected by copyright. All rights are reserved. No part of +# this document may be photocopied, reproduced or translated to +# another program language without prior written consent of +# XILINX Inc., San Jose, CA. 95124 +# +# Xilinx, Inc. +# XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A +# COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS +# ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR +# STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION +# IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE +# FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. +# XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO +# THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO +# ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE +# FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE. +# +####################################################################### +*/ +#include "bootheader.h" +#define MAX_REG_GROUPS 202 + + +RegisterInitAddressRange VersalAddressRanges[] = { +{ 0xffa80000, 0x00000200 }, +{ 0xffa90000, 0x00000200 }, +{ 0xffaa0000, 0x00000200 }, +{ 0xffab0000, 0x00000200 }, +{ 0xffac0000, 0x00000200 }, +{ 0xffad0000, 0x00000200 }, +{ 0xffae0000, 0x00000200 }, +{ 0xffaf0000, 0x00000200 }, +{ 0xf11e0000, 0x00000220 }, +{ 0xf9040000, 0x00001000 }, +{ 0xf9060000, 0x00001000 }, +{ 0xf9050000, 0x0000010c }, +{ 0xf9000000, 0x0000fffc }, +{ 0xf9010000, 0x00000058 }, +{ 0xf9020000, 0x0000fffc }, +{ 0xf9030000, 0x00000040 }, +{ 0xf9080000, 0x0000fffc }, +{ 0xf90a0000, 0x0000fffc }, +{ 0xf9090000, 0x0000c080 }, +{ 0xf90b0000, 0x0000c080 }, +{ 0xff9c0000, 0x00000110 }, +{ 0xf11f0000, 0x0000004c }, +{ 0xff060000, 0x0000418c }, +{ 0xff070000, 0x0000418c }, +{ 0xf12d0000, 0x00000250 }, +{ 0xf12e4000, 0x00000250 }, +{ 0xf12e6000, 0x00000250 }, +{ 0xf12e8000, 0x00000250 }, +{ 0xf12ea000, 0x00000250 }, +{ 0xf12ec000, 0x00000250 }, +{ 0xf12d2000, 0x00000250 }, +{ 0xf12d4000, 0x00000250 }, +{ 0xf12d6000, 0x00000250 }, +{ 0xf12d8000, 0x00000250 }, +{ 0xf12da000, 0x00000250 }, +{ 0xf12dc000, 0x00000250 }, +{ 0xf12de000, 0x00000250 }, +{ 0xf12e0000, 0x00000250 }, +{ 0xf12e2000, 0x00000250 }, +{ 0xf12ee000, 0x00000250 }, +{ 0xf12b0000, 0x0000011c }, +{ 0xfcf30000, 0x000000e4 }, +{ 0xfc000000, 0x00968e48 }, +{ 0xfca00000, 0x00000328 }, +{ 0xfcb00000, 0x0000207c }, +{ 0xfcd00000, 0x000061e0 }, +{ 0xfcff0000, 0x0000000c }, +{ 0xfca10000, 0x000003e8 }, +{ 0xfca20000, 0x00000430 }, +{ 0xfd1a0000, 0x00000318 }, +{ 0xff5e0000, 0x00000370 }, +{ 0xf1260000, 0x000005cc }, +{ 0xf0d10000, 0x00000ffc }, +{ 0xf0d00000, 0x00000ffc }, +{ 0xf0d30000, 0x00000ffc }, +{ 0xf0d20000, 0x00000ffc }, +{ 0xf0d50000, 0x00000ffc }, +{ 0xf0d40000, 0x00000ffc }, +{ 0xf0d70000, 0x00000ffc }, +{ 0xf0d60000, 0x00000ffc }, +{ 0xf0ca0000, 0x00000ffc }, +{ 0xf0c60000, 0x00000ffc }, +{ 0xf0c30000, 0x00000ffc }, +{ 0xf0c20000, 0x00000ffc }, +{ 0xf0fa0000, 0x00000ffc }, +{ 0xf0fd0000, 0x00000ffc }, +{ 0xf0f40000, 0x00000ffc }, +{ 0xf0f50000, 0x00000ffc }, +{ 0xf0f60000, 0x00000ffc }, +{ 0xf0f70000, 0x00000ffc }, +{ 0xf0f20000, 0x00000ffc }, +{ 0xf0f00000, 0x00000ffc }, +{ 0xf0bb0000, 0x00000ffc }, +{ 0xf0bc0000, 0x00000ffc }, +{ 0xf0bd0000, 0x00000ffc }, +{ 0xf0b30000, 0x00000ffc }, +{ 0xf0b50000, 0x00000ffc }, +{ 0xf0b20000, 0x00000ffc }, +{ 0xf0b10000, 0x00000ffc }, +{ 0xf0b40000, 0x00000ffc }, +{ 0xf0b00000, 0x00000ffc }, +{ 0xf0b70000, 0x00000ffc }, +{ 0xf0b60000, 0x00000ffc }, +{ 0xf09d0000, 0x00000ffc }, +{ 0xf0920000, 0x00000ffc }, +{ 0xf0910000, 0x00000ffc }, +{ 0xf0900000, 0x00000ffc }, +{ 0xf0990000, 0x00000ffc }, +{ 0xf08d0000, 0x00000ffc }, +{ 0xf0810000, 0x00000ffc }, +{ 0xf0800000, 0x00000ffc }, +{ 0xf0a10000, 0x00000ffc }, +{ 0xf0a00000, 0x00000ffc }, +{ 0xf0a30000, 0x00000ffc }, +{ 0xf0a50000, 0x00000ffc }, +{ 0xf0a40000, 0x00000ffc }, +{ 0xf0a70000, 0x00000ffc }, +{ 0xf1200000, 0x00000058 }, +{ 0xf1250000, 0x00000bfc }, +{ 0xf1240000, 0x00000060 }, +{ 0xfd360000, 0x00000f0c }, +{ 0xfd380000, 0x00000f0c }, +{ 0xfd5c0000, 0x00000094 }, +{ 0xfd5e0000, 0x00000040 }, +{ 0xfd700000, 0x000025fc }, +{ 0xfd000000, 0x00090118 }, +{ 0xfd390000, 0x00000284 }, +{ 0xfd610000, 0x00005000 }, +{ 0xfd690000, 0x00000ff8 }, +{ 0xfd5f0000, 0x00000060 }, +{ 0xfd800000, 0x0003ffb8 }, +{ 0xfd4d0000, 0x00002fd0 }, +{ 0xff0c0000, 0x00000b80 }, +{ 0xff0d0000, 0x00000b80 }, +{ 0xfe5f0000, 0x0000013c }, +{ 0xfcb40000, 0x00130000 }, +{ 0xfd370000, 0x0000009c }, +{ 0xfe600000, 0x001f0000 }, +{ 0xf1330000, 0x00240000 }, +{ 0xffc9f000, 0x000002fc }, +{ 0xff130000, 0x00000004 }, +{ 0xff140000, 0x00000020 }, +{ 0xff300000, 0x000a001c }, +{ 0xff9b0000, 0x00000f0c }, +{ 0xfe400000, 0x00001dfc }, +{ 0xfe000000, 0x0000017c }, +{ 0xff0a0000, 0x0000007c }, +{ 0xff080000, 0x00000728 }, +{ 0xff410000, 0x0000a040 }, +{ 0xff510000, 0x00000080 }, +{ 0xff990000, 0x00001640 }, +{ 0xff960000, 0x00000ff8 }, +{ 0xff980000, 0x00000284 }, +{ 0xf1010000, 0x00001ffc }, +{ 0xfca50000, 0x00000e9c }, +{ 0xfca60000, 0x00000e9c }, +{ 0xfca70000, 0x00000e08 }, +{ 0xfcfb0000, 0x00001db8 }, +{ 0xfcfc0000, 0x00001db8 }, +{ 0xf9000000, 0x00001ffc }, +{ 0xf1160000, 0x00020254 }, +{ 0xf11c0000, 0x00000ff8 }, +{ 0xf11d0000, 0x00000ff8 }, +{ 0xf1110000, 0x00040034 }, +{ 0xf1020000, 0x00000324 }, +{ 0xf1000000, 0x00000030 }, +{ 0xf1080000, 0x0000027c }, +{ 0xf1070000, 0x0000006c }, +{ 0xf1060000, 0x00000828 }, +{ 0xf1320000, 0x000019fc }, +{ 0xf1100000, 0x00000ff8 }, +{ 0xf1270000, 0x0002060c }, +{ 0xf11a0000, 0x00010034 }, +{ 0xf12f0000, 0x00000284 }, +{ 0xf1310000, 0x00001640 }, +{ 0xf1300000, 0x00001640 }, +{ 0xf0080000, 0x00000078 }, +{ 0xf0110000, 0x00005980 }, +{ 0xf0081000, 0x00000380 }, +{ 0xf0083000, 0x00000008 }, +{ 0xf0082000, 0x00000028 }, +{ 0xf0100000, 0x00000010 }, +{ 0xf0280000, 0x00000078 }, +{ 0xf0310000, 0x00005980 }, +{ 0xf0282000, 0x00000380 }, +{ 0xf0281000, 0x00000380 }, +{ 0xf0284000, 0x00000008 }, +{ 0xf0283000, 0x00000028 }, +{ 0xf0300000, 0x00000010 }, +{ 0xffc90000, 0x0000304c }, +{ 0xffc80000, 0x00000078 }, +{ 0xffc88000, 0x00000804 }, +{ 0xffcf0000, 0x00005980 }, +{ 0xffcb0000, 0x00000380 }, +{ 0xffca0000, 0x00000380 }, +{ 0xffcd0000, 0x00000008 }, +{ 0xffcc0000, 0x00000028 }, +{ 0xffce0000, 0x00000010 }, +{ 0xff0b0000, 0x000002e4 }, +{ 0xff020000, 0x00000030 }, +{ 0xff030000, 0x00000030 }, +{ 0xf0050000, 0x000003c4 }, +{ 0xf1030000, 0x00000828 }, +{ 0xff9a0000, 0x00000228 }, +{ 0xf12a0000, 0x00000050 }, +{ 0xf1040000, 0x0000f0fc }, +{ 0xf1050000, 0x0000f0fc }, +{ 0xf1210000, 0x00000050 }, +{ 0xf1220000, 0x0000030c }, +{ 0xff040000, 0x000000fc }, +{ 0xff050000, 0x000000fc }, +{ 0xf1230000, 0x000000f0 }, +{ 0xff0e0000, 0x00000080 }, +{ 0xff0f0000, 0x00000080 }, +{ 0xff100000, 0x00000080 }, +{ 0xff110000, 0x00000080 }, +{ 0xff000000, 0x00000ffc }, +{ 0xff010000, 0x00000ffc }, +{ 0xff9d0000, 0x00000070 }, +{ 0xfe200000, 0x0000cc28 }, +{ 0xff120000, 0x00002fd0 }, +{ 0xe1000000, 0x00006028 }, +{ 0x00000000, 0x00000000 }}; \ No newline at end of file diff -Nru xilinx-bootgen-2021.2/reginit.cpp xilinx-bootgen-2022.2/reginit.cpp --- xilinx-bootgen-2021.2/reginit.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/reginit.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +26,7 @@ #include "reginitscanner.h" #include "options.h" #include "bifoptions.h" +#include "regdefs.h" /* @@ -48,20 +50,28 @@ std::ifstream s(filename.c_str()); if (!s) { - LOG_ERROR("Cannot read file - %s", filename.c_str());; + LOG_ERROR("Cannot read file - %s", filename.c_str()); } scanner.switch_streams(&s); parser.parse(); - + fileParseEnd = true; LOG_INFO("Done RE parsing : %s. Added %d regiter pairs", filename.c_str(), count); } + if (invalidAddr.size() != 0) + { + LOG_MSG("[WARNING]: Given ini file has the below invalid Addresses : %s", filename.c_str()); + for (size_t itr = 0; itr < invalidAddr.size(); itr++) + { + LOG_MSG("\t 0x%x", invalidAddr[itr]); + } + } + /* Fill the remainder of the area with NOPs. */ while(count < MAX_REGISTER_INITS) { - Add(options, INVALID_REGISTER_ADDRESS,0); + Add(options, INVALID_REGISTER_ADDRESS, 0); } - } /******************************************************************************/ @@ -71,9 +81,29 @@ { LOG_ERROR("Too many register init pairs in %s", filename.c_str()); } - if (address != 0xFFFFFFFF) + + if (fileParseEnd != true) + { + bool isvalidAddress = false; + for (int j = 0; j < MAX_REG_GROUPS; j++) + { + if ((address <= (VersalAddressRanges[j].baseaddr + VersalAddressRanges[j].size)) && + (address >= (VersalAddressRanges[j].baseaddr))) + { + isvalidAddress = true; + break; + } + } + + if (!isvalidAddress) + { + invalidAddr.push_back(address); + } + } + + if (address != 0xFFFFFFFF) { - LOG_INFO("count [0x%8x], value = %d", address, value); + LOG_INFO("\t address [0x%8x], value = 0x%x", address, value); } regtab->registerInitialization[count ].address = address; diff -Nru xilinx-bootgen-2021.2/verifyimage-versal.cpp xilinx-bootgen-2022.2/verifyimage-versal.cpp --- xilinx-bootgen-2021.2/verifyimage-versal.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/verifyimage-versal.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -256,6 +257,7 @@ /* Verifying IHT Signature */ uint32_t iHTLength = sizeof(VersalImageHeaderTableStructure); uint8_t* tempIHBuffer = new uint8_t[iHTLength]; + memset(tempIHBuffer, 0, iHTLength); bool signatureVerified = false; bH = new VersalBootHeaderStructure; result = fread(bH, 1, sizeof(VersalBootHeaderStructure), binFile); @@ -293,6 +295,10 @@ LOG_ERROR("Error reading signature"); } } + else + { + LOG_ERROR("Error parsing Headers from BootImage file %s", binFilename.c_str()); + } if ((*(*auth_cert) & 0xF3) == 0x02) { @@ -326,7 +332,7 @@ size_t headersSize = (iHT->totalMetaHdrLength * 4) - SIGN_LENGTH_VERSAL; size_t headersAcDataSize = sizeof(AuthCertificate4096Sha3PaddingStructure) - SIGN_LENGTH_VERSAL; uint8_t* tempBuffer = new uint8_t[headersSize]; - + memset(tempBuffer, 0, headersSize); if(bH != NULL) { offset = bH->imageHeaderByteOffset + sizeof(VersalImageHeaderTableStructure); @@ -350,6 +356,10 @@ LOG_ERROR("Error reading signature"); } } + else + { + LOG_ERROR("Error parsing Headers from BootImage file %s", binFilename.c_str()); + } offset = iHT->firstImageHeaderWordOffset * 4; if (!(fseek(binFile, offset, SEEK_SET))) @@ -360,10 +370,14 @@ LOG_ERROR("Error reading signature"); } } + else + { + LOG_ERROR("Error parsing Headers from BootImage file %s", binFilename.c_str()); + } if ((*(*auth_cert) & 0xF3) == 0x02) { - signatureVerified = VerifyECDSASignature(true,tempBuffer,headersSize, (ACKeyECDSA *)(*auth_cert + AC_SPK_KEY_OFFSET), *auth_cert + AC_PARTITION_SIGN_OFFSET); + signatureVerified = VerifyECDSASignature(true, tempBuffer, headersSize, (ACKeyECDSA *)(*auth_cert + AC_SPK_KEY_OFFSET), *auth_cert + AC_PARTITION_SIGN_OFFSET); } else if((*(*auth_cert) & 0xF3) == 0x22) { @@ -477,6 +491,10 @@ LOG_ERROR("Error reading boot header while verifying "); } } + else + { + LOG_ERROR("Error parsing Boot Header from BootImage file %s", binFilename.c_str()); + } if ((*(*auth_cert) & 0xF3) == 0x02) { @@ -517,6 +535,7 @@ uint32_t dataBufferLength = ((*partitionHdr)->totalPartitionLength * 4) - SIGN_LENGTH_VERSAL; uint32_t acBufferLength = sizeof(AuthCertificate4096Sha3PaddingStructure) - SIGN_LENGTH_VERSAL; uint8_t* tempBuffer = new uint8_t[dataBufferLength]; + memset(tempBuffer, 0, dataBufferLength); offset = (*partitionHdr)->authCertificateOffset * 4; if (!(fseek(binFile, offset, SEEK_SET))) diff -Nru xilinx-bootgen-2021.2/verifyimage-zynqmp.cpp xilinx-bootgen-2022.2/verifyimage-zynqmp.cpp --- xilinx-bootgen-2021.2/verifyimage-zynqmp.cpp 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/verifyimage-zynqmp.cpp 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2021 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -179,8 +180,9 @@ headersSize = (pHT->partitionWordOffset * 4) - bH->imageHeaderByteOffset - RSA_4096_KEY_LENGTH; } uint8_t* tempBuffer = new uint8_t[headersSize]; - + memset(tempBuffer, 0, headersSize); offset = bH->imageHeaderByteOffset; + if (!(fseek(binFile, offset, SEEK_SET))) { result = fread(tempBuffer, 1, headersSize, binFile); @@ -189,6 +191,10 @@ LOG_ERROR("Error reading signature"); } } + else + { + LOG_ERROR("Error parsing Headers from BootImage file %s", binFilename.c_str()); + } bool signatureVerified = VerifySignature(true, tempBuffer, headersSize, &auth_cert->acSpk, (unsigned char*)(&auth_cert->acPartitionSignature)); if (signatureVerified) @@ -295,7 +301,6 @@ authenticationVerified = false; LOG_ERROR("Authentication verification failed on bootimage %s", binFilename.c_str()); } - delete[] tempBHBuffer; } @@ -307,30 +312,31 @@ bool signatureVerified = false; if (((((*partitionHdr)->partitionAttributes) >> PH_DEST_DEVICE_SHIFT_ZYNQMP) & PH_DEST_DEVICE_MASK_ZYNQMP) == 2) { - bufferLength = ((*partitionHdr)->totalPartitionLength * 4); + bufferLength = ((*partitionHdr)->totalPartitionLength * 4); } uint8_t* tempBuffer = new uint8_t[bufferLength]; + memset(tempBuffer, 0, bufferLength); + offset = (*partitionHdr)->partitionWordOffset * 4; if (!(fseek(binFile, offset, SEEK_SET))) { - result = fread(tempBuffer, 1, bufferLength, binFile); - if (result != bufferLength) - { - LOG_ERROR("Error reading partition for hash calculation"); - } + result = fread(tempBuffer, 1, bufferLength, binFile); + if (result != bufferLength) + { + LOG_ERROR("Error reading partition for hash calculation"); + } } else { - LOG_ERROR("Error parsing Partitions from BootImage file %s",binFilename.c_str()); + LOG_ERROR("Error parsing Partitions from BootImage file %s",binFilename.c_str()); } - if (((((*partitionHdr)->partitionAttributes) >> PH_DEST_DEVICE_SHIFT_ZYNQMP) & PH_DEST_DEVICE_MASK_ZYNQMP) == 2) { uint32_t blockSize = BITSTREAM_AUTH_CHUNK_SIZE; uint32_t lastBlockSize = ((*partitionHdr)->totalPartitionLength * 4) - (sizeof(AuthCertificate4096Structure) * plAcCount) - (BITSTREAM_AUTH_CHUNK_SIZE * (plAcCount - 1)); - + for(int i = 0; iacSpk, (unsigned char*)(&cert->acPartitionSignature)); if(!signatureVerified) { - LOG_MSG(" Partition Signature Verification Failed"); - authenticationVerified = false; - LOG_ERROR("Authentication verification failed on bootimage %s", binFilename.c_str()); + LOG_MSG(" Partition Signature Verification Failed"); + authenticationVerified = false; + LOG_ERROR("Authentication verification failed on bootimage %s", binFilename.c_str()); } - delete[] buffer; } } else { - signatureVerified = VerifySignature(!isItBootloader, tempBuffer, bufferLength, &auth_cert->acSpk, (unsigned char*)(&auth_cert->acPartitionSignature)); + signatureVerified = VerifySignature(!isItBootloader, tempBuffer, bufferLength, &auth_cert->acSpk, (unsigned char*)(&auth_cert->acPartitionSignature)); } if (signatureVerified) { @@ -370,9 +375,8 @@ authenticationVerified = false; LOG_ERROR("Authentication verification failed on bootimage %s", binFilename.c_str()); } - - delete[] tempBuffer; - } + delete[] tempBuffer; + } else { //EXIT diff -Nru xilinx-bootgen-2021.2/version.h xilinx-bootgen-2022.2/version.h --- xilinx-bootgen-2021.2/version.h 2021-09-30 06:08:18.000000000 +0000 +++ xilinx-bootgen-2022.2/version.h 2022-09-26 06:24:42.000000000 +0000 @@ -1,5 +1,6 @@ + /****************************************************************************** -* Copyright 2015-2020 Xilinx, Inc. +* Copyright 2015-2022 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +16,11 @@ ******************************************************************************/ #ifndef RDI_VERSION -#define RDI_VERSION "2021.2" +#define RDI_VERSION "2022.2" #endif #define PROGRAMNAME "Xilinx Bootgen" -#define COPYRIGHT "Copyright (c) 1995-2021 Xilinx, Inc. All rights reserved.\n" +#define COPYRIGHT "Copyright (c) 1986-2022 Xilinx, Inc. All rights reserved.\n" /****************************************************************************** @@ -46,6 +47,7 @@ log - Generate log file |\n\ nonbooting - Generate an intermediate boot image |\n\ o - Output filename in MCS/BIN format |\n\ + overlay_cdo - Overlay CDO files of Boot Image File |\n\ p - Part name for generating nky file |\n\ padimageheader - Pad header tables |\n\ process_bitstream - Outputs bitstream in bin/mcs format |\n\