From patchwork Tue Jul 27 12:36:35 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: 1510491 X-Patchwork-Delegate: monstr@monstr.eu 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=85.214.62.61; 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=U4IrtBjs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4GYxCy2yDLz9sRR for ; Tue, 27 Jul 2021 22:38:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A5168347F; Tue, 27 Jul 2021 14:38:03 +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="U4IrtBjs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 673F883481; Tue, 27 Jul 2021 14:37:01 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on20614.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::614]) (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 A326583478 for ; Tue, 27 Jul 2021 14:36:54 +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=CVgR4/RXzo0P5gdab5lGJOo5zJ3uk6o1pWM6eHy6TuiHZVaoJAZfMVoWC3du4d1ehGficBtEGwBJWq75ChHpba2M+LuFHMg7MRPr5zaZGyEfN98lAZhasoHK5iugPiYsyYpO/2QoCOof14vxMZGQcaFsfr+0ccbfSl5OQbNWWXdfiSlKPjxu55kRFehVvGhHoPz6DkSTbjZfQuuz+k2PBRiHflgflnU5Euiy/Z2OBiCvrtTHXQYF/0xHbeQGentkuQrajqguS7NyWwFiYT4ovBagJXRbZiWl5M177WEWKZLsyF9DSMBVX6WeGYvGY3R8XxiBmKGfgtbWhd9h0AJ9Fw== 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=2pOvGVKS10iBfi5NrLtUowqCZI7xlVvutc3epRwIJPw=; b=AwGuMCkXWfB+dbnOA8acUWLP8KIx94bT4COSC0uR4HqZHTFipHbWz9Dw66KojviEOPNC7NXGGkGBKPwVjqMILPxerLIYcIP+bzg+2pULXgz89y47fphetGpw9WyQiAyVtINlkALQYKfXKG19rSYZ3qJi8Aaor1WOvsd+4CTXo26lvlt4XrPIwOAGWSFMJYiqslPB88hgPeR+lmDq1QGNR2QblHq3hkD7pPqZ7nAkx9jXKpH9i97X0fcX3avkx+IScxSm0b7qicXI9fNI/JhwSLJjNcfkBu9NuK6GjtX/MILlLtNdwe6TU0tQ7kJdDZqKeyot2+meH3IufDCxMKqzhw== 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=2pOvGVKS10iBfi5NrLtUowqCZI7xlVvutc3epRwIJPw=; b=U4IrtBjsuA10GBM2Q1FmT/jdibtTMjll22kMeAWHMl7KXJ/99b72v7qvJ8SxE3JoMVN7hLeHJ+oDBmVTQKT8goh3XB8l7pEsIB+VTo96z6XJi80pREMICuachc1uLYiRaZJEoc8eT8cRXVA/klM+pUMBiiu8/ow1pe4ij0ZF5yo= Received: from DM6PR05CA0039.namprd05.prod.outlook.com (2603:10b6:5:335::8) by BY5PR02MB6339.namprd02.prod.outlook.com (2603:10b6:a03:1fd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26; Tue, 27 Jul 2021 12:36:50 +0000 Received: from DM3NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:5:335:cafe::e5) by DM6PR05CA0039.outlook.office365.com (2603:10b6:5:335::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 12:36:50 +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 DM3NAM02FT029.mail.protection.outlook.com (10.13.4.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:49 +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; Tue, 27 Jul 2021 05:36:47 -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; Tue, 27 Jul 2021 05:36:47 -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=38276 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKD-0007Ay-LF; Tue, 27 Jul 2021 05:36:45 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id D6DCC1005CC; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma , "T Karthik Reddy" Subject: [PATCH v2 1/8] mmc: zynq_sdhci: Return errors from arasan_sdhci_set_tapdelay Date: Tue, 27 Jul 2021 06:36:35 -0600 Message-ID: <20210727123642.2474-2-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19ccb8d3-f01f-4770-2bd3-08d950fb34a6 X-MS-TrafficTypeDiagnostic: BY5PR02MB6339: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:107; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8b0yt76D9Zw0ksSJ73PbqaXYQhUP49nzpqg93g5/cNskHBBEatCC5oma/tY/dBQr3ZAS156wyCav4F0Hd461+hRaV1sd77+HB4RJ8w8NG2FOfjsgZx/Hv1zTiDQCAjlFBi06ymDOL+4ZzJMUqi5JMFP63ZLXuZ4fA9g/QPYRAIldoLHdl9Pp2eJMjE9n78SxD8AP6y5TC7HD00w9WzmCffIPB4+1KRVv71RHS7rVBVFCP4gEvyWayk2iUCd9qnGdlE4LxGUTjy595sYNKGH4g9eSEmE8viJb9CeMX2LPrWn2nEL3ny9Fv8koWyLXGKl2nYB78vbn7sxnY7/D7RbFqHV18SrktYkVsOIUVvTBzCD4fQIpm1CpOyzWJ80nOeGm1Qxid3ERTnPQV1ZyeRFhYojRHLcFJZw9yYcHokImlPJHFWy+osR/qJaRdcqy/WuLDks2G8PPx0r6SJ+CBm1ToLu0g3+1PpgvHBiGSw4Mi+ziyDLBE7nmcIV/8j5EiyzFuuSOUWdx90ggWNo+NVs0wDt/lY/MZDhsSRXJIa4b44dZkn7GYcJSgRJXZGJu4abfyOHnykk53dEn1PUfnXdTFGYYn4yVI+VSOY2fwJbKbdghSsUS9V4+ePy165XoLebYxLjfpVgYFd3JzIxYOiaYWoHU4w+DogXmkJExyQZ9J4TuY9ER+TI0TZ1oDVJzM5b7I4oO1tqNx8YUQu6elHvhBQ== 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)(39860400002)(136003)(376002)(396003)(346002)(46966006)(36840700001)(186003)(70206006)(6666004)(7636003)(36906005)(336012)(26005)(107886003)(47076005)(36860700001)(5660300002)(8676002)(54906003)(70586007)(36756003)(8936002)(103116003)(1076003)(82310400003)(6266002)(316002)(2906002)(478600001)(42186006)(82740400003)(4326008)(6916009)(2616005)(83380400001)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:49.9035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19ccb8d3-f01f-4770-2bd3-08d950fb34a6 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: DM3NAM02FT029.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6339 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 Change return type of arasan_sdhci_set_tapdelay() to int, to facilitate returning errors. Get return values from input and output set clock phase functions inside arasan_sdhci_set_tapdelay() and return those errors. Signed-off-by: T Karthik Reddy Signed-off-by: Ashok Reddy Soma --- Changes in v2: - Split patch 1/7 to two patches, one for zynq_sdhci and other one for sdhci drivers/mmc/zynq_sdhci.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index ba87ee8dd5..9fb3603c7e 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -422,7 +422,7 @@ static int sdhci_versal_sampleclk_set_phase(struct sdhci_host *host, return 0; } -static void arasan_sdhci_set_tapdelay(struct sdhci_host *host) +static int arasan_sdhci_set_tapdelay(struct sdhci_host *host) { struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); struct arasan_sdhci_clk_data *clk_data = &priv->clk_data; @@ -431,18 +431,29 @@ static void arasan_sdhci_set_tapdelay(struct sdhci_host *host) u8 timing = mode2timing[mmc->selected_mode]; u32 iclk_phase = clk_data->clk_phase_in[timing]; u32 oclk_phase = clk_data->clk_phase_out[timing]; + int ret; dev_dbg(dev, "%s, host:%s, mode:%d\n", __func__, host->name, timing); if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) && device_is_compatible(dev, "xlnx,zynqmp-8.9a")) { - sdhci_zynqmp_sampleclk_set_phase(host, iclk_phase); - sdhci_zynqmp_sdcardclk_set_phase(host, oclk_phase); + ret = sdhci_zynqmp_sampleclk_set_phase(host, iclk_phase); + if (ret) + return ret; + ret = sdhci_zynqmp_sdcardclk_set_phase(host, oclk_phase); + if (ret) + return ret; } else if (IS_ENABLED(CONFIG_ARCH_VERSAL) && device_is_compatible(dev, "xlnx,versal-8.9a")) { - sdhci_versal_sampleclk_set_phase(host, iclk_phase); - sdhci_versal_sdcardclk_set_phase(host, oclk_phase); + ret = sdhci_versal_sampleclk_set_phase(host, iclk_phase); + if (ret) + return ret; + ret = sdhci_versal_sdcardclk_set_phase(host, oclk_phase); + if (ret) + return ret; } + + return 0; } static void arasan_dt_read_clk_phase(struct udevice *dev, unsigned char timing, From patchwork Tue Jul 27 12:36:36 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: 1510485 X-Patchwork-Delegate: monstr@monstr.eu 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=85.214.62.61; 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=a959n++a; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4GYxBX4C3dz9s5R for ; Tue, 27 Jul 2021 22:37:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 20E2E8347F; Tue, 27 Jul 2021 14:37:00 +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="a959n++a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 17E968347A; Tue, 27 Jul 2021 14:36:55 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::60e]) (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 23A1982EB1 for ; Tue, 27 Jul 2021 14:36:51 +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=mhDSDAyiHJvRo++4dXNYEsIaoBe9M+hXiXFp/NLJZfi8IL7GK9Nt7Xjb0eUMxyjKK7lg1+yCk7xsY16EmGM6xRAWLsJcEnZhoR6YiZe84anV002LzVsHjJAwSugWgl9YSvSIwwrDq0haDNoQA9ROHWKY5EvdCnZOhhM6BfRFOIcxVwjRBLJRrkvkRx8dsMif+nVerNCtw0l+aVM/RTd1lwnaldHbQmjVnzssJBeayZSM7rYsx43NU+Zi234qP+54UicfOLdHf2Q/i5b3+1GVKbnabRDpTrvM1og58ovzTMPrlOoO166d/U0dXTiv6kea0Qafv6ZfakAu6tRtOb/Qtg== 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=vuEg/PS0CzD8e34cjNS67m56qMbevqJKuW4bNIX8hEQ=; b=hYxpXyd/WRKZVxTe/G1v3Dz1wLPhTrtdwwssTNYNd7oeoorSp4AbRgHmR+ZcZMApBaD77nZ7KOML6Z16f0monP9ou7DOBazjHmydJDYD5HKrRVg+NoeLNdYe3RjCI4sQYOXodzpab+YjAnXrPV3XQmIR0qLZW9LCgHbPM2IgCZfTFvsOI81S57T5lOW0uFBwImZvctmi2CIlkGMqBe+PHPhMjZTSOkKRxXiu5AXwJrKGNHpANWg4waZTB9uzvVaVcbzAGnWIQBi/I3tdT24/U9fTIuxQPYNWgXqRSi24gEhu/gYu8Yhqin45bgbnTab7kvh+GZIQpz6GNuJrZ2Yzvw== 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=vuEg/PS0CzD8e34cjNS67m56qMbevqJKuW4bNIX8hEQ=; b=a959n++aomduuJkBGP33lDwj3AWJO0QDLT6Jb5oM/PNbn+XU0XaWrsb+WSG6F8oxloC3pwsfRBs5rbfA8ejpMBM20a1vVUB1LSvV2hUT9icNdwxkb2RVJcQV94fzbrZH4Fi3JkqLlDo3954OhGaOk7ivWNUWDKBwu4UL2h+1Ss8= Received: from DM6PR05CA0050.namprd05.prod.outlook.com (2603:10b6:5:335::19) by BL0PR02MB4356.namprd02.prod.outlook.com (2603:10b6:208:41::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 12:36:48 +0000 Received: from DM3NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:5:335:cafe::2f) by DM6PR05CA0050.outlook.office365.com (2603:10b6:5:335::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 12:36:48 +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 DM3NAM02FT029.mail.protection.outlook.com (10.13.4.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:48 +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; Tue, 27 Jul 2021 05:36:46 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 27 Jul 2021 05:36:46 -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=38278 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKD-000CNd-Ls; Tue, 27 Jul 2021 05:36:45 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id DAF7D10254C; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma Subject: [PATCH v2 2/8] mmc: sdhci: Change prototype of set_delay to return errors Date: Tue, 27 Jul 2021 06:36:36 -0600 Message-ID: <20210727123642.2474-3-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7cb016eb-fea8-437d-e9dd-08d950fb33cb X-MS-TrafficTypeDiagnostic: BL0PR02MB4356: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7qLF1bJnRDpcy3LL6qP22su4EC+rkIs7UWvJ9OSWG0IWHticVOQ1xPHj8K5tZPna38b25Iw6PTT5GRDXkqVzmsBpSjnmVnvBAlvuAJ2ZJRq3YEYOLjw5VPbxAqYckeFmRRrNbtmfB9cK4RNv1yE9jAeOgCkhgmzZhAkWEkoa5+Xf16KazidPoB9ACuEIVirzBnMK6xcvogZGoVdtijwfVHMvwssmTPJ7vQU37pUp0GI1Bnvzepwt3DP+PE6Xhp44FtQE/GCI17QeBmqL+5r9pJXM/wQ+v2O6evRIxJCjglD5WiyOhELFlU8mo6ZnoI6NbFx2l3tlN4RBDQpIkhBK5XYisx36n4BwxnI+lRF+VnzvfFrAEgGL1GJOxcVW2D9y2SgToQ6/2ozJsKaFyk5vce09lUotSqeYVDLHEfYVL/yaYyuu23oSG38AtjD4tKNusNhwMrdsFhM91X2jJ6Wurrb1RsaTJfmQR7L5sMBSTPp1NVJ3jf7NKKXKiv0J7KsaewZOXWbT37JesIHArghMVHGfISzPs8jPsEMeHd4YRdUZj0iIq9L2DzRwrBtDw/0vI2X46NG5RO+hlOc0HRZL8Pt9HxhOJFCx1bNs/bIFRF4zA8rESbxYxlbWbEirpjh6WinnoZMlmrTxVnNK2oKsXhkvjVc+dk2PRrENI6NHdT5BrHOnyJFUM4f3pphn89vyOR2HMaRTrJQlp791ddb5KA== 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)(39860400002)(136003)(376002)(396003)(346002)(46966006)(36840700001)(316002)(6266002)(47076005)(70206006)(70586007)(2616005)(5660300002)(54906003)(83380400001)(103116003)(26005)(2906002)(8936002)(1076003)(36906005)(336012)(186003)(4326008)(6666004)(42186006)(82310400003)(6916009)(7636003)(36756003)(36860700001)(8676002)(478600001)(82740400003)(356005)(107886003); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:48.4731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb016eb-fea8-437d-e9dd-08d950fb33cb 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: DM3NAM02FT029.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4356 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 set_delay() has return type as void. If there are any errors while setting tapdelay's it won't be able to return them. Change the prototype of set_delay() in sdhci_ops structure and return the errors from wherever it is called. Signed-off-by: Ashok Reddy Soma --- Changes in v2: - 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() drivers/mmc/sdhci.c | 10 ++++++++-- include/sdhci.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index d9ab6a0a83..a99014236a 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -366,6 +366,7 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock) { struct sdhci_host *host = mmc->priv; unsigned int div, clk = 0, timeout; + int ret; /* Wait max 20 ms */ timeout = 200; @@ -386,8 +387,13 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock) if (clock == 0) return 0; - if (host->ops && host->ops->set_delay) - host->ops->set_delay(host); + if (host->ops && host->ops->set_delay) { + ret = host->ops->set_delay(host); + if (ret) { + printf("%s: Error while setting tap delay\n", __func__); + return ret; + } + } if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { /* diff --git a/include/sdhci.h b/include/sdhci.h index 0ae9471ad7..44a0d84e5a 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -268,7 +268,7 @@ struct sdhci_ops { int (*set_ios_post)(struct sdhci_host *host); void (*set_clock)(struct sdhci_host *host, u32 div); int (*platform_execute_tuning)(struct mmc *host, u8 opcode); - void (*set_delay)(struct sdhci_host *host); + int (*set_delay)(struct sdhci_host *host); int (*deferred_probe)(struct sdhci_host *host); }; From patchwork Tue Jul 27 12:36:37 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: 1510488 X-Patchwork-Delegate: monstr@monstr.eu 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=jBKesj/s; 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 4GYxCD1RDTz9sRR for ; Tue, 27 Jul 2021 22:37:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E92C183484; Tue, 27 Jul 2021 14:37:33 +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="jBKesj/s"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 869D28347C; Tue, 27 Jul 2021 14:37:01 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::604]) (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 0FCBD8345D for ; Tue, 27 Jul 2021 14:36:53 +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=C0YYN7zZiFJKQlwb0wBlCu89T2NE1aJWLC9iXnUsCmxsVmEMvTv6ANmeGs/yMVJe/dbJokzDd4Clvu2Xru5lPUCTvVk++V4Dz+OawrGUiConWGMBWdCTWUOJhj01dkhnivDkXvhtHi2LnFb20vTTmaI8TLAezOdLOU7LDPKfzPCfHMvP6kSX+wYQMGdvqaX/LzqbiMyXTXbm/CNeTr9EdArqEx8C1FAs+DIIU/xoFcFQaUQ/Rh0/MO5bXaAvELb15kIC13I95rCEW4NDZ6n5j+n+kV/2xoEZi3yLzMYXEBYFPBZu8hZoEbOWU/cFyy9BN37H4FOW5Mkz8S/p6aE8QQ== 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=TaZeos2qVM/bF8ikB1Eh6R+IuRpM8ACvqEvpe5VcCKU=; b=XGhtOf8lq439JINq12wblXVWgZal/TQpalvrgns9aoFsASzh0pU6ThafSQGozsm9Zf/JqGf79NE89kOa1GP3+W0IuwhX74ppA33B2pthpJYkjOez6God5Hc6OZXaXOlJlDou3caGhfCyLG2mbBvyIJgR2V7F9v9iAtaddzVLhJsYcN+j54ry1i/D6+esYBB5WK22nzA7I2w+/a8+AOPFJnCed8YfjwKnoFHK+f0/umMM/SSH+ED2XAkNzpkOWc6BuJN2UZsfjb/5y83zNbTUoBNCGJjtUpmJKTyDX5oVktiUhHdgQepLsTTh7yVCQRiY3jq97PeC/vFW72XI/Ffenw== 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=TaZeos2qVM/bF8ikB1Eh6R+IuRpM8ACvqEvpe5VcCKU=; b=jBKesj/sUk3gyfWnN3UYeUp28pIli3JS9M4Ok6eHEgbdvbVqaO/PzISZFLH9U/Xb1UjhGrXZYs61zEKdx4N1QRcJ57fQUjWILUWU0nMByUJddexWOiyX+lUL3uhwTAmTUmFODRhWDuuTLhC1MdscuY5uf+1GEdS2s914QAqOOI4= Received: from DS7PR03CA0132.namprd03.prod.outlook.com (2603:10b6:5:3b4::17) by DM5PR02MB3800.namprd02.prod.outlook.com (2603:10b6:4:bb::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Tue, 27 Jul 2021 12:36:49 +0000 Received: from DM3NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::d) by DS7PR03CA0132.outlook.office365.com (2603:10b6:5:3b4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.28 via Frontend Transport; Tue, 27 Jul 2021 12:36:49 +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-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT031.mail.protection.outlook.com (10.13.4.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:49 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 05:36:47 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 27 Jul 2021 05:36:47 -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=38280 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKD-000CNe-ML; Tue, 27 Jul 2021 05:36:45 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id DF18910254E; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , T Karthik Reddy , Ashok Reddy Soma Subject: [PATCH v2 3/8] zynqmp_firmware: Add zynqmp firmware related enums Date: Tue, 27 Jul 2021 06:36:37 -0600 Message-ID: <20210727123642.2474-4-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd855ce5-5fb7-406e-9c67-08d950fb3479 X-MS-TrafficTypeDiagnostic: DM5PR02MB3800: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:311; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 69u1ZFNtqDFOSbX2OewzLVpA4jEVB3WunQaFsgL1YHkBArtPXgnAKIyLk6sNcwKQhR6tj5ttQ31uAAdcnB6ExSM3pSU25QDO9GQDZ6UlBY9UuvS/+AyntDCqzySBZD3a/cO1Du4z7tV1L1GSu+BxL6lcnIYZiAnzJm0dEkSN/LeJy6RUpzkJ1TAjkouKmVj3f+d7b5cuIGt27ejtiAwYS4mUn1A6wQjQlxURachbtRw55TRMTeRtojjUZlm/0+YXzYctlZPOiKTdGoDVJpVzZn/S9JteIxRV3rEcMoMegjGLC1I/autT8OVDHtbcBwjo50ZYrZwKELpTEIYrWoSfJXFWt397bpKXxYT4OotajrwkZAhJrymI2kiNg42is3nnquYF9iScJrmWRi6TEP3FH6FUofM4rp7HKRnE7N703reNqXwaE9D0WUs42KVfw7Bwev2EjoxXFKDHrEcE1g4H7ueJyPOyntQDTjCF/kYWSkcA726qigMTDJ6BVlpL6SmBhTLS0zfv7grhM/OPb5Qg+gUPy7QJbI44sim/Fx5IyYiEvuwv8vgxVdIlkOriei6U3Uuc1msm7JS+k6iPSJacEcw706UflW8ZKaokMmzZ3qu4FXzx08ecb/esum05LCjBSHCcXIPQ9gIYC47ZtrG+23HOj2AI3kKMjsvuMFDaGe5YzZpYWyVujNuqAagBs4cAvo+2CbAkFzU6AqwrUy2C3Q== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6666004)(36860700001)(5660300002)(4326008)(356005)(8676002)(186003)(316002)(83380400001)(107886003)(47076005)(336012)(103116003)(6266002)(6916009)(54906003)(26005)(36756003)(70586007)(70206006)(7636003)(1076003)(2906002)(2616005)(36906005)(8936002)(508600001)(82310400003)(42186006); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:49.6134 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd855ce5-5fb7-406e-9c67-08d950fb3479 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3800 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 From: T Karthik Reddy Add enums for pm node id's, pm ioctl id's, tapdelay types, dll reset types Signed-off-by: T Karthik Reddy Signed-off-by: Ashok Reddy Soma --- (no changes since v1) include/zynqmp_firmware.h | 127 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/include/zynqmp_firmware.h b/include/zynqmp_firmware.h index f6f82bf882..c559ee7d3c 100644 --- a/include/zynqmp_firmware.h +++ b/include/zynqmp_firmware.h @@ -62,6 +62,99 @@ enum pm_api_id { PM_API_MAX, }; +enum pm_node_id { + NODE_UNKNOWN = 0, + NODE_APU = 1, + NODE_APU_0 = 2, + NODE_APU_1 = 3, + NODE_APU_2 = 4, + NODE_APU_3 = 5, + NODE_RPU = 6, + NODE_RPU_0 = 7, + NODE_RPU_1 = 8, + NODE_PLD = 9, + NODE_FPD = 10, + NODE_OCM_BANK_0 = 11, + NODE_OCM_BANK_1 = 12, + NODE_OCM_BANK_2 = 13, + NODE_OCM_BANK_3 = 14, + NODE_TCM_0_A = 15, + NODE_TCM_0_B = 16, + NODE_TCM_1_A = 17, + NODE_TCM_1_B = 18, + NODE_L2 = 19, + NODE_GPU_PP_0 = 20, + NODE_GPU_PP_1 = 21, + NODE_USB_0 = 22, + NODE_USB_1 = 23, + NODE_TTC_0 = 24, + NODE_TTC_1 = 25, + NODE_TTC_2 = 26, + NODE_TTC_3 = 27, + NODE_SATA = 28, + NODE_ETH_0 = 29, + NODE_ETH_1 = 30, + NODE_ETH_2 = 31, + NODE_ETH_3 = 32, + NODE_UART_0 = 33, + NODE_UART_1 = 34, + NODE_SPI_0 = 35, + NODE_SPI_1 = 36, + NODE_I2C_0 = 37, + NODE_I2C_1 = 38, + NODE_SD_0 = 39, + NODE_SD_1 = 40, + NODE_DP = 41, + NODE_GDMA = 42, + NODE_ADMA = 43, + NODE_NAND = 44, + NODE_QSPI = 45, + NODE_GPIO = 46, + NODE_CAN_0 = 47, + NODE_CAN_1 = 48, + NODE_EXTERN = 49, + NODE_APLL = 50, + NODE_VPLL = 51, + NODE_DPLL = 52, + NODE_RPLL = 53, + NODE_IOPLL = 54, + NODE_DDR = 55, + NODE_IPI_APU = 56, + NODE_IPI_RPU_0 = 57, + NODE_GPU = 58, + NODE_PCIE = 59, + NODE_PCAP = 60, + NODE_RTC = 61, + NODE_LPD = 62, + NODE_VCU = 63, + NODE_IPI_RPU_1 = 64, + NODE_IPI_PL_0 = 65, + NODE_IPI_PL_1 = 66, + NODE_IPI_PL_2 = 67, + NODE_IPI_PL_3 = 68, + NODE_PL = 69, + NODE_GEM_TSU = 70, + NODE_SWDT_0 = 71, + NODE_SWDT_1 = 72, + NODE_CSU = 73, + NODE_PJTAG = 74, + NODE_TRACE = 75, + NODE_TESTSCAN = 76, + NODE_PMU = 77, + NODE_MAX = 78, +}; + +enum tap_delay_type { + PM_TAPDELAY_INPUT = 0, + PM_TAPDELAY_OUTPUT = 1, +}; + +enum dll_reset_type { + PM_DLL_RESET_ASSERT = 0, + PM_DLL_RESET_RELEASE = 1, + PM_DLL_RESET_PULSE = 2, +}; + enum pm_query_id { PM_QID_INVALID = 0, PM_QID_CLOCK_GET_NAME = 1, @@ -79,6 +172,40 @@ enum pm_query_id { PM_QID_CLOCK_GET_MAX_DIVISOR = 13, }; +enum pm_ioctl_id { + IOCTL_GET_RPU_OPER_MODE, + IOCTL_SET_RPU_OPER_MODE, + IOCTL_RPU_BOOT_ADDR_CONFIG, + IOCTL_TCM_COMB_CONFIG, + IOCTL_SET_TAPDELAY_BYPASS, + IOCTL_SET_SGMII_MODE, + IOCTL_SD_DLL_RESET, + IOCTL_SET_SD_TAPDELAY, + IOCTL_SET_PLL_FRAC_MODE, + IOCTL_GET_PLL_FRAC_MODE, + IOCTL_SET_PLL_FRAC_DATA, + IOCTL_GET_PLL_FRAC_DATA, + IOCTL_WRITE_GGS, + IOCTL_READ_GGS, + IOCTL_WRITE_PGGS, + IOCTL_READ_PGGS, + /* IOCTL for ULPI reset */ + IOCTL_ULPI_RESET, + /* Set healthy bit value*/ + IOCTL_SET_BOOT_HEALTH_STATUS, + IOCTL_AFI, + /* Probe counter read/write */ + IOCTL_PROBE_COUNTER_READ, + IOCTL_PROBE_COUNTER_WRITE, + IOCTL_OSPI_MUX_SELECT, + /* IOCTL for USB power request */ + IOCTL_USB_SET_STATE, + /* IOCTL to get last reset reason */ + IOCTL_GET_LAST_RESET_REASON, + /* AIE ISR Clear */ + IOCTL_AIE_ISR_CLEAR, +}; + #define PM_SIP_SVC 0xc2000000 #define ZYNQMP_PM_VERSION_MAJOR 1 From patchwork Tue Jul 27 12:36:38 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: 1510489 X-Patchwork-Delegate: monstr@monstr.eu 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=85.214.62.61; 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=VBGPgrCT; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4GYxCT3h0cz9s5R for ; Tue, 27 Jul 2021 22:37:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B1E7083499; Tue, 27 Jul 2021 14:37:46 +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="VBGPgrCT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5B8583484; Tue, 27 Jul 2021 14:37:02 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::624]) (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 0C1E28344D for ; Tue, 27 Jul 2021 14:36:53 +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=BUM9J8g0dNd1/eKJeLVS1wirk/WvrvvPRO4dNCmrVpb9jaS4SahyC3I0L2/ohDsFXtjJYlByn2Pxqqlkck3WGy1OB2H1OAFJ4owDnEr1wGPgLhM3mCiB5cAfVelVfrytUR9ytbShX1lypPBM6Esom2B87ILMoPan7s7jvQk7AKMeLJ8dkwyZhk+fj+cPVfzwwG8sic9qgKCisnPyJNcEfVxTjlAwBShHFz9N8JQJ1R6QSwKsTPiBlgnunZGdJ199kl2ZsoWT2V/gC0hT6YsywkqnJdW96x6P0xWZeS6YRhdJugyEGwVctxNLFo1IHRHow+iMrrky9vJhXIGQP6uaOA== 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=V53QaX0LV8IXv0pep12afJkAU4Zw14s30x2mdaTEKUQ=; b=en2YmOjmHFjhgBerMicdTqpNjKcBd8FuE/TzmBe4t/s6XWC61nQq6RePsUkvy+oBobes3vdM0sffaCBxXXV6ssFUN83H+vOSownN9p1uWz1rcMDwuf1SDDYwlDY7Sn9rgMSmbGoEN8BoEUAwNzxXLs/6pZ2E30/1xA/9YSXaFQ94A4xivfz5FSc3T+Gb+LHjeWFN7yZXqk3wnRKrlerKNPKmW4rFq6bj73LtyfdWfo1KG8s/vJGzJDkFrJKROaxMU25KcgFow6VjCUhLUXGjC3UeR4kwzMcPC3UFBOTDyEmXyHg6UP/dFr6es8oWj/P9q13eiTUymo8m5DZNgpxkWQ== 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=V53QaX0LV8IXv0pep12afJkAU4Zw14s30x2mdaTEKUQ=; b=VBGPgrCTH9mjlkC3o0/4wlf+jjns7PXa6oxH4eRrkfIwRySuTym8GpX98iXVoTGbn5Uu8NwZFpgtfOa97vI1l1482x8VKaguhk0iYm8ch5uAQBrsjUpKzOX8WZaBnIjBskxJ2GFRrprmXn/DPnxZdyVb5Dzp2l/+gG0WSEMqhi0= Received: from DS7PR03CA0133.namprd03.prod.outlook.com (2603:10b6:5:3b4::18) by DM5PR0201MB3398.namprd02.prod.outlook.com (2603:10b6:4:7a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.30; Tue, 27 Jul 2021 12:36:50 +0000 Received: from DM3NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::11) by DS7PR03CA0133.outlook.office365.com (2603:10b6:5:3b4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Tue, 27 Jul 2021 12:36:50 +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-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT031.mail.protection.outlook.com (10.13.4.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:49 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 05:36:47 -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; Tue, 27 Jul 2021 05:36:47 -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=38282 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKD-0007Az-Mq; Tue, 27 Jul 2021 05:36:46 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id E33A11025C7; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma , "T Karthik Reddy" Subject: [PATCH v2 4/8] mmc: zynq_sdhci: Use xilinx pm request instead of mmio_write Date: Tue, 27 Jul 2021 06:36:38 -0600 Message-ID: <20210727123642.2474-5-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 578befb7-d8b1-43b0-ca86-08d950fb34ab X-MS-TrafficTypeDiagnostic: DM5PR0201MB3398: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rVQ2IfMF5S2FC2fOYPrwa+E9gFdWiV3/xZxxvLaboKKo6t0aMvHoelSFQ2d8Ko/PCLNVspX2Vdw8czEdY1uaNZQ38y5p//zcM337vQl0+PHRSv+g3lZB5iba6OinreXVjk6RqKFcLWyh783xNiVOR9Y66L92MeKJu8bZPVxj8CvILD/E3+hLX3mLHPgPWuUetO45V50ZnTKzGoMyj8j1Fav9hR7QT5FosL0vx5zRpP2Xm35qIdTEOtj2hv/rXZBtveyquGN3DJsXI2Jbdq5gF8X2FM+q7HZ0K34WTzmLvdN4AD18rWIfeGnEH2PKp7tioExQ22voaiskvKuiZJGhPvj2r2Wm+OBPqivag0OTiKyossbL49DvU9p5WE9ijk6UpC+qXweyp3ddatWexMYdiP44uXnXWdisfX2I9ONqzt1sPfNLG3qWC5DORL3NY+39MTBE+wDwziwmQtIsEpGScJpICMt73F4F3dCk2BSorE6aqTzbXrPnbX4QJfpMtfC/3bSwIiGw8vRjl0mNcml7ACMecWsPJYm46idElh6Ti1EFWw9MDrIpbNnxY4EFln09ErOUqm3Umje1320wFmR4o5ZBBd5EbXXJeImJBxH0/5lxvoiOQ1qShf5zZQ7grICl8ZeNmR+WCng0FyI5tsSHFXWesD0fuuMsP5pB9TFML+JUSWSNW8zI97iPUcYRfAikdUBTvWl4qG0nxgpD5nperg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(376002)(39860400002)(346002)(396003)(46966006)(36840700001)(107886003)(47076005)(82740400003)(6916009)(30864003)(42186006)(103116003)(186003)(336012)(5660300002)(2616005)(6266002)(316002)(1076003)(7636003)(26005)(36906005)(36860700001)(478600001)(4326008)(54906003)(82310400003)(8936002)(6666004)(70206006)(70586007)(83380400001)(8676002)(36756003)(2906002)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:49.9413 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 578befb7-d8b1-43b0-ca86-08d950fb34ab 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3398 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 Currently xilinx sdhci driver is using zynqmp_mmio_write() to set tapdelay values. Use xilinx_pm_request() using appropriate arguments to set input/output tapdelays for zynqmp. Where tapdelay setting is done by firmware. Host driver should explicitly request DLL reset before ITAP (assert DLL) and after OTAP (release DLL) to avoid issues in some cases. Also handle error return where possible. Signed-off-by: T Karthik Reddy Signed-off-by: Ashok Reddy Soma --- Changes in v2: - Added comment for why 1ms delay is needed between DLL assert and release - Remove mmc->dev->seq_ and use priv->deviceid instead board/xilinx/zynqmp/tap_delays.c | 89 +++----------------------------- drivers/mmc/zynq_sdhci.c | 75 ++++++++++++++++++++++----- include/zynqmp_tap_delay.h | 25 ++++++--- 3 files changed, 87 insertions(+), 102 deletions(-) diff --git a/board/xilinx/zynqmp/tap_delays.c b/board/xilinx/zynqmp/tap_delays.c index d16bbb8eff..4ce2244060 100644 --- a/board/xilinx/zynqmp/tap_delays.c +++ b/board/xilinx/zynqmp/tap_delays.c @@ -10,92 +10,17 @@ #include #include #include +#include -#define SD_DLL_CTRL 0xFF180358 -#define SD_ITAP_DLY 0xFF180314 -#define SD_OTAP_DLY 0xFF180318 -#define SD0_DLL_RST_MASK 0x00000004 -#define SD0_DLL_RST 0x00000004 -#define SD1_DLL_RST_MASK 0x00040000 -#define SD1_DLL_RST 0x00040000 -#define SD0_ITAPCHGWIN_MASK 0x00000200 -#define SD0_ITAPCHGWIN 0x00000200 -#define SD1_ITAPCHGWIN_MASK 0x02000000 -#define SD1_ITAPCHGWIN 0x02000000 -#define SD0_ITAPDLYENA_MASK 0x00000100 -#define SD0_ITAPDLYENA 0x00000100 -#define SD1_ITAPDLYENA_MASK 0x01000000 -#define SD1_ITAPDLYENA 0x01000000 -#define SD0_ITAPDLYSEL_MASK 0x000000FF -#define SD1_ITAPDLYSEL_MASK 0x00FF0000 -#define SD0_OTAPDLYSEL_MASK 0x0000003F -#define SD1_OTAPDLYSEL_MASK 0x003F0000 - -void zynqmp_dll_reset(u8 deviceid) +int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type, u32 itap_delay) { - /* Issue DLL Reset */ - if (deviceid == 0) - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, - SD0_DLL_RST); - else - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, - SD1_DLL_RST); - - mdelay(1); - /* Release DLL Reset */ - if (deviceid == 0) - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, 0x0); - else - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, 0x0); + return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + type, itap_delay, NULL); } -void arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 itap_delay) +int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type, u32 otap_delay) { - if (deviceid == 0) { - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, SD0_DLL_RST); - - /* Program ITAP delay */ - zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPCHGWIN_MASK, - SD0_ITAPCHGWIN); - zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPDLYENA_MASK, - SD0_ITAPDLYENA); - zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPDLYSEL_MASK, itap_delay); - zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPCHGWIN_MASK, 0x0); - - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, 0x0); - } else { - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, SD1_DLL_RST); - - /* Program ITAP delay */ - zynqmp_mmio_write(SD_ITAP_DLY, SD1_ITAPCHGWIN_MASK, - SD1_ITAPCHGWIN); - zynqmp_mmio_write(SD_ITAP_DLY, SD1_ITAPDLYENA_MASK, - SD1_ITAPDLYENA); - zynqmp_mmio_write(SD_ITAP_DLY, SD1_ITAPDLYSEL_MASK, - (itap_delay << 16)); - zynqmp_mmio_write(SD_ITAP_DLY, SD1_ITAPCHGWIN_MASK, 0x0); - - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, 0x0); - } -} - -void arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 otap_delay) -{ - if (deviceid == 0) { - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, SD0_DLL_RST); - - /* Program OTAP delay */ - zynqmp_mmio_write(SD_OTAP_DLY, SD0_OTAPDLYSEL_MASK, otap_delay); - - zynqmp_mmio_write(SD_DLL_CTRL, SD0_DLL_RST_MASK, 0x0); - } else { - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, SD1_DLL_RST); - - /* Program OTAP delay */ - zynqmp_mmio_write(SD_OTAP_DLY, SD1_OTAPDLYSEL_MASK, - (otap_delay << 16)); - - zynqmp_mmio_write(SD_DLL_CTRL, SD1_DLL_RST_MASK, 0x0); - } + return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + type, otap_delay, NULL); } diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 9fb3603c7e..c4927d6c1a 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -18,6 +18,7 @@ #include #include #include +#include #define SDHCI_ARASAN_ITAPDLY_REGISTER 0xF0F8 #define SDHCI_ARASAN_ITAPDLY_SEL_MASK GENMASK(7, 0) @@ -75,26 +76,40 @@ static const u8 mode2timing[] = { [MMC_HS_200] = MMC_TIMING_MMC_HS200, }; -static void arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) +static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) { - u16 clk; + struct mmc *mmc = (struct mmc *)host->mmc; + struct udevice *dev = mmc->dev; unsigned long timeout; + int ret; + u16 clk; clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); clk &= ~(SDHCI_CLOCK_CARD_EN); sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); /* Issue DLL Reset */ - zynqmp_dll_reset(deviceid); + ret = zynqmp_pm_sd_dll_reset(deviceid, PM_DLL_RESET_ASSERT); + if (ret) { + dev_err(dev, "dll_reset assert failed with err: %d\n", ret); + return ret; + } + + /* Allow atleast 1ms delay for proper DLL reset */ + mdelay(1); + ret = zynqmp_pm_sd_dll_reset(deviceid, PM_DLL_RESET_RELEASE); + if (ret) { + dev_err(dev, "dll_reset release failed with err: %d\n", ret); + return ret; + } /* Wait max 20 ms */ timeout = 100; while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL)) & SDHCI_CLOCK_INT_STABLE)) { if (timeout == 0) { - dev_err(mmc_dev(host->mmc), - ": Internal clock never stabilised.\n"); - return; + dev_err(dev, ": Internal clock never stabilised.\n"); + return -EBUSY; } timeout--; udelay(1000); @@ -102,6 +117,8 @@ static void arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) clk |= SDHCI_CLOCK_CARD_EN; sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); + + return 0; } static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) @@ -112,12 +129,11 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) struct sdhci_host *host; struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev); char tuning_loop_counter = SDHCI_TUNING_LOOP_COUNT; - u8 deviceid; + u8 node_id = priv->deviceid ? NODE_SD_1 : NODE_SD_0; debug("%s\n", __func__); host = priv->host; - deviceid = priv->deviceid; ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); ctrl |= SDHCI_CTRL_EXEC_TUNING; @@ -125,7 +141,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) mdelay(1); - arasan_zynqmp_dll_reset(host, deviceid); + arasan_zynqmp_dll_reset(host, node_id); sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); @@ -171,7 +187,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) } udelay(1); - arasan_zynqmp_dll_reset(host, deviceid); + arasan_zynqmp_dll_reset(host, node_id); /* Enable only interrupts served by the SD controller */ sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, @@ -194,10 +210,13 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) static int sdhci_zynqmp_sdcardclk_set_phase(struct sdhci_host *host, int degrees) { - struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); struct mmc *mmc = (struct mmc *)host->mmc; + struct udevice *dev = mmc->dev; + struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev); + u8 node_id = priv->deviceid ? NODE_SD_1 : NODE_SD_0; u8 tap_delay, tap_max = 0; int timing = mode2timing[mmc->selected_mode]; + int ret; /* * This is applicable for SDHCI_SPEC_300 and above @@ -233,7 +252,20 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct sdhci_host *host, /* Limit output tap_delay value to 6 bits */ tap_delay &= SDHCI_ARASAN_OTAPDLY_SEL_MASK; - arasan_zynqmp_set_out_tapdelay(priv->deviceid, tap_delay); + /* Set the Clock Phase */ + ret = arasan_zynqmp_set_out_tapdelay(node_id, + PM_TAPDELAY_OUTPUT, tap_delay); + if (ret) { + dev_err(dev, "Error setting output Tap Delay\n"); + return ret; + } + + /* Release DLL Reset */ + ret = zynqmp_pm_sd_dll_reset(node_id, PM_DLL_RESET_RELEASE); + if (ret) { + dev_err(dev, "dll_reset release failed with err: %d\n", ret); + return ret; + } return 0; } @@ -250,10 +282,13 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct sdhci_host *host, static int sdhci_zynqmp_sampleclk_set_phase(struct sdhci_host *host, int degrees) { - struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); struct mmc *mmc = (struct mmc *)host->mmc; + struct udevice *dev = mmc->dev; + struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev); + u8 node_id = priv->deviceid ? NODE_SD_1 : NODE_SD_0; u8 tap_delay, tap_max = 0; int timing = mode2timing[mmc->selected_mode]; + int ret; /* * This is applicable for SDHCI_SPEC_300 and above @@ -263,6 +298,13 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct sdhci_host *host, if (SDHCI_GET_VERSION(host) < SDHCI_SPEC_300) return 0; + /* Assert DLL Reset */ + ret = zynqmp_pm_sd_dll_reset(node_id, PM_DLL_RESET_ASSERT); + if (ret) { + dev_err(dev, "dll_reset assert failed with err: %d\n", ret); + return ret; + } + switch (timing) { case MMC_TIMING_MMC_HS: case MMC_TIMING_SD_HS: @@ -289,7 +331,12 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct sdhci_host *host, /* Limit input tap_delay value to 8 bits */ tap_delay &= SDHCI_ARASAN_ITAPDLY_SEL_MASK; - arasan_zynqmp_set_in_tapdelay(priv->deviceid, tap_delay); + ret = arasan_zynqmp_set_in_tapdelay(node_id, + PM_TAPDELAY_INPUT, tap_delay); + if (ret) { + dev_err(dev, "Error setting Input Tap Delay\n"); + return ret; + } return 0; } diff --git a/include/zynqmp_tap_delay.h b/include/zynqmp_tap_delay.h index 1c1e3e7dee..7e4d4e4a9a 100644 --- a/include/zynqmp_tap_delay.h +++ b/include/zynqmp_tap_delay.h @@ -8,14 +8,27 @@ #ifndef __ZYNQMP_TAP_DELAY_H__ #define __ZYNQMP_TAP_DELAY_H__ +#include + #ifdef CONFIG_ARCH_ZYNQMP -void zynqmp_dll_reset(u8 deviceid); -void arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 itap_delay); -void arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 otap_delay); +int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay); +int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay); #else -inline void zynqmp_dll_reset(u8 deviceid) {} -inline void arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 itap_delay) {} -inline void arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 otap_delay) {} +inline int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay) +{ + return 0; +} + +int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay) +{ + return 0; +} #endif +static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type) +{ + return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SD_DLL_RESET, + type, 0, NULL); +} + #endif From patchwork Tue Jul 27 12:36: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: 1510493 X-Patchwork-Delegate: monstr@monstr.eu 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=85.214.62.61; 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=HfTMwm49; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4GYxDP3pRlz9sRR for ; Tue, 27 Jul 2021 22:38:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F86683492; Tue, 27 Jul 2021 14:38:21 +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="HfTMwm49"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 787AB83481; Tue, 27 Jul 2021 14:37:10 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::61f]) (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 718E382EB1 for ; Tue, 27 Jul 2021 14:36:57 +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=D1Zu/nXcaWMjg//9tkhjN4HGXgKUy5mTCwPIKIZ5GqSw66EymdqpIHkf5q40XZvw78SEt4gaSP59rnu4/0NllIguM2vFrUFYveKk+6IvLlWP44+gl9Aok5om+dGy9JRlhhGTSBxvxGvtOQPsdf8MDjGYXzbAw0lf0lX8cbAc/DGmRUpOA4us3/akuyvOJw9Ell+7Nmm4n+UUD+ilzPOjlUX50YB/5ickdKq1p2Eb1+rEeIZ3IKzBDWu+dYR/1XeVWEmmT0rpAGVHOjlsYD5i8Td5O0/O/E+rAw4ycOYKJ4VwKcNECh1FT09qn8+r3IvIwRSZNtP63n7dBkp5AtfgsA== 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=6G3+W5gR0uTDzd1vKj1OfM//xqNcaegnE0woq38/FOc=; b=nvCwZDWtsVifVn8BsGCvTYMGrZ0HqfFvQnwMJHVCbbxXeQxhrEvlP6f8KdZkVwW90cOOw2VLJw9SRD5bBYcXrBGburJ4ut5YqNMH8qUwaw6f9b0pdp3FWr+pPE1xX/o5nwgDIpwxte4xKxiCnHXnv/azpGBJChtPW5I7lYq+IJc+0zsp0vEeSZU9RVFbhIYQr5blyl08mdZztu3sT9dwkrQkxM8f+HGYQKL/Vh3di28ESSQkpU64tdCQxdrz86LkHxlz24QcmLj+PMVUik854TY375pUFSl50wkhEY9WnkJMP4aTxVsVa/TdovgkL5HyLm2ExQAAAJ1WYk1MQ05enw== 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=6G3+W5gR0uTDzd1vKj1OfM//xqNcaegnE0woq38/FOc=; b=HfTMwm49d2qstwVrtV6vD7ULdFBcsbvncY6yyHR0STFa801z+JYSgODtmhMwh2X5fMfq0O5Q2rv9IpkpL1nCkyLatL7PanZfLptMoccYPR+cLRWM9LyNWdQNt+t4FlaK5dL0lK6ArQxRE8I6sdcfyyDB/S6LU2Md/ZJX5UiSFto= Received: from DM6PR05CA0038.namprd05.prod.outlook.com (2603:10b6:5:335::7) by DM6PR02MB4762.namprd02.prod.outlook.com (2603:10b6:5:10::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Tue, 27 Jul 2021 12:36:53 +0000 Received: from DM3NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:5:335:cafe::fb) by DM6PR05CA0038.outlook.office365.com (2603:10b6:5:335::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 12:36:53 +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 DM3NAM02FT029.mail.protection.outlook.com (10.13.4.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:53 +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; Tue, 27 Jul 2021 05:36:48 -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; Tue, 27 Jul 2021 05:36:48 -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=38284 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKE-0007B8-Pl; Tue, 27 Jul 2021 05:36:47 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id E758D1025D8; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma Subject: [PATCH v2 5/8] mmc: zynq_sdhci: Move setting tapdelay code to driver Date: Tue, 27 Jul 2021 06:36:39 -0600 Message-ID: <20210727123642.2474-6-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4851aa0-37b2-4c96-34d0-08d950fb36fc X-MS-TrafficTypeDiagnostic: DM6PR02MB4762: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DIC7cPylr+ZZmp++IGuXhgBLYhd1GbNQjODPHkZSHzk57IabcqMC3etPUmUOdQXYd05fkjefy9aAuznKZ3C2iIir2G8MyKiTIh5mV2pvGjoqEtDsFprO/OxFchR9T4dg/rPPNBlRtzfEkHDhu/Gx7/5Ja45xWPlalbjviR2SoplmZ/WWXr4TqvVcH8+foI+z9H4CMfWx9XFEYQiuJgtsKS8zsI3nUzrvu9B8n2/d46vChtjEbu3r7VYxMyYTg0BAo/T4VHUUiJ+gIfKdUWsTeW6aPDRpij6MkN8/WJZWmoHos/PzdsXjtdPQVwvqGZd0PbaNvuv4OlPiITRtXfEg4mZes9E3FegzNgF5TAlY9OG/dTLx1Cn81ZFe66BByVG5Lfgjla22cq2kqJSMKcA9UixQoyrOop67uVbYOQtRzj6+h/74sL9b8BL3Bi64fROX5HHeq9A1K3Vp+HfdCQk5mslqihFipSJlhcBja9w0SI9Uluj/Y/s09cO8nhO7uBrJUj7YN3shI1SpSqWh6JnJ0fl8pvmNyWE+lqDXtkqwGndwhCsPUhpHblHdtQzRMU0JsYqpoEl+ri8MnsUr+CSauwNbtYXaasb0Kr0lGK/oRcjiV+n1/zjH2RXofFObOO/Vzdm+XVk3Q4qamlch3wgwX6IYDQ31NihToWAmm6s8dsn3pwvjafk1jwtjNMQD5TvCfNELOR81XB3aGNyUKRAX6w== 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)(39860400002)(376002)(396003)(346002)(136003)(46966006)(36840700001)(6916009)(8676002)(54906003)(83380400001)(107886003)(42186006)(36906005)(8936002)(36860700001)(1076003)(4326008)(6266002)(36756003)(2616005)(6666004)(82310400003)(103116003)(336012)(26005)(7636003)(82740400003)(478600001)(316002)(47076005)(2906002)(5660300002)(186003)(356005)(70206006)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:53.8167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4851aa0-37b2-4c96-34d0-08d950fb36fc 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: DM3NAM02FT029.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4762 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 tap_delays.c just has calls to xilinx_pm_request() for setting tapdelays. Simply move these calls to zynq_sdhci.c and make them static inline. Similarly zynqmp_tap_delay.h also has call to xilinx_pm_request() for dll reset. Do the same for this file as well. Remove tap_delays.c and zynqmp_tap_delay.h files. Signed-off-by: Ashok Reddy Soma Reviewed-by: Jaehoon Chung --- (no changes since v1) board/xilinx/zynqmp/Makefile | 2 -- board/xilinx/zynqmp/tap_delays.c | 26 ------------------------ drivers/mmc/zynq_sdhci.c | 21 +++++++++++++++++++- include/zynqmp_tap_delay.h | 34 -------------------------------- 4 files changed, 20 insertions(+), 63 deletions(-) delete mode 100644 board/xilinx/zynqmp/tap_delays.c delete mode 100644 include/zynqmp_tap_delay.h diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile index 7d8277ca40..a914028753 100644 --- a/board/xilinx/zynqmp/Makefile +++ b/board/xilinx/zynqmp/Makefile @@ -44,8 +44,6 @@ $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_C endif endif -obj-$(CONFIG_MMC_SDHCI_ZYNQ) += tap_delays.o - ifndef CONFIG_SPL_BUILD obj-$(CONFIG_CMD_ZYNQMP) += cmds.o endif diff --git a/board/xilinx/zynqmp/tap_delays.c b/board/xilinx/zynqmp/tap_delays.c deleted file mode 100644 index 4ce2244060..0000000000 --- a/board/xilinx/zynqmp/tap_delays.c +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Xilinx ZynqMP SoC Tap Delay Programming - * - * Copyright (C) 2018 Xilinx, Inc. - */ - -#include -#include -#include -#include -#include -#include - -int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type, u32 itap_delay) -{ - - return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, - type, itap_delay, NULL); -} - -int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type, u32 otap_delay) -{ - return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, - type, otap_delay, NULL); -} diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index c4927d6c1a..043af5cb3a 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #define SDHCI_ARASAN_ITAPDLY_REGISTER 0xF0F8 @@ -76,6 +75,26 @@ static const u8 mode2timing[] = { [MMC_HS_200] = MMC_TIMING_MMC_HS200, }; +static inline int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type, + u32 itap_delay) +{ + return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + type, itap_delay, NULL); +} + +static inline int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type, + u32 otap_delay) +{ + return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + type, otap_delay, NULL); +} + +static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type) +{ + return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SD_DLL_RESET, + type, 0, NULL); +} + static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) { struct mmc *mmc = (struct mmc *)host->mmc; diff --git a/include/zynqmp_tap_delay.h b/include/zynqmp_tap_delay.h deleted file mode 100644 index 7e4d4e4a9a..0000000000 --- a/include/zynqmp_tap_delay.h +++ /dev/null @@ -1,34 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Xilinx ZynqMP SoC Tap Delay Programming - * - * Copyright (C) 2018 Xilinx, Inc. - */ - -#ifndef __ZYNQMP_TAP_DELAY_H__ -#define __ZYNQMP_TAP_DELAY_H__ - -#include - -#ifdef CONFIG_ARCH_ZYNQMP -int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay); -int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay); -#else -inline int arasan_zynqmp_set_in_tapdelay(u8 device_id, u32 type, u32 itap_delay) -{ - return 0; -} - -int arasan_zynqmp_set_out_tapdelay(u8 device_id, u32 type, u32 otap_delay) -{ - return 0; -} -#endif - -static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type) -{ - return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SD_DLL_RESET, - type, 0, NULL); -} - -#endif From patchwork Tue Jul 27 12:36:40 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: 1510487 X-Patchwork-Delegate: monstr@monstr.eu 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=SbVsYK8u; 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 4GYxC02CXvz9sRR for ; Tue, 27 Jul 2021 22:37:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 704E08346F; Tue, 27 Jul 2021 14:37:29 +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="SbVsYK8u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 456A583480; Tue, 27 Jul 2021 14:37:03 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::60b]) (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 B17FB83479 for ; Tue, 27 Jul 2021 14:36:54 +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=C6YwYeRcVaIZpzh+d/b24m9aNom1LsrRihKbIeKpy1AnsilOaa+B/+3Hyccg5UBFitHgcjypYvXTNUKeiRwN+6x7D3vJnL0slTJrKidHbSzJTpVa2YYZ7wA7kZfdaB4mCohcYdwyDr2FxqB43sMGVdSUEWo5YTW/rHdD5F3gWsQTtSP10glbfI/dP/EjWQAX92sJAm74r/M7jZjd2le7ukYFwaLMGobwubcD7AdiZhEM7SQvuRGcPrbramgcX4opQ84wDBaeXj/vILS9VkBtORpqY0c8XGkr7XJoA1T6+rLK5li3Yg7am5NRjnHMkZeNbCu852SV7q1bN6G/nDhKWQ== 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=7eMAYCDtifkxncf8U3Mq8tBo1SrkquBEEIStXNFW9CU=; b=Z/zgRRK+gkGcv/5R5qLTa8BgB5j+Pa72JDWCbSxkLe5eiQa2ggeKKc+QJXp3Pz7bO0gLwqPHz582yUKwIZvwwYXtkePO1LxpOXg+eXbt5SdEnBkhGl/wGpPwmAztJqGqacaW2LeFr6UgGJ2SHYCNhl7ZiDXFm9Cdz2DKOPIixnL2pO7LYKLhz0hAJhVjofdoYG49YpEjREwNEjC6FLHwE0Yme6BFzK8yFJhPqseo5H5bmOhy88llwUoHu5cAUoWyJpbhAS4LO1NVQjGT2DIx7ndcB+nNoRd03F9yT5c2grXqY92RX+Nd7Gq1jD4iGYVmhMkJwBm+utxpQNFhLOt91w== 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=7eMAYCDtifkxncf8U3Mq8tBo1SrkquBEEIStXNFW9CU=; b=SbVsYK8uHK2Ms/7M8csdNjkbMmKGFW2VPlBqpgix0Mccbv0bhMd33w5B+O1F9pVkWhEQlPuDjpTEE9uOn7Of8o2jS0p1f3A6ZFd7vGVJC+iZeQNtRrSiTunCnH0q8m3yFYEZwmZAYYf5tyOOv18mEBWjNoCgIkZ1K1vcrve9rjg= Received: from DS7PR03CA0127.namprd03.prod.outlook.com (2603:10b6:5:3b4::12) by SN4PR0201MB3408.namprd02.prod.outlook.com (2603:10b6:803:50::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 12:36:51 +0000 Received: from DM3NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::fc) by DS7PR03CA0127.outlook.office365.com (2603:10b6:5:3b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Tue, 27 Jul 2021 12:36:51 +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-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT031.mail.protection.outlook.com (10.13.4.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:51 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 05:36:48 -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; Tue, 27 Jul 2021 05:36:48 -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=38286 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKE-0007B7-Pl; Tue, 27 Jul 2021 05:36:47 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id EB7641025DE; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma Subject: [PATCH v2 6/8] mmc: zynq_sdhci: Change variable deviceid to node_id Date: Tue, 27 Jul 2021 06:36:40 -0600 Message-ID: <20210727123642.2474-7-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5a3df52-f7ca-456c-91a9-08d950fb35c6 X-MS-TrafficTypeDiagnostic: SN4PR0201MB3408: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z00PrzHW/jJDIMzjhTed6JuWnPO4VthXP7eeuyiZNAgtUx1gLgOLf9w29IrEBaYlvaOHV00TW6sMq4H0rn6a1dqEckCXc8f+jOhauedYVlJLXzuTKat2WXGLeW2VzphogvnVkjaRTN/132rsjUO/4IZub65DHusxTX0IiYbh/NWSssrmpMYtrgmiJ+2aSGeoZcN37l+9cqF4mMOZkQy1CWIaa/JAF38NbxLT32CTtk1nL3w+G3a2ruEUrQ8efZXvizSA4ummFfiuooxnscrKKMPMsPfyenZEqXThyM+3n6xSSLn505AGzOlqTBqBuTI0iAd15O2slwlpmGz2GFwsHDyNBMKpfFooyKqwFG8dl15kbZsvhX3+GrduMjm5KNjthCMWwjIa1th0ueijL4qoUutu+LjuX9W9JIv2harXqwo+87mhXgVh/Stq2fAZrwz3eGY4COrt9pPROTvcRJXqoMA/Ym+EVBqczAHgsQJVyZDtvWqHpNbiCtnb2yb70yZbXi+C9nL6/a3oYvJ1JZmqSiaAw0BMG9Q7jcuG+mTb8aiV20MXw1wZ4Eqs3SOp06CgxNQApi3+rVMszLQ2fTPtGk6Dn7SEejizMkKtqpa+y9CQ7Q/jHuMAtHNsLu3fw7CeH8hquX9WYnC2X2Hp9GGN7+tXsA3+oT4XioDxe09cuaUWvdNW5zaglfppzENn8DjpYQBVm08bU/WNn9hs+JDGBA== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(396003)(376002)(46966006)(36840700001)(26005)(336012)(82310400003)(316002)(70586007)(70206006)(6916009)(5660300002)(36860700001)(83380400001)(2906002)(1076003)(103116003)(6666004)(36756003)(107886003)(186003)(4326008)(36906005)(478600001)(42186006)(8936002)(356005)(7636003)(82740400003)(8676002)(54906003)(47076005)(6266002)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:51.7955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5a3df52-f7ca-456c-91a9-08d950fb35c6 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0201MB3408 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 Change deviceid to node_id in arasan_zynqmp_dll_reset() and also in tapdelay related static inline functions to reflect proper name and for consistency. Signed-off-by: Ashok Reddy Soma Reviewed-by: Jaehoon Chung --- (no changes since v1) drivers/mmc/zynq_sdhci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 043af5cb3a..81311d14ca 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -75,17 +75,17 @@ static const u8 mode2timing[] = { [MMC_HS_200] = MMC_TIMING_MMC_HS200, }; -static inline int arasan_zynqmp_set_in_tapdelay(u8 deviceid, u32 type, +static inline int arasan_zynqmp_set_in_tapdelay(u8 node_id, u32 type, u32 itap_delay) { - return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SET_SD_TAPDELAY, type, itap_delay, NULL); } -static inline int arasan_zynqmp_set_out_tapdelay(u8 deviceid, u32 type, +static inline int arasan_zynqmp_set_out_tapdelay(u8 node_id, u32 type, u32 otap_delay) { - return xilinx_pm_request(PM_IOCTL, (u32)deviceid, IOCTL_SET_SD_TAPDELAY, + return xilinx_pm_request(PM_IOCTL, (u32)node_id, IOCTL_SET_SD_TAPDELAY, type, otap_delay, NULL); } @@ -95,7 +95,7 @@ static inline int zynqmp_pm_sd_dll_reset(u8 node_id, u32 type) type, 0, NULL); } -static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) +static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 node_id) { struct mmc *mmc = (struct mmc *)host->mmc; struct udevice *dev = mmc->dev; @@ -108,7 +108,7 @@ static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); /* Issue DLL Reset */ - ret = zynqmp_pm_sd_dll_reset(deviceid, PM_DLL_RESET_ASSERT); + ret = zynqmp_pm_sd_dll_reset(node_id, PM_DLL_RESET_ASSERT); if (ret) { dev_err(dev, "dll_reset assert failed with err: %d\n", ret); return ret; @@ -116,7 +116,7 @@ static int arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) /* Allow atleast 1ms delay for proper DLL reset */ mdelay(1); - ret = zynqmp_pm_sd_dll_reset(deviceid, PM_DLL_RESET_RELEASE); + ret = zynqmp_pm_sd_dll_reset(node_id, PM_DLL_RESET_RELEASE); if (ret) { dev_err(dev, "dll_reset release failed with err: %d\n", ret); return ret; From patchwork Tue Jul 27 12:36:41 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: 1510492 X-Patchwork-Delegate: monstr@monstr.eu 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=J0V2IPdX; 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 4GYxDB09YKz9sRR for ; Tue, 27 Jul 2021 22:38:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5920F8348B; Tue, 27 Jul 2021 14:38:12 +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="J0V2IPdX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D5A3983485; Tue, 27 Jul 2021 14:37:08 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::604]) (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 8AC838346F for ; Tue, 27 Jul 2021 14:36:56 +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=N/a4tQvl4G+keeF7yaBcvteSow6raR1ouwld5pivhTq5miZnVK/LNEYnj6dXiaOTYLEnJnrh1k7WPv8kyP46rjGo0NkpF7fz7q6TrHbBGHjdoB3avwziUUFIoY0+9TFvAdQj5wVAb9C8F2QPV073Uuaf7tptNpoAX6/sb9+gNSDxQcWWR3LH//BSxDfeYxMxUuWEntK6VgE/xoJaZ+6lS1Ef+EfsmVXZC8F8pIwsPFFogwNqrJ7wJC7FzjqTJsNAlLBVF2OeFqLxI4hVe96dfW9O8Pcd+txSMZ948cFDt0Q4KpNUyj/uMr8ULDCtH35wfbfNr9huMvoKMx2umyYe5Q== 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=c1tZk7mxFS2GooOPSamSMRANJLS5SpQfbFqRf3upqbg=; b=W/0rTuMoH7R73Bh8x0eN/O5qYjR/LrHBeFvbQX9w5zhwDeH42xOT2Ez6kb+9leIyx2196bib14vYqLAD9TUYXRFZnl44mIjF5a4Rf4wuE8ho29y7ByrV0JYD0x+ReX6s0B3/7GfEzAZmWwjsXONu36wPXpnWSLT237lRSv6pjBMReZ7QRu8x16/W6B2s+rT9pqQVl/1CSIt6jY1wIJUFZBxAMtlaHcGwicVviT47NVR47X+ADJB5ohedvFHAVHCxt20o3U+U/ZsMwJv2/enYQ/6K7H06LbuCEJkh6yAr2Lk3In60TWslheBPgrtBX1tLGjtrHn48lLhJ7BkPmOxyMA== 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=c1tZk7mxFS2GooOPSamSMRANJLS5SpQfbFqRf3upqbg=; b=J0V2IPdXvMcCcTRLGDI9aX/kH3xzpJcE5afa/DVWYa9gSSPtvQlj8Ezv+oZDmllKDe8UM0MPfeDEVKKS7ZKL3H2CLkJ0aHqhczuyuc2MfnxEjSQTd2t3RXH+u/BmgDG5hmy+8VRTICIBvHRfnjrBD0CavFef86BA5Thwx0ChrXM= Received: from DM6PR05CA0039.namprd05.prod.outlook.com (2603:10b6:5:335::8) by BN6PR02MB2178.namprd02.prod.outlook.com (2603:10b6:404:31::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Tue, 27 Jul 2021 12:36:53 +0000 Received: from DM3NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:5:335:cafe::e5) by DM6PR05CA0039.outlook.office365.com (2603:10b6:5:335::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Tue, 27 Jul 2021 12:36:52 +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 DM3NAM02FT029.mail.protection.outlook.com (10.13.4.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:52 +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; Tue, 27 Jul 2021 05:36:47 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 27 Jul 2021 05:36:47 -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=38288 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKE-000CNl-Pk; Tue, 27 Jul 2021 05:36:47 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id EF9101025DF; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , T Karthik Reddy , Ashok Reddy Soma Subject: [PATCH v2 7/8] mmc: zynq_sdhci: Wait till sd card detect state is stable Date: Tue, 27 Jul 2021 06:36:41 -0600 Message-ID: <20210727123642.2474-8-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a99a481-9421-4037-df49-08d950fb365f X-MS-TrafficTypeDiagnostic: BN6PR02MB2178: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lUeGaS+iByvQBoFJR4hSY8zfJMJc9FaJqS+JTv0rYZLsU2Fd9OFYV7F3zthdcQi5TSi4/y176GWJwhZbUVtDKQlRIe/LJqQ5uIkSUn20MZtT7FcxYBlDR3hYlOTCSinB61apvTHLj6zCHiaYREtrb5Uxu4ZjQuOzDIP5743SnGWD4ulfuQIMKJmjqSFoX6xMXtzC8XabSyXzmFrNCk1hrdh1GdKE8gIemYZeylXjXVS00Fz9P43/z90lOQhBi4Cu71ZycAzbfcgpC+OYxyo3e1dhyaF6WViLaC0auq74CUJdXs4W7HdUjsM+5V2nz8Yxz+AUVHt+57UDd1NHZcXYbwOTvsBbngI4X9NXkr/953dq8Oc8/EMDBDYAVJKRXm1FpM+7H894wqENnqqMn815Kv+1bxmv0ry9C/ZRZomnQlRvl/GjWhPhI838Txu7K3kInOoGj/grZxPoggubgdP18eo+nskvbNsyExI5FOZ6X5pX41co8ndZppAl7gVzCwU6jTAK2cuy3S8m5VBYLvnGoh/CJuNUByJDrQAvBEo1xv+W3fAsRhCbY33a2x5wRE2sIN3tJ/UDfCoZc0pPGP+rQQRbt62CGNQHZqwvV4JyEWTRpCPwtZoyVjdJ/oJhGZJdQh+YJtEFTU/WSGsNZ38cfXLS+8tB7r99LPZQcQdCHWddthuIrCNwnKUa7a/Twa3iXt4wpN3m7CMV8kkK9IVO2w== 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)(376002)(396003)(346002)(136003)(39860400002)(36840700001)(46966006)(6266002)(26005)(103116003)(83380400001)(107886003)(7636003)(186003)(2906002)(478600001)(82310400003)(336012)(47076005)(36860700001)(2616005)(1076003)(4326008)(8676002)(8936002)(5660300002)(356005)(54906003)(82740400003)(6916009)(70586007)(70206006)(6666004)(316002)(42186006)(36756003)(36906005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:52.7982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a99a481-9421-4037-df49-08d950fb365f 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: DM3NAM02FT029.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2178 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 From: T Karthik Reddy As per SD spec when SD host controller is reset, it takes 1000msec to detect the card state. In case, if we enable the sd bus voltage & card detect state is not stable, then host controller will disable the sd bus voltage. In case of warm/subsystem reboot, due to unstable card detect state host controller is disabling the sd bus voltage to sd card causing sd card timeout error. So we wait for a maximum of 1000msec to get the card detect state stable before we enable the sd bus voltage. This current fix is workaround for now, this needs to be analysed further. Zynqmp platform should behave the same as Versal, but we did not encounter this issue as of now. So we are fixing it for Versal only. Signed-off-by: T Karthik Reddy Signed-off-by: Ashok Reddy Soma --- Changes in v2: - Changed return error from -EIO to -ETIMEDOUT in arasan_sdhci_probe() in card detect state stable workaround drivers/mmc/zynq_sdhci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 81311d14ca..e71ba4eee0 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -689,6 +689,23 @@ static int arasan_sdhci_probe(struct udevice *dev) return ret; upriv->mmc = host->mmc; + /* + * Wait for 1000msec till the card detect state gets stable + * else host controller will set sd power bus voltage to 0. + */ + if (IS_ENABLED(CONFIG_ARCH_VERSAL)) { + u32 timeout = 1000; + + while (((sdhci_readl(host, SDHCI_PRESENT_STATE) & + SDHCI_CARD_STATE_STABLE) == 0) && timeout--) { + mdelay(1); + } + if (!timeout) { + dev_err(dev, "Sdhci card detect state not stable\n"); + return -ETIMEDOUT; + } + } + return sdhci_probe(dev); } From patchwork Tue Jul 27 12:36:42 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: 1510490 X-Patchwork-Delegate: monstr@monstr.eu 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=IFilY+m2; 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 4GYxCk1kf7z9s5R for ; Tue, 27 Jul 2021 22:38:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F00138348E; Tue, 27 Jul 2021 14:37:53 +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="IFilY+m2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E35683467; Tue, 27 Jul 2021 14:37:01 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2062b.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eb2::62b]) (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 97AD783467 for ; Tue, 27 Jul 2021 14:36:53 +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=evVgOVvrd6URNQUoVoi+sG7yl9/8/98AztvAQXzb8tCzZsrMbEmacVOQYouT/8d/l16nbrMot5RrRHhWioDaLLfvXJhnCIZjlwzyJG0Qy/k5IcuFg63ttpzZNmzUNODwjiQgNNkdIZZ9uu+RQDyNHVrIgKBJxZwr4nSFjg0Ewgx5T9t806COvCYDX2nSxIMJ9c1OMbCOyMxSgvAOxybxRL++ipZzk1tdl1SZURk9zxgjWEwjPnCO8QPf6Px3Nrlg4Ptbv4TFsPVcXPOlDZfYdcRbKtfKebzy+DxUnZMzL5t51XYZOeVLQr8TPZ4iEVO8hk3Jv7QKbhOLXdPvvxPIkQ== 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=Fi7+WUb6jzaK8ZTWwtgPzzpB5HoWJRkFh9jJwswGe+M=; b=SYJHhIVuNgLscdAcpvvQBORcLE4pEoUr/nCFYZILH1hLyxT/JlmHMgNudndGZygA7QyO51T0X5OIGF6AJGaR+ruNmEFxq2cYNq2LSNrRxOKrMK0hmWIQe+76av7cCO2apzfQ7qsNNULgzPS7Uo0mbvuH4EBcnGhquWWwbibCEF2mTi6VYRTdpBNaLNPLUETetLlfiyHtYMLfjZEB6GQwzbD5CpBvygYx4IGOtcYdl3gjWCerMTOCNOxqESUXsjZU3DH/el0aExZaVSfgtU2OdBg89Q3Xc87886EDvpEnvvAXkmow401HHZMOJBbDVzf1qamagQEljUmXht3vWxWRsQ== 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=Fi7+WUb6jzaK8ZTWwtgPzzpB5HoWJRkFh9jJwswGe+M=; b=IFilY+m2+gHaFecAbmzc8RuSuV8pBACs3tTeIUd99LJVJiFkiHWOKBuwdHdbrozyqcZM/iiEHz9DmxmAptx8FSlaCkW+ncS06R0znO2/JiIU+FBOXCbH7R1dOpL0+qKV/DnH4UJka6HFJm27uShbSo/AdKVdB3rb5511xZC8ZMY= Received: from DS7PR03CA0125.namprd03.prod.outlook.com (2603:10b6:5:3b4::10) by CO6PR02MB7764.namprd02.prod.outlook.com (2603:10b6:303:a1::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26; Tue, 27 Jul 2021 12:36:50 +0000 Received: from DM3NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::14) by DS7PR03CA0125.outlook.office365.com (2603:10b6:5:3b4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25 via Frontend Transport; Tue, 27 Jul 2021 12:36:50 +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-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT031.mail.protection.outlook.com (10.13.4.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 12:36:50 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 05:36:47 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 27 Jul 2021 05:36:47 -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=38290 helo=xhdashokred41.localdomain) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m8MKE-000CNm-Q4; Tue, 27 Jul 2021 05:36:47 -0700 Received: by xhdashokred41.localdomain (Postfix, from userid 2896) id F3B1B1026A1; Tue, 27 Jul 2021 06:36:44 -0600 (MDT) From: Ashok Reddy Soma To: CC: , , , , , , , , Ashok Reddy Soma Subject: [PATCH v2 8/8] mmc: zynq_sdhci: Use set_control_reg from sdhci.c Date: Tue, 27 Jul 2021 06:36:42 -0600 Message-ID: <20210727123642.2474-9-ashok.reddy.soma@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> References: <20210727123642.2474-1-ashok.reddy.soma@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 129dc19f-b3ea-44b8-785c-08d950fb3529 X-MS-TrafficTypeDiagnostic: CO6PR02MB7764: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:411; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7KRJLSHwyIC77028VS1zJCNkdvX5yvJzmGByBTy1pu48DxKmSap8DVlOzZQOa3FsSpUnyjW+mukI5Wqv/morkUVKkrM6iDkaqlBekL2xCbeBSxgvM1Uvtf7iXNh/mJ9UvOP27Jva2i5XcB9P8QlRpZFNefQCvrztha1gaB3mHsk146xUafq/BT0F7NGJ3r9uZV0WLOOqz976YtrEk6e95LRZB/1J4HUVHJRsC49Pp/9H62J9Xq8RjidMVjld/zQM9dJnMo23SFXrG8GDEREyC2I+ztfqeBGCJ4GRaTPB+28HPEMcvaAHmAxwIGseThTIBsDOkSvmiioD0qZgCI7t6eXsbk860lzIXrCAPtiTrK/5LgRZVp859/YVnLz4CL8R5QTdKpB88sERRivOC+1kfDnSXRz7lLCsOMdnJZBbRPeXs4V9Aaw+DQ+eswfbNaB8954SzCwD1f2GLoblo7HwxTMYVh0qzL5E+H8hO5AHhXkt4YaU+w3c1ZA6JIMuLSQ1mxDxBrjklGORlGcGD2xzXiifxI0jJlWbhuztPMYvVo88hk7Yz3EvzhGmKB6w+TSbOP/5+h3bDh64AKwX7tckZ/uieCzMMbXo/HKdj28zuKUD+LyqcGLIVs/WCS/OgZ+EkqcdUP1gHdtQUd9qkhyda/+5PGkQW4JOSG1euIohcIqMxAbdq4FG+iAGq0I3efpI5BwMeY62JMN4V0Bz9GYrxg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(376002)(136003)(346002)(36840700001)(46966006)(1076003)(83380400001)(8676002)(5660300002)(356005)(107886003)(6266002)(6916009)(2906002)(54906003)(316002)(82310400003)(36756003)(47076005)(42186006)(336012)(36906005)(103116003)(478600001)(4326008)(70206006)(70586007)(82740400003)(2616005)(8936002)(36860700001)(186003)(7636003)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 12:36:50.7659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 129dc19f-b3ea-44b8-785c-08d950fb3529 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR02MB7764 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 Since set_control_reg is available in sdhci.c, use it and remove arasan_sdhci_set_control_reg(). Signed-off-by: Ashok Reddy Soma Reviewed-by: Jaehoon Chung --- (no changes since v1) drivers/mmc/zynq_sdhci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index e71ba4eee0..4becd8c7ba 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -603,29 +603,10 @@ static void arasan_dt_parse_clk_phases(struct udevice *dev) "clk-phase-mmc-hs400"); } -static void arasan_sdhci_set_control_reg(struct sdhci_host *host) -{ - struct mmc *mmc = (struct mmc *)host->mmc; - u32 reg; - - if (!IS_SD(mmc)) - return; - - if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) { - reg = sdhci_readw(host, SDHCI_HOST_CONTROL2); - reg |= SDHCI_CTRL_VDD_180; - sdhci_writew(host, reg, SDHCI_HOST_CONTROL2); - } - - if (mmc->selected_mode > SD_HS && - mmc->selected_mode <= MMC_HS_200) - sdhci_set_uhs_timing(host); -} - static const struct sdhci_ops arasan_ops = { .platform_execute_tuning = &arasan_sdhci_execute_tuning, .set_delay = &arasan_sdhci_set_tapdelay, - .set_control_reg = &arasan_sdhci_set_control_reg, + .set_control_reg = &sdhci_set_control_reg, }; #endif