From patchwork Mon Mar 25 11:57:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Bansal X-Patchwork-Id: 1064207 X-Patchwork-Delegate: prabhakar@freescale.com 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="gU0HAY3D"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44SXnn2hVGz9sSh for ; Mon, 25 Mar 2019 22:57:47 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id F20CAC21FAE; Mon, 25 Mar 2019 11:57:42 +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 E8DCAC21F04; Mon, 25 Mar 2019 11:57:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A0C37C21F04; Mon, 25 Mar 2019 11:57:39 +0000 (UTC) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40053.outbound.protection.outlook.com [40.107.4.53]) by lists.denx.de (Postfix) with ESMTPS id 0E083C21EEF for ; Mon, 25 Mar 2019 11:57: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=Z+HwXzJp6VW4fN0cYAqKElzjHSNwLsjNmsxHNAULsqU=; b=gU0HAY3DD2kszHL9I4WgA/0oMQJffOhM+9zQqxK0GJkRVdYVezDLFNAk//JtS1M9UJ4QNPsCiQx6MAJrXdUANh07C2v/XCwCJlaVkr8qO2jswDCs9BUmjZeHH27FuqMSGoYrizdM/AEOIie8yt5YksMpKjQs66P/sJnGR2URvG4= Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2463.eurprd04.prod.outlook.com (10.168.64.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Mon, 25 Mar 2019 11:57:37 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::e5db:1f34:f9d2:bdb0]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::e5db:1f34:f9d2:bdb0%7]) with mapi id 15.20.1730.019; Mon, 25 Mar 2019 11:57:37 +0000 From: Pankaj Bansal To: Meenakshi Aggarwal , Priyanka Jain , Prabhakar Kushwaha Thread-Topic: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot Thread-Index: AQHU4wHwKlhAmKBFcku47NLH+JjXpA== Date: Mon, 25 Mar 2019 11:57:37 +0000 Message-ID: <20190325172147.21963-1-pankaj.bansal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TY1PR01CA0159.jpnprd01.prod.outlook.com (2603:1096:402::11) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 34073037-5e56-428d-588f-08d6b11912ed x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2463; x-ms-traffictypediagnostic: VI1PR0401MB2463: x-microsoft-antispam-prvs: x-forefront-prvs: 0987ACA2E2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(39860400002)(376002)(366004)(199004)(189003)(316002)(486006)(26005)(66066001)(102836004)(6486002)(54906003)(4326008)(106356001)(81166006)(6436002)(8936002)(6636002)(81156014)(50226002)(110136005)(99286004)(53936002)(6512007)(105586002)(36756003)(1076003)(8676002)(2906002)(68736007)(52116002)(305945005)(6116002)(5660300002)(3846002)(71200400001)(71190400001)(14454004)(86362001)(478600001)(97736004)(25786009)(7736002)(6506007)(386003)(186003)(476003)(2616005)(256004)(14444005)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2463; H:VI1PR0401MB2496.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: ms3wgUdRKd6brMZ6gLwqyzBcH7GGJJ3GM8NFa3ayYo192X2EKHt9FQoBjvQydwIYssb+E94P9vY8iJ4pYYBsH+hXVUmqhm5xYCsd2vX609oRDl4l5dRSwC6HjJiVGaxd0P8e4iaaBVlVtuK9PROe6Xj3WuGz2npDvRkU4KgV+2t/snRebqDwtFdKKbeM/iBpo+hUiyhG0zorAnoKgaP5c3TqK8HA4qY8DOP0lH/AWJY9OM6ndvar2TbPhKXEisFqEiugzzxAtUQtsVxP7Z65DcquRi6CAaTXLnCujp0HP+3gwj4Nt8LqhEhfVQBCcZl2p5Mzfb//tp/ykIuTgMvthzDP7ZY3pDceeYxgqavVT2A7ODOMZFr+KjQ+NYj31iPrjHNUcTD4ncUmavCu3PCwVkl5nQWFFAyi2bTWEqfH6pE= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34073037-5e56-428d-588f-08d6b11912ed X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2019 11:57:37.5011 (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: VI1PR0401MB2463 Cc: "u-boot@lists.denx.de" Subject: [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot 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" during SD boot, following error comes: MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read: OK MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK fsl-mc: ERR: Bad firmware image (bad FIT header) Hit any key to stop autoboot: 0 it's occurring because mc 10.14.3 file size is 1064880, which means 0x820 SD blocks which is more than 0x800 blocks (1MB). This results in DPC loading address 0x80100000 overlapping with MC loading address 0x80000000. so, update the MC/dpl/dpc addresses as per their addresses in SD card. Assuming that SD card block size is 512 bytes and 0x0 block in SD card would get loaded at 0x80000000 (DDR base address), this gives following addresses for various binaries: Binary | SD block | DDR offset ------------------------------ MC | 0x5000 | 0x80a00000 DPL | 0x6800 | 0x80d00000 DPC | 0x7000 | 0x80e00000 Signed-off-by: Pankaj Bansal --- Notes: V5: - Add 2019 in Copyright year V4: - Modify the commit message to remove any reference to Flexspi flash V3: - modify the commit message. - remove issue/cause/fix from message. V2: - reduce the mc firmware size blocks from 0x1800 to 0x1200, to save on boot time - Fix the commit message to indicate that the patch is for LX2160A boards only and for SD boot only include/configs/lx2160a_common.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h index 637619cb55..17e8f272a1 100644 --- a/include/configs/lx2160a_common.h +++ b/include/configs/lx2160a_common.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ #ifndef __LX2_COMMON_H @@ -200,14 +200,14 @@ unsigned long get_board_ddr_clk(void); "fsl_mc start mc 0x20a00000 0x20e00000\0" #define SD_MC_INIT_CMD \ - "mmc read 0x80000000 0x5000 0x800;" \ - "mmc read 0x80100000 0x7000 0x800;" \ + "mmc read 0x80a00000 0x5000 0x1200;" \ + "mmc read 0x80e00000 0x7000 0x800;" \ "env exists secureboot && " \ "mmc read 0x80700000 0x3800 0x10 && " \ "mmc read 0x80740000 0x3A00 0x10 && " \ "esbc_validate 0x80700000 && " \ "esbc_validate 0x80740000 ;" \ - "fsl_mc start mc 0x80000000 0x80100000\0" + "fsl_mc start mc 0x80a00000 0x80e00000\0" #define EXTRA_ENV_SETTINGS \ "hwconfig=fsl_ddr:bank_intlv=auto\0" \ @@ -272,11 +272,11 @@ unsigned long get_board_ddr_clk(void); #define SD_BOOTCOMMAND \ "env exists mcinitcmd && mmcinfo; " \ - "mmc read 0x80001000 0x6800 0x800; " \ + "mmc read 0x80d00000 0x6800 0x800; " \ "env exists mcinitcmd && env exists secureboot " \ " && mmc read 0x80780000 0x3C00 0x10 " \ "&& esbc_validate 0x80780000;env exists mcinitcmd " \ - "&& fsl_mc lazyapply dpl 0x80001000;" \ + "&& fsl_mc lazyapply dpl 0x80d00000;" \ "run distro_bootcmd;run sd_bootcmd;" \ "env exists secureboot && esbc_halt;"