From patchwork Fri Oct 27 01:13:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 117278 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp185855qgn; Thu, 26 Oct 2017 18:14:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QyjcFMJ+UK5Ql1AEv/lGBl1Jh1KvhPrBtX9Ykn/C54gNBupostvnODVXGKvzjElk0ZEPqZ X-Received: by 10.84.168.69 with SMTP id e63mr5816339plb.340.1509066885201; Thu, 26 Oct 2017 18:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509066885; cv=none; d=google.com; s=arc-20160816; b=CADU2hnb1J9Z5UVDs7NBoEdsxbjOMklQyDbPUVyTJnOuXPrSV2Wz03ppcxgr6+2DFZ jFY4kxQGqgLeGET0W/oaqlk9tvi4lmS/bclwLQYfWYp+q+YYFtHhWYdKMFI5PaYygVDo DhkQoVc+HeaNghgKNS9gUHN+5tnhVqImZQgIXonZ8mfycQ8Pe+ZcRVdkmYTOM+5yzXHP 71/wJZYmuWrbAyjwsGcbmtwWwbyvpJqJQziKQumJUK8n1PYgf/x4ALWNsis26uOEf538 djnGU5rzUTguv/GMsfJ4duq0Jd3bw/jlXvTBCuSpKVIUdwiHCx58KD70QLNSe8dCPhX4 zdNw== 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:cc :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:delivered-to:arc-authentication-results; bh=6sSi3/WmsSVCLQDA6kqLfWhDefprR3YaKmLNbULmigA=; b=LwsFzb0LKwC/Gh+B2/U42Sxd8V/9zA0mZomSTsjRZWCEz1x1mlN2PUYC305Xa+6Dth 5hha832M6QCj/7ws1vqlxAxk86vOr540q+VET75OVGPtadGgTX/EZ6E25SNfCTpZBsrF M5DpY6/G4NOGL9lUS/wBDfns0bPXe2x5YIOYdmyWiA83zYc7ku9yO95bxTMNIbyPvJkX GN+GUZB3cIYkNr1daBgnjV38lTIFo14d3S46N7dolgOxq2Khfa9njFoO5k42XwDyJ779 yCg9NqhRqYC/DR64RQv1EP6VUzvpaZKlkM5RFm6RzfQcXYJZ15qjGhqn3Ib2fmQkWdrC z7Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=V9bIAmvu; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id c6si38046pgq.243.2017.10.26.18.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 18:14:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=V9bIAmvu; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1B7B62034A886; Thu, 26 Oct 2017 18:10:53 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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 7BDA921CEB122 for ; Thu, 26 Oct 2017 18:10:49 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id 90so5655102lfs.13 for ; Thu, 26 Oct 2017 18:14:36 -0700 (PDT) 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=c2fyQgv2Z5WT0KL9Kq9Fe8K5V0Zyqvytvrut+0OQ5J0=; b=V9bIAmvubMSKTI3cyyPLPVPhl9am/hG7nLDvvAIFBPTu3l466ZKre2lfjnbmp49Ubx coIG+S9XIQIheaMn+8/TKEmxcYFaPR/c0Yf0wWlE2RlRNb+tAQ0vmBdjvr3txajsrbmj RHRAQm+TpZsI7A8j+ADViIc/Wjk2oZYDXFxo5AxNKdJE9NKk8A4caFQGING+QRgc6RGZ DErE2KHuwrZGlQ5SzhkyNAClu2Rz77dUsDrkEG0d8CRV+tqsHcjh/84/difzC/3lSs6d D8u+EshKVH0oWG7syqfslO2VsB/RCSIwDpUE+aXrX4WBJ2IQBlURHTCe58OvXqJ82N00 55uQ== 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=c2fyQgv2Z5WT0KL9Kq9Fe8K5V0Zyqvytvrut+0OQ5J0=; b=PcwdZuA4vojLTJhaPv8PKGUCJVJnSxNk4iGuEvesmwpFR6IYGAI3r5amc38k4M1C3X D2BTldJQ8F8w299REMiAAPZGXZ35WzO23m6GAHNHCQKd7FRhz4li2/7S38eFqZz456as dgjvdqrVnn+ZGNQZdnIEuq+TkEYGcIjB+zScZKHr43rtfomBsuNQMlkOdhZJXdO2eV3e 7l8Qmg/usixLpqfSpzBWLtSyCU4+t4GC20WE1sicX7Z771143jFb4Sk1uSJucY/SDskt W4+Fy9D2biwwIsgRC1taTfM9EUMp77J6xPBESgMQKdAYcXz2eksjR/WEDRwP1m5Ho2d8 kyVA== X-Gm-Message-State: AMCzsaVOMACeGe3pFxgWRxjx0wzQjM/2PiHyk8wCXRTGVVIgQUyjzAXK qBNExxaN96rycYYU+IaYuq/XwE+pieo= X-Received: by 10.46.66.198 with SMTP id h67mr10545534ljf.108.1509066874261; Thu, 26 Oct 2017 18:14:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Oct 2017 18:14:33 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 03:13:47 +0200 Message-Id: <1509066832-5285-6-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 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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 gMarvellTokenSpaceGuid.PcdPciESdhci + +[BuildOptions] + *_*_*_CC_FLAGS = -fno-stack-protector From patchwork Fri Oct 27 01:13:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 117279 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp185897qgn; Thu, 26 Oct 2017 18:14:48 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Ro58HaIlT8t8y3uoEHNUtSseKIPIFlsc1iRebxFqiB3wiT3fK16CxWadX/BqRcp0sIyvpF X-Received: by 10.99.160.71 with SMTP id u7mr6529456pgn.22.1509066888213; Thu, 26 Oct 2017 18:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509066888; cv=none; d=google.com; s=arc-20160816; b=VWZRh7iLH0i2sMzOmDgYoPuGG4Z6LzWPyqjNV3RL+2bSHCyRX3yIKceUyLU7Ay/lfi tWrmFBSv+Fmb0EQL53wxrdQVp3bDCvpWCdsOvydlbbp7k7wBxEN5t+KbE3dryMHdHJSo pXSey3ubCMSQ0u3xoJA3pJyfnr7QM8tyKG1YJBFVAsIlHHH1AqkACCDrtgzmePx+gP40 zt13hJ02uiSd5VBomUBC0sL4kt+xnu985o+azfDkUEUm0/2kOORwUIjlXlEWGlTTl745 XUmxGyTWWwrtz58OK04eiq6ePOlVBtfag463U4EY17dMu+yd6eTLbTN3rkDmqmgV6sEP u34Q== 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:cc :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:delivered-to:arc-authentication-results; bh=EwXZ5SLeRdEFsr6l6rjsPQ3lDgCXm5Wh+olOGMLS8Sw=; b=ZVySC0dKHiACWWTe3skZ7i6rU3O7Vv2xlMtz/hVSma8qrjUZzKT57D5eJkwktAiWX1 MCjnyt09kz8tC4ZzwCCz+JcekQWtSsz4wn3iR4FcTjK4AONt+GWdHbUSPsYF5t+QOku/ IfgxwCPFiQ9f4wlvqLDlcWSm6/9tRdCn0P4WZhcRKeey5uM5aiOFxVUTg+lOKU0oKA6a ESNso7hZ7Qm+bhM3D3NVgj8Mt+MMjnby80WrGI7YkekdGE8unSEfdrOMfWbaS+JP0pHe l9ncxGgplEYXGg/0EhU6L9CDbgfKv4T4l+qzfsGAYhZ9QnTVVbxakcVLnFzRdSGgcihO 6waw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=XMAb7ne2; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id w7si4118029pgp.252.2017.10.26.18.14.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 18:14:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=XMAb7ne2; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org 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) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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) 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-Received: by 10.46.46.8 with SMTP id u8mr10353032lju.117.1509066875521; Thu, 26 Oct 2017 18:14:35 -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) 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Platform/Marvell/Library/MppLib/MppLib.c b/Platform/Marvell/Library/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; Sign = ReverseFlag ? -1 : 1; for (i = 0; i < RegCount; i++) { CtrlVal = 0; + CtrlMask = 0; for (j = 0; j < MPP_PINS_PER_REG; j++) { - CtrlVal |= MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, - MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign]); + + PinIndex = 7 * (UINTN)ReverseFlag + j * Sign; + + if (MppRegPcd[i][PinIndex] != 0xff) { + CtrlVal |= MPP_PIN_VAL(PinIndex, MppRegPcd[i][PinIndex]); + CtrlMask |= MPP_PIN_VAL(PinIndex, 0xf); + } } - MmioWrite32 (BaseAddr + 4 * i * Sign, CtrlVal); + MmioAndThenOr32 (BaseAddr + 4 * i * Sign, ~CtrlMask, CtrlVal); } }