From patchwork Tue May 7 20:19:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Matheus Lima X-Patchwork-Id: 1096525 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="YXcOrUaj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44z9tr0SrQz9s4Y for ; Wed, 8 May 2019 06:19:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D8032C21E68; Tue, 7 May 2019 20:19:23 +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 D6FE2C21C57; Tue, 7 May 2019 20:19:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 55431C21C57; Tue, 7 May 2019 20:19:20 +0000 (UTC) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by lists.denx.de (Postfix) with ESMTPS id E659BC21C50 for ; Tue, 7 May 2019 20:19:19 +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=ZOlcgCS4SiEjwo32SWsIedjUzsNH8fdEieyEG8UWeKA=; b=YXcOrUajJeJ8Vnm/vuGItMxae8u5thnIaP7kbJCBvZfBpwxSnQILLdO631KXauakiQw5QaVRKkzgdH2H24pWi9Zm1LxqJx2MDfgJare0hS3dXHjPQ9NKgB+gIeG5/qD1OXYUUFbadQXMHln8NQjRCwHTlJXQJJv/a2zI0ut5FYo= Received: from DB7PR04MB4636.eurprd04.prod.outlook.com (52.135.138.158) by DB7PR04MB4265.eurprd04.prod.outlook.com (52.135.131.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Tue, 7 May 2019 20:19:18 +0000 Received: from DB7PR04MB4636.eurprd04.prod.outlook.com ([fe80::2c60:389d:bb4b:db67]) by DB7PR04MB4636.eurprd04.prod.outlook.com ([fe80::2c60:389d:bb4b:db67%4]) with mapi id 15.20.1856.012; Tue, 7 May 2019 20:19:18 +0000 From: Breno Matheus Lima To: "festevam@gmail.com" , Fabio Estevam , "sbabic@denx.de" Thread-Topic: [PATCH] mx6sl: hab: Fix pu_irom_mmu_enabled address Thread-Index: AQHVBRIlTnLMar+07E6hJ65c7lh+fw== Date: Tue, 7 May 2019 20:19:17 +0000 Message-ID: <1557260320-80-1-git-send-email-breno.lima@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.88.166.1] x-clientproxiedby: LO2P265CA0095.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::35) To DB7PR04MB4636.eurprd04.prod.outlook.com (2603:10a6:5:36::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=breno.lima@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 60120c7f-69b7-4739-2637-08d6d32947cd 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:DB7PR04MB4265; x-ms-traffictypediagnostic: DB7PR04MB4265: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(199004)(189003)(110136005)(186003)(2501003)(476003)(6486002)(6512007)(14444005)(54906003)(305945005)(486006)(71190400001)(66066001)(7736002)(6436002)(81156014)(81166006)(53936002)(8676002)(256004)(50226002)(478600001)(8936002)(99286004)(26005)(316002)(25786009)(6506007)(386003)(2906002)(3846002)(6116002)(5660300002)(2616005)(4326008)(64756008)(52116002)(66446008)(66556008)(66476007)(73956011)(66946007)(86362001)(36756003)(71200400001)(14454004)(68736007)(102836004)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4265; H:DB7PR04MB4636.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: 92hYfvuudDc7hrelCJccwdhdy2UpOvVxVgr1uj7oaccfSFvg/O9pvcuyDwXlq8m7ZsuOZi9MJRplFIMUw4UhKPsOKWgYPuFiK7jvJyVeR5WYEObEf5fOGV1as94QY5eMsyz2gWqrB2wFj+Z+AHtuPMJzQCzXopmBRWPJRtDacVyDKOJ6PEH1GhbR5ydXcnw0rfULXq/hNLigbou4aAc3SsoQINRCSohPXOxTqUXvl7en4/eqqb3dxcnfY3Wo19eZuRsBWEwbgmzyPD1FzQIDcAsOCGqafUoprKaVV3qzbWnP1YjZY8P26ieHykjq9NE42Y1bPcyE5OzI6vjmaEz6j+pnBKBv5naxyYxEuApxMP5DFlnGV8E46AtfV2iKaBrIU6Nyh8pJnrwPsi78MeG6F2CQYdSjflfKhhnFR8k143U= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60120c7f-69b7-4739-2637-08d6d32947cd X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 20:19:17.9976 (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: DB7PR04MB4265 Cc: Breno Matheus Lima , "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH] mx6sl: hab: Fix pu_irom_mmu_enabled address 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" According to hab.c code we have to notify the ROM code if the MMU is enabled or not. This is achieved by setting the "pu_irom_mmu_enabled" to 0x1. The current address in hab.c code is wrong for i.MX6SL, according to ROM map file the correct address is 0x00901c60. As we are writing in the wrong address the ROM code is not flushing the caches when needed, and the following HAB event is observed in certain scenarios: --------- HAB Event 1 ----------------- event data: 0xdb 0x00 0x14 0x41 0x33 0x18 0xc0 0x00 0xca 0x00 0x0c 0x00 0x01 0xc5 0x00 0x00 0x00 0x00 0x07 0xe4 STS = HAB_FAILURE (0x33) RSN = HAB_INV_SIGNATURE (0x18) CTX = HAB_CTX_COMMAND (0xC0) ENG = HAB_ENG_ANY (0x00) Update MX6SL_PU_IROM_MMU_EN_VAR to address this issue. Reported-by: Frank Zhang Signed-off-by: Breno Lima Reviewed-by: Ye Li Reviewed-by: Fabio Estevam --- arch/arm/mach-imx/hab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index d42a15e877..24d16299e8 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -17,7 +17,7 @@ #define ALIGN_SIZE 0x1000 #define MX6DQ_PU_IROM_MMU_EN_VAR 0x009024a8 #define MX6DLS_PU_IROM_MMU_EN_VAR 0x00901dd0 -#define MX6SL_PU_IROM_MMU_EN_VAR 0x00900a18 +#define MX6SL_PU_IROM_MMU_EN_VAR 0x00901c60 #define IS_HAB_ENABLED_BIT \ (is_soc_type(MXC_SOC_MX7ULP) ? 0x80000000 : \ (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2))