]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
Dynamic cfg: Update the tools
authorSoby Mathew <soby.mathew@arm.com>
Tue, 7 Nov 2017 16:50:31 +0000 (16:50 +0000)
committerSoby Mathew <soby.mathew@arm.com>
Mon, 26 Feb 2018 16:31:10 +0000 (16:31 +0000)
This patch updates the `fiptool` and `cert_create` for the
`hw_config` and `tb_fw_config` dynamic configuration files.
The necessary UUIDs and OIDs are assigned to these files and
the `cert_create` is updated to generate appropriate hashes
and include them in the "Trusted Boot FW Certificate". The
`fiptool` is updated to allow the configs to be specified
via cmdline and included in the generated FIP.

Change-Id: I940e751a49621ae681d14e162aa1f5697eb0cb15
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
include/tools_share/firmware_image_package.h
include/tools_share/tbbr_oid.h
tools/cert_create/include/tbbr/tbb_ext.h
tools/cert_create/src/tbbr/tbb_cert.c
tools/cert_create/src/tbbr/tbb_ext.c
tools/fiptool/tbbr_config.c

index c39e6f02704385bb52f1e2583403d0642c765489..b7fac07f68a1351f077fad413a7e6a6526dac11e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
        {0x11449fa4, 0x635e, 0x11e4, 0x87, 0x28, {0x3f, 0x05, 0x72, 0x2a, 0xf3, 0x3d} }
 #define UUID_NON_TRUSTED_FW_CONTENT_CERT \
        {0xf3c1c48e, 0x635d, 0x11e4, 0xa7, 0xa9, {0x87, 0xee, 0x40, 0xb2, 0x3f, 0xa7} }
+/* Dynamic configs */
+#define UUID_HW_CONFIG \
+       {0xd9f1b808, 0xcfc9, 0x4993, 0xa9, 0x62, {0x6f, 0xbc, 0x6b, 0x72, 0x65, 0xcc} }
+#define UUID_TB_FW_CONFIG \
+       {0xff58046c, 0x6baf, 0x4f7d, 0x82, 0xed, {0xaa, 0x27, 0xbc, 0x69, 0xbf, 0xd2} }
 
 typedef struct fip_toc_header {
        uint32_t        name;
index e57790c6ae90a323aaf5c5cdffa21f5925717a78..18ddbdc2a591104778f8e6810f9696691a1a5c61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -41,7 +41,8 @@
 
 /* TrustedBootFirmwareHash - BL2 */
 #define TRUSTED_BOOT_FW_HASH_OID               "1.3.6.1.4.1.4128.2100.201"
-
+#define TRUSTED_BOOT_FW_CONFIG_HASH_OID                "1.3.6.1.4.1.4128.2100.202"
+#define HW_CONFIG_HASH_OID                     "1.3.6.1.4.1.4128.2100.203"
 
 /*
  * Trusted Key Certificate
index 85ad3595e0916ace1fe2248007f195b571b6fd41..5b427d3529af492d4241b2a158dc172a449868b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -13,6 +13,8 @@ enum {
        TRUSTED_FW_NVCOUNTER_EXT,
        NON_TRUSTED_FW_NVCOUNTER_EXT,
        TRUSTED_BOOT_FW_HASH_EXT,
+       TRUSTED_BOOT_FW_CONFIG_HASH_EXT,
+       HW_CONFIG_HASH_EXT,
        TRUSTED_WORLD_PK_EXT,
        NON_TRUSTED_WORLD_PK_EXT,
        SCP_FW_CONTENT_CERT_PK_EXT,
index c815178cf04f7f5c5b59a5ba4e3fda57dc8048ed..325b46223e81a0da5bca20f9f173752ad7166747 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -26,9 +26,11 @@ static cert_t tbb_certs[] = {
                .issuer = TRUSTED_BOOT_FW_CERT,
                .ext = {
                        TRUSTED_FW_NVCOUNTER_EXT,
-                       TRUSTED_BOOT_FW_HASH_EXT
+                       TRUSTED_BOOT_FW_HASH_EXT,
+                       TRUSTED_BOOT_FW_CONFIG_HASH_EXT,
+                       HW_CONFIG_HASH_EXT
                },
-               .num_ext = 2
+               .num_ext = 4
        },
        [TRUSTED_KEY_CERT] = {
                .id = TRUSTED_KEY_CERT,
index 504b0fc0a5f67f8fb0a156bc17498b0b79a59639..5f2cec19263f7de4d063d2edd53d073dadad995b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -53,6 +53,26 @@ static ext_t tbb_ext[] = {
                .asn1_type = V_ASN1_OCTET_STRING,
                .type = EXT_TYPE_HASH
        },
+       [TRUSTED_BOOT_FW_CONFIG_HASH_EXT] = {
+               .oid = TRUSTED_BOOT_FW_CONFIG_HASH_OID,
+               .opt = "tb-fw-config",
+               .help_msg = "Trusted Boot Firmware Config file",
+               .sn = "TrustedBootFirmwareConfigHash",
+               .ln = "Trusted Boot Firmware Config hash",
+               .asn1_type = V_ASN1_OCTET_STRING,
+               .type = EXT_TYPE_HASH,
+               .optional = 1
+       },
+       [HW_CONFIG_HASH_EXT] = {
+               .oid = HW_CONFIG_HASH_OID,
+               .opt = "hw-config",
+               .help_msg = "HW Config file",
+               .sn = "HWConfigHash",
+               .ln = "HW Config hash",
+               .asn1_type = V_ASN1_OCTET_STRING,
+               .type = EXT_TYPE_HASH,
+               .optional = 1
+       },
        [TRUSTED_WORLD_PK_EXT] = {
                .oid = TRUSTED_WORLD_PK_OID,
                .sn = "TrustedWorldPublicKey",
index 827cab2800e1535481d5eca622008e21a3c77048..2c0adcd22775ddedcc699d0da8245bff33b5b23e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -67,7 +67,17 @@ toc_entry_t toc_entries[] = {
                .uuid = UUID_NON_TRUSTED_FIRMWARE_BL33,
                .cmdline_name = "nt-fw"
        },
-
+       /* Dynamic Configs */
+       {
+               .name = "HW_CONFIG",
+               .uuid = UUID_HW_CONFIG,
+               .cmdline_name = "hw-config"
+       },
+       {
+               .name = "TB_FW_CONFIG",
+               .uuid = UUID_TB_FW_CONFIG,
+               .cmdline_name = "tb-fw-config"
+       },
        /* Key Certificates */
        {
                .name = "Root Of Trust key certificate",