From nobody Thu May 15 09:15:21 2025 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 1509066889089614.7412022695232; Thu, 26 Oct 2017 18:14:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 54CEB2034A88A; Thu, 26 Oct 2017 18:10:53 -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 9E4032034A882 for ; Thu, 26 Oct 2017 18:10:50 -0700 (PDT) Received: by mail-lf0-x241.google.com with SMTP id a132so5674999lfa.7 for ; Thu, 26 Oct 2017 18:14:37 -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 m9sm1675702ljb.61.2017.10.26.18.14.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Oct 2017 18:14:34 -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=MEQtyXsQqjmj8ow5AzkWa+NyZ/kNRHhP3gpq5lhpC+U=; b=XMAb7ne2uZuztFj4GnHDh6AY72l04xssxoAKTXUYZbB+0AYKiEVe4x+PPmh3KS2KZh G6eErcMaoO8YbRHNWrleeHYLyAL62y2LTTjhYsAmMjNTtmFs5Uz6z5KrcvIeCP0T/eZa SoGmf1IYBLR4/W2L+EuJd6lhuZqpXiHoaHIfBpfo+XgKOqjyx+kU83Ibn4i94VM2c8jW fasj0CDBaw9frX2fpaqxa+5ATqdKeLIfJ887BTmTxEKpEoN5OypefWKsqY0uDsQg0Cva /uzaszARmVF+6y4WFtvMcgcVwThL8bDkiz1XEwTbOUQf4LOqT2OH1GhP25kYw4EfRUf0 oMpA== 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=MEQtyXsQqjmj8ow5AzkWa+NyZ/kNRHhP3gpq5lhpC+U=; b=sXw1eH+yNCJjCgE/Ua+CepX1437c6kzOf43zUvgD7SzExo7mTi5G+62txhPBfnPOiT AdVuDnAWogbVl4q08nlo3P6aQj0ArxBpF3V9Mi//gPSGHe0uE3zJ8igMjxG6XF3gJWBW vqhgOt+sjetyIjU0iVxExDwjFxNyk95+cLtgliesy0G281qrtCqpszx2iK76d9gBCiQ8 8QSIP0JCQjUTvBOCOVB0I49RKTn9Kvkk120PVakF6z1h9M4Usgar2SW+vezUrQZTMH5L uE8ns+t0Ih9oI48fpBbgkPt7E4IzSlC4y6CbSQpK7uT7YxRLm3MerGg9wyGQ5ZlJ4m6v 0cAQ== X-Gm-Message-State: AMCzsaWzv7KCPQXSeR3E73KKs78acyyBreSucDAssvv2KgUBKtAWRF28 ouldbgKRoE9b6H7+SMCPiDc94SEfdAY= X-Google-Smtp-Source: ABhQp+RAEzpXYHQuUMDxRDgH37NOsoAWwmQPMOuFGPCojZsvkSPJBhzONLDASCWdc1eTL5tTxkwiKA== X-Received: by 10.46.46.8 with SMTP id u8mr10353032lju.117.1509066875521; Thu, 26 Oct 2017 18:14:35 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 03:13:48 +0200 Message-Id: <1509066832-5285-7-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509066832-5285-1-git-send-email-mw@semihalf.com> References: <1509066832-5285-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH v2 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 Reviewed-by: Leif Lindholm --- Platform/Marvell/Library/MppLib/MppLib.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Platform/Marvell/Library/MppLib/MppLib.c b/Platform/Marvell/Li= brary/MppLib/MppLib.c index 383c820..297725f 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.c +++ b/Platform/Marvell/Library/MppLib/MppLib.c @@ -79,18 +79,24 @@ SetRegisterValue ( BOOLEAN ReverseFlag ) { - UINT32 i, j, CtrlVal; + UINT32 i, j, CtrlVal, CtrlMask, PinIndex; 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]); + + PinIndex =3D 7 * (UINTN)ReverseFlag + j * Sign; + + if (MppRegPcd[i][PinIndex] !=3D 0xff) { + CtrlVal |=3D MPP_PIN_VAL(PinIndex, MppRegPcd[i][PinIndex]); + CtrlMask |=3D MPP_PIN_VAL(PinIndex, 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