From patchwork Tue May 7 12:52:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096333 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="C5EJ2scv"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44z01c55VKz9sB8 for ; Tue, 7 May 2019 22:54:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 667B5C21DF3; Tue, 7 May 2019 12:53:16 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 35DA4C21E52; Tue, 7 May 2019 12:52:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DDCDCC21E88; Tue, 7 May 2019 12:52:35 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by lists.denx.de (Postfix) with ESMTPS id EB1C0C21EA1 for ; Tue, 7 May 2019 12:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nlmdkxTJ560GeRMQb8H3si7cs4lMfXCkqW5i71Lvy1U=; b=C5EJ2scvHJft0183lP/koPPx5fjQUtkWF2UN1thzdiMxQnm33CuTdAMth++DfhaocDRfZZJEPOtCN4+t2lls4QOqt4OuAAyJK+0rLs8QkmDhU/6sjyOrcKEP/J+I+XLW0UnuPe6R2tYAlqSmTNzepi+9UUxunQRvxcpS/iMt2dQ= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:33 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:33 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 1/6] imx: mach-imx: clean up Makefile Thread-Index: AQHVBNO90e15qz39i0qssYGz0JKAIg== Date: Tue, 7 May 2019 12:52:33 +0000 Message-ID: <20190507130554.4598-2-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89867978-b956-4708-ad66-08d6d2eadfa6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:400; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(14444005)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 57AmrjqY9klyGMGkhYftAdqLF6QcnxopBx2GZhuWYild7FDbwnBI96T44zw022rFJXWMnjbxu3Wos6GZ7orpLUyNtgOpwJjRd+YRPePnhPxmOKCJ6aGd8UcrGyU/iUtHqjEDf+/56d7qa0rqMnJPZWloq5I/Uc/3v1fD/aHQaCPu8V/UifhGknJjY6nOtfE+p9671nz/noTcvRN9gPniKgtxM0pWVShfoxopvMB3Ff6Yj00cINNWjVQutx5f7iaIsNdUhjhvIQFtt06kvsMB6JPnlHCu8mlw3OrrSWbKY+DY0RE5jdW1DS04Yl5y1Yquk9XkXHVPehwb0hGj8O7gxOEVyFdhznTt8898592Y4nUKwWD9Yd3cbFzpjozJo4oCEAP02+CvLUMKCn6qKBiOJPdwvcXrg4rb9D7T/B1JUL4= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89867978-b956-4708-ad66-08d6d2eadfa6 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:33.8475 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 1/6] imx: mach-imx: clean up Makefile X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Only eval the variables when building related target, then we will not see unrelated warning that when building spl and u-boot. Signed-off-by: Peng Fan --- arch/arm/mach-imx/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 37675d0558..0562640599 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -104,18 +104,15 @@ IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%) $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cpp_cfg) +DEPFILE_EXISTS := 0 ifeq ($(CONFIG_ARCH_IMX8), y) CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh IMAGE_TYPE := imx8image -SPL_DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG); if [ -f spl/u-boot-spl.cfgout ]; then $(CNTR_DEPFILES) spl/u-boot-spl.cfgout; echo $$?; fi) -DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctree)/$(IMX_CONFIG); if [ -f u-boot-dtb.cfgout ]; then $(CNTR_DEPFILES) u-boot-dtb.cfgout; echo $$?; fi) else ifeq ($(CONFIG_ARCH_IMX8M), y) IMAGE_TYPE := imx8mimage IMX8M_DEPFILES := $(srctree)/tools/imx8m_image.sh -DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG);if [ -f spl/u-boot-spl.cfgout ]; then $(IMX8M_DEPFILES) spl/u-boot-spl.cfgout 0; echo $$?; fi) else IMAGE_TYPE := imximage -DEPFILE_EXISTS := 0 endif MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \ @@ -139,30 +136,33 @@ endif ifdef CONFIG_ARM64 ifeq ($(CONFIG_ARCH_IMX8M), y) -SPL: +SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout \ -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE) flash.bin: MKIMAGEOUTPUT = flash.log spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE + $(eval DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG);if [ -f spl/u-boot-spl.cfgout ]; then $(IMX8M_DEPFILES) spl/u-boot-spl.cfgout 0; echo $$?; fi)) ifeq ($(DEPFILE_EXISTS),0) $(IMX8M_DEPFILES) spl/u-boot-spl.cfgout 1 endif flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE + $(eval DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG);if [ -f spl/u-boot-spl.cfgout ]; then $(IMX8M_DEPFILES) spl/u-boot-spl.cfgout 0; echo $$?; fi)) ifeq ($(DEPFILE_EXISTS),0) $(call if_changed,mkimage) endif endif ifeq ($(CONFIG_ARCH_IMX8), y) -SPL: +SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000 flash.bin: MKIMAGEOUTPUT = flash.log flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE + $(eval SPL_DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG); if [ -f spl/u-boot-spl.cfgout ]; then $(CNTR_DEPFILES) spl/u-boot-spl.cfgout; echo $$?; fi)) ifeq ($(SPL_DEPFILE_EXISTS),0) $(call if_changed,mkimage) endif From patchwork Tue May 7 12:52:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096332 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="E6IwKDgL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44yzzk5dRMz9sB8 for ; Tue, 7 May 2019 22:53:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6A49DC21E1B; Tue, 7 May 2019 12:53:03 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9EAB7C21C8B; Tue, 7 May 2019 12:52:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D3906C21E85; Tue, 7 May 2019 12:52:39 +0000 (UTC) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50040.outbound.protection.outlook.com [40.107.5.40]) by lists.denx.de (Postfix) with ESMTPS id 6BF3CC21E85 for ; Tue, 7 May 2019 12:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hgLxShXb7Lo4NjSpyCGhO9BI4DAQOjn6iH5otRmBkIY=; b=E6IwKDgLbcE7yEmfYk8hgp4+fJeH55tTH5LJ6A+yxma6VL6wcF+tKFBggMmJgk10mp4L5CCZkP6R3gvUU/M1c3Kn2bcMLq5nPNHbn5w5x+5L8yv8TMMgEmRtzk5QtYjeKPEB54/D4kBotce5yW4XPxcwGSYXbbeOwD+v/X2LhyY= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:37 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:37 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 2/6] spl: Add function to get u-boot raw sector Thread-Index: AQHVBNO/YOLdhj+wm0OHuk80Z9apNA== Date: Tue, 7 May 2019 12:52:37 +0000 Message-ID: <20190507130554.4598-3-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7899e98a-e5f7-470d-c75e-08d6d2eae1c8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:164; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: jyIrTiJtlWjiYrUuId/IR9H4iVIEaWM9jgzq5Q2IBmwlJs2RVOENSbx/9rnNPIa+czZxAjPyT4DnnVF/To3U9WIOcb7+DFzsi+LcIXYPLxVYhuNRG4tdDFDaCzidQ/Ii5z3E/VFYeJ9sO5vVnqHqXR6XZPeN4ibSlPr/fCkq5ob3KrockLeQ59xJ07dzwTjwQpMy56bqk8f2EgviSz2S5Q8bBUM3w6JTsy3dxSQO66X366D7lofd4jDdojLWsyM4yy1P2HxjLVCNN7VkQ0+19X62XW4XousOrKthI+uX8ZoFv1xN0oRUYC6VDiSuc5Zsxg6BelttuncebTJe1SEV7Y7EmjswZ6A5QRIkUn7YICdH36YYqkSqc35XPC8kwBIH1KOKlG9jtuqGyftwPK+1wPMs8Nq4sAQ57sRaClBKsEg= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7899e98a-e5f7-470d-c75e-08d6d2eae1c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:37.4574 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: Marek Vasut , Tien Fong Chee , "u-boot@lists.denx.de" , dl-uboot-imx , York Sun Subject: [U-Boot] [PATCH 2/6] spl: Add function to get u-boot raw sector X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a weak function spl_mmc_get_uboot_raw_sector to get u-boot raw sector. At default it returns CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. Users can overwrite it to return customized offset. This is to support i.MX8 specific image type container image type. Cc: Tien Fong Chee Cc: Peng Fan Cc: Simon Goldschmidt Cc: York Sun Cc: Marek Vasut Cc: Alex Kiernan Signed-off-by: Peng Fan --- common/spl/spl_mmc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 324d91c884..bf53a1dadf 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -149,6 +149,13 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device) return 0; } +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR +unsigned long __weak spl_mmc_get_uboot_raw_sector(struct mmc *mmc) +{ + return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR; +} +#endif + #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION static int mmc_load_image_raw_partition(struct spl_image_info *spl_image, struct mmc *mmc, int partition) @@ -181,7 +188,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image, #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR return mmc_load_image_raw_sector(spl_image, mmc, - info.start + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); + info.start + spl_mmc_get_uboot_raw_sector(mmc)); #else return mmc_load_image_raw_sector(spl_image, mmc, info.start); #endif @@ -366,7 +373,7 @@ int spl_mmc_load_image(struct spl_image_info *spl_image, #endif #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR err = mmc_load_image_raw_sector(spl_image, mmc, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); + spl_mmc_get_uboot_raw_sector(mmc)); if (!err) return err; #endif From patchwork Tue May 7 12:52:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096331 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="kBa4WAPZ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44yzzZ4DHlz9sB8 for ; Tue, 7 May 2019 22:52:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 2FE8EC21E96; Tue, 7 May 2019 12:52:47 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 042B6C21D74; Tue, 7 May 2019 12:52:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C89B6C21E79; Tue, 7 May 2019 12:52:41 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140078.outbound.protection.outlook.com [40.107.14.78]) by lists.denx.de (Postfix) with ESMTPS id 19C7CC21E9F for ; Tue, 7 May 2019 12:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ICtkSoVK61b0c1dCw1xZ9wJ1js2F2/zDeyrKTEgH7Q=; b=kBa4WAPZEAHuwne/H6yONQlaN3bX/fQmMLBlfo7iX2d922+HaVvma9VEtWoWk2/4aIT2kkqdxMT1xep9K26i/bUDWLh7bIJNo5S6DY5fL8xt8YIvHQfRAh5E8aPf3Y7BqowZu8zhDlefB42K8iOs/bLDzdybL1bH0J6gUqQ9ODs= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:40 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:40 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 3/6] imx8: support parsing i.MX8 Container file Thread-Index: AQHVBNPAvUYP/btGnEmoUldLD+EmhA== Date: Tue, 7 May 2019 12:52:39 +0000 Message-ID: <20190507130554.4598-4-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 659bbf80-1d6f-44c5-85e7-08d6d2eae339 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:138; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: p2dZ1E97sa+Rguf3i43cVGGoQwR/9yDrLx63uQQqklrdwtB/xSGTn4oNvcAxBGqw8CZqp4PcRDqMCYKvEAYp/L2l9gs+9ZUtQVUkrk+pxrSNkqbYW7T68jedoJn1TwCkcEM4knDikwJ/7p7LcBPCLE2PYz27lMbCNp4vCrkVIMu1ga00OYRU6+gkoKGhFiygzHkPt5KxdDO8297BQyHAZCn4Mix6KpLMYkNhs6FqMvwqHURZfl/RtlkwIKsPjD6Za8/4LEBl7GnYXYwCvFagiZ5WP6RYQ8QnakH0Mf0BAEuPiNxt5Nz9yOuB/ojszVFu5Tc2n04/s791of40zdA8JXZ8f7B0Rf25VtuetiTXNb+XvyvLjdbwjFTY/rKgTpzho8ZzGvJb728vvQNPONldgrERaLKhXQHeeLPUPyluLmA= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 659bbf80-1d6f-44c5-85e7-08d6d2eae339 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:39.9220 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 3/6] imx8: support parsing i.MX8 Container file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add parsing i.MX8 Container file support, this is to let SPL could load images in a container file to destination address. Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8/image.h | 56 +++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 6 ++ arch/arm/mach-imx/imx8/Makefile | 4 ++ arch/arm/mach-imx/imx8/parse-container.c | 120 +++++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 arch/arm/include/asm/arch-imx8/image.h create mode 100644 arch/arm/mach-imx/imx8/parse-container.c diff --git a/arch/arm/include/asm/arch-imx8/image.h b/arch/arm/include/asm/arch-imx8/image.h new file mode 100644 index 0000000000..c1e5700859 --- /dev/null +++ b/arch/arm/include/asm/arch-imx8/image.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2018-2019 NXP + */ + +#ifndef __CONTAINER_HEADER_H_ +#define __CONTAINER_HEADER_H_ + +#include +#include + +#define IV_MAX_LEN 32 +#define HASH_MAX_LEN 64 + +#define CONTAINER_HDR_ALIGNMENT 0x400 +#define CONTAINER_HDR_EMMC_OFFSET 0 +#define CONTAINER_HDR_MMCSD_OFFSET SZ_32K +#define CONTAINER_HDR_QSPI_OFFSET SZ_4K +#define CONTAINER_HDR_NAND_OFFSET SZ_128M + +struct container_hdr { + u8 version; + u8 length_lsb; + u8 length_msb; + u8 tag; + u32 flags; + u16 sw_version; + u8 fuse_version; + u8 num_images; + u16 sig_blk_offset; + u16 reserved; +} __packed; + +struct boot_img_t { + u32 offset; + u32 size; + u64 dst; + u64 entry; + u32 hab_flags; + u32 meta; + u8 hash[HASH_MAX_LEN]; + u8 iv[IV_MAX_LEN]; +} __packed; + +struct signature_block_hdr { + u8 version; + u8 length_lsb; + u8 length_msb; + u8 tag; + u16 srk_table_offset; + u16 cert_offset; + u16 blob_offset; + u16 signature_offset; + u32 reserved; +} __packed; +#endif diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig index c32f7dbb61..8e6b79eb77 100644 --- a/arch/arm/mach-imx/imx8/Kconfig +++ b/arch/arm/mach-imx/imx8/Kconfig @@ -23,6 +23,12 @@ config IMX8QXP config SYS_SOC default "imx8" +config SPL_LOAD_IMX_CONTAINER + bool "Enable SPL loading U-Boot as a i.MX Container image" + depends on SPL + help + This is to let SPL could load i.MX8 Container image + choice prompt "i.MX8 board select" optional diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile index 31ad169ccf..19690110a5 100644 --- a/arch/arm/mach-imx/imx8/Makefile +++ b/arch/arm/mach-imx/imx8/Makefile @@ -5,3 +5,7 @@ # obj-y += cpu.o iomux.o + +ifdef CONFIG_SPL_BUILD +obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += parse-container.o +endif diff --git a/arch/arm/mach-imx/imx8/parse-container.c b/arch/arm/mach-imx/imx8/parse-container.c new file mode 100644 index 0000000000..32f78bdddf --- /dev/null +++ b/arch/arm/mach-imx/imx8/parse-container.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2018-2019 NXP + */ + +#include +#include +#include +#include + +static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image, + struct spl_load_info *info, + struct container_hdr *container, + int image_index, + u32 container_sector) +{ + struct boot_img_t *images; + ulong sector; + u32 sectors; + + if (image_index > container->num_images) { + debug("Invalid image number\n"); + return NULL; + } + + images = (struct boot_img_t *)((u8 *)container + + sizeof(struct container_hdr)); + + if (images[image_index].offset % info->bl_len) { + printf("%s: image%d offset not aligned to %u\n", + __func__, image_index, info->bl_len); + return NULL; + } + + sectors = roundup(images[image_index].size, info->bl_len) / + info->bl_len; + sector = images[image_index].offset / info->bl_len + + container_sector; + + debug("%s: container: %p sector: %lu sectors: %u\n", __func__, + container, sector, sectors); + if (info->read(info, sector, sectors, + (void *)images[image_index].entry) != sectors) { + printf("%s wrong\n", __func__); + return NULL; + } + + return &images[image_index]; +} + +static int read_auth_container(struct spl_image_info *spl_image, + struct spl_load_info *info, ulong sector) +{ + struct container_hdr *container = NULL; + u16 length; + u32 sectors; + int i, size; + + size = roundup(CONTAINER_HDR_ALIGNMENT, info->bl_len); + sectors = size / info->bl_len; + + /* + * It will not override the ATF code, so safe to use it here, + * no need malloc + */ + container = (struct container_hdr *)spl_get_load_buffer(-size, size); + + debug("%s: container: %p sector: %lu sectors: %u\n", __func__, + container, sector, sectors); + if (info->read(info, sector, sectors, container) != sectors) + return -EIO; + + if (container->tag != 0x87 && container->version != 0x0) { + printf("Wrong container header"); + return -ENOENT; + } + + if (!container->num_images) { + printf("Wrong container, no image found"); + return -ENOENT; + } + + length = container->length_lsb + (container->length_msb << 8); + debug("Container length %u\n", length); + + if (length > CONTAINER_HDR_ALIGNMENT) { + size = roundup(length, info->bl_len); + sectors = size / info->bl_len; + + container = (struct container_hdr *)spl_get_load_buffer(-size, size); + + debug("%s: container: %p sector: %lu sectors: %u\n", + __func__, container, sector, sectors); + if (info->read(info, sector, sectors, container) != + sectors) + return -EIO; + } + + for (i = 0; i < container->num_images; i++) { + struct boot_img_t *image = read_auth_image(spl_image, info, + container, i, + sector); + + if (!image) + return -EINVAL; + + if (i == 0) { + spl_image->load_addr = image->dst; + spl_image->entry_point = image->entry; + } + } + + return 0; +} + +int spl_load_imx_container(struct spl_image_info *spl_image, + struct spl_load_info *info, ulong sector) +{ + return read_auth_container(spl_image, info, sector); +} From patchwork Tue May 7 12:52:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096336 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="UQ+ZEZFi"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44z02w4NQRz9sB8 for ; Tue, 7 May 2019 22:55:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4C355C21D74; Tue, 7 May 2019 12:53:44 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7F0F1C21E70; Tue, 7 May 2019 12:53:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CDC8DC21C4A; Tue, 7 May 2019 12:52:50 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140057.outbound.protection.outlook.com [40.107.14.57]) by lists.denx.de (Postfix) with ESMTPS id 97F42C21E88 for ; Tue, 7 May 2019 12:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A03z9V15hxvB3Bw4petQjcBgFlLelqq/MR48QcQZtqA=; b=UQ+ZEZFi8YgP+64Es2fyMEP9V10InuKLK5Mhz8I0zYXsVR9wXKntaXcoamjF5mciIFvDd9L6vimyrRCJ6x0H5Vp71FGoi7meBmRhG4gKzhPE/ZoUA2Q8DUSF5sXN7cRZwVReNp52YqATVeuwQeV+OlhVG2ARPylcWWqZbPWpSdQ= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:44 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:44 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 4/6] spl: mmc: support loading i.MX container format file Thread-Index: AQHVBNPD1i8f74t68kmU/NmBgO2wCQ== Date: Tue, 7 May 2019 12:52:44 +0000 Message-ID: <20190507130554.4598-5-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9c370a37-5506-4a51-4f26-08d6d2eae5f9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(7416002)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /jKuqsMmW8cyz5kNnt68KCN3n5zAmQSbNOVrf3CgR/34o09sovlCjLs5loAZOQPbdOUTRd+asntPqU8r/8bOA2xShb0Co8f4JRR7XcwJOWyun9MD4h+4s8tuhsxWXJjpEsY6yw7gauNUaqJeUHfthcHQKUCDD9fu6RB5O774R/JjbFX8W0AqCNFdURcvL/uFmTbC3c3tV489dRske9x4q/2uf+qUfu+ZQb4R7d4dlVC77oZxLrKVMq+0etHJIZwOyNAnr/+preOKzSEEiupvpvRUDeEJHY8QlIJXzRYpmk6eGX8PfF/dKL9QdBSfVaatRlf4cUQKoQ2Zwl5Uo2e4EFXM5ccPzaP+Lgaz4VHC0qCXs/huKxGxZa9z4KWKgwe75DuLOZSAP+Ltii82UFMU0OMR8m85bhCcPvZ+WO27N5w= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c370a37-5506-4a51-4f26-08d6d2eae5f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:44.4433 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: Marek Vasut , Tien Fong Chee , "u-boot@lists.denx.de" , dl-uboot-imx , York Sun Subject: [U-Boot] [PATCH 4/6] spl: mmc: support loading i.MX container format file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" i.MX8 only support AHAB secure boot with Container format image, we could not use FIT to support secure boot, so introduce container support to let SPL could load container images. Cc: Simon Goldschmidt Cc: Tien Fong Chee Cc: York Sun Cc: Marek Vasut Cc: Alex Kiernan Cc: Simon Glass Cc: Philipp Tomsich Cc: Kever Yang Cc: Heiko Schocher Signed-off-by: Peng Fan --- common/spl/spl_mmc.c | 10 ++++++++++ include/spl.h | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index bf53a1dadf..6320af055b 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -79,6 +79,16 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image, load.bl_len = mmc->read_bl_len; load.read = h_spl_load_read; ret = spl_load_simple_fit(spl_image, &load, sector, header); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) { + struct spl_load_info load; + + load.dev = mmc; + load.priv = NULL; + load.filename = NULL; + load.bl_len = mmc->read_bl_len; + load.read = h_spl_load_read; + + ret = spl_load_imx_container(spl_image, &load, sector); } else { ret = mmc_load_legacy(spl_image, mmc, sector, header); } diff --git a/include/spl.h b/include/spl.h index f09909e189..b7c8a972dd 100644 --- a/include/spl.h +++ b/include/spl.h @@ -125,6 +125,18 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, #define SPL_COPY_PAYLOAD_ONLY 1 #define SPL_FIT_FOUND 2 +/** + * spl_load_imx_container() - Loads a imx container image from a device. + * @spl_image: Image description to set up + * @info: Structure containing the information required to load data. + * @sector: Sector number where container image is located in the device + * + * Reads the container image @sector in the device. Loads u-boot image to + * specified load address. + */ +int spl_load_imx_container(struct spl_image_info *spl_image, + struct spl_load_info *info, ulong sector); + /* SPL common functions */ void preloader_console_init(void); u32 spl_boot_device(void); From patchwork Tue May 7 12:52:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096337 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="HDEgOJYF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44z0323PLNz9sB8 for ; Tue, 7 May 2019 22:55:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0B17FC21EB9; Tue, 7 May 2019 12:54:12 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 48289C21E3A; Tue, 7 May 2019 12:53:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 488F5C21E89; Tue, 7 May 2019 12:52:52 +0000 (UTC) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50044.outbound.protection.outlook.com [40.107.5.44]) by lists.denx.de (Postfix) with ESMTPS id F3D89C21DCA for ; Tue, 7 May 2019 12:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aouIVMMA4FldUAgq6WH9Y0Px2akpeb7WpV2XdZL0xkg=; b=HDEgOJYFKMrWo6T6zwfZTSB0sKJXVjtnnwpG/VmjDJDN9cs15qFYp3xtjh/cJ455rJyRelPNGstl8P+TEWklAotUFxbuA7gkv46nLvPRtm5Gh83HI61+DmlME+nN5c5Iu3V8/ghjRxpTLNNSeqhCOcBlt2BhRPt4OLZfjnafrgQ= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:47 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:46 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 5/6] imx: add container target Thread-Index: AQHVBNPFZN4LOd5yaU+q2VIRYvgDWg== Date: Tue, 7 May 2019 12:52:46 +0000 Message-ID: <20190507130554.4598-6-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ec7ba22-a741-43d0-f0d5-08d6d2eae763 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: T5VAPMNOcED8sSA5EPuB3d2PmheZ+tibrz1zQLwKnD1JdUpmlMy5CoxaA3A40glXyk5R/2uRNfk1YEOcfe/L8YmvNpbYHsEBZPFnijSgI30F3/vdznJneTBSmqsjHOLROegFgtn2K9CjqVg4xfTONj6ufZ2NHevW4mSucy3Aq6YqiWHh7z/lznxj4FiQfvDUTkl+W6lWML8VKsa0a2v1gqZFDWiALJQiYNC8w9+SiWoAQaAVb8XcU7Gmk1Q41wTSO1EFBOP8bC/jf5v6uQR/ihTM3CWfenUkO61BL1s/HrmLfoTmEq6KoMz/Lkut4dW8AXNSgy8A0qjenKB95RevdoThIFb9rb0DctG0uivmQ7V7ISTvH9QgmXNqQm0izH63qd0PrpHZrqdi2XzAxV8z8pKOLqRRoN5piKUQ6oIPY9U= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ec7ba22-a741-43d0-f0d5-08d6d2eae763 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:46.8558 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 5/6] imx: add container target X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To support SPL loading container file, add a new Makefile target, and introduce a new Kconfig file to source the cfg file which will be parsed by mkimage. Signed-off-by: Peng Fan --- Makefile | 8 ++++++++ arch/arm/mach-imx/Makefile | 14 ++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/Makefile b/Makefile index d6a6ef19ab..2912cebaf6 100644 --- a/Makefile +++ b/Makefile @@ -1300,9 +1300,17 @@ SPL: spl/u-boot-spl.bin FORCE $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ ifeq ($(CONFIG_ARCH_IMX8M)$(CONFIG_ARCH_IMX8), y) +ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y) +u-boot.cnt: u-boot.bin FORCE + $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ + +flash.bin: spl/u-boot-spl.bin u-boot.cnt FORCE + $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ +else flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ endif +endif u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 0562640599..494eee8e5a 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -104,6 +104,11 @@ IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%) $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cpp_cfg) +IMX_CONTAINER_CFG = $(CONFIG_IMX_CONTAINER_CFG:"%"=%) +container.cfg: $(IMX_CONTAINER_CFG) FORCE + $(Q)mkdir -p $(dir $@) + $(call if_changed_dep,cpp_cfg) + DEPFILE_EXISTS := 0 ifeq ($(CONFIG_ARCH_IMX8), y) CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh @@ -161,7 +166,16 @@ SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000 flash.bin: MKIMAGEOUTPUT = flash.log +MKIMAGEFLAGS_u-boot.cnt = -n container.cfg -T $(IMAGE_TYPE) -e 0x100000 +u-boot.cnt: MKIMAGEOUTPUT = u-boot.cnt.log + +ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y) +u-boot.cnt: u-boot.bin container.cfg FORCE + $(call if_changed,mkimage) +flash.bin: spl/u-boot-spl.bin u-boot.cnt FORCE +else flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE +endif $(eval SPL_DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG); if [ -f spl/u-boot-spl.cfgout ]; then $(CNTR_DEPFILES) spl/u-boot-spl.cfgout; echo $$?; fi)) ifeq ($(SPL_DEPFILE_EXISTS),0) $(call if_changed,mkimage) diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig index 8e6b79eb77..8128ec16b4 100644 --- a/arch/arm/mach-imx/imx8/Kconfig +++ b/arch/arm/mach-imx/imx8/Kconfig @@ -29,6 +29,13 @@ config SPL_LOAD_IMX_CONTAINER help This is to let SPL could load i.MX8 Container image +config IMX_CONTAINER_CFG + string "i.MX Container config file" + depends on SPL + help + This is to specific the cfg file for generating container + image which will be loaded by SPL. + choice prompt "i.MX8 board select" optional From patchwork Tue May 7 12:52:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1096335 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="BXYCHtq6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44z02q3tpXz9sB8 for ; Tue, 7 May 2019 22:55:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 14B02C21E1E; Tue, 7 May 2019 12:53:58 +0000 (UTC) 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=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8057CC21E73; Tue, 7 May 2019 12:53:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9C787C21E85; Tue, 7 May 2019 12:52:55 +0000 (UTC) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50088.outbound.protection.outlook.com [40.107.5.88]) by lists.denx.de (Postfix) with ESMTPS id 3BE9AC21D74 for ; Tue, 7 May 2019 12:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=va/sAYaZ2h9559AbWOAJOhy76y2dy0f3o6vfz7FZRhw=; b=BXYCHtq6QF0F8uv8/chpx5i1hayBYnpeprMYruGVS603orEZqav0CyDpTyznH/aXUq+n9w+85JbICji97AH2jNlkjvf6EWmNjmIhwyc7l7CRjMxEPjhrXgI8pNNU++1YG2TyrDd/P9kEKkjPJRiaFMks6kri7Q+2wNtcspJrknA= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6627.eurprd04.prod.outlook.com (20.179.255.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Tue, 7 May 2019 12:52:49 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1856.012; Tue, 7 May 2019 12:52:49 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 6/6] imx8qxp_mek: switch to use container image Thread-Index: AQHVBNPGgHDH1wSWH02PyIp1br4UIQ== Date: Tue, 7 May 2019 12:52:49 +0000 Message-ID: <20190507130554.4598-7-peng.fan@nxp.com> References: <20190507130554.4598-1-peng.fan@nxp.com> In-Reply-To: <20190507130554.4598-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0047.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::35) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 255f5ed2-19da-40a4-99f3-08d6d2eae8d3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6627; x-ms-traffictypediagnostic: AM0PR04MB6627: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(6486002)(486006)(64756008)(66476007)(54906003)(110136005)(2501003)(73956011)(99286004)(1076003)(14444005)(14454004)(256004)(71190400001)(71200400001)(478600001)(7736002)(66066001)(8676002)(2906002)(186003)(36756003)(81166006)(86362001)(11346002)(2616005)(446003)(6116002)(66446008)(3846002)(8936002)(305945005)(44832011)(50226002)(66946007)(53936002)(476003)(66556008)(68736007)(6436002)(316002)(52116002)(6506007)(386003)(76176011)(6512007)(5660300002)(26005)(81156014)(102836004)(4326008)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6627; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: svFyRm0co9zU1YW5MUe2NagX3qfUHJHNkU3dxLQeZvp3bG/jVzm8hBWKNjj0jR7plrGSBpKuSMuozk/+GNO2s522SPQkppIkx4D3afMHgVLzXQeIA9KQnLecEpM3Ly96Sf5cCByAufns5MOj8ni1MvhlmdOyQdR7SjTv9yGN+0FdztBvF/6dQKqBYBugPL1aQweXEhH3PqWeBOG6cBduxCp516jejMVtIwWukpRmQCfiL6gm9xq+0iKjywE/a94TXoM1ByHwlDlsWuZHrrzL5ITda4Mw2jL7cj0JaSJmBRCs12dXNzStfWdj3Tg/8namtgSa/YpnKIEvRH41/ssfnfVdgVQfHrpaMESqieVauY0pB/Vl3Bki6TdkNYSFyF7P6q902Z/QS+SCMEBXAPygz3OgMxi4qaQSQtB6IcQYXmw= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 255f5ed2-19da-40a4-99f3-08d6d2eae8d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 12:52:49.2344 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6627 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 6/6] imx8qxp_mek: switch to use container image X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Because FIT could not be used for AHAB secure boot on i.MX8, so switch to use container image that could let SPL verify ATF and U-Boot with AHAB. Note: The AHAB related code has not been added. Signed-off-by: Peng Fan --- board/freescale/imx8qxp_mek/README | 4 +--- board/freescale/imx8qxp_mek/uboot-container.cfg | 13 +++++++++++++ configs/imx8qxp_mek_defconfig | 5 ++--- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg diff --git a/board/freescale/imx8qxp_mek/README b/board/freescale/imx8qxp_mek/README index f32290e3a2..6dc151b166 100644 --- a/board/freescale/imx8qxp_mek/README +++ b/board/freescale/imx8qxp_mek/README @@ -39,11 +39,9 @@ $ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin . Build U-Boot ============ -$ export ATF_LOAD_ADDR=0x80000000 -$ export BL33_LOAD_ADDR=0x80020000 $ make imx8qxp_mek_defconfig $ make flash.bin -$ dd if=u-boot.itb of=flash.bin bs=512 seek=528 +$ dd if=u-boot.cnt of=flash.bin bs=512 seek=528 Flash the binary into the SD card ================================= diff --git a/board/freescale/imx8qxp_mek/uboot-container.cfg b/board/freescale/imx8qxp_mek/uboot-container.cfg new file mode 100644 index 0000000000..8165811818 --- /dev/null +++ b/board/freescale/imx8qxp_mek/uboot-container.cfg @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2019 NXP + */ + +#define __ASSEMBLY__ + +/* This file is to create a container image could be loaded by SPL */ +BOOT_FROM SD 0x400 +SOC_TYPE IMX8QX +CONTAINER +IMAGE A35 bl31.bin 0x80000000 +IMAGE A35 u-boot.bin CONFIG_SYS_TEXT_BASE diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig index 6101f62087..8fafb3cf1a 100644 --- a/configs/imx8qxp_mek_defconfig +++ b/configs/imx8qxp_mek_defconfig @@ -5,15 +5,14 @@ CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_SPL_LOAD_IMX_CONTAINER=y +CONFIG_IMX_CONTAINER_CFG="board/freescale/imx8qxp_mek/uboot-container.cfg" CONFIG_TARGET_IMX8QXP_MEK=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_DRIVERS_MISC_SUPPORT=y CONFIG_NR_DRAM_BANKS=3 CONFIG_SPL=y -CONFIG_FIT=y -CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8qxp_mek/imximage.cfg" CONFIG_BOOTDELAY=3 CONFIG_LOG=y