From patchwork Tue Aug 3 05:20:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashok Reddy Soma X-Patchwork-Id: 1512741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-xilinx-onmicrosoft-com header.b=qvYbe5r+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gf3Cj6qp2z9sRR for ; Tue, 3 Aug 2021 15:22:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7F0383448; Tue, 3 Aug 2021 07:21:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="qvYbe5r+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6750282D9C; Tue, 3 Aug 2021 07:21:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EE35D82D88 for ; Tue, 3 Aug 2021 07:21:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ashokred@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QJbGoFwp6oF9sD7D1N48F/kDyLKZHm7cBiPI/sH+az5qpYf1dlH7tzt5I8cmFLMinqydeo0+go7KKqQPvuLpnGiB4zQ8eqoXvBruA5n4wRlKmFnT/rxERC/t4L0pRzhRn+4NDDPmiGdh4FaBYl5x298kqYUJJZomWvLW/aHdBQ6axhrgMGWJzRDJxUTXSlcwEhYnZGicIJRCvYvpYg2CmQNLgG1dspFPapdXQ0IFh3Dm4bq2udx61uWo4SOLsCB7Z+GjpwrT9BGowczXgUPK4IoryIABL/IMrzEZcPPbY4hbDa2L0lHG3OypL/ubl0/GriaSFSIw+ZOwTK/fJKMYUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PH/rYsteDnABCTZ4oGy5PUi+VHcrmOU/jIH+6uuBipY=; b=Juu637VxyChkM3mdU2vLXLMDqgJge4xsP9tnNd+7JeobgQuHOnpVReZOWIfCsJMT18bJPkgKz84GKEqSeGd7sNLMktAbc0QcotuoHO/3pWeza+VMrjoKfS6SBFypSPcjCbyEDE6FXn1YuKdaiN5vx6WAf/fXJMCR4fSfHsNGk9E6ZpLWvgINz1l+Loar63vh7U9aF5uJM1Q18sCMsEDuMksjdsYg8rmwTkkldS+Mmuiq+FHAc8lbCU1lsqh9Qf1j/OXz4OI/6PZxmv8m/ZM/z65HqvZGyMz9LEYM9h6MWbFyG31F7ByP8i+TAOu1Ms9GCxJmedQ3N6HMOMoi0xyKtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PH/rYsteDnABCTZ4oGy5PUi+VHcrmOU/jIH+6uuBipY=; b=qvYbe5r+LIw8AIyYJC31EZ8de3ZrtxDX9ixHyAYVwlpFdJccU9mOlq6141yLh3+gpA4oYeRyK67a+ukmlNoHx9Xp+3/DSyBoUigdc6OGZBjye/u1HbUzNUHOxYEGb5uHQc2Hp5AmSbPp+u/ou7HzRWCwcMMZI3LRths+dvZZgTE= Received: from SA9PR13CA0162.namprd13.prod.outlook.com (2603:10b6:806:28::17) by DM6PR02MB4601.namprd02.prod.outlook.com (2603:10b6:5:2c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Tue, 3 Aug 2021 05:21:09 +0000 Received: from SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com (2603:10b6:806:28:cafe::91) by SA9PR13CA0162.outlook.office365.com (2603:10b6:806:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.8 via Frontend Transport; Tue, 3 Aug 2021 05:21:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0047.mail.protection.outlook.com (10.97.5.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4373.18 via Frontend Transport; Tue, 3 Aug 2021 05:21:09 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 2 Aug 2021 22:20:51 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 2 Aug 2021 22:20:51 -0700 Envelope-to: git@xilinx.com, sjg@chromium.org, somaashokreddy@gmail.com, u-boot@lists.denx.de, monstr@monstr.eu, peng.fan@nxp.com, jh80.chung@samsung.com, faiz_abbas@ti.com, michael@walle.cc Received: from [10.140.6.65] (port=42654 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mAmrC-0007i7-2Y; Mon, 02 Aug 2021 22:20:50 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id 4E8E4FFD24; Mon, 2 Aug 2021 23:20:49 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma Subject: [PATCH v5 0/7] Arasan sdhci driver updates Date: Mon, 2 Aug 2021 23:20:39 -0600 Message-ID: <20210803052046.16165-1-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 477994a1-1b9e-4e85-ab53-08d9563e806a X-MS-TrafficTypeDiagnostic: DM6PR02MB4601: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4/Wm/zQHgA2Tpk/saSbKReSrNNIQ6iGGwKEUhUkz88NmK/hvnY7wbZlGuKhbELsnhy2rxCFffZ7ynIA5gRlQSdbRCu0OKi75AuesDO6JwfFq6Ky/sQ7SI5KHYaANGnkxm4VRMp/S/q3kuDL0dFZRW9zJn94wRISa3YD+7Ln5RWcV2D4Am5e/JurhZNpgAC+3GYOpYadzv6uuE2Gkgf6vSy8MtpE0t2BR3vTBoePqh8wEHjkKtyKZRLoG/Q63AcBVrPr+CKM6k4f7r7OmD8TwIddhNr9TA33fC/i0wSZyBdEmyjgJCJaVSigEQLxrVk9q2Z3svSOVE0AQi6c5XfILQXwFCCBBydUWwH+rBRXNUm2zQIOf2dq18j5aUwbepm92/nd0niygJebufaBufz1r3bUgpum570VYG44d4aaEsGO63AaK2QPERr/08ymzoyVritD3PrEakUyaRJEa6pRaKuRSEh3+yT5M4J7j7Ayx75y9VbrmABv5E3GXiS23rv0fWHekXIlzPXkXigN17NbEIH/CbrD4HzKJG8xB0RI1St5jcn+uyzqF4bq8/Wy0vKq6+ovHPlarYylpD1YRqd5GMr2B8ww0spFvgfXvvrw88bbFZ0/wXQziySl9HTVcY5ytyuR95y6e9xrBl3XiCd0lFIz319MDkgVHyU+M2EMrAZDDQ+7IKbWx0B/6fh6rbPHJGbI+uJojcXzBfGmrEKuBsVS35cAP72sFcnc06KkRMc8IlWb1t1v45i075s1sYniOu2JBOu22HCK/NuVdZT0+7w== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39860400002)(396003)(136003)(36840700001)(46966006)(966005)(103116003)(36860700001)(186003)(82740400003)(6916009)(8936002)(6666004)(26005)(478600001)(356005)(82310400003)(1076003)(7636003)(336012)(107886003)(15650500001)(70586007)(70206006)(54906003)(4326008)(36906005)(6266002)(42186006)(83380400001)(316002)(2616005)(36756003)(2906002)(8676002)(47076005)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2021 05:21:09.1261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 477994a1-1b9e-4e85-ab53-08d9563e806a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4601 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This patch series updates/fixes below things: - Handle errors from tapdelay functions and return to set_delay() - Add ZynqMP firmware related enums which are used in sdhci driver - Replace mmio_write() with firmware call xilinx_pm_request() - Move tapdelay setting code from tap_delays.c to driver and remove tap_dealy.c and zynqmp_tap_delay.h - Change variable name from deviceid to node_id in couple of functions for consistancy - Add a workaround for sd card detect stable issue for Versal platforms - Use set_control_reg from sdhci.c These patches are based on below microblaze U-Boot 'next' branch. https://source.denx.de/u-boot/custodians/u-boot-microblaze/-/commits/next Changes in v5: - Added WORKAROUND in comment and elaborated the comment about issue. Changes in v4: - Rebase to latest u-boot-microblaze custodian 'next' branch - Initialized all enum pm_ioctl_id elements with explicit values Changes in v3: - Added new line after return at two places - As we are seeing issues with SPL flow, keep zynqmp_mmio_write method to set tapdelay's and DLL resets. Add xilinx_pm_request on top of it for regular flow. - Changed the patch title to reflect these changes - Make the changes on top of patch 4/7 to move the code to zynq_sdhci.c Changes in v2: - Split patch 1/7 to two patches, one for zynq_sdhci and other one for sdhci - This is the second patch that has been split from 1/7 - This covers changes for sdhci driver separately - Added a debug print in case of error from set_delay() - Added comment for why 1ms delay is needed between DLL assert and release - Remove mmc->dev->seq_ and use priv->deviceid instead - Changed return error from -EIO to -ETIMEDOUT in arasan_sdhci_probe() in card detect state stable workaround Ashok Reddy Soma (5): mmc: zynq_sdhci: Return errors from arasan_sdhci_set_tapdelay mmc: sdhci: Change prototype of set_delay to return errors mmc: zynq_sdhci: Add xilinx_pm_request() method to set tapdelays mmc: zynq_sdhci: Move setting tapdelay code to driver mmc: zynq_sdhci: Use set_control_reg from sdhci.c T Karthik Reddy (2): zynqmp_firmware: Add zynqmp firmware related enums mmc: zynq_sdhci: Wait till sd card detect state is stable board/xilinx/zynqmp/Makefile | 2 - board/xilinx/zynqmp/tap_delays.c | 101 ------------- drivers/mmc/sdhci.c | 10 +- drivers/mmc/zynq_sdhci.c | 244 ++++++++++++++++++++++++++----- include/sdhci.h | 2 +- include/zynqmp_firmware.h | 127 ++++++++++++++++ include/zynqmp_tap_delay.h | 21 --- 7 files changed, 340 insertions(+), 167 deletions(-) delete mode 100644 board/xilinx/zynqmp/tap_delays.c delete mode 100644 include/zynqmp_tap_delay.h