From patchwork Fri Oct 27 16:31: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: 117373 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1000879edm; Fri, 27 Oct 2017 09:32:53 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SF271VlyslO9njn1VVk72PaN8s7wm9v24bf77ABQICa6eGsJNLdoYMJlpaIL8dA7E21PnJ X-Received: by 10.99.122.28 with SMTP id v28mr737300pgc.394.1509121973206; Fri, 27 Oct 2017 09:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509121973; cv=none; d=google.com; s=arc-20160816; b=Ozlx7Wkkpk7p44DRjEJF7NNdxetLTkpkrT/XbYCtcn3n9cYkBLmzhY1/LVYLt+IACr RjVuL9MEuVfcGJbJDp/PB1WsRQeq3wdwjWwjIH1qIuOH0Tnb+hPcMzEmnYuH8xICcg0Q 8nfXdUUg2RL6SgG+DQwglpRznBbEBsLmEQfuovRAVJ6zdr4R3M0Oum+N8oIcke2NAr/F gXK7ABR0r5Hn+19L/V+apq3/f5+yt6iKO+UKSHCzH6vbHWm7r/aQllPA7AssK63zYzzB R6ZIS/YOV+4QBlQR+yPdqulD2qwVc3ILiimfA2w9DNhOYshY3K5e9fyIL+W7aqK5FUO7 16XA== 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=bHxx2gXYf5euLBmAJFOmaN24mGjWl4+61JEvyY47S3fSSbpdfnxuKqsc0gJoFY6brx kWRATnJQ+q1RoaxgGX7I+drlPfjiNBW/dk9ZxVvdsnLKLKvSLRg741+2NyMQso4KRwPi QmwC7662BPaBeLIedpoe76tYqc9K/3B9CNWp1oaRljhtEB/7zJ+z7boSUQB2BOXelDGl xYvcFg6NZSliAOJrPU4k9nMu8L4LvqLgJY7wmrETeJuTVnhITXwnT1h7DVTgx20QGTHO sKOZT8nheE8WMa7w/vN9Ws+EI3TdZY/tcU1pgZTDXVZIccIj016vOqmj4YQWj5eqG+6j x7VA== 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=J5ck1PkO; 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 s1si5142055pgc.387.2017.10.27.09.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 09:32:53 -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=J5ck1PkO; 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 7272921EA15D7; Fri, 27 Oct 2017 09:29:00 -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::244; helo=mail-lf0-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org 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 C110221CEB12D for ; Fri, 27 Oct 2017 09:28:55 -0700 (PDT) Received: by mail-lf0-x244.google.com with SMTP id 75so8047600lfx.1 for ; Fri, 27 Oct 2017 09:32:43 -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=J5ck1PkO6llWm9lX7NiNGSd7Azsb1IEk3qTTgcpzmUoi+/dWqriPOGmQNaSxYDBTMa RThwOHH/nzY4efsoJBGyPtcW/DuTVkRceVPxzMuy4p51PcT7aQnvJBTVCTkqhs2Wj+0G k2eqLw0X/QlV5+E1WEy0dc50Jthd4UkDe2+OZNkWFhKG7K0HLGOr6d7T56mjT3bcQUYq MWaodQ/w3zETpB3WAJsY/YeIFNW5hMNWU8YrJJyZXjwJ8aHid2HXmroppC9omEOCH5Us Ulge2WsNSxpHn4wahm89vfdX3GmWzSS9jDie6TAv7jToIdhCkx0OOrneXXhtgnVk4Cbo 5e6g== 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=VVIls2Vv8ZNADy4kvGbyK2DbCz2DPoqdt3rxXjLcbymAPofTjJh53bljNdV2BLjLOx xYax5Ez2ahSqw3v/fSpu88JTJOVGQXE1ovRSUnEUy4AFO9DpjXmeztUrVgOn3RRVSF6L ga960vYWUh7eEaK0XR0dzNQlJcKiv46EHMPr1Jc1ukqQmp0gQDvVL/Lk6UVe/1becydc V2bKgZCBZ1LV+fHiJrNPnyblO+po7GAPqY/f8et4Ovz9NsQIDfz0WObK4B0sKzCYoO2r YWytnOQbQ4muf6iKdVxIbviTHEtyp46cQQjgMRCZE+X3XQRjor6T/9VNw77o3ZT5s4JJ RSGg== X-Gm-Message-State: AMCzsaV3x8CxFVYdgsNh+rjJPDKCpDIT4ho6Ewp57rQ7G8TvN4c98FUf 20WzeDK6Xtr0LGrFxiu3NLOwrdLDCvI= X-Received: by 10.25.178.206 with SMTP id t75mr379236lfk.228.1509121961225; Fri, 27 Oct 2017 09:32:41 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 09:32:40 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 18:31:48 +0200 Message-Id: <1509121913-12937-6-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 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 16:31:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 117374 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1000938edm; Fri, 27 Oct 2017 09:32:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RTC1veo/CLc8reyyt1uRozvG9hdbql+diRmTO2DqnnPT0uu9XLLVz1KOqKSEnChlRwsVJt X-Received: by 10.84.142.129 with SMTP id 1mr781293plx.341.1509121976933; Fri, 27 Oct 2017 09:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509121976; cv=none; d=google.com; s=arc-20160816; b=el4ccTrlS8bSfVUTG+naNcNHiMfxCg4gMj+tzjF84PDO3KYnbogUQ8/IpjJoPKCbBt Hkb4jHyAopXdC3+jn/ijlccpl75FOfFjKgdUe+St1BfqAmyeh1s1ah7fyH9Rix2mUmbi ZYoasaP1URuP/5HYwtwKhax612251sFbIkgeB2C5HTuoGA7LMVzeaD9ljzc+odjxK8R9 +/q1J+8z9avWqsr9UI5v5k/r670rnVlrklyJcZjr2H0Mp2HWAOlaOOCgasdx4K2dOhGJ mgT4rLT1lODm0+OGE33m6u2c1M8nF0c9MRvvr0NWB53uMRjFLMU0yLmJkM2JAz55R6qq 8iQQ== 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=YT8bEpv6KqYH0cxWDJigH280LDumbPjiHzmWeUD80+4=; b=0v0KYq3UfVjs+nKHAM1oLvE4vcCewVaCQvEnSeSbugb4k38Yj/1glAS8RmWdIqcQO+ BaO7tMrM8jFrLc+RjcmEy2JjTo6kkk9JLuazaGsIkOLoN+KIjvqf64+a9uuiibRC77hb Q+Rew2PYLBWazDyFc1OEp7ZCmZ3QbxaxB7G2SbjdqdJhBcIxpCEOrDdL+5zf/i4pNYUu Vqej9tsKxyvE/PfAmIkprcDZBxjCydO9EsAOrLytpQytdETdWkghYsrHl0vQEjHw108a tHUQezeiyovb8SkDmRTOaNcXhTIDhSbwEZB+IRCN1M+0M945SilrRRMMAYKx2N9KZrlA kJ8w== 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=VDlaVkNA; 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 i6si5111629pgt.798.2017.10.27.09.32.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 09:32:56 -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=VDlaVkNA; 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 B798221F3B3E3; Fri, 27 Oct 2017 09:29:00 -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::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org 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) 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-Received: by 10.25.83.76 with SMTP id h73mr359238lfb.196.1509121962519; Fri, 27 Oct 2017 09:32:42 -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) 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 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 Reviewed-by: Leif Lindholm --- 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 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); } }