From patchwork Fri Dec 29 17:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122944 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4916947qgn; Fri, 29 Dec 2017 09:04:58 -0800 (PST) X-Google-Smtp-Source: ACJfBouEBEFNYgHsGPOX2femdinc37IYhfvE1oIgz/9AZgbdAWe3LRovszIXaVUQUhWrIWLIx5hM X-Received: by 10.80.171.131 with SMTP id u3mr25193753edc.111.1514567097967; Fri, 29 Dec 2017 09:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514567097; cv=none; d=google.com; s=arc-20160816; b=L4pcoUuBawSQVz1wcb+ARe5G8bpeKYQVYIiYGcVXIol1Fw0Ob+Pc5ZLHW7LoCyZYyl QdL3U2I7/5Q2B+SCi6jgryopqMh/ygsEcADaIHsYwITAYAAosjUEgsmRon/i25gnLXJ8 4YVHO2Mx+rftYQCLhRYbDyvJFz5qeDO0I+2GR8aXnWJXt8QMHYpsjOvS26NsLTKsAOhc pQwhJx4cOSLykNwPiFWHur3XdLSnSetqb1sUuVaNhMljX05LDENQR5nFJ/qmNQ5ja/WY 5aUnxnUYQbt3YGRVWHvcT8XvTIU/tufk4+Hy2UglGwaSPe/szv6vqeiWe/LtO0fFujQW GpcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=FDZBYUTASwbL24MRyUW2UB85WoiMzZfuz30rWA8wZoA=; b=wPIl8B3sWLjbPCXcJN4eAp8lWfvsjvtAumtUxTgzNdt7O8V0lhZ+VUdhr9utizYawX AjxYsZ+dvaQHYx18DIi08xX2bnCF+0EE+kBQCN7jWqlGnPmmIj52MStDWCfhmXjQ1wuS GsRgsCqf9pu9IzV0loq1pQoKVkfuSBpgnf553G4A6n+bi0dS2sYrOEmQdFmB7zVBGxec DNSrEI9n0N6NMne6FWN3m157dnj2ef9gJEOEPSugy4/+aR6CPfk9Fd5iwUw3KQeedse/ 5jKGyeAo/fLJQ4tVhg/ATa1DgHE2tT2NpoatVX20HSBdTKpcwiey0KdrTzRRaCyMgJDX vhYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=MFvl5cwa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 48si4291463edz.287.2017.12.29.09.04.57; Fri, 29 Dec 2017 09:04:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=MFvl5cwa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 6168FC21DEF; Fri, 29 Dec 2017 17:03:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AA5E4C21E0E; Fri, 29 Dec 2017 17:01:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 96D53C21DA9; Fri, 29 Dec 2017 17:00:54 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 5481FC21E18 for ; Fri, 29 Dec 2017 17:00:49 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9I000541; Sat, 30 Dec 2017 02:00:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9I000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566825; bh=jOB2AIwdGOMa62l/m8m7pdXJyO1MaMQOxHNWCb88DwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MFvl5cwaLVo6hJmqiNcvihmVLaBQRN/5WeqDfLU1tQ/56gI56cFrbB0HXFOYDDCrw IamPPj6IkDNGz/l6YUlQfGwJ1uz2lCFkX27BmuzZ1YOAigDdaD7wDT1043bXpKzV2q sKWL1/eldjnkEPjUF2hgPPLKsoeum5tlWQmd5UMCD1I21z0wlIhD2FIYA09y+FWqaC P/IWHfj1+V+knXOd6njDtG8hb7n5yGo2Wr00dAiQ/5DREO9xYQBxD7r38NkI7aCKpF QCwPW7b0ov7NsaPNLUVmZtZlFkv0nY8gkV+NFhP9bfGYp+NfC1sUp8vFORVmhYQ9OB 5M+f16XzKq0uA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:05 +0900 Message-Id: <1514566812-16781-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 1/8] dm: add dev_read_u32() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" dev_read_u32_default() always returns something even when the property is missing. So, it is impossible to do nothing in the case. One solution is to use ofnode_read_u32() instead, but adding dev_read_u32() will be helpful. BTW, Linux has an equvalent function, device_property_read_u32(); it is clearer that it reads a property. I cannot understand the behavior of dev_read_u32() from its name. Signed-off-by: Masahiro Yamada --- BTW, I do not understand why we want *_default helpers. It is pretty easy to do equivalent without _default. priv->val = default; /* default in case property is missing */ dev_read_u32(dev, "foo-property", &priv->val); On the other hand, if we want to do nothing for missing property, we will end up with clumsy code. /* we do not want to overwrite priv->val if property is missing */ if (dev_read_bool(dev, "foo-property") { /* default value '0' will not be used anyway */ priv->val = dev_read_u32_default(dev, "foo-property", 0); } One more BTW, it was just painful to write equivalent code twice for CONFIG_DM_DEV_READ_INLINE. drivers/core/read.c | 5 +++++ include/dm/read.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/core/read.c b/drivers/core/read.c index 5d440ce..e027041 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -10,6 +10,11 @@ #include #include +int dev_read_u32(struct udevice *dev, const char *propname, u32 *outp) +{ + return ofnode_read_u32(dev_ofnode(dev), propname, outp); +} + int dev_read_u32_default(struct udevice *dev, const char *propname, int def) { return ofnode_read_u32_default(dev_ofnode(dev), propname, def); diff --git a/include/dm/read.h b/include/dm/read.h index 8114037..5cacec8 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -46,6 +46,16 @@ static inline bool dev_of_valid(struct udevice *dev) #ifndef CONFIG_DM_DEV_READ_INLINE /** + * dev_read_u32() - read a 32-bit integer from a device's DT property + * + * @dev: device to read DT property from + * @propname: name of the property to read from + * @outp: place to put value (if found) + * @return 0 if OK, -ve on error + */ +int dev_read_u32(struct udevice *dev, const char *propname, u32 *outp); + +/** * dev_read_u32_default() - read a 32-bit integer from a device's DT property * * @dev: device to read DT property from @@ -412,6 +422,12 @@ int dev_read_resource_byname(struct udevice *dev, const char *name, #else /* CONFIG_DM_DEV_READ_INLINE is enabled */ +static inline int dev_read_u32(struct udevice *dev, + const char *propname, u32 *outp) +{ + return ofnode_read_u32(dev_ofnode(dev), propname, outp); +} + static inline int dev_read_u32_default(struct udevice *dev, const char *propname, int def) { From patchwork Fri Dec 29 17:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122940 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4911309qgn; Fri, 29 Dec 2017 09:00:47 -0800 (PST) X-Google-Smtp-Source: ACJfBouBndxtOSbjOUaZCsI88zGuCJJ0I6tSpQQkqG8gDeIFYp5GJ8cBgRljKk/dC3QmnEQ5SFv7 X-Received: by 10.80.135.182 with SMTP id a51mr44405749eda.98.1514566847155; Fri, 29 Dec 2017 09:00:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514566847; cv=none; d=google.com; s=arc-20160816; b=b7nl1Yj2g44zKovdapmu+fG5U449zlhaPIEo3e3h2s6tq95gFXCSbaVQV8LBweXaNY WZTFoNLcxO391G7oUzb3bJpBHQbUL5JSf3v3qPA4J5YN/fMF4L8XbbYrASBkWqoHBXPQ SqoX+zpzzxTVCNsXddY1pqy8RDehiMsJKEtd6nFEHcTBwcIynTQ/SaKTa7m0CKqk1gn8 553Erlpm2mqO5NHciFtW4Bt5CkY4xfzTShU+FsfFgUfQ5AI7LrfI6oyAHWtWkoH97VN+ t+Nmf8ClbhPlheHP2HWOgv2GKNNkBnrYj+rf6MqwyqpGd7+W0e4UWq0PkFNSwYhve3It VldQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=wI68akq3V+4dyLGJ4QkzpvGHa7/E3ul9BC1Bde/a/Bk=; b=N2XSeW1GxmI13lnbjOni/2NH+DwITa7mExycdv9nM+cN6U2Ymx4fj4RRHQr5uY/1MJ D6EK3Aw6/carXhTMnSjUEGmVTIpB0qTz1qthKkpV4NyaSbpoM+4beV/j27kI9P9pblVL OfRBtCNBtBkBpjiTHW0oxX7v5xt3ul42n/Cu+SjLgDaYTAptSvQEzDDoxo1qRrzUbnZb 7eTUB+lREsSyVmXvJAhDjKCSKSZ1SKoipPGZ4Q49fva5eH7EFxw76pdqt5TheoVBxFRf Zx8FWhP1SzXvDtZz/CAZC0dUoB0ESddYjxN/r8KgdsMXSpnKyZGL4Ut8Dt00yUdYNZTc QfZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=17yYXSZQ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r17si1534293edl.492.2017.12.29.09.00.46; Fri, 29 Dec 2017 09:00:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=17yYXSZQ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 26D68C21DB2; Fri, 29 Dec 2017 17:00:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E8D1CC21C59; Fri, 29 Dec 2017 17:00:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 241E1C21DA3; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 26671C21C59 for ; Fri, 29 Dec 2017 17:00:37 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9J000541; Sat, 30 Dec 2017 02:00:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9J000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566826; bh=SZmK4XZtKFaqOTZhuf7rImc97Bw+LjX5UM8N3PuQUWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=17yYXSZQDbGUPDl5aeUIxtqW/QV5+Fvf4pLaKdM7uk1N28cNQw3xSKRVnUr3LV83B a9sdKQ+tl6u10zJPColh+ncftD2miptCTg6hd2aIZe7xhgyPN2haBjdGh/7grOGFEB 7LSTn1fGQNKWbKLL3dgCSUTKRlWdtw0sqURmkoft0NiWab1DzvSNIHT8Lvl3Mmecd6 jhNdc1tDhgcZFn2ptUasckqhfkukMcKeD+e7d08ClM5zA0WCl5WBidlfnt0F/HxK7W yo2bHLEKJKFVyM9UzNDxaGlhy44Ja2FwgqG8ceIh4K3qGnzsnKDYP+LuISJd7j9DZY HmYRmjAgZqIZg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:06 +0900 Message-Id: <1514566812-16781-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 2/8] mmc: do not overwrite cfg->f_max if "max-frequency" if missing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" mmc_of_parse() in U-Boot is a pussy helper; it sets cfg->f_max to 52MHz even if DT does not provide "max-frequency" at all. This can overwrite cfg->f_max that may have been set to a reasonable default. As the DT binding says, "max-frequency" is an optional property. Do nothing if DT does not specify it. This is the behavior of mmc_of_parse() in Linux. Signed-off-by: Masahiro Yamada --- drivers/mmc/mmc-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 793196b..37ce922 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -146,7 +146,8 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg) break; } - cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000); + /* f_max is obtained from the optional "max-frequency" property */ + dev_read_u32(dev, "max-frequency", &cfg->f_max); if (dev_read_bool(dev, "cap-sd-highspeed")) cfg->host_caps |= MMC_CAP(SD_HS); From patchwork Fri Dec 29 17:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122941 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4912469qgn; Fri, 29 Dec 2017 09:01:31 -0800 (PST) X-Google-Smtp-Source: ACJfBouLioWoXRVsOtfdjXwBiXD3Wy78bWK4O9nzJRXQ8qK8HIqnPnDa/Vk0MjUtvB60x1K6dpfz X-Received: by 10.80.145.3 with SMTP id e3mr45518969eda.273.1514566891507; Fri, 29 Dec 2017 09:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514566891; cv=none; d=google.com; s=arc-20160816; b=e/wHBpM3Jk9egVuYi9I4yo+LrjXU1j6/vYxsYThhB5Fl0PsQvBCQWmUGpXI7Ei5tDo DZ9uYT3bO/EOzQgcaMBzlk1PDWHUOBqr04hwPRDdK9V5PyBlhvi9WMwmjtdGzmZKykdZ f46pCeYRNqzhqWziuhQFxZ/W56+y8XzjaqLypsYBf0qeMsSYkv0YhoHJUyIrDt7uc0KR rlc/LSuulCJUNR+NlcqDhYEVqXBVI78pO7EzkMldO6+k957r6UzNyjil1JyvF7hNRsx0 J5R6z2hJs3zDQ/O0oHQApTyl55iaMxqvg9NWQySbyYoVqyR0S69KvtK6G7saDyr9Nw/M H4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=w9tdKzFQ5SejdNioZ3Z1UIqzDbo4D2X/GCcWHfVWrIU=; b=bojNafAt8uqkEL/mfjrLUhPHb2gGemOd1p2jaTKgX6athFe/GQVRo2jgSAg66qZNkg 3lpw+o1FLKxpK6iriETVZuP6MRiR8QUyypSpmH44/RuyLNUHUthPNfotZhKisUlhWP90 I5m85UhEM+npePtX+uUJu1safzOcf0O8lra4B33gcnBY/JObf2kO7a9r2+1oa1deiN7x erlAm6dlotUkpLrDiguMHPmLyiv3r4xPdqDuGi+SliQpA5eKiHsGvUhfdgorzy2MkAZ5 XaDLYfZFJyEc99dfypY0HfjxIMuL2bUWjER17Vn8kLMxwHSP1FF/xdzgC0q2YJUMxAr0 2rZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=i3b3xn5r; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a27si1326509edd.542.2017.12.29.09.01.31; Fri, 29 Dec 2017 09:01:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=i3b3xn5r; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id ECCAEC21D5D; Fri, 29 Dec 2017 17:01:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9EA22C21DB5; Fri, 29 Dec 2017 17:00:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2E5CAC21C34; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 1E5B9C21C34 for ; Fri, 29 Dec 2017 17:00:37 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9K000541; Sat, 30 Dec 2017 02:00:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9K000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566826; bh=M+9IU5mWr1Du45nw+3Wt+z7yVkYMwbAqxMA3fZ1sWbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i3b3xn5rYU6nFMbU+vtRR18hq7ExQ1wMxLczVmU0bUmkRpO6iWrtSdCoqhRS5YLDD QwKvkx7/L/UqWyi+uEALZZy1p6MyD1+0vz/8LmOSItxFDJ+pvQUydxd9jEhIDLDNsl hlBEMuQrgf7Espp0oZudStddHsldK7EDa3VeZ9azM0Af5SNQ7TUL8oj5pYlspEF13k bhF7qmCftQc5/eXFJxDX3hgtidXWpAUuf3B5E6wotfukMNdbU/wBBIrPtcvEcW3Hwh bt9I0UdXV9ejHXVUxd/IGrfd+bmiANVnQS7ezAJ6/bdbJJ5KFrpgJ1XmTSSG81APom SC0VwIpGJYOIQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:07 +0900 Message-Id: <1514566812-16781-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 3/8] mmc: let mmc_of_parse() fail for insane bus-width value X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" You must fix your DT if it specifies insane bus-width, for example, bus-width = <3>; debug() is not displayed in usual configuration, so people will not even notice weirdness. Use dev_err() instead, then let it fail. Signed-off-by: Masahiro Yamada --- drivers/mmc/mmc-uclass.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 37ce922..44c36dc 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -140,10 +140,8 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg) cfg->host_caps |= MMC_MODE_1BIT; break; default: - debug("warning: %s invalid bus-width property. using 1-bit\n", - dev_read_name(dev)); - cfg->host_caps |= MMC_MODE_1BIT; - break; + dev_err(dev, "Invalid \"bus-width\" value %u!\n", val); + return -EINVAL; } /* f_max is obtained from the optional "max-frequency" property */ From patchwork Fri Dec 29 17:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122946 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4917576qgn; Fri, 29 Dec 2017 09:05:29 -0800 (PST) X-Google-Smtp-Source: ACJfBosbjN8O7JOjNO0S+LWQfHVb0ggmA8EM6WWQ5m0aoCPpPxRRPkSjY8ayAnQRdi1KHW00Iv9h X-Received: by 10.80.139.180 with SMTP id m49mr47414484edm.36.1514567129513; Fri, 29 Dec 2017 09:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514567129; cv=none; d=google.com; s=arc-20160816; b=enhGmr4O0+SHH6CghJD4IH99E2eXHZVM1R49Dje4EqF1u5xv48J+ebl8IIkgqe4eO1 QZF4g7XzGKujek1D+K3XXz4xKqu3ZIb9yAnqnZ5GXwNc3Hy9X8DXdvuZKzOUWdJWywK5 E8oYGkHYwhVGsALl5n+vjPOlYxpJweJP5uctX/JK2rVlhOSlRBfG4/iRt2mtDTtFfuPU v3AjQkcsp58pl7qnFLUxRBEEa4Sy3yiPxtNq1tHZrRsy2KDOmIbrirI+HmtT2rNgk/sB mfQClE6CDCuaeXvAr1+Cejin4Rmn9sW2XL5P56wggnccH/+se8M+RxzRkCBHwJp1QPDR uwNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=Qt7aCNwhM/uGvT0ShFatktoa5sxWFzkhPBs3X/H1w0Q=; b=w2z6Y8Fwc00lnrVj9KrFVsGVqSCGplySBPtNQRsYNyxK5P8jZoHUTTHiJaoiCpfNg/ NVZ47KN8fYCJzxaTrxGQoz65Nfuk12cgK/qV3h8TnMwELEx3DMXt7ythJ69OmRgZePiA uPCoMkawfYeDr4Ptcj1L6YH+8ouOPDlSH90slpIXuyU5vFBmS7hIhao3+Q70YUhjwBxU AzTdNZgbMTFZhkiwcFuZ9BmRiGD/Shvmpw9wCTZUhopc9Npf6K91lFM1K6kYhQ8cmh82 7CtjXrX3VMlMaWUWR2pgZLIkwrsbonmCToKyZ0RshzNXyFowyulD0Rhguvzl2YH8hWLF NH6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=O3uWL45A; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a27si1331151edd.542.2017.12.29.09.05.29; Fri, 29 Dec 2017 09:05:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=O3uWL45A; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 11F82C21E08; Fri, 29 Dec 2017 17:02:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8FCF8C21DCE; Fri, 29 Dec 2017 17:00:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 920A8C21D5D; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 4B832C21DA0 for ; Fri, 29 Dec 2017 17:00:38 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9L000541; Sat, 30 Dec 2017 02:00:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9L000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566826; bh=ZBd90A87bHiCk263Q3i3a/GHUsTZZgSzb9+yxESXn3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3uWL45Ajk60epq1lj96NjpS0Xh2x2Tmj/4rErZYyRBJb+YwG3GUVriBPVQrrZSAU WCv2SIpHABo14DFSTZjCJqC4F/Tw4v4g1T9tXEX0rDIpQZg8dAO4/+VLkGlfYBWqbL 4atQiEcQbbfKTR79AM6GydyyhaFPMqgMm8AedThLH0LI7w+fRzXPmepFKnabsU73fR +vjTjMFw66aDC0xpatfz6OiDpZaClXDWHvp/JZvP2jQZRLC9Gg3ExBo4KOMTSygRLE HCy0/oCnFWO0msBcPkkZN9gLSZ52fDQTZdN6fgdq0i75nkKxJTF3bRFmzehzH27Mdl k5s8QPZv9JyPw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:08 +0900 Message-Id: <1514566812-16781-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 4/8] mmc: sdhci: do not overwrite host_caps in sdhci_setup_cfg() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This line overwrites host_cap that has been set by drivers and/or helpers like mmc_of_parse(). Accumulate capabilities flags. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index e2ddf5d..243e0e5 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -594,7 +594,7 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE) cfg->voltages |= host->voltages; - cfg->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT; + cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT; /* Since Host Controller Version3.0 */ if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { From patchwork Fri Dec 29 17:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122943 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4915245qgn; Fri, 29 Dec 2017 09:03:29 -0800 (PST) X-Google-Smtp-Source: ACJfBouPgsWdO78dmFT6L1W5yMITE989ORVP7c3TCzF+W2UR/1E+YtPNFs2i4awOGM+wqXzd7gLS X-Received: by 10.80.180.205 with SMTP id x13mr46541664edd.205.1514567009394; Fri, 29 Dec 2017 09:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514567009; cv=none; d=google.com; s=arc-20160816; b=A3UpD0CPKMBNZ6N5GZeOEUw+4rXl/87ST/SFbOoO/MDE1t8IbyHzjy261F3cWHB8ZZ lLXmDgRHZ19caKDZr3tOSSws4AtUIgL/BKd2AOV5GYaZsF/LKFnlw2W/ISvbrVm9hbko kQm/okKQLEk/0QpcqylNKovzPuEkss+3+7kEk6v5qlI/k5OOXCc7t/cBcxB8iVimZgNR v8/UGuFJmVHzXCOuwAK60ILXDNjBsEQMvb8/x/EltUOL5PpXgW3/uzaaRS6NEL6v7kec qoKzPugU6wN42e85+Y9btJ1zuoqZP5luU6X3HL9asKnRBWljyUIe20iOlFVKPCVnj7Ls hUFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=GrReHSzHoDcootGqtVNQKLh2fj/uH5rhzqonQB4ALRE=; b=ArDsGOvI5cJ4S6jt4bZ1XPiJFMVfJrDuBAUEz5ThJPd3X7Y5zRhk7Cvplo2DhHkX8r vdV6ssRi/FDR+aLqfMIQtJOX3VsWfB0X/wRkJpu4I4dbrGIy6CoYFk+BoqETTqJd6f+/ nQ46G92WGq060TwFpjmO0yD22KtNLZ6TRMI74lwXhVHDCv5kRJKQ7dFaMamFcdWZIOZm sDRGcG+64+BBt7RpXU8i71E2idXh7E4pEp46YSJQow5NB7pCn0sD2q+VU/KBrVcBBA1x ZFYlDnXGoIHTZqnNeM8BuMAiiWrVNhrmXuBMsU+fPYTtkg4cWsAhDhTrx8xnswl9ffhh sT6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=utERpmwg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id h58si621768eda.257.2017.12.29.09.03.29; Fri, 29 Dec 2017 09:03:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=utERpmwg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id E5DB8C21DCA; Fri, 29 Dec 2017 17:01:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9421EC21DE4; Fri, 29 Dec 2017 17:00:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7988BC21C34; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 2B12EC21D56 for ; Fri, 29 Dec 2017 17:00:37 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9M000541; Sat, 30 Dec 2017 02:00:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9M000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566827; bh=U734gI4tDf51x4yeJE8qlIcOfxWYIeYrAayLy49RgI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=utERpmwgpYUute62fw97WF6OHpVMlsQFczdRIeehe7bAcGm8P63BVGbFP1/3ks8WX U9ZdcAaOf2DFMitmJSf+hghSrZg3TKx0VdNbNzc/q3olywrFhak7MbFKuQNR7DCEpE vZSGBtopKELgrEn7J8sCmRePpln5drNpT9rOrAPSECIPMEVegImjTUrAT7FJV7elFx 8WvXaESfLyLhnDRM4xjU/uO1oa65U/54EPMQGuYo12mylJUf/bR/0pQNa1sIMu976o gAF5rZ8IsqQEEOS1pi+RhIAVa3Rpdk41h5IrMkfkbZ1d0znTD8K7BYMZSv41029ORd 1Y4cezFHKWYBQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:09 +0900 Message-Id: <1514566812-16781-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 5/8] mmc: sdhci-cadence: use bitfield access macros for cleanup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This driver is a counterpart from the one in Linux. Follow the clean-up I did in Linux. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci-cadence.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 72d1c64..712b18c 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -19,15 +20,14 @@ #define SDHCI_CDNS_HRS04_ACK BIT(26) #define SDHCI_CDNS_HRS04_RD BIT(25) #define SDHCI_CDNS_HRS04_WR BIT(24) -#define SDHCI_CDNS_HRS04_RDATA_SHIFT 16 -#define SDHCI_CDNS_HRS04_WDATA_SHIFT 8 -#define SDHCI_CDNS_HRS04_ADDR_SHIFT 0 +#define SDHCI_CDNS_HRS04_RDATA GENMASK(23, 16) +#define SDHCI_CDNS_HRS04_WDATA GENMASK(15, 8) +#define SDHCI_CDNS_HRS04_ADDR GENMASK(5, 0) #define SDHCI_CDNS_HRS06 0x18 /* eMMC control */ #define SDHCI_CDNS_HRS06_TUNE_UP BIT(15) -#define SDHCI_CDNS_HRS06_TUNE_SHIFT 8 -#define SDHCI_CDNS_HRS06_TUNE_MASK 0x3f -#define SDHCI_CDNS_HRS06_MODE_MASK 0x7 +#define SDHCI_CDNS_HRS06_TUNE GENMASK(13, 8) +#define SDHCI_CDNS_HRS06_MODE GENMASK(2, 0) #define SDHCI_CDNS_HRS06_MODE_SD 0x0 #define SDHCI_CDNS_HRS06_MODE_MMC_SDR 0x2 #define SDHCI_CDNS_HRS06_MODE_MMC_DDR 0x3 @@ -84,8 +84,8 @@ static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_plat *plat, u32 tmp; int ret; - tmp = (data << SDHCI_CDNS_HRS04_WDATA_SHIFT) | - (addr << SDHCI_CDNS_HRS04_ADDR_SHIFT); + tmp = FIELD_PREP(SDHCI_CDNS_HRS04_WDATA, data) | + FIELD_PREP(SDHCI_CDNS_HRS04_ADDR, addr); writel(tmp, reg); tmp |= SDHCI_CDNS_HRS04_WR; @@ -152,8 +152,8 @@ static void sdhci_cdns_set_control_reg(struct sdhci_host *host) } tmp = readl(plat->hrs_addr + SDHCI_CDNS_HRS06); - tmp &= ~SDHCI_CDNS_HRS06_MODE_MASK; - tmp |= mode; + tmp &= ~SDHCI_CDNS_HRS06_MODE; + tmp |= FIELD_PREP(SDHCI_CDNS_HRS06_MODE, mode); writel(tmp, plat->hrs_addr + SDHCI_CDNS_HRS06); } From patchwork Fri Dec 29 17:00:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122942 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4914987qgn; Fri, 29 Dec 2017 09:03:18 -0800 (PST) X-Google-Smtp-Source: ACJfBotsAJWlQr65pHK0LLKoTpUP4U4yOF4rojWFRXR6hfyzngkEj3nWYfl3dZBFqDZjOdsC79g9 X-Received: by 10.80.219.11 with SMTP id o11mr45843425edk.259.1514566998375; Fri, 29 Dec 2017 09:03:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514566998; cv=none; d=google.com; s=arc-20160816; b=E/lBA+QGOk6wfrP6reWSW6wQu2jV0r0HH7pWMi/7p8cg34hVh44hvfigW7HZTfm3nX hZ2enpMb4d5ib5MQ7vger9K4S0NqoiLVGBGDGUt3N4YbA20f7OlxYDZ4+c1OCdd8LKGN bgZY/dkcf4Gqe1ZKmVo17Vc+xyR6JsFnLB5Xutu3olvflyX9ZkkS9Lg4+72XMtuvj/KB Fl260eLrfl790eeIcQaFv8JQCt9+GEcWAWMgaKp93qw5DWFoe5PdI39WE9kWfksrLPnk P7LJv2R4cKLFOuW8pd//nQmZ+UPMrOFzezoCPW/eg1J15bgZaFF3gYXYAK+czGB0XfZF 63sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=x9W7Og0xAeOdTOczSycSbkJOuvF4RsGuINgEPxD+l98=; b=K4/Kme7pG9K8FFxIPWiExxVwXs46H+i2WEi7KP+2kDA9pAAF5DW8JxH2ZNJPju4NpI M01ObinqC2vBGOQEFcO8hy3DQhv8WqnlSmDAGZk/zbONIO9kpF0Nn55gTBlWKVryGIhH IoVXCJCqVTujcb5sVs8kJeZ5FJ7dHnm/hb1b70zv1P/9cws3mG+cKqPleGi8sBfc1WC6 1XaOYusjQfqAblwKDLZehXLClwY50VjsknrUd/I1V5iLfCzcUkM+FU5fC4dIR8I8P+01 nF6r8sjQSvPgeUJ3niqyaZc9WMvnZQ6X/fOUb10+BTIM5upYHrTi+A9xN6qKJAgZX9I0 pOow== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=b2ThMmfM; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p6si919278edd.133.2017.12.29.09.03.18; Fri, 29 Dec 2017 09:03:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=b2ThMmfM; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id BC0DBC21DAB; Fri, 29 Dec 2017 17:01:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 42067C21DF4; Fri, 29 Dec 2017 17:00:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 84B8AC21D56; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 496B3C21D5D for ; Fri, 29 Dec 2017 17:00:38 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9N000541; Sat, 30 Dec 2017 02:00:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9N000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566827; bh=12xQHC8hICxO4qcOyqXf5v7SGsLdcR9l99ICm+LF774=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b2ThMmfMVODpyOlCRDulG+vYV4fRNb3VKgq6W9knBKnhUEFfziY2cgoMu6V5Pk4tM qXFNT1DVPmMB6+pRX3mPsEbPRj2G9VUqkI3Fl2vcocFfz6x8TWAcydu/c3wqRc/paX 0n0ZnIgvuUhXA/GPUMucc6T8GMGdf4fTeyN+STF+NqVIIUEfzBs6YbmAXzk5EPk8Uw dc72Tn4OrHL5iR2c2BVPMW+LB8jXyb51KDQO+gDFYfXQG68JifkVVRVkqzkFCnhSz/ T86RMeRBaB7Kb2x+cDKFvINxAq/GQucfoewysdDBkukUfN+IQC22W2zPqGTY+WeRu/ SN0enRht5Qg5g== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:10 +0900 Message-Id: <1514566812-16781-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 6/8] mmc: sdhci-cadence: call mmc_of_parse() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This is needed to parse more capabilities such as mmc-hs200-1_8v. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci-cadence.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 712b18c..921095b 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -190,6 +190,10 @@ static int sdhci_cdns_probe(struct udevice *dev) host->ops = &sdhci_cdns_ops; host->quirks |= SDHCI_QUIRK_WAIT_SEND_CMD; + ret = mmc_of_parse(dev, &plat->cfg); + if (ret) + return ret; + ret = sdhci_cdns_phy_init(plat, gd->fdt_blob, dev_of_offset(dev)); if (ret) return ret; From patchwork Fri Dec 29 17:00:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122948 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4919004qgn; Fri, 29 Dec 2017 09:06:42 -0800 (PST) X-Google-Smtp-Source: ACJfBotwzZxp4t4LAougIhTr1F8IdPSc4oFE3DnR/ESRJr8wBFz+egmmXT2oQHBWE+137GGV+YCn X-Received: by 10.80.164.87 with SMTP id v23mr44590855edb.99.1514567202857; Fri, 29 Dec 2017 09:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514567202; cv=none; d=google.com; s=arc-20160816; b=RfItupT5qx0o8I0V+FREOeaYg4tvcQDOhbAMoGN08f3tZmZSb0wMyLLDxHqd0rQ2f9 VrKUdygb01fijcaY5ukD/9u/QHAnp02UWHhZi642+JnjuHZyPKqC9AG32mhtcGvdjoAu Cc6/MwUsKBkWUKJZc6thFvy9qHG8KTUxTNKkR/YmYQqXIB+msr4Is/4NRgX8VHuDvuAA O2LbzrQH0nGzYHJ5lZL6O0Bs8xEhXc5AweQ8pTL6w19bwjUtwVwVX7WLrGVHWeSrVB6V 6p7I/Zn9vQWOjdpr56zupHVDlm8sabOVYHIBwhZT0KsVQiadyZJ5MvnKf8HgzNp+gIbf 4rIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=Zin3cxkcliu7CC/Fi2a8RtHP4rkQsYLVIlyL40DDrmc=; b=ig2DMjQZHScgaZIo4H36VkRtC69jIJQGBZNcC3JqW+3FT+lY/uU0eLp5EIq6XtBy7o k6+zXWfOYUkaaQKrqa+Q8IaJpjH6ViKfAI/Vtazuz39E1t29SUthYhhrQ9zfl3rkbJKR 9uEqk2JhYUGyU5lujhg3igZsaKLVSOAbPoIm/v2wz7rq/q9DARU2Z6yNM1fCfvZ5BzfP IpIPbKmshgnzn5WoVlfqFY1Cj3VorMoiXq9j7cNlzy/p9m0b+JD/dM1Q/nGMb+3mFMn3 XaWXMq02JAEdO35KZqDczx/UYe/kGRaSHX2HTYUbJAWHM1WwHTXv6gaMCLJZBOlGAGl4 1XAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=L5wLpYaF; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id g9si8745859edi.196.2017.12.29.09.06.42; Fri, 29 Dec 2017 09:06:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=L5wLpYaF; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 76EBCC21DD9; Fri, 29 Dec 2017 17:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 280D2C21E09; Fri, 29 Dec 2017 17:00:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A87D1C21C59; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 4B180C21D9F for ; Fri, 29 Dec 2017 17:00:38 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9O000541; Sat, 30 Dec 2017 02:00:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9O000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566828; bh=THeOiAUMlQIRObCnwKYKVMnD4AnYwEwG6vwvJwAG0b0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5wLpYaF2Olc7Dz4d4vW7yy6Ps6nG6K2c+Mb8ZvkR7Eo3jwoPRYscr9hokkjsb+6Q OlezlD4Zm2gSLTF7lzEXSakBv2ol8JmlB0iFLpjEksn7BWjDsIPVSv98GZAqS+aCiL hmwJIlEutjLxgjq/GpWAvf4lcyfjINqppIWtCdyO/keWe0kAX6IzyZwNYSZmWFFrEj v1dyVDi5a03a6+O/YNHxc47VG48GPgMuSnUMNSm+kUe1ZeDUJj/n7kkqHPvfp1OQoG V/SK/U60n3mWkVmJHVzBHH5rr3+34CUGiFlrZL9xt/oP3ryywWe5YfFoEif9o9193Y whxKVpT3XH3Sw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:11 +0900 Message-Id: <1514566812-16781-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 7/8] mmc: sdhci-cadence: add HS200 support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add HS200 timing setting and the MMC tuning callback. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci-cadence.c | 87 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 921095b..8658126 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -52,6 +52,13 @@ #define SDHCI_CDNS_PHY_DLY_HSMMC 0x0c #define SDHCI_CDNS_PHY_DLY_STROBE 0x0d +/* + * The tuned val register is 6 bit-wide, but not the whole of the range is + * available. The range 0-42 seems to be available (then 43 wraps around to 0) + * but I am not quite sure if it is official. Use only 0 to 39 for safety. + */ +#define SDHCI_CDNS_MAX_TUNING_LOOP 40 + struct sdhci_cdns_plat { struct mmc_config cfg; struct mmc mmc; @@ -135,20 +142,18 @@ static void sdhci_cdns_set_control_reg(struct sdhci_host *host) * The mode should be decided by MMC_TIMING_* like Linux, but * U-Boot does not support timing. Use the clock frequency instead. */ - if (clock <= 26000000) + if (clock <= 26000000) { mode = SDHCI_CDNS_HRS06_MODE_SD; /* use this for Legacy */ - else if (clock <= 52000000) { + } else if (clock <= 52000000) { if (mmc->ddr_mode) mode = SDHCI_CDNS_HRS06_MODE_MMC_DDR; else mode = SDHCI_CDNS_HRS06_MODE_MMC_SDR; } else { - /* - * REVISIT: - * The IP supports HS200/HS400, revisit once U-Boot support it - */ - printf("unsupported frequency %d\n", clock); - return; + if (mmc->ddr_mode) + mode = SDHCI_CDNS_HRS06_MODE_MMC_HS400; + else + mode = SDHCI_CDNS_HRS06_MODE_MMC_HS200; } tmp = readl(plat->hrs_addr + SDHCI_CDNS_HRS06); @@ -161,6 +166,68 @@ static const struct sdhci_ops sdhci_cdns_ops = { .set_control_reg = sdhci_cdns_set_control_reg, }; +static int sdhci_cdns_set_tune_val(struct sdhci_cdns_plat *plat, + unsigned int val) +{ + void __iomem *reg = plat->hrs_addr + SDHCI_CDNS_HRS06; + u32 tmp; + + if (WARN_ON(!FIELD_FIT(SDHCI_CDNS_HRS06_TUNE, val))) + return -EINVAL; + + tmp = readl(reg); + tmp &= ~SDHCI_CDNS_HRS06_TUNE; + tmp |= FIELD_PREP(SDHCI_CDNS_HRS06_TUNE, val); + tmp |= SDHCI_CDNS_HRS06_TUNE_UP; + writel(tmp, reg); + + return readl_poll_timeout(reg, tmp, !(tmp & SDHCI_CDNS_HRS06_TUNE_UP), + 1); +} + +static int sdhci_cdns_execute_tuning(struct udevice *dev, unsigned int opcode) +{ + struct sdhci_cdns_plat *plat = dev_get_platdata(dev); + struct mmc *mmc = &plat->mmc; + int cur_streak = 0; + int max_streak = 0; + int end_of_streak = 0; + int i; + + /* + * This handler only implements the eMMC tuning that is specific to + * this controller. The tuning for SD timing should be handled by the + * SDHCI core. + */ + if (!IS_MMC(mmc)) + return -ENOSYS; + + if (WARN_ON(opcode != MMC_CMD_SEND_TUNING_BLOCK_HS200)) + return -EINVAL; + + for (i = 0; i < SDHCI_CDNS_MAX_TUNING_LOOP; i++) { + if (sdhci_cdns_set_tune_val(plat, i) || + mmc_send_tuning(mmc, opcode, NULL)) { /* bad */ + cur_streak = 0; + } else { /* good */ + cur_streak++; + if (cur_streak > max_streak) { + max_streak = cur_streak; + end_of_streak = i; + } + } + } + + if (!max_streak) { + dev_err(dev, "no tuning point found\n"); + return -EIO; + } + + return sdhci_cdns_set_tune_val(plat, end_of_streak - max_streak / 2); +} + +static struct dm_mmc_ops sdhci_cdns_mmc_ops; + static int sdhci_cdns_bind(struct udevice *dev) { struct sdhci_cdns_plat *plat = dev_get_platdata(dev); @@ -189,6 +256,8 @@ static int sdhci_cdns_probe(struct udevice *dev) host->ioaddr = plat->hrs_addr + SDHCI_CDNS_SRS_BASE; host->ops = &sdhci_cdns_ops; host->quirks |= SDHCI_QUIRK_WAIT_SEND_CMD; + sdhci_cdns_mmc_ops = sdhci_ops; + sdhci_cdns_mmc_ops.execute_tuning = sdhci_cdns_execute_tuning; ret = mmc_of_parse(dev, &plat->cfg); if (ret) @@ -223,5 +292,5 @@ U_BOOT_DRIVER(sdhci_cdns) = { .probe = sdhci_cdns_probe, .priv_auto_alloc_size = sizeof(struct sdhci_host), .platdata_auto_alloc_size = sizeof(struct sdhci_cdns_plat), - .ops = &sdhci_ops, + .ops = &sdhci_cdns_mmc_ops, }; From patchwork Fri Dec 29 17:00:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122945 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4917527qgn; Fri, 29 Dec 2017 09:05:27 -0800 (PST) X-Google-Smtp-Source: ACJfBotKi2LchryZbKWhGhYH6SICsvCHC3sMGBWvWeAWKVIe0wFuLPIuXtZF/DO0berrjztaQCnE X-Received: by 10.80.244.202 with SMTP id v10mr45619347edm.91.1514567127321; Fri, 29 Dec 2017 09:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514567127; cv=none; d=google.com; s=arc-20160816; b=zh9Txiq8mSO0yjhZQcKeHFJG+Jetc35ZgFiOyNWXmBdc+u9CDx2HHQ2gC/LyK6QqAW 3ofW56wr+Ulh63FVBpkVS5HFt6cT3pd9hcwefr4IAdZSH0AId17sKiaTo2O7VWFPPO24 m4PGwTd59nFYXOFaiYyN69xLi5PEWdrsfK/Nu8xijMFV9vdXWNgZ4DWSXH8kadmWqych 7TJrOoLmsG7P7SXFWFwXpYm9/wk2qtdI0rE+nNp3LoD+pzU52fGld/2fyCuzvCogzMzi wrsdXA/igqT2Pp2j02eShP3mUt1GTwpg2IG4t6cC08vQe67u6N7E2visGLy8Ft6lrLVv m3rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=j5m7K0Gf0mPedmGbpxH3ERi5MQOguh2NhNLohcIfp7U=; b=DNlEdSB8EB8KGsd3HDLFhRjprkHK4amAKAEWyZK5+2prOD+kylYQ1PZy5o1GblhKKB gnro9pz145+nPDGbADYaYe0kky4fRkpx7B8jgQMh4YbVsCTDKYaNUoOL6nyFX9o9cjy5 3HlzyLoyuOS/EqykL0Ti8uMqzZfGuNIyfeciFK0mVB0Ac4T92G8I8tzlvUBjdUJAiaAB JyiIuVbo1qbx2jpO2VE+TNE0/bMq3XnGXjIpZvKVkkupMpl5YnnB9uQHuN4FHVqACTrv e3av/cA9a8IaqW48vj/gDi+GdmL+3v+lh/sf/aZtz0t2a8AtVEoFaNXbd5qXSfTcdhcy lvjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=2bFcs5lm; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id d36si4374442eda.310.2017.12.29.09.05.27; Fri, 29 Dec 2017 09:05:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=2bFcs5lm; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id E2390C21C59; Fri, 29 Dec 2017 17:01:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 81603C21DDE; Fri, 29 Dec 2017 17:00:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 64EAAC21C59; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 52A5AC21DA2 for ; Fri, 29 Dec 2017 17:00:38 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9P000541; Sat, 30 Dec 2017 02:00:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9P000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566828; bh=BW+zZpu2LxaOj+3SIwmqqP4MS+qllA+OdMGd8n3GpJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2bFcs5lmDoAthxmLgZdW9ChxKs+MNSUya8ewUxoLvIpMklMzvy5G+TJjejgk/wd1g UKmA7topce90k3Wei5KQ4vyMrcmD+Jg2NglCMNKee3PX/He8c6Ef+XNkd0Ale3Ag6p 8kb563JVMPzYBzGzDc0vknYdk4iOMSMfO3oEvDjWOi8N5Jw8okmDgx1Dm08txpkxYW cc6V/xX7rgICNKmz7I5FxuWi1tQUFuR7fdyVmYWtYhUFJKgli6hE68zS8vNl65HpEE VFaKcrcRjmrT6G/vFbw25rGz3AfeikhqhCEywW0oDrkHI9KCAomTVBuFPdxcE0Axfu Nb+dLrVR2ImLA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:12 +0900 Message-Id: <1514566812-16781-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 8/8] mmc: sdhci: change data transfer failure into debug message X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" During the tuning, drivers repeat data transfer, changing timing parameters in the controller hardware. So, the tuning commands (CMD19 for SD, CMD21 for eMMC) fail, and this is not a problem at all. Showing "Error detected..." in normal operation just make users upset. This should not be shown. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 243e0e5..d31793a 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -86,8 +86,8 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data, do { stat = sdhci_readl(host, SDHCI_INT_STATUS); if (stat & SDHCI_INT_ERROR) { - printf("%s: Error detected in status(0x%X)!\n", - __func__, stat); + pr_debug("%s: Error detected in status(0x%X)!\n", + __func__, stat); return -EIO; } if (!transfer_done && (stat & rdy)) {