From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980804460146.58173910584162; Wed, 25 Oct 2017 18:20:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 902352034CF8F; Wed, 25 Oct 2017 18:16:17 -0700 (PDT) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CF30F2034A7B8 for ; Wed, 25 Oct 2017 18:16:14 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id 75so1949663lfx.1 for ; Wed, 25 Oct 2017 18:20:00 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.19.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:19:57 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7MAtV9Y3dbCdLDNBKC5bUfr3HpBLZDupJWyLmeBN+IQ=; b=iKJodbxmF96R1uuMJF8mj5Bi/wYpfOUNKzjg/6Y4A/2cuacNFjwvWlowORARrjuCOR JRWd6pkGDoI8QlyonaIxfPKOa0WEbUMG5sSLoUWruuKZGPZi1or0Y7ar+szU+EzxAaUW POfWET0yn1+rR5seFt7OuOsKXSTaqOtyFtYHgiL1VfP1ks2K06S7n+EkJ1Y2cKEL2syi g2m3XGnwqKYEATisw7rcK+p9v3JvDPv5aSbh/jbK0NXxGmwNaDr2UcQoK67iQKF8Jx1y 683/D6bdyyQrEBP7v/zFl48vGJ4KXVzGo9EgfGZtgABL8nI34uK6nB2hDeQXdD7M9eRq Zy9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7MAtV9Y3dbCdLDNBKC5bUfr3HpBLZDupJWyLmeBN+IQ=; b=QElt4Ey/3imreU0xhGpqPVJkhmIgkLjlJJ1A9Cf2ljInB8UsPGTTBTzw8XccmmCQMS 8kx+J0ki1Qc7HjGdjGgSbzDDxqvX/UimxXGXqnRCGMkj28Xz0vY6W266aaYcXw13xRUN JHm8RTo/9T44ShLKR95dMVrKS/Lc3O9rkrCoLBEEkn33KZrf6rNbN2uPeNWIPEvGmL12 zAxbFnnoSLpu3O9Kw7p+UShvj26+VdgXZgB6sFpU5nbK6UtzcJIdJB2r3aI3OZJb6G5B gL+MHdLS8az8wpo3+hTdU7nEtBeAuu4+Fb74s9lIYOeaI6AYf16p+kY8iRC9B2Q+imvj nXXg== X-Gm-Message-State: AMCzsaXMKDbsW3i/7v09ibudlzAipMRcXo0VlT8EHE9p8+HEM8Uqh+Kf DP2wFPlwnY0MbD5GfmZGiScHmlhggXY= X-Google-Smtp-Source: ABhQp+Sri/jGznZwAhRgnHw1lgfammutO2xThYaeycaQzggMwwGgyDxalQ1sQZLtTL14rHblCBTixA== X-Received: by 10.25.228.129 with SMTP id x1mr6185110lfi.232.1508980798423; Wed, 25 Oct 2017 18:19:58 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:28 +0200 Message-Id: <1508980777-29006-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 01/10] Marvell/Drivers: MvI2cDxe: Abort transaction immediately upon fail X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, David Greeson , neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: David Greeson Although the I2C transaction routines were prepared to return their status, they were never used. This could cause bus lock-up e.g. in case of failing to send a slave address, the data transfer was attempted to be continued anyway. This patch fixes faulty behavior by checking transaction status and stopping it immediately, once the fail is detected. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: David Greeson [Style adjustment and cleanup] Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 34 +++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c b/Platform/Ma= rvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c index d85ee0b..7faf1f7 100755 --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c @@ -565,6 +565,7 @@ MvI2cStartRequest ( UINTN Transmitted; I2C_MASTER_CONTEXT *I2cMasterContext =3D I2C_SC_FROM_MASTER(This); EFI_I2C_OPERATION *Operation; + EFI_STATUS Status =3D EFI_SUCCESS; =20 ASSERT (RequestPacket !=3D NULL); ASSERT (I2cMasterContext !=3D NULL); @@ -574,35 +575,58 @@ MvI2cStartRequest ( ReadMode =3D Operation->Flags & I2C_FLAG_READ; =20 if (Count =3D=3D 0) { - MvI2cStart ( I2cMasterContext, + Status =3D MvI2cStart (I2cMasterContext, (SlaveAddress << 1) | ReadMode, I2C_TRANSFER_TIMEOUT ); } else if (!(Operation->Flags & I2C_FLAG_NORESTART)) { - MvI2cRepeatedStart ( I2cMasterContext, + Status =3D MvI2cRepeatedStart (I2cMasterContext, (SlaveAddress << 1) | ReadMode, I2C_TRANSFER_TIMEOUT ); } =20 + /* I2C transaction was aborted, so stop further transactions */ + if (EFI_ERROR (Status)) { + MvI2cStop (I2cMasterContext); + break; + } + + /* + * If sending the slave address was successful, + * proceed to read or write section. + */ if (ReadMode) { - MvI2cRead ( I2cMasterContext, + Status =3D MvI2cRead (I2cMasterContext, Operation->Buffer, Operation->LengthInBytes, &Transmitted, Count =3D=3D 1, I2C_TRANSFER_TIMEOUT ); + Operation->LengthInBytes =3D Transmitted; } else { - MvI2cWrite ( I2cMasterContext, + Status =3D MvI2cWrite (I2cMasterContext, Operation->Buffer, Operation->LengthInBytes, &Transmitted, I2C_TRANSFER_TIMEOUT ); + Operation->LengthInBytes =3D Transmitted; } + + /* + * The I2C read or write transaction failed. + * Stop the I2C transaction. + */ + if (EFI_ERROR (Status)) { + MvI2cStop (I2cMasterContext); + break; + } + + /* Check if there is any more data to be sent */ if (Count =3D=3D RequestPacket->OperationCount - 1) { - MvI2cStop ( I2cMasterContext ); + MvI2cStop (I2cMasterContext); } } =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150898080710566.61726164463005; Wed, 25 Oct 2017 18:20:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D0E5B2034CF9C; Wed, 25 Oct 2017 18:16:17 -0700 (PDT) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 04CA12034CF85 for ; Wed, 25 Oct 2017 18:16:15 -0700 (PDT) Received: by mail-lf0-x241.google.com with SMTP id w21so1936706lfc.6 for ; Wed, 25 Oct 2017 18:20:01 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.19.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:19:59 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::241; helo=mail-lf0-x241.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=neItHWEozlAbutULwk5Bmm8kNH6fXnfKEqO94bUc5cA=; b=JZvU/L/TYnXJXXBShTDkwgq+ElvHLXaM90EOT+0E2nJFrqqj476osw/eFDujhdoNrs nxEvLKjWQlSAaiTz6vq6zCbXhSzLLXLYzItV4WxEAR+vZ25WQjCIf9fTkod33BnGziud 6J6CLvn9J/HihXhTS913qVPZV8qyF3yHJEDVkaZhs3uxvIEtDz7ML7cQF6eGi8UvpCxk 1mcvEpGU9xeBUHXnLNznWhBG/bALAdaXSWcgW2y5h8iDQ+fKeTHO8NzCjOJbo9nGpC/H yXR0LtQdBXNtoWjGGDkXAtcQRMO/C8jiHOJrVDnk7XaIrQpCvlg6yweVv6Lfc/SDKtDO QLgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=neItHWEozlAbutULwk5Bmm8kNH6fXnfKEqO94bUc5cA=; b=G6fXpJd4oWalvoulsYSVhS3pZpYCcfvOPuEFXiOzTS6OXU7Rn54RJ1gqTrtsIiHLxA /EVmlxnvXTWpq1oZ0f0g37Z1lIma+e1fhIsEPVs1ByThUhNI3/Gm6zJiV8ibWjdoc+XQ xAquHUagVwxjWUFibIm15m9W/miGoyiZ7tzKRtlv146sGkhlkz8qXRs124gRHt0JYR5e XMqIytBbxV1ucxSEz68+KV/UEaP5+72oSfpW7DR15rpbt0Pw3DmUt9IcuS/sW52tWiN8 WDANUU7THReREWDmfKL6frCTF/BT6euofWg19gqCgJVtHY6lMw/3x5rjq05RNnedeQo+ 3fXg== X-Gm-Message-State: AMCzsaUoLq4k5w1ZnBmA+BqJ4XsMtDTXchX9mfYoZxM0LK/qHuyItilu tcMLS1wXPuCYOTXGHMH2zX246Uvgcg8= X-Google-Smtp-Source: ABhQp+RvbmQtFvoCVFJ/zUB1vW9cB3QRJ9WgafIoRmdYVk9dUCGKy9zQJFkLe0xecLDSrZiU5ms7EQ== X-Received: by 10.25.0.216 with SMTP id 207mr7661314lfa.242.1508980799761; Wed, 25 Oct 2017 18:19:59 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:29 +0200 Message-Id: <1508980777-29006-3-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 02/10] Marvell/Drivers: MvI2cDxe: Fix returning status in MvI2cStartRequest X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In MvI2cStartRequest the status was assigned to the variable without dereferencing a pointer. Fix it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c b/Platform/Ma= rvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c index 7faf1f7..8ed96f0 100755 --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c @@ -631,7 +631,7 @@ MvI2cStartRequest ( } =20 if (I2cStatus !=3D NULL) - I2cStatus =3D EFI_SUCCESS; + *I2cStatus =3D Status; if (Event !=3D NULL) gBS->SignalEvent(Event); return EFI_SUCCESS; --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980810029519.7776433341949; Wed, 25 Oct 2017 18:20:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1F09C203525E5; Wed, 25 Oct 2017 18:16:21 -0700 (PDT) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 551EB2034CF8D for ; Wed, 25 Oct 2017 18:16:17 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id a2so1904462lfh.11 for ; Wed, 25 Oct 2017 18:20:02 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.19.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:00 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::243; helo=mail-lf0-x243.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4Y4ZOSBmbKvqIxtzHc0XgQzM7/ggPK172m5cmX9ogj4=; b=xfxaJmVSQS9caPIKM3ZZKrhNCZzUqhywnoia8nKLNSgD8cPnHlPPR+Fi8QgLbHjmdm I/Ota6OjBl3Bf0D9OMCVQb0c1kqiIxrqxKeiwL3gDJNy3M0Qjk0U+4XzuvbmsXubT2rj O5WZWE+8rDJ8j/jZuL++7jL6I5YZ+LT3M2R+tz4dRAny4jJFUr4EHMhE/yTBhugbP/J4 2geITv48oQlVJHBniabKnQhGxrD4YjvSsZGTR2A++nMKU1xsZZMlkt5pZ7wAo1VSlFHR ypFQFmA13CgJdkGkE0vL1HdEzKw8ZTRmmhG2GX8pG/idTKKW2uLz+1MQaoOS0ElJcy2n 5CJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4Y4ZOSBmbKvqIxtzHc0XgQzM7/ggPK172m5cmX9ogj4=; b=daE8Js5lvJULxUjN6yvO5TDMSMRgWjtSBCy1XAfSQv2pMCu5xguUzwSpI59rwlvxpV WttDPPNxi9agqeS4eoQ2PumRJZrH1Ar7JBlnSGkUuqdtWtKxRftBYfDsQjL6TYkAbtjg m0RJi5nGLaCnhCO84Vs/WlD0SFXvezBVNLlRnaiDI0KeZU7bn60vHOhrlOCGPo/aTY3q fdnwDk6I75Z4JlggNmugjAjjLPIKDbgfPyuf0rMsr5kDxiOTVaOs3Kfx9+GoQtXIT601 9VeowG8SQp1VHFgx8wX4i17o1swzAqsMl92mcUrZ9ua4ihxf0UWvhJz73x1LbtGUFv+o 8f7w== X-Gm-Message-State: AMCzsaXFmb1YNeScp7r9/iAK792TFphSZOhDh8AXDJMbywYWXc0Sjmi3 0fiby1gxwWZ2ougk7pvd6RjfSSOCmiI= X-Google-Smtp-Source: ABhQp+TPuOs11sx/7gfXR0e3ameK7WB0W/Kbns/Y8k99MPwmlDyCwhmKk8e9PfvhKeXj/InzeaM9Ww== X-Received: by 10.25.160.211 with SMTP id j202mr6323177lfe.218.1508980801013; Wed, 25 Oct 2017 18:20:01 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:30 +0200 Message-Id: <1508980777-29006-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 03/10] Marvell/Drivers: MvI2cDxe: Reduce bus occupation time X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, David Greeson , neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: David Greeson During each transaction start, clearing the I2C_CONTROL_FLAG was surrounded by 3 uncoditional stalls. This was not necessary, so replace them with one busy-wait loop, whose polling count could be also safely reduced. Above improvements result in faster transfer initialization and allow to reduce the I2C bus occupation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: David Greeson Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm --- Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 6 +----- Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c b/Platform/Ma= rvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c index 8ed96f0..3c26d18 100755 --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c @@ -243,9 +243,8 @@ MvI2cClearIflg ( IN I2C_MASTER_CONTEXT *I2cMasterContext ) { - gBS->Stall(I2C_OPERATION_TIMEOUT); + MvI2cPollCtrl (I2cMasterContext, I2C_OPERATION_TIMEOUT, I2C_CONTROL_IFLG= ); MvI2cControlClear(I2cMasterContext, I2C_CONTROL_IFLG); - gBS->Stall(I2C_OPERATION_TIMEOUT); } =20 /* Timeout is given in us */ @@ -295,9 +294,6 @@ MvI2cLockedStart ( MvI2cClearIflg(I2cMasterContext); } =20 - /* Without this delay we Timeout checking IFLG if the Timeout is 0 */ - gBS->Stall(I2C_OPERATION_TIMEOUT); - if (MvI2cPollCtrl(I2cMasterContext, Timeout, I2C_CONTROL_IFLG)) { DEBUG((DEBUG_ERROR, "MvI2cDxe: Timeout sending %sSTART condition\n", Mask =3D=3D I2C_STATUS_START ? "" : "repeated ")); diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h b/Platform/Ma= rvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h index 028fd54..3c9beaf 100644 --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h @@ -68,7 +68,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA= GE. =20 #define I2C_SOFT_RESET 0x1c #define I2C_TRANSFER_TIMEOUT 10000 -#define I2C_OPERATION_TIMEOUT 1000 +#define I2C_OPERATION_TIMEOUT 100 =20 #define I2C_UNKNOWN 0x0 #define I2C_SLOW 0x1 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150898081334064.96155160971693; Wed, 25 Oct 2017 18:20:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 58F19203525E7; Wed, 25 Oct 2017 18:16:21 -0700 (PDT) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B01A2034CF8C for ; Wed, 25 Oct 2017 18:16:18 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id p184so1905720lfe.12 for ; Wed, 25 Oct 2017 18:20:04 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:01 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::243; helo=mail-lf0-x243.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2532Svcu8NwMIdeSTM4lYZ6egIbyQgwtAcJXuH2JBps=; b=A+PzelRSw1RH+RIGPp9kg+wQVOSp+Hb/RwdMvqAzzAEZqlJrjZymN4sW0q+fK+6Jyr z6tFS/Iw/eygf2mvzG5p74SUr3iQsQeAzEXmq0+t0jGrQ9PC/CSj4ARpsiheBFcsJBI7 CYe/3XDOMn3g5a0iyQFC6H7GT6CtosXPUdUTre/Kj9QeHO0tz4DYrJyvcor3O9o6wYO/ YCGXZ4YpV54syLYIrfsneShUPBBbQQvSXTePThMjWnkavzjmYeimwAV8g4f4jcFvmZ7Z 95qr3sSIl9ZhQVPDO7MId3IWWqQeUm8RxkmduNve5o9RfwxhUitpUFETtB1QrO1dnJHQ vPCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2532Svcu8NwMIdeSTM4lYZ6egIbyQgwtAcJXuH2JBps=; b=GYCOhvtxh+UZQL9OyMcEsIkMnl81jilXl65GiwoXJ4vkr0SDGv3lZPjIgmeigdCvUG KP2X5rdaM87EC8aMWOBuUS0topyzKsz1fMDQyDVoBiMhfRHT9/IOVFoujdU6jNgdeXaL AeL7HdOKxKUNPE8bpjCqJjiVSMStqV+PVv3ehOQr+z9TrzLbmafCXp50P7Dagd4krU2j xOCQl5RCFcrpW8tM64+ass201gSfqAx1oBwUUQ9qkWODvW1TmHYDOAzdDFqCXA1kKezC irIHCvVjDjI+I9xnwVTYG9dxZw0Jaahj9FGyf4jIflzNf7QTfhu6W2PIwygbjgbzWzSv 6ESA== X-Gm-Message-State: AMCzsaXr4wRbtPUt9O2dzLvZwb1cTmCF4ThVTbfx0ualn+FdfoWO84j7 2ZV68LWTFmc8xJRWR1IP+kIjCZkmIrA= X-Google-Smtp-Source: ABhQp+Re/He0y3GtbPukPahwz+yj2om/z+KcAWRxCmg4eXTlzdWKDoVUVnAMGe9JQuBO/uDAuXRLgA== X-Received: by 10.25.29.199 with SMTP id d190mr5299224lfd.47.1508980802302; Wed, 25 Oct 2017 18:20:02 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:31 +0200 Message-Id: <1508980777-29006-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 04/10] Marvell/Library: MppLib: Prevent overwriting PCD values X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, Joe Zhou , ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Joe Zhou After enabling dynamic PCDs, it is possible to reconfigure MPP during platform initialization. It occurred that due to a faulty way of passing temporary values, information obtained from PCDs was overwritten. This patch fixes the issue, which on the occasion simplifies PcdToMppRegs function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Joe Zhou Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm --- Platform/Marvell/Library/MppLib/MppLib.c | 21 ++++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Platform/Marvell/Library/MppLib/MppLib.c b/Platform/Marvell/Li= brary/MppLib/MppLib.c index c09acf9..383c820 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.c +++ b/Platform/Marvell/Library/MppLib/MppLib.c @@ -74,7 +74,7 @@ STATIC VOID SetRegisterValue ( UINT8 RegCount, - UINT8 **MppRegPcd, + UINT8 MppRegPcd[][MPP_PINS_PER_REG], UINTN BaseAddr, BOOLEAN ReverseFlag ) @@ -99,10 +99,10 @@ STATIC UINT8 PcdToMppRegs ( UINTN PinCount, - UINT8 **MppRegPcd + UINT8 **MppRegPcd, + UINT8 MppRegPcdTmp[][MPP_PINS_PER_REG] ) { - UINT8 MppRegPcdTmp[MPP_MAX_REGS][MPP_PINS_PER_REG]; UINT8 PcdGroupCount, MppRegCount; UINTN i, j, k, l; =20 @@ -125,14 +125,7 @@ PcdToMppRegs ( for (j =3D 0; j < PCD_PINS_PER_GROUP; j++) { k =3D (PCD_PINS_PER_GROUP * i + j) / MPP_PINS_PER_REG; l =3D (PCD_PINS_PER_GROUP * i + j) % MPP_PINS_PER_REG; - MppRegPcdTmp[k][l] =3D MppRegPcd[i][j]; - } - } - - /* Update input table */ - for (i =3D 0; i < MppRegCount; i++) { - for (j =3D 0; j < MPP_PINS_PER_REG; j++) { - MppRegPcd[i][j] =3D MppRegPcdTmp[i][j]; + MppRegPcdTmp[k][l] =3D (UINT8)MppRegPcd[i][j]; } } =20 @@ -191,6 +184,7 @@ MppInitialize ( BOOLEAN ReverseFlag[MAX_CHIPS]; UINT8 *MppRegPcd[MAX_CHIPS][MPP_MAX_REGS]; UINT32 i, ChipCount; + UINT8 TmpMppValue[MPP_MAX_REGS][MPP_PINS_PER_REG]; =20 ChipCount =3D PcdGet32 (PcdMppChipCount); =20 @@ -203,8 +197,9 @@ MppInitialize ( for (i =3D 0; i < MAX_CHIPS; i++) { if (i =3D=3D ChipCount) break; - RegCount =3D PcdToMppRegs (PinCount[i], MppRegPcd[i]); - SetRegisterValue (RegCount, MppRegPcd[i], BaseAddr[i], ReverseFlag[i]); + + RegCount =3D PcdToMppRegs (PinCount[i], MppRegPcd[i], TmpMppValue); + SetRegisterValue (RegCount, TmpMppValue, BaseAddr[i], ReverseFlag[i]); =20 /* * eMMC PHY IP has its own MPP configuration. --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980816517199.16673551240626; Wed, 25 Oct 2017 18:20:16 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8E361203525E9; Wed, 25 Oct 2017 18:16:21 -0700 (PDT) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9FD3A2034A7B8 for ; Wed, 25 Oct 2017 18:16:19 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id l23so1914951lfk.10 for ; Wed, 25 Oct 2017 18:20:05 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:02 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PGSMb6osvv878jP+7KCx5d73pHqnezDsF/JTd4nmtJQ=; b=dLsGOSd7C5MzbYsBacIUhcE+a+nJcG/OUZYvVAkkS0LG0xy2s+4nZuHBbO9y6dm1ds oU4p/gtH4IFsef9pIGg4ORS0MbRAPAkNMvLR1Msd3ur8c5aCpgj3FGBlCvLrc4hbWxlH yAh8A4L4xLbOXcfz4lKVOkttuTl1ZMrsFw4IUlRn8r7vB0mMkfae8Vm1VpQtfyZiL6LY ngH0nAihvFKoWo/b3YnYPQCU1oKnlFuqytcDSmca/D3doG4HZ3Y5Y/gWG6k9GRSP3qBV PtyU90anWBNMK+o4UfBMvbTJLMpT/R5dXdRCYOHwuDzUNQvKC7AI7ucnUH5Z/wxzSZhT kK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PGSMb6osvv878jP+7KCx5d73pHqnezDsF/JTd4nmtJQ=; b=HEUzCUGN22iK5Ugxw2TtXCrS3MJkKieFmSv/mBekbJ45mwbEeAiIjNEOGS2Wk5UDCE 4bb4lR5nrF3T7RThJv/7eWhdNs3ebe9bLzNlLqVo9xb8n5H+IG6JuQfkh0MBolKAtScG sl2Lop85vHDyZbgGYlQ069OGBu77N8pD91wZiKcA+K3gZiLDD94iw2E/R/JQHMWuEylY zxodk+N+M/P1EuTWv6Ma2SdZoKDzfBn3YvCeS0obhJIas10Ng+4EXDbjUr2lvZIK6+zs xC5VhMPMeV6OQ8f3Lvvpisd8tz5L+VUYp2MEve/5Ty7TbsqccUCCTswJmvA1eF1fAy5V 2BGg== X-Gm-Message-State: AMCzsaU89r8FgVI1Ms/wONUraiI1jVOrKDTbA2mRS8td7YlhZ5WA88rc uS4WMRFv4QeCS6bjsFvBBRS0dGfRXw4= X-Google-Smtp-Source: ABhQp+RskT/FlorSeHcE1aZ3vCpycvj5M0LDRCfjJhvMbaGo7vy1uWsiiqYeVJZ/udM0i5jfFSvKxw== X-Received: by 10.25.89.206 with SMTP id n197mr7104024lfb.96.1508980803475; Wed, 25 Oct 2017 18:20:03 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:32 +0200 Message-Id: <1508980777-29006-6-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 05/10] Marvell/Library: MppLib: Disable the stack protector X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel MppLib may be used very early (in SEC), at which point stack protection measures are more likely to cause harm than help, given that not even the UART has been configured to the point where we can complain usefully. So just disable it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm --- Platform/Marvell/Library/MppLib/MppLib.inf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Platform/Marvell/Library/MppLib/MppLib.inf b/Platform/Marvell/= Library/MppLib/MppLib.inf index 2de9cd0..1268542 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.inf +++ b/Platform/Marvell/Library/MppLib/MppLib.inf @@ -106,3 +106,6 @@ gMarvellTokenSpaceGuid.PcdChip3MppSel7 =20 gMarvellTokenSpaceGuid.PcdPciESdhci + +[BuildOptions] + *_*_*_CC_FLAGS =3D -fno-stack-protector --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980819768254.8115945868533; Wed, 25 Oct 2017 18:20:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C5A15203525EE; Wed, 25 Oct 2017 18:16:23 -0700 (PDT) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 097EE2034CF85 for ; Wed, 25 Oct 2017 18:16:20 -0700 (PDT) Received: by mail-lf0-x244.google.com with SMTP id a16so1955037lfk.0 for ; Wed, 25 Oct 2017 18:20:06 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::244; helo=mail-lf0-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IbWJkKgQEEoKEyONm2oA23Q1NdAKtg79W2BuT3BphZU=; b=LBDo0wthF0ASo1+V10FN2h5VZMZbuA8FIdcIzdsrPZZhBUSpG0upFEbqPfe3X2cuZF tINaOIN37OOI5cmbRtyBMyHCyYQ8a0u/vTG2sy48to8bOPnGuHWdTxAtnQ3PSY3xJ49n 055MrV5D0yfUvAjrmtvAfEEM6efoJOgOg9Z0P2QnBTxLu9+zgRqHuYCqWyjM1G1Js+6K N0KLnSG8tn/BrUprap/ewC2pfIA6p+ZX1yFAf8NU8sR3JKRSs9mdl3oXqBg4BEa+LqrK g0/lvsEDYTLqGEcdWgxWufggofv2PN/gTo4H13rr+/ou1I5C5vhotS87abAiPdMyHG4g mZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IbWJkKgQEEoKEyONm2oA23Q1NdAKtg79W2BuT3BphZU=; b=glKn2XnB9npFGHc7d1zZRK6aGlqKd28CzQGDvqmKkzXPHWzZwZFWXese0/9SqHggWH czFGhYhsDRIj+lvXtdkcL3a+jYsRRcyeqx8OAwrja6udRosX8NE6XULZKL0KoDyF5yGY Rfvpdhxso/ZucnbH5qk69jcQ/HtMT8KspwYTFIFzn2QMAY4ZlJx6OowrCU4oqiG/a8nZ voW3msdu9wMlmxrwzcfEGk4iDv9GH6knHI0055d2a/m32SA54XnETpV42eB22QYIb+Uo u3SGfJmTWnYPrfvDx1e5F/YghS71xin1EfqzAA/fNbboOW+lMz1Ezk5C1//GCxPrpfNN Xeag== X-Gm-Message-State: AMCzsaU8FO0kTR8S5fC5eC0wHirkwvRtTC8Df9lAbxUdKUavoHpiqJLS SsXH7ho1g713x1Adpgjtfdn9vMjbstY= X-Google-Smtp-Source: ABhQp+TxZnDGg0Eblm7K+h2zB4K8zmQpbWKqdpMMREzRTWlv6ahUkonnKmoOWSoiQPS4jHlvDMrNcA== X-Received: by 10.25.22.28 with SMTP id m28mr7634963lfi.185.1508980804694; Wed, 25 Oct 2017 18:20:04 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:33 +0200 Message-Id: <1508980777-29006-7-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 06/10] Marvell/Library: MppLib: Take 0xFF placeholders into account X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel The MppSel definition PCDs contain 0xFF placeholders for values that should be left untouched. MppLib needs to be taught how to take those into account. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Signed-off-by: Marcin Wojtas --- Platform/Marvell/Library/MppLib/MppLib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Platform/Marvell/Library/MppLib/MppLib.c b/Platform/Marvell/Li= brary/MppLib/MppLib.c index 383c820..9e42f08 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.c +++ b/Platform/Marvell/Library/MppLib/MppLib.c @@ -79,18 +79,22 @@ SetRegisterValue ( BOOLEAN ReverseFlag ) { - UINT32 i, j, CtrlVal; + UINT32 i, j, CtrlVal, CtrlMask; INTN Sign; =20 Sign =3D ReverseFlag ? -1 : 1; =20 for (i =3D 0; i < RegCount; i++) { CtrlVal =3D 0; + CtrlMask =3D 0; for (j =3D 0; j < MPP_PINS_PER_REG; j++) { - CtrlVal |=3D MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, - MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign]); + if (MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign] !=3D 0xff) { + CtrlVal |=3D MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, + MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign]); + CtrlMask |=3D MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, 0xf); + } } - MmioWrite32 (BaseAddr + 4 * i * Sign, CtrlVal); + MmioAndThenOr32 (BaseAddr + 4 * i * Sign, ~CtrlMask, CtrlVal); } } =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980822680528.1296020408251; Wed, 25 Oct 2017 18:20:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0598F203525F0; Wed, 25 Oct 2017 18:16:24 -0700 (PDT) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 236AC21DFA7B6 for ; Wed, 25 Oct 2017 18:16:22 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id l23so1915010lfk.10 for ; Wed, 25 Oct 2017 18:20:07 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:05 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::243; helo=mail-lf0-x243.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3mPSqlNxgOd1dpHoCgXyNLpO4BrLpBiRGWCgceYs/3U=; b=ALmQDL3MdcXPQ8HR8QsLIWxeVyA5SpYTCSDAf6XL+mXzUdcDVAx/b+x5/KCVaJZw8q wr7/5/aCaRgSwDhjQ7maHICblo9BBPWX7+WyTzMjdKbW2cwHhJTsTnw7XnnuqS7NXgJ7 hQLYvEaaojhDS7Th+bKknUL4luWdthYf7544JgBNkwbUDF95qkAYp87nl3O6BUBvmsJj xXeZPLmhRxzL+Js7S/CjcddROiTgnzNNradgLPEwlWxxhlcX60MgcRacfiUHAJ+J7qJO 1hqtlOFdcx8DYXqpmdOrhdBWroyrs/3ljTRWUdNZX9gQbsiNc5o9lblO9okoFjqqdzSc jHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3mPSqlNxgOd1dpHoCgXyNLpO4BrLpBiRGWCgceYs/3U=; b=jZXDxcNXGlcaKjDLs1DJhETKGu5v3vAeHUP706WpIOgUH8pYn38vW1zOJs+U1/phAm 3lT0xZjS2ou5XN5Fz2lvikZgBMFxWpH4w4LEcOiS+ra5VWkD5Xkj9DwX4mHEtvMlt+mw MbW0uKYn3U9bxFQMmLA30y4KTmkzD1lSpkTs/GfvWx/WoQIit9oj3oTzXg5jOk2URmGp 50cKjfCeB/16KgGOSkQakqEQd/AmudnmjoWIAZ7/LUob99NmOH54dik5tl7X7vwYY8xN R1Cf0aphKzzm63Sf3njP898/MK4MysnIygi1towWd9n6eh2wVh0F+qRwPYcK+LutJ26o 5nBg== X-Gm-Message-State: AMCzsaV2ztzEkUIfmEBNg28BzC5BAGO5NPrn+9f4/gFFbL0wjgNduqGt swfLIe0MD7IiF/VMH/Y0nCIO1FXwpys= X-Google-Smtp-Source: ABhQp+QUJc56HJ0chDtQ6w0XLNtRSmJBABPKXGHRCAAfOCn1NU7mbx4ws7luF1osQm94vn10VvRfrg== X-Received: by 10.25.221.29 with SMTP id u29mr7260276lfg.182.1508980805884; Wed, 25 Oct 2017 18:20:05 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:34 +0200 Message-Id: <1508980777-29006-8-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 07/10] Marvell/Drivers: Pp2Dxe: Change settings for the always-up link X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently initial forcing link status happened for all ports, not only marked as 'always-up'. Although this didn't actually matter for the MAC settings, because MAC is automatically updated with PHY HW polling feature of the controller, perform mv_gop110_fl_cfg only when the appropriate flag is true. Also in such case, force the link as up, using a new library routine. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c | 31 ++++++++++++++++++++ Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h | 7 +++++ Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 6 +++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c b/Platform/Marv= ell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c index 53154db..e3ddc58 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.c @@ -4804,6 +4804,37 @@ MvGop110PortEventsMask ( return 0; } =20 +/* + * Sets "Force Link Pass" and "Do Not Force Link Fail" bits. + * This function should only be called when the port is disabled. + */ +VOID +MvGop110GmacForceLinkModeSet( + IN PP2DXE_PORT *Port, + IN BOOLEAN ForceLinkUp, + IN BOOLEAN ForceLinkDown) +{ + UINT32 RegVal; + + /* Can't force link pass and link fail at the same time */ + if ((ForceLinkUp) && (ForceLinkDown)) + return; + + RegVal =3D MvGop110GmacRead (Port, MVPP2_PORT_AUTO_NEG_CFG_REG); + + if (ForceLinkUp) + RegVal |=3D MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_UP_MASK; + else + RegVal &=3D ~MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_UP_MASK; + + if (ForceLinkDown) + RegVal |=3D MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_DOWN_MASK; + else + RegVal &=3D ~MVPP2_PORT_AUTO_NEG_CFG_FORCE_LINK_DOWN_MASK; + + MvGop110GmacWrite (Port, MVPP2_PORT_AUTO_NEG_CFG_REG, RegVal); +} + INT32 MvGop110FlCfg ( IN PP2DXE_PORT *Port diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h b/Platform/Marv= ell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h index a7011f7..2938777 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Mvpp2Lib.h @@ -504,6 +504,13 @@ MvGop110XlgPortLinkEventMask ( IN PP2DXE_PORT *Port ); =20 +VOID +MvGop110GmacForceLinkModeSet ( + IN PP2DXE_PORT *Port, + IN BOOLEAN ForceLinkUp, + IN BOOLEAN ForceLinkDown + ); + INT32 MvGop110FlCfg ( IN PP2DXE_PORT *Port diff --git a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Platform/Marvel= l/Drivers/Net/Pp2Dxe/Pp2Dxe.c index 2827976..94a2988 100644 --- a/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c +++ b/Platform/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c @@ -1310,7 +1310,11 @@ Pp2DxeInitialiseController ( NetCompConfig |=3D MvpPp2xGop110NetcCfgCreate(&Pp2Context->Port); =20 MvGop110PortInit(&Pp2Context->Port); - MvGop110FlCfg(&Pp2Context->Port); + + if (Pp2Context->Port.AlwaysUp =3D=3D TRUE) { + MvGop110GmacForceLinkModeSet (&Pp2Context->Port, TRUE, FALSE); + MvGop110FlCfg (&Pp2Context->Port); + } =20 Status =3D gBS->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES, --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980825925568.007767287004; Wed, 25 Oct 2017 18:20:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 40162203525EC; Wed, 25 Oct 2017 18:16:27 -0700 (PDT) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 94B7A2034A7B8 for ; Wed, 25 Oct 2017 18:16:23 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id a132so1935559lfa.7 for ; Wed, 25 Oct 2017 18:20:09 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:06 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3DHn9wfHWWniH2mHxORiQBkDFflX+kf7T1qL+mNO/Fk=; b=mhDP3r7UIz7JSRnd+bvFaOOPS84eZ9D//fXZbnyxz9/YAbSPSg2me0m8zmf4GosUjB GEe3iqi1S6Ej0DE8ufXlMEhIyEKygkfQNYwsZKz/bXUD5ecNEFbft//XpiFOvlAzw1hm JsFXb7mqFMT3m8x4ooABtcdZOrigKiZn5uswo/nXqikO0N9t1oO/L5nZ1D0qROE7glTj uRXn5SRoGatKiH71hJ4bCuvlkuW9bhNGGGuDQaHT/ZktAe90z0NDiq4p9OJHH4inmkeT aw3MWeEljORMq8f9V5ltmNJuKQ4A6S/3MIk5it/GFAta1QHrGAJA2hzNANg2DrIeh92C WIjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3DHn9wfHWWniH2mHxORiQBkDFflX+kf7T1qL+mNO/Fk=; b=cZiRqZfYfs7uFmY2bef8NgK4rL738BC42i4eMvTlCVGylc35AHhf4wpx6uUFREoRF2 4y5B+vnLzUVSvTCoMv/wKRdsnxVd1FQTf9ADyQk5TlRy51APBLRfIiCZHZwFUMc1OZP6 qbWl/b/f2ncd8bWBf+eOkM3nYNzVl5w7qK073I0YnIlLUQFqkbZzJmbzvdwZnOBmpLWO 0iP6RYHAMr3pRMW4AOPXpmXI22BWdJdi2WL2i9HbmR7NpsqMzdZpcXVH2V9jp4maq9eW LYUIZ1q3YqcmCXeS4Sk+kmb0gLenEnzVaaZDgX+Ojzq1hZaEqaibMbjspPVwWjmzNe2U pYsg== X-Gm-Message-State: AMCzsaXCfToeD5Ey38c35eQhegJYrU/eD23deq4t/4Ec6bAyDzI6wohy +z8nBHVVM8WQyR2w3to6UXlZZg/kQ6c= X-Google-Smtp-Source: ABhQp+TMJBpgMQwLslCQuF8bi12EwUCEVgYlBqmJeos03T2heI8H6ISeaVprXqrYtl4bx3Mo62LW6w== X-Received: by 10.25.225.144 with SMTP id l16mr7862585lfk.53.1508980807344; Wed, 25 Oct 2017 18:20:07 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:35 +0200 Message-Id: <1508980777-29006-9-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 08/10] Marvell/Drivers: XenonDxe: Fix UHS signalling mode setting X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes incorrect settings for UHS mode in SD_MMC_HC_HOST_CTRL2 register. This field should be set to 0x4 for DDR52 0x2 for SDR50 0x1 for SDR25 0x0 for others. This way EmmcSwitchToHighSpeed function is on par with Linux set_uhs_signaling routine in the Xenon driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c b/Platfor= m/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c index 3f73194..4d4833f 100755 --- a/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c +++ b/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c @@ -772,6 +772,8 @@ EmmcSwitchToHighSpeed ( if (IsDdr) { HostCtrl2 =3D BIT2; } else if (ClockFreq =3D=3D 52) { + HostCtrl2 =3D BIT1; + } else if (ClockFreq =3D=3D 26) { HostCtrl2 =3D BIT0; } else { HostCtrl2 =3D 0; --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980828879900.1068688745928; Wed, 25 Oct 2017 18:20:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 75650203525F3; Wed, 25 Oct 2017 18:16:27 -0700 (PDT) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 275B52034CF8C for ; Wed, 25 Oct 2017 18:16:25 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id g70so1940880lfl.3 for ; Wed, 25 Oct 2017 18:20:10 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:07 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MGckb2m6lPxbCuQdM1slIPel35gTqteWDvbWhUgZDR4=; b=0DaOALR4FFTzs+GIjfgcV5R1GCia+Qrsp2fYQTt/SD6p1d54XqPjU64Naopu0DVYEb 8kL1JaWkI3lE5iamw7v2JVxeV49o4mxQlsXwZHQHfqU1iD4If9Ex6eYZyBr2F05sS85r 2imxCLnZxSNl8uefFSYOvF+7H0XkZK/XzkgQrUWiFK/mIYFnngifxKZcpB3inef03YoM Ph31OQ6WwD3QwNes/ic2UdXZXZ7O95RhvOrBx8oa7O8IhGcbDY0ynXjCO7RYPCKY1qPl DNzdFRrlVpGlI5mKslpFs266Z95iV7dkFuMN71P4O+UK9GZkVf5P72EGZ9ln2yy+4jkM UIEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MGckb2m6lPxbCuQdM1slIPel35gTqteWDvbWhUgZDR4=; b=Ig9IKq+fygeOVJ4iwkx/fC7y7uDPctm9SPZv8LBd2Y7bX14w4isagoIMbyPqRZyT8v tjct5S8DEt+dngh17HawtHpVUhAd3gSa8XgEj/OUQhdspVUC1N128+ilYSSAtTr0vd4X QMFU+yRiq5SSfw3IHEZM1ympDzMstvbW+Bt0hzrLDHjmcyR4rjkHODIbYywClGALwG4z dW4suafuHA2168qU8jbYxu1Fd9sjXWk/ztakvZJf6rfQiwm0EUW9ZTt375L96cnSdmq0 ZCpsZKRrlYxi7wS3VsXk/0211ATVsaPKH7rmu5audq2ENzE7oIFWqT2pdcKQPhPLRni8 XHxQ== X-Gm-Message-State: AMCzsaUe1h4YV2XQVn1Ax81oNUCYrInBLhrJs+Xf07CYjZZ7O0DiG62F 7DTbk7tDuSZe4tICb3jpBpfoYqs6Exk= X-Google-Smtp-Source: ABhQp+TeNHm4beifMGrA5fqwu1i3sy+cS0VRKhGcmPos7+tWh4GutCuhu/VNanLTJ1jbktGSZ/LD5w== X-Received: by 10.25.148.216 with SMTP id o85mr7266715lfk.190.1508980808811; Wed, 25 Oct 2017 18:20:08 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:36 +0200 Message-Id: <1508980777-29006-10-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 09/10] Marvell/Drivers: XenonDxe: Fix base clock frequency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Incorrectly the clock divisor was calculated relatively to 255MHz instead of actual 400MHz. Fix this. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.c b/Platfo= rm/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.c index ccbf355..0b9328b 100644 --- a/Platform/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.c +++ b/Platform/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.c @@ -16,6 +16,7 @@ **/ =20 #include "SdMmcPciHcDxe.h" +#include "XenonSdhci.h" =20 /** Dump the content of SD/MMC host controller's Capability Register. @@ -703,9 +704,8 @@ SdMmcHcClockSupply ( // // Calculate a divisor for SD clock frequency // - ASSERT (Capability.BaseClkFreq !=3D 0); =20 - BaseClkFreq =3D Capability.BaseClkFreq; + BaseClkFreq =3D XENON_MMC_MAX_CLK / 1000 / 1000; if (ClockFreq =3D=3D 0) { return EFI_INVALID_PARAMETER; } --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 14:13:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508980831768965.9199287637018; Wed, 25 Oct 2017 18:20:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A93CF203525E4; Wed, 25 Oct 2017 18:16:30 -0700 (PDT) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3AB872034CF8C for ; Wed, 25 Oct 2017 18:16:26 -0700 (PDT) Received: by mail-lf0-x241.google.com with SMTP id 90so1911569lfs.13 for ; Wed, 25 Oct 2017 18:20:11 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:09 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::241; helo=mail-lf0-x241.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=su8EVPW+PVySzpBE/RQBDhevNsuQL9eBl4d1g2nHt/8=; b=p7tc8uayo2sVwyJhOM8cZlWqvsowzga8UH781YZhuBzKXjoTNhyje3L4ldNS3ky+HK o+uFDBaoh7HXOY2ULdmZRRzjyfZfCqWg7IrcBEPuhQUaNT7E49MXZ9vY1ChAPOZFr3dc pPKiWXr58DzSmJd4xeeGJHe1hN2rjV5Hi1Zanw5PFxhbV70KRTHFZmyUc9iLrjJrieFF fDNgQKRI3ys2jn+CHC2k2KRtOS3xBtYyTmy2e5hF5jB4hUdc728gNiXJLIhvJxfnNZ1A DhT4+nEthcwprnCUO6eoPr/hpfeuotyiQtEyyOevTs8qRU2qHPd37CT3yWrKX4IE8HNB NE9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=su8EVPW+PVySzpBE/RQBDhevNsuQL9eBl4d1g2nHt/8=; b=Dee5wfr5oFyPexMNYCpbyxS0lsIkxMW5TcIvQ794F3NyxMN96Ua2VkbEfzECVPPZ11 5UYPJ0BQsAPTuCqgKLJVC5m+zCaJFtkyQsuM8o0gWS0JiHBBO0Xpq0rC3LYwzDs7r30s NNEbhY4pmO+hxJwGsdYRR0ubxXyJ8UBVCQtEQ44+7kzxkSHGoQ3CbA7vLofXFO5B8d/l 4JK7EXnEIlYDa2FC7mgqmr2ZX/JXamJi7YlnwuF+Flgr2bHG5g6v8x+mjUba/uQ+tR9c YRXd/3+tTsRT1zqFmUmccY7zWvqr+2xvcUn+uSiraXm4E6UlICd49/Dr6z+pIHSOzdCe FSvQ== X-Gm-Message-State: AMCzsaWdx4KwTacGCjsnqfhcTtp0HyhhV7HhbUfgdG0dU2THnw4wnPSC 3Saz7WfHnmIUBYYAL5w+ts9wd5846qI= X-Google-Smtp-Source: ABhQp+QpZ/Bkc6jDGzyGW8/MUgwMZGB+gpvIklkAoSzLmsFQk7Cj3EmTSAPVM9uOJADdGtV+rXkm1Q== X-Received: by 10.25.202.82 with SMTP id h18mr7919870lfj.54.1508980810031; Wed, 25 Oct 2017 18:20:10 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:37 +0200 Message-Id: <1508980777-29006-11-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 10/10] Marvell/Drivers: XenonDxe: Do not modify FIFO default values X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Changing controller's FIFO default values is not necessary and possibly can cause instabilities, when using some devices. Disable the modification and rely on initial settings. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm --- Platform/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Platform/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c b/Platfor= m/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c index 31f207e..6bbe5bc 100755 --- a/Platform/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c +++ b/Platform/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c @@ -44,20 +44,6 @@ XenonReadVersion ( SdMmcHcRwMmio (PciIo, SD_BAR_INDEX, SD_MMC_HC_CTRL_VER, TRUE, SDHC_REG_S= IZE_2B, ControllerVersion); } =20 -STATIC -VOID -XenonSetFifo ( - IN EFI_PCI_IO_PROTOCOL *PciIo - ) -{ - UINTN Data; - - // Set FIFO_RTC, FIFO_WTC, FIFO_CS and FIFO_PDLVMC - Data =3D SDHC_SLOT_FIFO_DEFAULT_CONFIG; - - SdMmcHcRwMmio (PciIo, SD_BAR_INDEX, SDHC_SLOT_FIFO_CTRL, FALSE, SDHC_REG= _SIZE_4B, &Data); -} - // Auto Clock Gating STATIC VOID @@ -634,8 +620,6 @@ XenonInit ( // Read XENON version XenonReadVersion (PciIo, &Private->ControllerVersion); =20 - XenonSetFifo (PciIo); - // Disable auto clock generator XenonSetAcg (PciIo, FALSE); =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel