From patchwork Thu Aug 27 09:25:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 1352446 X-Patchwork-Delegate: eugen.hristev@microchip.com 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; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=shmQZDAU; 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 4Bccr66NHNz9sTj for ; Thu, 27 Aug 2020 19:29:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 652A38006D; Thu, 27 Aug 2020 11:29:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="shmQZDAU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 174E581260; Thu, 27 Aug 2020 11:29:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa3.microchip.iphmx.com (esa3.microchip.iphmx.com [68.232.153.233]) (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 134FF8004A for ; Thu, 27 Aug 2020 11:29:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=Eugen.Hristev@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1598520551; x=1630056551; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tgNZ4TurZu0NitZmt+8+rIdejAe6iF2oy0Dj5RJ4KPg=; b=shmQZDAUT861Pi/ukiarixzyzSjeuZ/J4H7EPQ9qn5ZHx1x1s7JDfZJk Lx8Dp4XsVIcUwC9UJwjIWzO9sb9rvQ4UNt7HAfSCE7PVFcvIm9xQ/ilx7 PCBfUBUE4M/37CKyvthul9L4Z6OIIDzA2HFO03VxMJbnztUOOCmngY31j gM1kXWuv+To2szsl01VBS+YPqlKo7Xfx8EAQP5OyLzdZjldia9XsPYDUd 7Z/fTVmbcTrn6Kq+845sFI3xzoiwPSaRKs+qKbYimXK3vDAukKF7X/x32 kM6m8Yh9ClUFAgsFjmwrHuFMrxJsaBRlnRLjdeRKywU+4shqLSam9rIkV A==; IronPort-SDR: 2x/Uny1jDZ5HtZeH6ZEcD2X924zGs6ciYEQmGOehGRa8dGRRI98ha9gT5NgnfQ8F0/YlA/PKdB s7im0WB5jYy38R35Vof+ZZiHARjJPftLh6BULW/5AE243graDSyL5tSSBoOXYIoEdac9QaIamG Phx6ec/QQKZfL/zz+pVmOe9/duEtdq4siVVfXvywrsrvyLO1HmQZIFj3k/k+fQc39f+jzVMqVE cIAgSV4MxY3xzHKWNqTKkmGoq2F8iPQZ9jA5GWpEB8NeTBBMctB2CucWCBKkVAT73HmoTkJReH NC4= X-IronPort-AV: E=Sophos;i="5.76,359,1592895600"; d="scan'208";a="89540919" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Aug 2020 02:29:08 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 27 Aug 2020 02:25:13 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 27 Aug 2020 02:26:02 -0700 From: Eugen Hristev To: , CC: , Eugen Hristev Subject: [PATCH v2 4/6] mmc: atmel-sdhci: do not check clk_set_rate return value Date: Thu, 27 Aug 2020 12:25:55 +0300 Message-ID: <20200827092557.269129-1-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean clk_set_rate will return rate in case of success and zero in case of error, however it can also return -ev, but it's an ulong function. To avoid any issues, disregard the return value of this call. In case this call actually fails, nothing much we can do anyway, but we can at least try with the previous values (or DT assigned-clocks) Signed-off-by: Eugen Hristev --- drivers/mmc/atmel_sdhci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index f03c0457e1..54b660c34a 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -79,9 +79,7 @@ static int atmel_sdhci_probe(struct udevice *dev) if (ret) return ret; - ret = clk_set_rate(&clk, ATMEL_SDHC_GCK_RATE); - if (ret) - return ret; + clk_set_rate(&clk, ATMEL_SDHC_GCK_RATE); max_clk = clk_get_rate(&clk); if (!max_clk) From patchwork Thu Aug 27 09:25:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 1352450 X-Patchwork-Delegate: eugen.hristev@microchip.com 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; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=KVU7ShWB; 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 4Bccvy1Vj1z9sRK for ; Thu, 27 Aug 2020 19:32:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51BAD8158B; Thu, 27 Aug 2020 11:32:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="KVU7ShWB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 984788221F; Thu, 27 Aug 2020 11:32:41 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa6.microchip.iphmx.com (esa6.microchip.iphmx.com [216.71.154.253]) (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 3EA7081260 for ; Thu, 27 Aug 2020 11:32:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=Eugen.Hristev@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1598520757; x=1630056757; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1pxfs3hMGyLPAAdlayv7Wjbdwol2rPS+tpuLHeCo60A=; b=KVU7ShWBdgS16ATCcTXjcFVuurHT1fbox6qz/vjivWRGCiFZFwcuDlTA 3kvk6ryR9QTJuReT+F/17PYAsu7nF5D4GeBSxM3qhrQ/+2oo/5f2FwNKw 6ekzwC01C4d9K5cqfG9KkGsrRpgxsS1r7eDRUjh2InCxJ0Ch27GcfTqud misNXrDsSaQSjatUrr3KDQUh+1o6eskhh0vKMeONEwhc7tHlB/WrEREB/ 4/jEQk1RfWwSdR7EKeyuK2OipZDq37n3/GAwUjm9B4451cvOsuJrzTIpg sOqA5LiFnQOhqf+9boHol4xnSTPxyIfOQudrtKNVEy4cN4tOHvSQbuVzn g==; IronPort-SDR: oT8wZWXwxi8CgAegYzwXE5jl9/+QD8PgTETESxRZPzuv1M9srqZZezNMTasXVERiYkt19FebMi xykmY75gvYWTReI1gUgDH4e/V681BGm3b+Zu164rXi3dG/9Bj9uEPi3los4osa0m3X/EARf93t c3ke8lzmNz3pi7otbyjttQhjHdtkEln90g6UMoEA5bIdHze5A099DDvo/sScm5+F/6IhnLQ4O+ P9LmzBLyQs0w1/zpoVHh7q0dnex0tpHoVmOl+Kr9Q+NBP7U7zvfRvgdMY5Dt4IYjjzjKn2YqGl PGs= X-IronPort-AV: E=Sophos;i="5.76,359,1592895600"; d="scan'208";a="24401721" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Aug 2020 02:32:35 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 27 Aug 2020 02:27:12 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 27 Aug 2020 02:27:53 -0700 From: Eugen Hristev To: , CC: , Eugen Hristev Subject: [PATCH v2 5/6] mmc: atmel-sdhci: enable the required generic clock Date: Thu, 27 Aug 2020 12:25:56 +0300 Message-ID: <20200827092557.269129-2-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200827092557.269129-1-eugen.hristev@microchip.com> References: <20200827092557.269129-1-eugen.hristev@microchip.com> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean The second clock of the IP block (the generic clock), must be explicitly enabled. Signed-off-by: Eugen Hristev Reviewed-by: Peng Fan --- drivers/mmc/atmel_sdhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index 54b660c34a..c67b065061 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -85,6 +85,10 @@ static int atmel_sdhci_probe(struct udevice *dev) if (!max_clk) return -EINVAL; + ret = clk_enable(&clk); + if (ret) + return ret; + host->max_clk = max_clk; host->mmc = &plat->mmc; host->mmc->dev = dev; From patchwork Thu Aug 27 09:25:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 1352447 X-Patchwork-Delegate: eugen.hristev@microchip.com 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; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=QBoP4P1v; 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 4Bccrs21BVz9sRK for ; Thu, 27 Aug 2020 19:30:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D91F81260; Thu, 27 Aug 2020 11:30:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="QBoP4P1v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26037821DE; Thu, 27 Aug 2020 11:30:00 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa6.microchip.iphmx.com (esa6.microchip.iphmx.com [216.71.154.253]) (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 8E86E8006D for ; Thu, 27 Aug 2020 11:29:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=Eugen.Hristev@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1598520595; x=1630056595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3y0327mcw65REiLawRFOZN/phh1qK/SPK7pKPzlYVPU=; b=QBoP4P1vClEr8irQp1A1l+3YQ6KyTnYXEO23xwokPo+ffBNegAyqLUwy TEvNJXrO32GTNOnizEDf/oK4YGU1yCHeN93tvVVRHULvHhJsuqXlbDJkS jyLzNWm5SYzF5bXT0iP1307YBJkoLODpWXjhHLhaxPsUnNtY4gdJfSb9k j/7kL8YiB2Ur5BKghJhzyFhoahCDCEnd3NY+xSr3p0jjDoU+/BaiAMqFO 4RsqDYCLJ4JyWbvHGtWOxkuzzhUI41DsPEXdbunebzn3Wgfjo6Mmp61A6 7daLD6PJEHoOm6Gxo6+bz6DFUuJLnbVcjyQ3SiW7S0JCXy3gwDf9fRwoX A==; IronPort-SDR: l/hFJS9Ef8YVsOZHZZXKQAWKb0c8vbwxQNiOlCcc53VBvtwVcebgoTYWKGWf5fkEvET9bKxgPS tP3XLgx9tsqwbiTnk/2O3vke4rSUeZJEHK+7FPsH0GKaqWp85+LmiovtMbbsZZYwGgnVoB0FnF OeFT7cumSNToOIKw7Mx4SSBIftbRM04lJggqaGhhI0YdGl2jtUCLNVmx4inHJP8j7LS5XtCPoP 79OYQDXYffsvXh1LmBCKooHYqxuGbMuVjfw7OKz3WF8ZJ91+gsyQsX5Wq4RIhtTvI2SJd6ronF VMc= X-IronPort-AV: E=Sophos;i="5.76,359,1592895600"; d="scan'208";a="24401549" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Aug 2020 02:29:37 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 27 Aug 2020 02:27:49 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 27 Aug 2020 02:28:39 -0700 From: Eugen Hristev To: , CC: , Eugen Hristev Subject: [PATCH v2 6/6] mmc: atmel-sdhci: use mmc_of_parse to get the DT properties Date: Thu, 27 Aug 2020 12:25:57 +0300 Message-ID: <20200827092557.269129-3-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200827092557.269129-1-eugen.hristev@microchip.com> References: <20200827092557.269129-1-eugen.hristev@microchip.com> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean Call mmc_of_parse at probe time to fetch all the host properties from the DT. Signed-off-by: Eugen Hristev Reviewed-by: Peng Fan --- drivers/mmc/atmel_sdhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index c67b065061..f56ae63bc2 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -89,6 +89,10 @@ static int atmel_sdhci_probe(struct udevice *dev) if (ret) return ret; + ret = mmc_of_parse(dev, &plat->cfg); + if (ret) + return ret; + host->max_clk = max_clk; host->mmc = &plat->mmc; host->mmc->dev = dev;