From patchwork Tue Oct 1 05:11:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 1169693 X-Patchwork-Delegate: trini@ti.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=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="o1/xhTEg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46j6ny296Fz9s4Y for ; Tue, 1 Oct 2019 15:12:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DF850C21DA6; Tue, 1 Oct 2019 05:12:04 +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=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 BF2A5C21C38; Tue, 1 Oct 2019 05:12:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 892CBC21C38; Tue, 1 Oct 2019 05:12:01 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id 18664C21BE5 for ; Tue, 1 Oct 2019 05:12:00 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x915Bx7O124682; Tue, 1 Oct 2019 00:11:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569906719; bh=44GJ4OmHTx4oCacHDzhxpUfDlrgxoXRuwUoAzjn7zVM=; h=From:To:CC:Subject:Date; b=o1/xhTEgpVHddoyzi191v8LR8zdVMnPnXe2wRtJ1ziNimalefRPsuS+BlAHB15KM4 LI7oGPWRDRRB7bS9akeGW9e+VJtiI3KdfyXReQ2fMxVscfzQB0wUS/IzZjEgOzEDzX tZzU75XkXVzQeboLLsjW8yEEaN2h2NKyRsLqCRSs= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x915BwSB063694 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 00:11:59 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 00:11:48 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 00:11:58 -0500 Received: from uda0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x915Bt91052299; Tue, 1 Oct 2019 00:11:56 -0500 From: Lokesh Vutla To: Tom Rini , Date: Tue, 1 Oct 2019 10:41:00 +0530 Message-ID: <20191001051101.2739-1-lokeshvutla@ti.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Tero Kristo , Richard Woodruff Subject: [U-Boot] [PATCH 1/2] arm: dra7xx: Fix error path in iodelay recalibration 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" When an error is reported in __recalibrate_iodelay_start(), de-isolation of IO doesn't happen. Because of this, undefined behaviour is observed on many peripherals without any error. So make sure io is out of isolation at the end of iodelay recalibration. Reported-by: Richard Woodruff Signed-off-by: Lokesh Vutla --- arch/arm/mach-omap2/omap5/dra7xx_iodelay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c index e2abb7d058..9bd7051786 100644 --- a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c +++ b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c @@ -202,8 +202,9 @@ void __recalibrate_iodelay_end(int ret) return; } - if (!ret) - ret = isolate_io(DEISOLATE_IO); + /* Deisolate IO if it is already isolated */ + if (readl((*ctrl)->ctrl_core_sma_sw_0) & CTRL_ISOLATE_MASK) + isolate_io(DEISOLATE_IO); /* lock IODELAY CONFIG registers */ writel(CFG_IODELAY_LOCK_KEY, (*ctrl)->iodelay_config_base + From patchwork Tue Oct 1 05:11:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 1169694 X-Patchwork-Delegate: trini@ti.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=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="mwjVb8vK"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46j6pt4Fnqz9sDB for ; Tue, 1 Oct 2019 15:12:54 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 21DD2C21DB6; Tue, 1 Oct 2019 05:12:14 +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=RCVD_IN_MSPIKE_H2, 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 36A1DC21DB3; Tue, 1 Oct 2019 05:12:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6C1FDC21C57; Tue, 1 Oct 2019 05:12:06 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lists.denx.de (Postfix) with ESMTPS id 9D19AC21D74 for ; Tue, 1 Oct 2019 05:12:03 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x915C0cu113395; Tue, 1 Oct 2019 00:12:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569906720; bh=gz1EKGeEIf3zlm0XrH7yQCMlIAVLSIkIIzk6z1mSizg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mwjVb8vKFEuhv+iPDoIEBlk7TmHd4hTYu33s9C5fVxOimX5AZ4bTT7tLVRKd1dpov Hy00Dx5ar1ayEp34TEosBS2H5Kzf6HE14BpOGh3DcbM/AuYYHEA3HC9Bo3mAiy6FCg ZnqNQWTOuaKtfmuFRqksvKq6bFnwO2BijyNUCt0I= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x915C06E077149 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 00:12:00 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 00:11:50 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 00:11:50 -0500 Received: from uda0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x915Bt92052299; Tue, 1 Oct 2019 00:11:58 -0500 From: Lokesh Vutla To: Tom Rini , Date: Tue, 1 Oct 2019 10:41:01 +0530 Message-ID: <20191001051101.2739-2-lokeshvutla@ti.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191001051101.2739-1-lokeshvutla@ti.com> References: <20191001051101.2739-1-lokeshvutla@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Tero Kristo Subject: [U-Boot] [PATCH 2/2] arm: dra7xx: Hang on any failure during IOdelay recalibration 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" If there is any failure during IOdelay recalibration sequence, IOs are not guaranteed to behave as expected. So hang on any failure during the sequence. Signed-off-by: Lokesh Vutla --- arch/arm/mach-omap2/omap5/dra7xx_iodelay.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c index 9bd7051786..9eda57c450 100644 --- a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c +++ b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c @@ -241,6 +241,12 @@ void __recalibrate_iodelay_end(int ret) debug("IODELAY: IO delay recalibration successfully completed\n"); } + /* If there is an error during iodelay recalibration, SoC is in a bad + * state. Do not progress any further. + */ + if (ret) + hang(); + return; }