From nobody Wed Dec 25 14:01:10 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 1509121977837918.6272769498833; Fri, 27 Oct 2017 09:32:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B798221F3B3E3; Fri, 27 Oct 2017 09:29:00 -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 01C6921E1B76A for ; Fri, 27 Oct 2017 09:28:56 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id l23so8011497lfk.10 for ; Fri, 27 Oct 2017 09:32:44 -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 h3sm1569222lfj.26.2017.10.27.09.32.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 09:32:41 -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=lB+l/pkxnBfH0TSzI0QyKiJPPs+O8DuOjdIlbvgep/o=; b=VDlaVkNAAV7vIYVoaqaQvcL8KzG2E0gbBBp+eA3LTL+gr6VdMbTx/g5skewCie2sPR GGGsgyzJs/20M7pk2AvzPdqPFOl9q2S43QbyAi59aOoTjUUQbqaYmi71n1LywMSx8uEw bEU7FmH5GGmgWASV/unvQdlzE6X1+gv2EpNxYA6XTrNhdkUvCnSPMAgPpMv895H/5hnD WivPvf8rp0xxlIeYFj14Q5rpmNUExe3sjgk81a+61VAAr0qLOsTk8113xMKh2ie9AIKW vTPGADVH7htsh1+8oEsyNuamZ+zg5xkhY4ipnWNJisDdm1tJIQxeq0olsvYBoNSfgZMm pgsA== 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=lB+l/pkxnBfH0TSzI0QyKiJPPs+O8DuOjdIlbvgep/o=; b=TZKwQZgG8vXS1SepwoVeYHD2a884QrCkgbx5lNguzVH+8YqA+1WzUVDFKKu/JSni61 ce2T7KadsevdqyKkHBsKLOMk5lCkTFmi4YaRJowM0qOYDMopIX6oU9Z3zcA3fY3Xarm8 kXcV0OXlnbxtTKEul738I4S0A3HPObeObJuDZuJYYJsTu8kezU/Evxa/sYix7s/vbxtb nLrJAKmC6/5DBfvaiK+48+Wg/8luHWfbhboRv8z6u4NEw65PxyB/A+aFcupvV1GBJVjY hIw1n8TS5IiCS68zcKiebcG6yDCWfnN9EjPfrThaFDaNn+9leG2GQYOnbn+AJv3kjywa vvkA== X-Gm-Message-State: AMCzsaUp9VTwN7Fu1akodZQWzFJ1QlVNIrQnrVWHjuaFspL9lvvZCu2C LgdC3H/H5U6JiFhNXq/1ivmRzlCN4fA= X-Google-Smtp-Source: ABhQp+T8rjWFfW2zcWV5Cpra9O4cNspUVdzH/3tf4mCTNVcAye22CUSDqMNWIFAlAPhhPjpkl2Gk0g== X-Received: by 10.25.83.76 with SMTP id h73mr359238lfb.196.1509121962519; Fri, 27 Oct 2017 09:32:42 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 18:31:49 +0200 Message-Id: <1509121913-12937-7-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509121913-12937-1-git-send-email-mw@semihalf.com> References: <1509121913-12937-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH v3 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