From patchwork Fri Feb 9 11:09:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 871324 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="GBewlGgp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zdC8F3Dpfz9s71 for ; Fri, 9 Feb 2018 22:12:29 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 36BC0C21DCA; Fri, 9 Feb 2018 11:10:18 +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 B275EC21E35; Fri, 9 Feb 2018 11:10:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 66255C21DE4; Fri, 9 Feb 2018 11:09:55 +0000 (UTC) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by lists.denx.de (Postfix) with ESMTPS id 3037FC21D75 for ; Fri, 9 Feb 2018 11:09:51 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w19B9ZEV025899; Fri, 9 Feb 2018 05:09:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518174575; bh=lltoXrDZ5xeR5UtRp8vlcdKgI1YC7FzSImUKCWpV40M=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GBewlGgpr8D/uEWbsUwSo8kwJmB2LKmayOpc0HkWlJkbbNgwDAXhmuMATakEk/blm pGw1u993RNoA6xZWRlXDX8xElTRgVF/Q7rbUyZGnIOwX43evi0KgjpJD+js7TrIj4u gn+37RtIRqoegsYLtoSSTtlchoFRtd0iOAl2fOeY= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19B9ZD1009898; Fri, 9 Feb 2018 05:09:35 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 9 Feb 2018 05:09:35 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 9 Feb 2018 05:09:35 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19B9YTh004592; Fri, 9 Feb 2018 05:09:34 -0600 From: Jean-Jacques Hiblot To: , Date: Fri, 9 Feb 2018 12:09:27 +0100 Message-ID: <1518174568-12404-2-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518174568-12404-1-git-send-email-jjhiblot@ti.com> References: <1518174568-12404-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Jonathan Gray , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v1 1/2] mmc: Fix bug in sd_set_card_speed() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" After settings the speed of the sd with the switch command, a check is done to make sure that the new speed has been set. The current check has a masking error: speed are encoded on 4 bits only. Fix it by masking the upper bits. This fixes a problem seen with QEmu emulating a vexpress-a15. Reported-by: Jonathan Gray Signed-off-by: Jean-Jacques Hiblot Tested-by: Jonathan Gray --- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 255310a..31614dd 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1333,7 +1333,7 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode) if (err) return err; - if ((__be32_to_cpu(switch_status[4]) >> 24) != speed) + if (((__be32_to_cpu(switch_status[4]) >> 24) & 0xF) != speed) return -ENOTSUPP; return 0; From patchwork Fri Feb 9 11:09:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 871318 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="UXM3MMnM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zdC5W5jjZz9s71 for ; Fri, 9 Feb 2018 22:10:06 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3CE47C21DA5; Fri, 9 Feb 2018 11:09:50 +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 9FC18C21D75; Fri, 9 Feb 2018 11:09:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EFB30C21DA1; Fri, 9 Feb 2018 11:09:43 +0000 (UTC) Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by lists.denx.de (Postfix) with ESMTPS id 1F425C21D75 for ; Fri, 9 Feb 2018 11:09:42 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w19B9atr032196; Fri, 9 Feb 2018 05:09:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518174576; bh=t/+x+31IEtRXnLcs4+beddlzJLXNi0B5zQX/CQqE50U=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UXM3MMnMMtO1yh24MNCsTompdOwMoTT0D1g100b6dY6dHNafXOnSJxXzyE4kSLjfl U+eBbm6LH15KGX63GrB6lgIj3A+xasM++GdGvebfGmYkXjMBtDhfKOojCX7wre5b91 kJvYsROOR7/ZNU7eIwqR4dwlCp2qBL73rA8/fOMk= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19B9aJN013582; Fri, 9 Feb 2018 05:09:36 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 9 Feb 2018 05:09:36 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 9 Feb 2018 05:09:36 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19B9Z1M006495; Fri, 9 Feb 2018 05:09:36 -0600 From: Jean-Jacques Hiblot To: , Date: Fri, 9 Feb 2018 12:09:28 +0100 Message-ID: <1518174568-12404-3-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518174568-12404-1-git-send-email-jjhiblot@ti.com> References: <1518174568-12404-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Kishon Vijay Abraham I , u-boot@lists.denx.de, eil@keba.com Subject: [U-Boot] [PATCH v1 2/2] mmc: fix bug in mmc_startup_v4() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The correspondence between mmc versions as used in u-boot and the version numbers reported in register EXT_CSD_REV is wrong for versions above and including MMC_VERSION_4_41. All those versions were shifted by one: real 4.5 hardware appeared to be MMC_VERSION_5_0. Fix this by adding the missing version in the correspondence table. Reported-by: eil Eilmsteiner Heribert Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass Reviewed-by: Sam Protsenko --- drivers/mmc/mmc.c | 1 + include/mmc.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 31614dd..99e2a75 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1950,6 +1950,7 @@ static int mmc_startup_v4(struct mmc *mmc) MMC_VERSION_4_1, MMC_VERSION_4_2, MMC_VERSION_4_3, + MMC_VERSION_4_4, MMC_VERSION_4_41, MMC_VERSION_4_5, MMC_VERSION_5_0, diff --git a/include/mmc.h b/include/mmc.h index a46eaed..86f885b 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -54,6 +54,7 @@ #define MMC_VERSION_4_1 MAKE_MMC_VERSION(4, 1, 0) #define MMC_VERSION_4_2 MAKE_MMC_VERSION(4, 2, 0) #define MMC_VERSION_4_3 MAKE_MMC_VERSION(4, 3, 0) +#define MMC_VERSION_4_4 MAKE_MMC_VERSION(4, 4, 0) #define MMC_VERSION_4_41 MAKE_MMC_VERSION(4, 4, 1) #define MMC_VERSION_4_5 MAKE_MMC_VERSION(4, 5, 0) #define MMC_VERSION_5_0 MAKE_MMC_VERSION(5, 0, 0)