[{"id":1792820,"web_url":"http://patchwork.ozlabs.org/comment/1792820/","msgid":"<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-23T21:20:46","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"On 09/01/2017 01:25 AM, Sumit Garg wrote:\n> Enable support for loadables in SEC firmware FIT image. Currently support\n> is added for single loadable image.\n> \n> Brief description of implementation:\n> - Add two more address pointers (loadable_h, loadable_l) as arguments to\n>   sec_firmware_init() api.\n> - Create new api: sec_firmware_checks_copy_loadable() to check if loadables\n>   node is present in SEC firmware FIT image. If present, verify loadable\n>   image and copies it to secure DDR memory.\n> - Populate address pointers with secure DDR memory addresses where loadable\n>   is copied.\n> \n> Example use-case could be trusted OS (tee.bin) as loadables node in SEC\n> firmware FIT image.\n> \n> Signed-off-by: Sumit Garg <sumit.garg@nxp.com>\n> ---\n>  arch/arm/cpu/armv8/fsl-layerscape/ppa.c   | 16 +++++-\n>  arch/arm/cpu/armv8/sec_firmware.c         | 92 +++++++++++++++++++++++++++++--\n>  arch/arm/include/asm/armv8/sec_firmware.h |  4 +-\n>  3 files changed, 104 insertions(+), 8 deletions(-)\n> \n> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> index 35c612d..87a0885 100644\n> --- a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> +++ b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> @@ -35,6 +35,7 @@ int ppa_init(void)\n>  \tunsigned int el = current_el();\n>  \tvoid *ppa_fit_addr;\n>  \tu32 *boot_loc_ptr_l, *boot_loc_ptr_h;\n> +\tu32 *loadable_l, *loadable_h;\n>  \tint ret;\n>  \n>  #ifdef CONFIG_CHAIN_OF_TRUST\n> @@ -252,9 +253,9 @@ int ppa_init(void)\n>  \t\t\t\t\t   PPA_KEY_HASH,\n>  \t\t\t\t\t   &ppa_img_addr);\n>  \t\tif (ret != 0)\n> -\t\t\tprintf(\"PPA validation failed\\n\");\n> +\t\t\tprintf(\"SEC firmware(s) validation failed\\n\");\n>  \t\telse\n> -\t\t\tprintf(\"PPA validation Successful\\n\");\n> +\t\t\tprintf(\"SEC firmware(s) validation Successful\\n\");\n>  \t}\n>  #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \\\n>  \tdefined(CONFIG_SYS_LS_PPA_FW_IN_NAND)\n> @@ -266,15 +267,24 @@ int ppa_init(void)\n>  \tstruct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);\n>  \tboot_loc_ptr_l = &gur->bootlocptrl;\n>  \tboot_loc_ptr_h = &gur->bootlocptrh;\n> +\n> +\t/* Assign addresses to loadable ptrs */\n> +\tloadable_l = &gur->scratchrw[4];\n> +\tloadable_h = &gur->scratchrw[5];\n>  #elif defined(CONFIG_FSL_LSCH2)\n>  \tstruct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR);\n>  \tboot_loc_ptr_l = &scfg->scratchrw[1];\n>  \tboot_loc_ptr_h = &scfg->scratchrw[0];\n> +\n> +\t/* Assign addresses to loadable ptrs */\n> +\tloadable_l = &scfg->scratchrw[2];\n> +\tloadable_h = &scfg->scratchrw[3];\n>  #endif\n>  \n>  \tdebug(\"fsl-ppa: boot_loc_ptr_l = 0x%p, boot_loc_ptr_h =0x%p\\n\",\n>  \t      boot_loc_ptr_l, boot_loc_ptr_h);\n> -\tret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h);\n> +\tret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h,\n> +\t\t\t\tloadable_l, loadable_h);\n>  \n>  #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \\\n>  \tdefined(CONFIG_SYS_LS_PPA_FW_IN_NAND)\n> diff --git a/arch/arm/cpu/armv8/sec_firmware.c b/arch/arm/cpu/armv8/sec_firmware.c\n> index 0e74834..927eae4 100644\n> --- a/arch/arm/cpu/armv8/sec_firmware.c\n> +++ b/arch/arm/cpu/armv8/sec_firmware.c\n> @@ -105,6 +105,74 @@ static int sec_firmware_parse_image(const void *sec_firmware_img,\n>  \treturn 0;\n>  }\n>  \n> +/*\n> + * SEC Firmware FIT image parser to check if any loadable is\n> + * present. If present, verify integrity of the loadable and\n> + * copy loadable to address provided in (loadable_h, loadable_l).\n> + *\n> + * Returns 0 on success and a negative errno on error task fail.\n> + */\n> +static int sec_firmware_check_copy_loadable(const void *sec_firmware_img,\n> +\t\t\t\t\t    u32 *loadable_l, u32 *loadable_h)\n> +{\n> +\tphys_addr_t sec_firmware_loadable_addr = 0;\n> +\tint conf_node_off, ld_node_off;\n> +\tchar *conf_node_name = NULL;\n> +\tconst void *data;\n> +\tsize_t size;\n> +\tulong load;\n> +\n> +\tconf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME;\n> +\n> +\tconf_node_off = fit_conf_get_node(sec_firmware_img, conf_node_name);\n> +\tif (conf_node_off < 0) {\n> +\t\tprintf(\"SEC Firmware: %s: no such config\\n\", conf_node_name);\n> +\treturn -ENOENT;\n> +\t}\n> +\n> +\tld_node_off = fit_conf_get_prop_node(sec_firmware_img, conf_node_off,\n> +\t\t\t\t\t     FIT_LOADABLE_PROP);\n> +\tif (ld_node_off >= 0) {\n> +\t\tprintf(\"SEC Firmware: '%s' present in config\\n\",\n> +\t\t       FIT_LOADABLE_PROP);\n> +\n> +\t\t/* Verify secure firmware image */\n> +\t\tif (!(fit_image_verify(sec_firmware_img, ld_node_off))) {\n> +\t\t\tprintf(\"SEC Loadable: Bad loadable image (bad CRC)\\n\");\n> +\t\t\treturn -EINVAL;\n> +\t\t}\n> +\n> +\t\tif (fit_image_get_data(sec_firmware_img, ld_node_off,\n> +\t\t\t\t       &data, &size)) {\n> +\t\t\tprintf(\"SEC Loadable: Can't get subimage data/size\");\n> +\t\t\treturn -ENOENT;\n> +\t\t}\n> +\n> +\t\t/* Get load address, treated as load offset to secure memory */\n> +\t\tif (fit_image_get_load(sec_firmware_img, ld_node_off, &load)) {\n> +\t\t\tprintf(\"SEC Loadable: Can't get subimage load\");\n> +\t\t\treturn -ENOENT;\n> +\t\t}\n> +\n> +\t\t/* Compute load address for loadable in secure memory */\n> +\t\tsec_firmware_loadable_addr = (sec_firmware_addr -\n> +\t\t\t\t\t\tgd->arch.tlb_size) + load;\n> +\n> +\t\t/* Copy loadable to secure memory and flush dcache */\n> +\t\tdebug(\"%s copied to address 0x%p\\n\",\n> +\t\t      FIT_LOADABLE_PROP, (void *)sec_firmware_loadable_addr);\n> +\t\tmemcpy((void *)sec_firmware_loadable_addr, data, size);\n> +\t\tflush_dcache_range(sec_firmware_loadable_addr,\n> +\t\t\t\t   sec_firmware_loadable_addr + size);\n> +\t}\n> +\n> +\t/* Populate address ptrs for loadable image with loadbale addr */\n> +\tout_le32(loadable_l, (sec_firmware_loadable_addr & WORD_MASK));\n> +\tout_le32(loadable_h, (sec_firmware_loadable_addr >> WORD_SHIFT));\n> +\n> +\treturn 0;\n> +}\n> +\n>  static int sec_firmware_copy_image(const char *title,\n>  \t\t\t u64 image_addr, u32 image_size, u64 sec_firmware)\n>  {\n> @@ -117,9 +185,11 @@ static int sec_firmware_copy_image(const char *title,\n>  \n>  /*\n>   * This function will parse the SEC Firmware image, and then load it\n> - * to secure memory.\n> + * to secure memory. Also load any loadable if present along with SEC\n> + * Firmware image.\n>   */\n> -static int sec_firmware_load_image(const void *sec_firmware_img)\n> +static int sec_firmware_load_image(const void *sec_firmware_img,\n> +\t\t\t\t   u32 *loadable_l, u32 *loadable_h)\n>  {\n>  \tconst void *raw_image_addr;\n>  \tsize_t raw_image_size = 0;\n> @@ -172,6 +242,15 @@ static int sec_firmware_load_image(const void *sec_firmware_img)\n>  \tif (ret)\n>  \t\tgoto out;\n>  \n> +\t/*\n> +\t * Check if any loadable are present along with firmware image, if\n> +\t * present load them.\n> +\t */\n> +\tret = sec_firmware_check_copy_loadable(sec_firmware_img, loadable_l,\n> +\t\t\t\t\t       loadable_h);\n> +\tif (ret)\n> +\t\tgoto out;\n> +\n>  \tsec_firmware_addr |= SEC_FIRMWARE_LOADED;\n>  \tdebug(\"SEC Firmware: Entry point: 0x%llx\\n\",\n>  \t      sec_firmware_addr & SEC_FIRMWARE_ADDR_MASK);\n> @@ -289,17 +368,22 @@ int sec_firmware_get_random(uint8_t *rand, int bytes)\n>   * @sec_firmware_img:\tthe SEC Firmware image address\n>   * @eret_hold_l:\tthe address to hold exception return address low\n>   * @eret_hold_h:\tthe address to hold exception return address high\n> + * @loadable_l:\t\tthe address to hold loadable address low\n> + * @loadable_h:\t\tthe address to hold loadable address high\n>   */\n>  int sec_firmware_init(const void *sec_firmware_img,\n>  \t\t\tu32 *eret_hold_l,\n> -\t\t\tu32 *eret_hold_h)\n> +\t\t\tu32 *eret_hold_h,\n> +\t\t\tu32 *loadable_l,\n> +\t\t\tu32 *loadable_h)\n>  {\n>  \tint ret;\n>  \n>  \tif (!sec_firmware_is_valid(sec_firmware_img))\n>  \t\treturn -EINVAL;\n>  \n> -\tret = sec_firmware_load_image(sec_firmware_img);\n> +\tret = sec_firmware_load_image(sec_firmware_img, loadable_l,\n> +\t\t\t\t      loadable_h);\n>  \tif (ret) {\n>  \t\tprintf(\"SEC Firmware: Failed to load image\\n\");\n>  \t\treturn ret;\n> diff --git a/arch/arm/include/asm/armv8/sec_firmware.h b/arch/arm/include/asm/armv8/sec_firmware.h\n> index 6d42a71..2ba1847 100644\n> --- a/arch/arm/include/asm/armv8/sec_firmware.h\n> +++ b/arch/arm/include/asm/armv8/sec_firmware.h\n> @@ -9,8 +9,10 @@\n>  \n>  #define PSCI_INVALID_VER\t\t0xffffffff\n>  #define SEC_JR3_OFFSET\t\t\t0x40000\n> +#define WORD_MASK\t\t\t0xffffffff\n> +#define WORD_SHIFT\t\t\t32\n>  \n> -int sec_firmware_init(const void *, u32 *, u32 *);\n> +int sec_firmware_init(const void *, u32 *, u32 *, u32 *, u32 *);\n>  int _sec_firmware_entry(const void *, u32 *, u32 *);\n>  bool sec_firmware_is_valid(const void *);\n>  bool sec_firmware_support_hwrng(void);\n> \n\nSumit,\n\nIf I understand you correctly, you are parsing the secure firmware FIT\nimage to find the loadable node and store the 64-bit load address in the\nscratch registers. How do you determine which scratch registers to use?\n\nYork","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"mDsoklna\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yLTph6q48z9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 24 Oct 2017 08:21:00 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid A243FC21D93; Mon, 23 Oct 2017 21:20:56 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id EF951C21D19;\n\tMon, 23 Oct 2017 21:20:51 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid C8024C21D19; Mon, 23 Oct 2017 21:20:49 +0000 (UTC)","from EUR01-HE1-obe.outbound.protection.outlook.com\n\t(mail-he1eur01on0074.outbound.protection.outlook.com [104.47.0.74])\n\tby lists.denx.de (Postfix) with ESMTPS id 63760C21CEC\n\tfor <u-boot@lists.denx.de>; Mon, 23 Oct 2017 21:20:48 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB3278.eurprd04.prod.outlook.com (10.170.231.143) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.156.4; Mon, 23 Oct 2017 21:20:46 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3%14]) with mapi id 15.20.0156.007;\n\tMon, 23 Oct 2017 21:20:46 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4,\n\tRCVD_IN_MSPIKE_WL, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=zejNouOmiNwPfvl8i4R9Ors7uZmoeCVWzdqpe4SE6zI=;\n\tb=mDsoklnazPwrDuutxF4SkvajDYHBAlguRQhysK08OvyW00cmaHblrY4XfwqDqu0aTB/5jD4Z28UBqDwkHgiBpGJCCOrdSX/6W9jPc8J0wKGD/CppjfDJPCIkkukhPoDE+XzXrjOoN6O2cs2Qcsvj2+flRdMUHpshq3G1YpvJWsg=","From":"York Sun <york.sun@nxp.com>","To":"Sumit Garg <sumit.garg@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvOMspI/1gXeUyY6InPiXTrcA==","Date":"Mon, 23 Oct 2017 21:20:46 +0000","Message-ID":"<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"mDsoklna\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[24.16.45.3]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB3278;\n\t6:Ix5YkwF8O6LPBWbvMST+j9bvjIle2ODcGUVwmiXbjrB6tMsRiyQfEySoMXe5/HibFecIw/GLTZ0FeDAN80Vg9SJTKXyGgmiR013ECy55ScXYMUn1395fWvpJoCMhbrb618hBt6jhqb1BmiVPmIIQUUE8AewU5R+25raO009yb/HLio9yGu6DpqSMZ9TgC+ie/p2ritscPUk1aQ7GIU69SVfoPSzIljpDWH7yV9tv8mMZcr+ORuhIJV0FhoxL9T68i0SMZFymfa7/yxjjvWuez1cdakEkpTJ18q6N0XkvrXgpz2+AEE99xNvcPGmrp0CbsWcj94OzPqk4SV4/e+Nf6w==;\n\t5:Tr+8m8ApxQKXKB9ShIXu7+/dY6Ri/XEV3tyV9G0Lwg06rvtW3ixc8paGqpsmvypidGxcvAl+HBtqtgaf3PmMlytphjOUJp3f+261AZeHnmB4eYxOmGaneZ3RDeS+1bjoNVNX8Rk3cr9jlSS0HArNUA==;\n\t24:5WSupSgixYw/ccg8WWlqntqsNFFPzoBXqsOxTrjGS22fKjHotM/tp6vTvdbT10dTFD31yruPVUxwGAm+Yn1bV+GrXTUehuW9HBn1II+pU9A=;\n\t7:guJ8njyRMrsRuZymNr/gESjRqoh9jmCOUSnlBWwvr/wmgB1MKU2D4AKQYv08W4WjHsN2Lmpo8wPzsZ71iSjbgVszmRQ7A80K2fDmeiS+6KUFcDJueeUmv8eM3tausroTlwJRfjW6CTXfw0YO8N+LdLVZEsrMpL1kY8S1Fw9e5l9unfKhBQkwxhyXWNPMs6fE3i2tvuiIcq40HcX+oBy3s3axHGTSzUUgjDnm+OKs3Xc=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(346002)(376002)(39860400002)(189002)(199003)(24454002)(6246003)(14454004)(189998001)(2906002)(54356999)(43066004)(76176999)(50986999)(33656002)(7696004)(81166006)(8676002)(81156014)(4326008)(5660300001)(74316002)(66066001)(53546010)(3660700001)(7736002)(106356001)(105586002)(101416001)(8936002)(2900100001)(305945005)(3280700002)(25786009)(3450700001)(5250100002)(2501003)(110136005)(575784001)(6116002)(102836003)(3846002)(6506006)(68736007)(97736004)(478600001)(6436002)(99286003)(55016002)(54906003)(86362001)(53936002)(316002)(9686003)(229853002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3278;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"a3e31823-37b5-44a9-1701-08d51a5becef","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199);\n\tSRVR:VI1PR04MB3278; ","x-ms-traffictypediagnostic":"VI1PR04MB3278:","x-exchange-antispam-report-test":"UriScan:(185117386973197);","x-microsoft-antispam-prvs":"<VI1PR04MB3278D59600BFEB6066ACF5AC9A460@VI1PR04MB3278.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3231020)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB3278; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB3278; ","x-forefront-prvs":"046985391D","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"a3e31823-37b5-44a9-1701-08d51a5becef","X-MS-Exchange-CrossTenant-originalarrivaltime":"23 Oct 2017 21:20:46.1137\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB3278","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1792964,"web_url":"http://patchwork.ozlabs.org/comment/1792964/","msgid":"<VI1PR04MB14557F458647EA84C3C799C198470@VI1PR04MB1455.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-24T04:21:02","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":68653,"url":"http://patchwork.ozlabs.org/api/people/68653/","name":"Sumit Garg","email":"sumit.garg@nxp.com"},"content":"> -----Original Message-----\n> From: York Sun\n> Sent: Tuesday, October 24, 2017 2:51 AM\n> To: Sumit Garg <sumit.garg@nxp.com>; u-boot@lists.denx.de\n> Cc: Ruchika Gupta <ruchika.gupta@nxp.com>; Prabhakar Kushwaha\n> <prabhakar.kushwaha@nxp.com>; Z.q. Hou <zhiqiang.hou@nxp.com>; Pankaj\n> Gupta <pankaj.gupta@nxp.com>; Arun Pathak <arun.pathak@nxp.com>; Sahil\n> Malhotra <sahil.malhotra@nxp.com>\n> Subject: Re: [PATCH 2/2] armv8: sec_firmware: Add support for loadables in FIT\n> \n> On 09/01/2017 01:25 AM, Sumit Garg wrote:\n> > Enable support for loadables in SEC firmware FIT image. Currently\n> > support is added for single loadable image.\n> >\n> > Brief description of implementation:\n> > - Add two more address pointers (loadable_h, loadable_l) as arguments to\n> >   sec_firmware_init() api.\n> > - Create new api: sec_firmware_checks_copy_loadable() to check if\n> loadables\n> >   node is present in SEC firmware FIT image. If present, verify loadable\n> >   image and copies it to secure DDR memory.\n> > - Populate address pointers with secure DDR memory addresses where\n> loadable\n> >   is copied.\n> >\n> > Example use-case could be trusted OS (tee.bin) as loadables node in\n> > SEC firmware FIT image.\n> >\n> > Signed-off-by: Sumit Garg <sumit.garg@nxp.com>\n> > ---\n> >  arch/arm/cpu/armv8/fsl-layerscape/ppa.c   | 16 +++++-\n> >  arch/arm/cpu/armv8/sec_firmware.c         | 92\n> +++++++++++++++++++++++++++++--\n> >  arch/arm/include/asm/armv8/sec_firmware.h |  4 +-\n> >  3 files changed, 104 insertions(+), 8 deletions(-)\n> >\n> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> > b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> > index 35c612d..87a0885 100644\n> > --- a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c\n> > @@ -35,6 +35,7 @@ int ppa_init(void)\n> >  \tunsigned int el = current_el();\n> >  \tvoid *ppa_fit_addr;\n> >  \tu32 *boot_loc_ptr_l, *boot_loc_ptr_h;\n> > +\tu32 *loadable_l, *loadable_h;\n> >  \tint ret;\n> >\n> >  #ifdef CONFIG_CHAIN_OF_TRUST\n> > @@ -252,9 +253,9 @@ int ppa_init(void)\n> >  \t\t\t\t\t   PPA_KEY_HASH,\n> >  \t\t\t\t\t   &ppa_img_addr);\n> >  \t\tif (ret != 0)\n> > -\t\t\tprintf(\"PPA validation failed\\n\");\n> > +\t\t\tprintf(\"SEC firmware(s) validation failed\\n\");\n> >  \t\telse\n> > -\t\t\tprintf(\"PPA validation Successful\\n\");\n> > +\t\t\tprintf(\"SEC firmware(s) validation Successful\\n\");\n> >  \t}\n> >  #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \\\n> >  \tdefined(CONFIG_SYS_LS_PPA_FW_IN_NAND)\n> > @@ -266,15 +267,24 @@ int ppa_init(void)\n> >  \tstruct ccsr_gur __iomem *gur = (void\n> *)(CONFIG_SYS_FSL_GUTS_ADDR);\n> >  \tboot_loc_ptr_l = &gur->bootlocptrl;\n> >  \tboot_loc_ptr_h = &gur->bootlocptrh;\n> > +\n> > +\t/* Assign addresses to loadable ptrs */\n> > +\tloadable_l = &gur->scratchrw[4];\n> > +\tloadable_h = &gur->scratchrw[5];\n> >  #elif defined(CONFIG_FSL_LSCH2)\n> >  \tstruct ccsr_scfg __iomem *scfg = (void\n> *)(CONFIG_SYS_FSL_SCFG_ADDR);\n> >  \tboot_loc_ptr_l = &scfg->scratchrw[1];\n> >  \tboot_loc_ptr_h = &scfg->scratchrw[0];\n> > +\n> > +\t/* Assign addresses to loadable ptrs */\n> > +\tloadable_l = &scfg->scratchrw[2];\n> > +\tloadable_h = &scfg->scratchrw[3];\n> >  #endif\n> >\n> >  \tdebug(\"fsl-ppa: boot_loc_ptr_l = 0x%p, boot_loc_ptr_h =0x%p\\n\",\n> >  \t      boot_loc_ptr_l, boot_loc_ptr_h);\n> > -\tret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l,\n> boot_loc_ptr_h);\n> > +\tret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h,\n> > +\t\t\t\tloadable_l, loadable_h);\n> >\n> >  #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \\\n> >  \tdefined(CONFIG_SYS_LS_PPA_FW_IN_NAND)\n> > diff --git a/arch/arm/cpu/armv8/sec_firmware.c\n> > b/arch/arm/cpu/armv8/sec_firmware.c\n> > index 0e74834..927eae4 100644\n> > --- a/arch/arm/cpu/armv8/sec_firmware.c\n> > +++ b/arch/arm/cpu/armv8/sec_firmware.c\n> > @@ -105,6 +105,74 @@ static int sec_firmware_parse_image(const void\n> *sec_firmware_img,\n> >  \treturn 0;\n> >  }\n> >\n> > +/*\n> > + * SEC Firmware FIT image parser to check if any loadable is\n> > + * present. If present, verify integrity of the loadable and\n> > + * copy loadable to address provided in (loadable_h, loadable_l).\n> > + *\n> > + * Returns 0 on success and a negative errno on error task fail.\n> > + */\n> > +static int sec_firmware_check_copy_loadable(const void\n> *sec_firmware_img,\n> > +\t\t\t\t\t    u32 *loadable_l, u32 *loadable_h) {\n> > +\tphys_addr_t sec_firmware_loadable_addr = 0;\n> > +\tint conf_node_off, ld_node_off;\n> > +\tchar *conf_node_name = NULL;\n> > +\tconst void *data;\n> > +\tsize_t size;\n> > +\tulong load;\n> > +\n> > +\tconf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME;\n> > +\n> > +\tconf_node_off = fit_conf_get_node(sec_firmware_img,\n> conf_node_name);\n> > +\tif (conf_node_off < 0) {\n> > +\t\tprintf(\"SEC Firmware: %s: no such config\\n\",\n> conf_node_name);\n> > +\treturn -ENOENT;\n> > +\t}\n> > +\n> > +\tld_node_off = fit_conf_get_prop_node(sec_firmware_img,\n> conf_node_off,\n> > +\t\t\t\t\t     FIT_LOADABLE_PROP);\n> > +\tif (ld_node_off >= 0) {\n> > +\t\tprintf(\"SEC Firmware: '%s' present in config\\n\",\n> > +\t\t       FIT_LOADABLE_PROP);\n> > +\n> > +\t\t/* Verify secure firmware image */\n> > +\t\tif (!(fit_image_verify(sec_firmware_img, ld_node_off))) {\n> > +\t\t\tprintf(\"SEC Loadable: Bad loadable image (bad\n> CRC)\\n\");\n> > +\t\t\treturn -EINVAL;\n> > +\t\t}\n> > +\n> > +\t\tif (fit_image_get_data(sec_firmware_img, ld_node_off,\n> > +\t\t\t\t       &data, &size)) {\n> > +\t\t\tprintf(\"SEC Loadable: Can't get subimage data/size\");\n> > +\t\t\treturn -ENOENT;\n> > +\t\t}\n> > +\n> > +\t\t/* Get load address, treated as load offset to secure memory\n> */\n> > +\t\tif (fit_image_get_load(sec_firmware_img, ld_node_off,\n> &load)) {\n> > +\t\t\tprintf(\"SEC Loadable: Can't get subimage load\");\n> > +\t\t\treturn -ENOENT;\n> > +\t\t}\n> > +\n> > +\t\t/* Compute load address for loadable in secure memory */\n> > +\t\tsec_firmware_loadable_addr = (sec_firmware_addr -\n> > +\t\t\t\t\t\tgd->arch.tlb_size) + load;\n> > +\n> > +\t\t/* Copy loadable to secure memory and flush dcache */\n> > +\t\tdebug(\"%s copied to address 0x%p\\n\",\n> > +\t\t      FIT_LOADABLE_PROP, (void\n> *)sec_firmware_loadable_addr);\n> > +\t\tmemcpy((void *)sec_firmware_loadable_addr, data, size);\n> > +\t\tflush_dcache_range(sec_firmware_loadable_addr,\n> > +\t\t\t\t   sec_firmware_loadable_addr + size);\n> > +\t}\n> > +\n> > +\t/* Populate address ptrs for loadable image with loadbale addr */\n> > +\tout_le32(loadable_l, (sec_firmware_loadable_addr & WORD_MASK));\n> > +\tout_le32(loadable_h, (sec_firmware_loadable_addr >>\n> WORD_SHIFT));\n> > +\n> > +\treturn 0;\n> > +}\n> > +\n> >  static int sec_firmware_copy_image(const char *title,\n> >  \t\t\t u64 image_addr, u32 image_size, u64 sec_firmware)  {\n> @@ -117,9\n> > +185,11 @@ static int sec_firmware_copy_image(const char *title,\n> >\n> >  /*\n> >   * This function will parse the SEC Firmware image, and then load it\n> > - * to secure memory.\n> > + * to secure memory. Also load any loadable if present along with SEC\n> > + * Firmware image.\n> >   */\n> > -static int sec_firmware_load_image(const void *sec_firmware_img)\n> > +static int sec_firmware_load_image(const void *sec_firmware_img,\n> > +\t\t\t\t   u32 *loadable_l, u32 *loadable_h)\n> >  {\n> >  \tconst void *raw_image_addr;\n> >  \tsize_t raw_image_size = 0;\n> > @@ -172,6 +242,15 @@ static int sec_firmware_load_image(const void\n> *sec_firmware_img)\n> >  \tif (ret)\n> >  \t\tgoto out;\n> >\n> > +\t/*\n> > +\t * Check if any loadable are present along with firmware image, if\n> > +\t * present load them.\n> > +\t */\n> > +\tret = sec_firmware_check_copy_loadable(sec_firmware_img,\n> loadable_l,\n> > +\t\t\t\t\t       loadable_h);\n> > +\tif (ret)\n> > +\t\tgoto out;\n> > +\n> >  \tsec_firmware_addr |= SEC_FIRMWARE_LOADED;\n> >  \tdebug(\"SEC Firmware: Entry point: 0x%llx\\n\",\n> >  \t      sec_firmware_addr & SEC_FIRMWARE_ADDR_MASK); @@ -289,17\n> > +368,22 @@ int sec_firmware_get_random(uint8_t *rand, int bytes)\n> >   * @sec_firmware_img:\tthe SEC Firmware image address\n> >   * @eret_hold_l:\tthe address to hold exception return address low\n> >   * @eret_hold_h:\tthe address to hold exception return address high\n> > + * @loadable_l:\t\tthe address to hold loadable address low\n> > + * @loadable_h:\t\tthe address to hold loadable address high\n> >   */\n> >  int sec_firmware_init(const void *sec_firmware_img,\n> >  \t\t\tu32 *eret_hold_l,\n> > -\t\t\tu32 *eret_hold_h)\n> > +\t\t\tu32 *eret_hold_h,\n> > +\t\t\tu32 *loadable_l,\n> > +\t\t\tu32 *loadable_h)\n> >  {\n> >  \tint ret;\n> >\n> >  \tif (!sec_firmware_is_valid(sec_firmware_img))\n> >  \t\treturn -EINVAL;\n> >\n> > -\tret = sec_firmware_load_image(sec_firmware_img);\n> > +\tret = sec_firmware_load_image(sec_firmware_img, loadable_l,\n> > +\t\t\t\t      loadable_h);\n> >  \tif (ret) {\n> >  \t\tprintf(\"SEC Firmware: Failed to load image\\n\");\n> >  \t\treturn ret;\n> > diff --git a/arch/arm/include/asm/armv8/sec_firmware.h\n> > b/arch/arm/include/asm/armv8/sec_firmware.h\n> > index 6d42a71..2ba1847 100644\n> > --- a/arch/arm/include/asm/armv8/sec_firmware.h\n> > +++ b/arch/arm/include/asm/armv8/sec_firmware.h\n> > @@ -9,8 +9,10 @@\n> >\n> >  #define PSCI_INVALID_VER\t\t0xffffffff\n> >  #define SEC_JR3_OFFSET\t\t\t0x40000\n> > +#define WORD_MASK\t\t\t0xffffffff\n> > +#define WORD_SHIFT\t\t\t32\n> >\n> > -int sec_firmware_init(const void *, u32 *, u32 *);\n> > +int sec_firmware_init(const void *, u32 *, u32 *, u32 *, u32 *);\n> >  int _sec_firmware_entry(const void *, u32 *, u32 *);  bool\n> > sec_firmware_is_valid(const void *);  bool\n> > sec_firmware_support_hwrng(void);\n> >\n> \n> Sumit,\n> \n> If I understand you correctly, you are parsing the secure firmware FIT image to\n> find the loadable node and store the 64-bit load address in the scratch\n> registers. How do you determine which scratch registers to use?\n> \n> York\n\nYes your understanding is correct. The scratch registers which I used are as follows:\n\nFor Chassis gen 3 platforms:\n\t/* Assign addresses to loadable ptrs */\n\tloadable_l = &gur->scratchrw[4];\n\tloadable_h = &gur->scratchrw[5];\n\nFor Chassis gen 2 platforms:\n\t/* Assign addresses to loadable ptrs */\n\tloadable_l = &scfg->scratchrw[2];\n\tloadable_h = &scfg->scratchrw[3];\n\nI choose above scratch registers to avoid any conflict with usage of scratch registers\nin Boot-ROM, u-boot and PPA.\n\nSumit","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Iupol8cs\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=sumit.garg@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yLg7d4YcHz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 24 Oct 2017 15:21:16 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid D93CEC21D9E; Tue, 24 Oct 2017 04:21:13 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C805AC21D19;\n\tTue, 24 Oct 2017 04:21:08 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 7F72DC21D19; Tue, 24 Oct 2017 04:21:07 +0000 (UTC)","from EUR03-DB5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr40050.outbound.protection.outlook.com [40.107.4.50])\n\tby lists.denx.de (Postfix) with ESMTPS id C4A29C21C73\n\tfor <u-boot@lists.denx.de>; Tue, 24 Oct 2017 04:21:06 +0000 (UTC)","from VI1PR04MB1455.eurprd04.prod.outlook.com (10.163.166.147) by\n\tVI1PR04MB2077.eurprd04.prod.outlook.com (10.166.43.17) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.156.4; Tue, 24 Oct 2017 04:21:04 +0000","from VI1PR04MB1455.eurprd04.prod.outlook.com\n\t([fe80::dce7:7a72:4fe9:ad22]) by\n\tVI1PR04MB1455.eurprd04.prod.outlook.com\n\t([fe80::dce7:7a72:4fe9:ad22%14]) with mapi id 15.20.0156.005;\n\tTue, 24 Oct 2017 04:21:03 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2,\n\tSPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=IPoZXIW6uOKZblU2fb7UlSCSKPNL79ACXgkoEtK0/Mc=;\n\tb=Iupol8cs/xCvgamieLP5k5JQeACAVTXgLF6MSkEcc7ajlw24nwM4Ae3J3WkLoI7gWGWhLSBzTqyGxztbepKAReAup1Q0Lc3UaFowBjzlAdS6M/z6wPan6sSIroB33ERtD97KhqSFQr09X2SXiYs7QQp0vJzHbTDPKWTWj+r4QeU=","From":"Sumit Garg <sumit.garg@nxp.com>","To":"York Sun <york.sun@nxp.com>,\n\t\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvPofoqlrg/9EqxljE/8GXTkaLysUVA","Date":"Tue, 24 Oct 2017 04:21:02 +0000","Message-ID":"<VI1PR04MB14557F458647EA84C3C799C198470@VI1PR04MB1455.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>\n\t<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>","In-Reply-To":"<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Iupol8cs\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=sumit.garg@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB2077;\n\t6:EbGCht1G9skHDdZIOz2BS15TRJYXWcHqFDI4kgWJNWnJsLcZY+aDTAZr54k6B5LeEkDXorFTcGIy5GMdvmvtqIjsDVqlj4/5uzWyP+LQP0fJbQjHsJjU04JteJ3Wd9GP8Xz9NvuOBsxsVzm+vyZ+/BpuU2jSDDCUMmCUz9hP55FCtAxKoEJOULNzCG7jbOFbGWXyb03Vu6fvTvNZ2pd7eXKv+RJu/CiibAraedzbkN9OuvIDaR3/rDSyZWiPTSjJrDBf4XcHcyTblCgjFyX0d93nXTudQ0zW1dwk2gHRvZqtrybBg1SEdl3aI2qlE5fRuyiNL35kmhZkZE4rX3+DOw==;\n\t5:uD80tzoLjSHoorPda1yjH3iBb9Y6quF3Ca5vM7/zNvta89WCoemdjScb0X5O86Z5ocbmkbsZT/d5PIlufQ0MsDSee0Lhv8/ie12oIPGtcR9QPn0ZN9OQ0ehHdKtRJfY253QCwlgFspUD83HaJ5X00Q==;\n\t24:z+MtNPFOb81YjkqZRI4xrte4hFUNoRut7eCPm7u/rAFuhIR67Wlg6StdPeiSCRorXYgCIG5DFVpAO8l/UrCuA0Yyp7G5Iryi0ShIGwX4cHk=;\n\t7:6/lwWkObCxYI5KyioTsBYWpOgq7GY2Q7jlmwmvKAqF6K5/JpT94pbtxtp+NxUD4l6lmOqH39ZkqQYu4G6gBFJMQ/kJA9a0eY1KS78OGoAT6bqMcFEWoM916UF7mRZlZ/AQiIlRSmaJtvCkJ37TqP7HhPPhmlo+qyn3PTHHacMuCkcQ+1d5PCKdj8YVRAIaoARn7XNbFjzDtg07DvlHrS7ylnx/aOT6zwBtOtmhqjNVQ=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(13464003)(24454002)(189002)(6436002)(68736007)(189998001)(4326008)(33656002)(97736004)(110136005)(54906003)(53546010)(53936002)(9686003)(86362001)(2501003)(316002)(106356001)(99286003)(2900100001)(105586002)(575784001)(14454004)(2950100002)(101416001)(81156014)(8936002)(81166006)(8676002)(478600001)(2906002)(5250100002)(55016002)(66066001)(54356999)(6246003)(229853002)(3846002)(25786009)(3660700001)(5660300001)(102836003)(50986999)(7736002)(6506006)(305945005)(6116002)(76176999)(7696004)(74316002)(3280700002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB2077;\n\tH:VI1PR04MB1455.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"28c4bddd-6002-472d-9643-08d51a96a359","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199);\n\tSRVR:VI1PR04MB2077; ","x-ms-traffictypediagnostic":"VI1PR04MB2077:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<VI1PR04MB207708136C00357C1161AC5798470@VI1PR04MB2077.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3231020)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB2077; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB2077; ","x-forefront-prvs":"047001DADA","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"28c4bddd-6002-472d-9643-08d51a96a359","X-MS-Exchange-CrossTenant-originalarrivaltime":"24 Oct 2017 04:21:02.8892\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB2077","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1793186,"web_url":"http://patchwork.ozlabs.org/comment/1793186/","msgid":"<VI1PR04MB207866DDB8F85F6D28E04DF49A470@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-24T14:29:51","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"On 10/23/2017 09:21 PM, Sumit Garg wrote:\n<snip>\n>>\n>> Sumit,\n>>\n>> If I understand you correctly, you are parsing the secure firmware FIT image to\n>> find the loadable node and store the 64-bit load address in the scratch\n>> registers. How do you determine which scratch registers to use?\n>>\n>> York\n> \n> Yes your understanding is correct. The scratch registers which I used are as follows:\n> \n> For Chassis gen 3 platforms:\n> \t/* Assign addresses to loadable ptrs */\n> \tloadable_l = &gur->scratchrw[4];\n> \tloadable_h = &gur->scratchrw[5];\n> \n> For Chassis gen 2 platforms:\n> \t/* Assign addresses to loadable ptrs */\n> \tloadable_l = &scfg->scratchrw[2];\n> \tloadable_h = &scfg->scratchrw[3];\n> \n> I choose above scratch registers to avoid any conflict with usage of scratch registers\n> in Boot-ROM, u-boot and PPA.\n\nI see you write to these scratch registers but never read from them.\nWhat's the purpose to store the address in them?\n\nYork","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"KZJpXzIj\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yLwf8154Pz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Oct 2017 01:30:06 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 00764C21DB2; Tue, 24 Oct 2017 14:30:00 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 8F498C21C73;\n\tTue, 24 Oct 2017 14:29:57 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid E08D4C21C73; Tue, 24 Oct 2017 14:29:55 +0000 (UTC)","from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0074.outbound.protection.outlook.com [104.47.1.74])\n\tby lists.denx.de (Postfix) with ESMTPS id 7B2BEC21C34\n\tfor <u-boot@lists.denx.de>; Tue, 24 Oct 2017 14:29:55 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB3277.eurprd04.prod.outlook.com (10.170.231.142) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.156.4; Tue, 24 Oct 2017 14:29:54 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3%14]) with mapi id 15.20.0156.007;\n\tTue, 24 Oct 2017 14:29:52 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4,\n\tRCVD_IN_MSPIKE_WL, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=rRz93DCIFYabiA6cxWCNrYdFfAx3/zynw19jsfU8HPs=;\n\tb=KZJpXzIjmSUjl7T6T9tKoSBw36cMaBKmbX6JY4TWEBlTmR9MH1IUWmuAh0a6drUG/CnETUvpjiEsYNzyehwKUrD2LQ/kFFVBiaodlzRhhe+5gboiZGBQlfBM1waieNrRN/YzFTs1Ihf5/EJpjU45TGz716TByYThvcw3vv9S2b0=","From":"York Sun <york.sun@nxp.com>","To":"Sumit Garg <sumit.garg@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvOMspI/1gXeUyY6InPiXTrcA==","Date":"Tue, 24 Oct 2017 14:29:51 +0000","Message-ID":"<VI1PR04MB207866DDB8F85F6D28E04DF49A470@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>\n\t<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>\n\t<VI1PR04MB14557F458647EA84C3C799C198470@VI1PR04MB1455.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"KZJpXzIj\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[24.16.45.3]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB3277;\n\t6:aNDiwnJfTm73M6P1xCIYEoBjq8lUVvsZENbuiSbflsvNRS3DRwK1uvY3JbR/jNr/6kMgD5Doims42JAxjkMhYOb7eLrHufnk7ryc6CjDOLVN0eNxK95cAJjGSCZczoJIHZoR1L6Mu2/TkMA0pg0PyHnsXywMgN4ORNwPnhlanU2kD8j7/EJWzD33z+rHm98YmAjASYdqcjOCYWe1o7mIW5xmg8cMeScrchiNpCNYEgoHhg6gKaXXbLz9XVoPavq7g9vCmpkGiee+Sf8KdnsDe+PwTG9JT+Ht/DUnIHzPkYVkCtD/vCiaM1R4ZkrBppn5axNuBC1jgVPYD/JYXRrZeA==;\n\t5:0a/i2HXeSOXjSF9YIJw/uG9o1wfk33xyCQ9Z4Fq2XqSeNBO7/yecw6HGbu11W1lc4Lr2hNTamwd/WEN4QuypFLSo8EFHam/ManMd5T9Szs8xIUKRXDGAoyjSH5PrwzdL18rvsYU446PXircLNbi0fw==;\n\t24:CmT/be44RwnXiJLQVQctMRZwruC84AqZskf5uyxMk5GBdbK4kpvLvMDX83dzBHx7i7la2Ndo8ydV6bw28tHsQGelR2yNWwAI2HOSqVE0Z/8=;\n\t7:95OWuDuKpV4aIYcZwsLOMDgt0y8SKcL5qHIkAeRNdUd8cKIQ5yytD1xzCVR/L+DYZoNEQCLJD7lCtUtBasaMOvSxQFtgyoKyFJFoKt8WjAT8NbnVGqunaf6/OtTlVYrBlzj9H2OC3rnXu7TOUY1sNTVwkzX/UGQqIdOJe1zUw+L0W01/TeFyWSE+Z9i2RsJ25lR+qR4Ql3j5vGSe7QI2Kn3JomNNDSDg7NtBE3enTKE=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(24454002)(189002)(199003)(9686003)(74316002)(7696004)(7736002)(86362001)(43066004)(2501003)(5250100002)(305945005)(5660300001)(54906003)(110136005)(14454004)(33656002)(316002)(101416001)(54356999)(76176999)(53546010)(97736004)(50986999)(66066001)(93886005)(102836003)(6116002)(81166006)(81156014)(2900100001)(8676002)(8936002)(68736007)(106356001)(105586002)(3846002)(2906002)(53936002)(55016002)(99286003)(25786009)(6506006)(189998001)(4326008)(3660700001)(478600001)(3280700002)(6436002)(6246003)(3450700001)(229853002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3277;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"acbfc313-5acb-4f8c-1722-08d51aebb04d","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199);\n\tSRVR:VI1PR04MB3277; ","x-ms-traffictypediagnostic":"VI1PR04MB3277:","x-exchange-antispam-report-test":"UriScan:;","x-microsoft-antispam-prvs":"<VI1PR04MB327776CF8A7E294F98F8B9CF9A470@VI1PR04MB3277.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3231020)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB3277; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB3277; ","x-forefront-prvs":"047001DADA","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"acbfc313-5acb-4f8c-1722-08d51aebb04d","X-MS-Exchange-CrossTenant-originalarrivaltime":"24 Oct 2017 14:29:51.8709\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB3277","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1793554,"web_url":"http://patchwork.ozlabs.org/comment/1793554/","msgid":"<VI1PR04MB14552F3AB0F250943EADBD1098440@VI1PR04MB1455.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-25T04:00:28","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":68653,"url":"http://patchwork.ozlabs.org/api/people/68653/","name":"Sumit Garg","email":"sumit.garg@nxp.com"},"content":"> -----Original Message-----\n> From: York Sun\n> Sent: Tuesday, October 24, 2017 8:00 PM\n> To: Sumit Garg <sumit.garg@nxp.com>; u-boot@lists.denx.de\n> Cc: Ruchika Gupta <ruchika.gupta@nxp.com>; Prabhakar Kushwaha\n> <prabhakar.kushwaha@nxp.com>; Z.q. Hou <zhiqiang.hou@nxp.com>; Pankaj\n> Gupta <pankaj.gupta@nxp.com>; Arun Pathak <arun.pathak@nxp.com>; Sahil\n> Malhotra <sahil.malhotra@nxp.com>\n> Subject: Re: [PATCH 2/2] armv8: sec_firmware: Add support for loadables in FIT\n> \n> On 10/23/2017 09:21 PM, Sumit Garg wrote:\n> <snip>\n> >>\n> >> Sumit,\n> >>\n> >> If I understand you correctly, you are parsing the secure firmware\n> >> FIT image to find the loadable node and store the 64-bit load address\n> >> in the scratch registers. How do you determine which scratch registers to\n> use?\n> >>\n> >> York\n> >\n> > Yes your understanding is correct. The scratch registers which I used are as\n> follows:\n> >\n> > For Chassis gen 3 platforms:\n> > \t/* Assign addresses to loadable ptrs */\n> > \tloadable_l = &gur->scratchrw[4];\n> > \tloadable_h = &gur->scratchrw[5];\n> >\n> > For Chassis gen 2 platforms:\n> > \t/* Assign addresses to loadable ptrs */\n> > \tloadable_l = &scfg->scratchrw[2];\n> > \tloadable_h = &scfg->scratchrw[3];\n> >\n> > I choose above scratch registers to avoid any conflict with usage of\n> > scratch registers in Boot-ROM, u-boot and PPA.\n> \n> I see you write to these scratch registers but never read from them.\n> What's the purpose to store the address in them?\n> \n> York\n \nThese scratch registers are used to communicate loadable address to PPA similar\nto how return address is communicated in boot-location pointer registers to PPA.\n\nPPA uses this loadable address (Trusted OS address) to initialize Trusted OS.\n\nSumit","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"het4jp2q\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=sumit.garg@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yMGdR6kVFz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Oct 2017 15:00:42 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 16F00C21DD7; Wed, 25 Oct 2017 04:00:36 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id F20E6C21D82;\n\tWed, 25 Oct 2017 04:00:33 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A6254C21D82; Wed, 25 Oct 2017 04:00:32 +0000 (UTC)","from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0076.outbound.protection.outlook.com [104.47.1.76])\n\tby lists.denx.de (Postfix) with ESMTPS id 0CB5EC21D75\n\tfor <u-boot@lists.denx.de>; Wed, 25 Oct 2017 04:00:32 +0000 (UTC)","from VI1PR04MB1455.eurprd04.prod.outlook.com (10.163.166.147) by\n\tVI1PR04MB1247.eurprd04.prod.outlook.com (10.162.121.156) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.156.4; Wed, 25 Oct 2017 04:00:30 +0000","from VI1PR04MB1455.eurprd04.prod.outlook.com\n\t([fe80::dce7:7a72:4fe9:ad22]) by\n\tVI1PR04MB1455.eurprd04.prod.outlook.com\n\t([fe80::dce7:7a72:4fe9:ad22%14]) with mapi id 15.20.0156.005;\n\tWed, 25 Oct 2017 04:00:28 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=9Z0ZhTil+Wsl9dqfw1rKRaJpBq1JdnVOm9aeRwEYc6A=;\n\tb=het4jp2qwBvP9n3l8J6ts7ovVAzX5BNl/aERcwQnuCcBmlrFH6jzDRabjYY2jyalp7mX22OOkSE18X5w1XO/r/iXjZbwiAq5x6YYhIUwP4IzyS7ke5y4PAkEQXV7pnFSNaJlo7txZSGV0pXUHl9/Ojd/XqFTvGihEldT0uLDFa0=","From":"Sumit Garg <sumit.garg@nxp.com>","To":"York Sun <york.sun@nxp.com>,\n\t\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvPofoqlrg/9EqxljE/8GXTkaL0RFUA","Date":"Wed, 25 Oct 2017 04:00:28 +0000","Message-ID":"<VI1PR04MB14552F3AB0F250943EADBD1098440@VI1PR04MB1455.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>\n\t<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>\n\t<VI1PR04MB14557F458647EA84C3C799C198470@VI1PR04MB1455.eurprd04.prod.outlook.com>\n\t<VI1PR04MB207866DDB8F85F6D28E04DF49A470@VI1PR04MB2078.eurprd04.prod.outlook.com>","In-Reply-To":"<VI1PR04MB207866DDB8F85F6D28E04DF49A470@VI1PR04MB2078.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"het4jp2q\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=sumit.garg@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB1247;\n\t6:rXz8tcx90VfZAurZeAcdDbHuKxzbQV1ILCRv4gmUmimH9Rzf70VtC1jCPQBEQj1fZoXR9Sy97ioysPZGaqYQTEGeXu7uIxcwJfoqj4r56Rl4vfeEc1PnQ8XVoXcmEgZsWsZ29Hkbqo4ZDISleJJfKOCJpKMlLus2NrRGdNjJcMkdDX2zqveea/ukMKpVwVmGOR4SrobvivTmFXxxWoX2kBWgK4G+h55gS25/8yTegDlsMOZHoJzrh/LmNGEBZym4R8y2MSKWWcwQNgTWSIICcCiEO7I5Az9N5lUhCKSBZES2oJsgeUYxv3RQIiGEFD+U5Ag7rGCQz09fFCNAv8zgMw==;\n\t5:YeGPu6EI8mbdeY6Y93wUfbou1kkq5fOpjEolZFh4TR7pSkB1HyQc7IcUZoTD0/DBHR3EYtbJMLlKqhSkJ9NafVC9uzY28zzAUqiCSuJafH+1XBEEGiA7cLmE+FC35aK1LiCFtCVTLZFbqwMW/wTHHg==;\n\t24:8pZOB2quZXzIaGZxQV0cGI/ndvEPnR49Ag2jqV20zGITv5+HhgwKDThaqYKboWInOnkqLPsHr6wEsvk3DkkP8D37rjWnE+Tf15J5t/4gQZ0=;\n\t7:GNQiNpMACh3lxF9c3cTCRm78IQCKILaSg+xPoXdDDeK3nK+2tnLFtuapvdof0F+m/0qz9YQaNYFsKh/TKAp5K1ItT2GSk7ruvOtlYJt+ThG52ALPLfx70vKzyLTaylsncgN676+m+sJUFxGYF5nKQ645mOx6Uxcry9MKeG1kSFQOnWi/mE4NH3IRG8Jl5fUPRYXKS3tqTHxIFZNVzNUuWz5fZ9su7OU/VPDbr9NGwng=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(199003)(24454002)(13464003)(5250100002)(316002)(189998001)(3846002)(478600001)(102836003)(33656002)(2906002)(66066001)(7696004)(9686003)(6436002)(2950100002)(3280700002)(5660300001)(86362001)(6116002)(25786009)(99286003)(6506006)(55016002)(3660700001)(101416001)(2900100001)(6246003)(81156014)(8936002)(8676002)(76176999)(50986999)(81166006)(54356999)(229853002)(7736002)(74316002)(68736007)(4326008)(53936002)(93886005)(305945005)(54906003)(2501003)(110136005)(14454004)(106356001)(53546010)(105586002)(97736004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1247;\n\tH:VI1PR04MB1455.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"c37db69e-602c-478a-e863-08d51b5cede3","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199);\n\tSRVR:VI1PR04MB1247; ","x-ms-traffictypediagnostic":"VI1PR04MB1247:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<VI1PR04MB1247ACB986BA88ACAB1A3E5C98440@VI1PR04MB1247.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3231020)(3002001)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB1247; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB1247; ","x-forefront-prvs":"0471B73328","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"c37db69e-602c-478a-e863-08d51b5cede3","X-MS-Exchange-CrossTenant-originalarrivaltime":"25 Oct 2017 04:00:28.3308\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB1247","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1793836,"web_url":"http://patchwork.ozlabs.org/comment/1793836/","msgid":"<VI1PR04MB2078063BEB503AEDE9A09E719A440@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-25T16:17:58","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"On 10/24/2017 09:00 PM, Sumit Garg wrote:\n>> -----Original Message-----\n>> From: York Sun\n>> Sent: Tuesday, October 24, 2017 8:00 PM\n>> To: Sumit Garg <sumit.garg@nxp.com>; u-boot@lists.denx.de\n>> Cc: Ruchika Gupta <ruchika.gupta@nxp.com>; Prabhakar Kushwaha\n>> <prabhakar.kushwaha@nxp.com>; Z.q. Hou <zhiqiang.hou@nxp.com>; Pankaj\n>> Gupta <pankaj.gupta@nxp.com>; Arun Pathak <arun.pathak@nxp.com>; Sahil\n>> Malhotra <sahil.malhotra@nxp.com>\n>> Subject: Re: [PATCH 2/2] armv8: sec_firmware: Add support for loadables in FIT\n>>\n>> On 10/23/2017 09:21 PM, Sumit Garg wrote:\n>> <snip>\n>>>>\n>>>> Sumit,\n>>>>\n>>>> If I understand you correctly, you are parsing the secure firmware\n>>>> FIT image to find the loadable node and store the 64-bit load address\n>>>> in the scratch registers. How do you determine which scratch registers to\n>> use?\n>>>>\n>>>> York\n>>>\n>>> Yes your understanding is correct. The scratch registers which I used are as\n>> follows:\n>>>\n>>> For Chassis gen 3 platforms:\n>>> \t/* Assign addresses to loadable ptrs */\n>>> \tloadable_l = &gur->scratchrw[4];\n>>> \tloadable_h = &gur->scratchrw[5];\n>>>\n>>> For Chassis gen 2 platforms:\n>>> \t/* Assign addresses to loadable ptrs */\n>>> \tloadable_l = &scfg->scratchrw[2];\n>>> \tloadable_h = &scfg->scratchrw[3];\n>>>\n>>> I choose above scratch registers to avoid any conflict with usage of\n>>> scratch registers in Boot-ROM, u-boot and PPA.\n>>\n>> I see you write to these scratch registers but never read from them.\n>> What's the purpose to store the address in them?\n>>\n>> York\n>  \n> These scratch registers are used to communicate loadable address to PPA similar\n> to how return address is communicated in boot-location pointer registers to PPA.\n> \n> PPA uses this loadable address (Trusted OS address) to initialize Trusted OS.\n\nOK. So these registers are actually consumed by PPA image. That makes\nmore sense.\n\nYork","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Iy3mGdg9\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yMb0Q2S18z9t3k\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 26 Oct 2017 03:18:12 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 69EE5C21DE9; Wed, 25 Oct 2017 16:18:06 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 1334EC21D75;\n\tWed, 25 Oct 2017 16:18:04 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid C371BC21D75; Wed, 25 Oct 2017 16:18:02 +0000 (UTC)","from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0070.outbound.protection.outlook.com [104.47.1.70])\n\tby lists.denx.de (Postfix) with ESMTPS id 38C48C21C71\n\tfor <u-boot@lists.denx.de>; Wed, 25 Oct 2017 16:18:02 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB3277.eurprd04.prod.outlook.com (10.170.231.142) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.156.4; Wed, 25 Oct 2017 16:17:59 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::6800:8284:f829:3ea3%14]) with mapi id 15.20.0156.007;\n\tWed, 25 Oct 2017 16:17:58 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4,\n\tRCVD_IN_MSPIKE_WL, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=FE9t+vHIlyKRdn2779A3XiMK9BaWSuEyHlgkpYMLzR4=;\n\tb=Iy3mGdg9mc2o6f8lR2M8I4HJ4VDmN7HH1XFZ4bqOo9w6wuB2EL7HWMPcvwL+sohj+br1IvXif8ETu/nJmncleTUjWYXgor0VamA+gWWtG5LoTQ8cc0M4KS+u0tDPSIknizBItyNnlQUs5+O+dW/d9FrBxP86dp/ylkqcM6hxydA=","From":"York Sun <york.sun@nxp.com>","To":"Sumit Garg <sumit.garg@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvOMspI/1gXeUyY6InPiXTrcA==","Date":"Wed, 25 Oct 2017 16:17:58 +0000","Message-ID":"<VI1PR04MB2078063BEB503AEDE9A09E719A440@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>\n\t<VI1PR04MB207838983D2E057F21E62CE69A460@VI1PR04MB2078.eurprd04.prod.outlook.com>\n\t<VI1PR04MB14557F458647EA84C3C799C198470@VI1PR04MB1455.eurprd04.prod.outlook.com>\n\t<VI1PR04MB207866DDB8F85F6D28E04DF49A470@VI1PR04MB2078.eurprd04.prod.outlook.com>\n\t<VI1PR04MB14552F3AB0F250943EADBD1098440@VI1PR04MB1455.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Iy3mGdg9\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[192.88.168.49]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB3277;\n\t6:5bwdyZX4EBSWxF6tyBydX4lLj3zs41Pu3550wv3YTyNl6IKV9jJn3rSfATzA0z5eZZctl32O2zgIzFQr/BiFFJpDdu27xeDUiQegoJs71PC4p57E4AI1J6iLkbijIiQ4yp5s4BNf/zF4tAtzqotqR1zS7zcLh5v3VTfcpSiDbBwj7TZ6kJHKQumKCURoeAqZzU+PU1UFyKqa4SrbpV+Ko+NtJYajCs+EeUMg5rXHpFfRXcXuQ46zbyz+EjROzpKPJ0qRO5PnjCjM9DzOtYdyURR4HldI2xv4I80l05e619ohMO51w8VgxukgiRbs1yCcVDBb5AMHhFlVmRRS9IJRHg==;\n\t5:wzlbn7WB9goqNKu+cH47uvOPGcjNSqwraXkwTMkIqNY5YWeJFyzqiCT2kFG+7yRR2lBPeLYUa6fJpyExfaF7oMCBtzP+m9bmwjDC9L/WSRXBlHFJsuyZAyY2f7IKqBq7v3FRWNJF+gcfaodGMfU94A==;\n\t24:5b21JStOk9QCmjNEOgmYef76dKiQWtRO3/zElCRFM1Agd+nUtLNzjb1A/PHy8AEHsTEn+7pOuWixxYaKjrSmKTvo7q7NCqOsbi7QyrU78tI=;\n\t7:jHD91so/o9VeB/ze+Vv+kNqf+qHs3F6hY9pubBw5yaqzOykRYVVsixVzZ5DUVml0Zt7caQDRNpShb4QbxT9vOplOLysVwJvg4Zs3khGyuAIqmpw/pvp53p96i22AO4xMEaBrR399JztjHgC84XqxrU/m+R+6pemSHTphtOgZqFoE3forus+BecNEBPzByXSVrFc+wGAwZOwZM3hFG+eTypBWdjG5ea+t8SLB6SZ0s/o=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(24454002)(13464003)(189002)(199003)(316002)(74316002)(5660300001)(7696004)(7736002)(86362001)(305945005)(2501003)(5250100002)(54906003)(43066004)(110136005)(33656002)(14454004)(93886005)(101416001)(54356999)(76176999)(97736004)(53546010)(50986999)(66066001)(478600001)(6116002)(81156014)(102836003)(2900100001)(8676002)(8936002)(68736007)(9686003)(81166006)(106356001)(105586002)(3846002)(99286003)(53936002)(55016002)(2906002)(25786009)(6506006)(4326008)(3660700001)(189998001)(3450700001)(6436002)(6246003)(3280700002)(229853002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3277;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"cd5f52e0-d143-4516-c8c3-08d51bc3f52e","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199);\n\tSRVR:VI1PR04MB3277; ","x-ms-traffictypediagnostic":"VI1PR04MB3277:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<VI1PR04MB32779BD1BE7DE1AFCE76B0089A440@VI1PR04MB3277.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231020)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB3277; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB3277; ","x-forefront-prvs":"0471B73328","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"cd5f52e0-d143-4516-c8c3-08d51bc3f52e","X-MS-Exchange-CrossTenant-originalarrivaltime":"25 Oct 2017 16:17:58.7599\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB3277","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1796167,"web_url":"http://patchwork.ozlabs.org/comment/1796167/","msgid":"<VI1PR04MB2078FD0269F503B72CC7703F9A590@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-30T18:37:25","subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"On 09/01/2017 01:25 AM, Sumit Garg wrote:\n> Enable support for loadables in SEC firmware FIT image. Currently support\n> is added for single loadable image.\n> \n> Brief description of implementation:\n> - Add two more address pointers (loadable_h, loadable_l) as arguments to\n>   sec_firmware_init() api.\n> - Create new api: sec_firmware_checks_copy_loadable() to check if loadables\n>   node is present in SEC firmware FIT image. If present, verify loadable\n>   image and copies it to secure DDR memory.\n> - Populate address pointers with secure DDR memory addresses where loadable\n>   is copied.\n> \n> Example use-case could be trusted OS (tee.bin) as loadables node in SEC\n> firmware FIT image.\n> \n> Signed-off-by: Sumit Garg <sumit.garg@nxp.com>\n> ---\n\nReformatted commit message get rid of the bulletin style.\nApplied to fsl-qoriq master. Thanks.\n\nYork","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"mCECFafY\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yQjrv524cz9t5Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 31 Oct 2017 05:37:35 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 08BA6C21D5B; Mon, 30 Oct 2017 18:37:31 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 9D486C21C93;\n\tMon, 30 Oct 2017 18:37:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid BBB08C21C4F; Mon, 30 Oct 2017 18:37:28 +0000 (UTC)","from EUR01-DB5-obe.outbound.protection.outlook.com\n\t(mail-db5eur01on0053.outbound.protection.outlook.com [104.47.2.53])\n\tby lists.denx.de (Postfix) with ESMTPS id 37555C21C4F\n\tfor <u-boot@lists.denx.de>; Mon, 30 Oct 2017 18:37:28 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB2960.eurprd04.prod.outlook.com (10.170.228.26) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.178.6; Mon, 30 Oct 2017 18:37:26 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::94f4:3642:3629:81bb]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::94f4:3642:3629:81bb%13]) with mapi id 15.20.0178.012;\n\tMon, 30 Oct 2017 18:37:26 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2,\n\tSPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=nAQd3OSxUbNF6kFadSgPJTAyFdtLjkEhwFTfY4qY0lk=;\n\tb=mCECFafYKSnqqlQilraoi7N46DenQGyJZ7ymg6UJIc9/bDjFVNX/9eP1wZY+IkI+niefqq0pj0ls4+OYaVXTeX8drLNYVl3SY/0AEs7uQ/Iqy6q5JQ6utosAGnYkA/jeneJYEWBMfLrP9EiD2MhdE0bFlLiZyctFR90prpqkv9c=","From":"York Sun <york.sun@nxp.com>","To":"Sumit Garg <sumit.garg@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH 2/2] armv8: sec_firmware: Add support for loadables in\n\tFIT","Thread-Index":"AQHTIvvOMspI/1gXeUyY6InPiXTrcA==","Date":"Mon, 30 Oct 2017 18:37:25 +0000","Message-ID":"<VI1PR04MB2078FD0269F503B72CC7703F9A590@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1504254301-7970-1-git-send-email-sumit.garg@nxp.com>\n\t<1504254301-7970-2-git-send-email-sumit.garg@nxp.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"mCECFafY\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[24.16.45.3]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB2960;\n\t6:+DmiVolqDZYQcieDTHyAMPnwhSIYe8vQFJ2uG08y4caLQuQ4Uxjexr7Zkm1vdbNe3/DZIZ5oCr1iPV/p6bIjjutupapIB8SIOEhEh9I8IkzoBWsdWMsXAhzokRx1hPNWJepr7tU1JaMGto3jb5xJxMw569YlXjGuFCV+wFLNYu6idxiJvUmPiuoCQDpxQUDbsG7e7TGyR4JTIddPcxJm2DqwI5kUU6xowl4L+9N5NWrLa605BkdZm9IurnVwgQfJYw9P/3i58VYGW/sIIlqtd9g8UvZLZ6IqLL+C3t2MR+QrxipdTxrhJLWtb0DEpqvczt++4LQ25X2MSpsC3pAwlGXAcd97oBbCuMmp7bnzzQ0=;\n\t5:z2t/9b8C9AcsP2AQe45erMZ+GukTtcBgf0XY8IjZR42daVXKJUGb2C1qiU0sha2dqktL/32UGxHLPQoGCSjelamc+V5ZBEqoo04TjN724KqvKSmYU1S7JAXaSm6XEu0O19gpdAK+fv4iFZuuGE8JdlGDCPjHrQ4iVhMdsFD6SKw=;\n\t24:Ykt+GhdZEyXvnjrkltis4t9f1W2LRH497R2TDF8sdMxnowrtSJvq3MqJUV1hSy+1MlvRvkCdDkbaH0PMZLgMAL8sg3W7Szjus/l99FhORZY=;\n\t7:zoI8HRiDQL+DWu5k6kbZAA72/AvIZdAxb0p0uvIr/Vjj10LrO5dVRg5CotLLgvaMHnTT49UyDuAkEHZanlLnsN4ciobmRPDCjgJK3sGnsJKhrwun18AoZPScDy5uSf/Yt6zk9cYy7I/vahV0Fhb1zjCVAzrr+qKCx0Gy1APTv7NERqmA5x1B64PVZdWPG9S8SbOSovUl8GeQtDpnDba8k37mIJkxhwddrjC63vf8LharFmpHS6wtFfLwlgtwoFrZ","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(24454002)(199003)(2900100001)(305945005)(25786009)(102836003)(3846002)(3450700001)(66066001)(6116002)(316002)(3280700002)(3660700001)(229853002)(5660300001)(478600001)(97736004)(9686003)(55016002)(99286003)(7736002)(50986999)(54356999)(14454004)(76176999)(86362001)(2501003)(53936002)(53546010)(8676002)(4326008)(106356001)(105586002)(81166006)(81156014)(5250100002)(33656002)(43066004)(6506006)(101416001)(110136005)(6436002)(189998001)(2906002)(8936002)(54906003)(7696004)(68736007)(6246003)(74316002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB2960;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"d0bfc03c-fec2-436e-639f-08d51fc54489","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(4534020)(4602075)(48565401081)(2017052603199);\n\tSRVR:VI1PR04MB2960; ","x-ms-traffictypediagnostic":"VI1PR04MB2960:","x-exchange-antispam-report-test":"UriScan:(185117386973197);","x-microsoft-antispam-prvs":"<VI1PR04MB29600056ED3835381B48C5139A590@VI1PR04MB2960.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3231020)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB2960; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB2960; ","x-forefront-prvs":"0476D4AB88","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"d0bfc03c-fec2-436e-639f-08d51fc54489","X-MS-Exchange-CrossTenant-originalarrivaltime":"30 Oct 2017 18:37:26.0103\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB2960","Cc":"Sahil Malhotra <sahil.malhotra@nxp.com>,\n\t\"Z.q. Hou\" <zhiqiang.hou@nxp.com>, \n\tPankaj Gupta <pankaj.gupta@nxp.com>, Arun Pathak <arun.pathak@nxp.com>,\n\tRuchika Gupta <ruchika.gupta@nxp.com>","Subject":"Re: [U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for\n\tloadables in FIT","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]