From patchwork Fri Sep 29 03:19:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 114483 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp312407qgf; Thu, 28 Sep 2017 20:27:12 -0700 (PDT) X-Received: by 10.98.20.78 with SMTP id 75mr5984331pfu.239.1506655632676; Thu, 28 Sep 2017 20:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506655632; cv=none; d=google.com; s=arc-20160816; b=XPzrhTdXecKK5dAY90YebGHgDLoof/cCsmki1GUYrGkLcBEWOrQaohun0xw1f+cA3D qx8B+gqGKkHYFal689p4zaMkd9rE5Eh05Pf+gPqDejY2DIR1zSzciaWOYXiv6DmPqNme 1uKYj3SM1PKbBzEd0SBuBSsEP/K2UfZQrMoAZoautS3FYkAZ3SKnbBuFyRcIMCZe0SLo SI91zrgn3vIQYnVovz3+54TIIpgc3kGR/dIWBgPBUTlhP85ZoFafNQ3WeAjQ4/bIPud4 Sy+lJUV5+8DMkeVUTRnq5P5mCAQQ4fCWWbiK4xiV0cfDUAyfKnpkMDQKOFgERhQlxf8j mMfg== 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=B1o4gEj4/WO1r9PP2mOr/QEdHmYU/8PKswQ80rtXp3Y=; b=cXWehJNmBgNM3PK+z3r7w19zJdHOR0yCoy16ZXRncFmTqvraAPpG1YiHzNN53/9cwq gygtBlaju8EVTcAWriJ0fyWr0AkECfgdOI22HHPkunGMV6dJFD+gJpErF93tQWEV3Br9 w2Xn1vsDEKR9uJa2fy/NxWiT5waGNdlxWfUiBoi3OGDMAQ25HTKDx7elO0s62FqIehv6 Fr9FOiy+pmaOblLgHdbN4OzuvDn8KEMXqq1EAob3TbmfWdjdbR89JIf3Bi/eyI6xuqTK +1dJWXQDsIi4X8KDQ5gAUidBnK7PO0s1vRw2MIMFutS0fMvAxGUhT3Mdx93wWJzwF4KI 0Mow== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z/eK1ta0; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id o12si2559374plk.182.2017.09.28.20.27.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Sep 2017 20:27:12 -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=@linaro.org header.s=google header.b=Z/eK1ta0; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D4F1921E87967; Thu, 28 Sep 2017 20:23:55 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::229; helo=mail-pf0-x229.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (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 CC76720945B68 for ; Thu, 28 Sep 2017 20:23:54 -0700 (PDT) Received: by mail-pf0-x229.google.com with SMTP id d187so54313pfg.11 for ; Thu, 28 Sep 2017 20:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=axAqhG06bhdicOPruvqAk8NM/FW/iZgSUPSvmGntTrM=; b=Z/eK1ta0ktS3PNG4wd8mB4Ybks9LmoCTCOVfHj965o+/jhNjOxTfGigEAHKzNmM/bB KmaDT67le6CUYjRA1VdWql5eJS9x9TTMWMcKWuWhZ2dgogbdtejYMKGL44FemqTzzwm4 PZuYxlPYmqp+UVn//+BGFvH7WdPUxDuegJBV4= 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=axAqhG06bhdicOPruvqAk8NM/FW/iZgSUPSvmGntTrM=; b=gDTCYKPzL6LTRR6FJH6TlZs1Ks8vKq6ijQKblMRmAHcUXRjYClf9lu39LObPwJT/1B GIgiESdVid8bH03F6DnYjHI8ddZd1gMy+BYSg/ZWyQWRvhGREs/CVCg6B/Mh36TzjDO8 K7+SVSEhN5uWW11NvZuU2HXISzvVE7MUTxT/TX8PA9B3iF1aoWp1TQ5LrEaevOQnGc3v yfsOe/slRo7z5MN7uOHLkwNpLvKqGe+2EGIXh/rDEtHc2Sz7B18yt+2m9kGhlOmF/2k9 gK9Pa12bewqoL8vpsFLMb4lOAQ6FtEKz3/d3T8G6yv8yn1RGjddRxpldabwzteDAmjKg wV+A== X-Gm-Message-State: AHPjjUjxK+lCC2jv2R1d3E1EJbg1/lVCVHlTAy8sIA8IKlVnTbqvujhm eLUS309BYdkSeRqHKDxA8oufnA== X-Google-Smtp-Source: AOwi7QCsVZEuukZLYtnJLIME9Kz2A15Laot6mXLwFZ3FaYGDLQp0ssFQTTFytM/MMMtNqEON+sBMMA== X-Received: by 10.99.56.78 with SMTP id h14mr6039582pgn.192.1506655629864; Thu, 28 Sep 2017 20:27:09 -0700 (PDT) Received: from localhost.localdomain ([119.145.15.121]) by smtp.gmail.com with ESMTPSA id g16sm5094376pfd.6.2017.09.28.20.27.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Sep 2017 20:27:09 -0700 (PDT) From: Heyi Guo To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Fri, 29 Sep 2017 11:19:47 +0800 Message-Id: <1506655190-56231-9-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506655190-56231-1-git-send-email-heyi.guo@linaro.org> References: <1506655190-56231-1-git-send-email-heyi.guo@linaro.org> Subject: [edk2] [PATCH edk2-platforms v5 08/11] Hisilicon/D03: Disable the function of PerfTuning 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: huangming23@huawei.com, ard.biesheuvel@linaro.org, Chenhui Sun , zhangjinsong2@huawei.com, Heyi Guo , wanghuiqiang@huawei.com, guoheyi@huawei.com, waip23@126.com, mengfanrong@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Chenhui Sun The PerTuning function is not stable, it will cause the LSI SAS 3008/3108 crash, disable this function first. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chenhui Sun Signed-off-by: Heyi Guo --- Platform/Hisilicon/D03/D03.dsc | 1 - Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf | 1 - Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.c | 50 -------------------- Silicon/Hisilicon/HisiPkg.dec | 1 - 4 files changed, 53 deletions(-) -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc index fca6781..f2a120e 100644 --- a/Platform/Hisilicon/D03/D03.dsc +++ b/Platform/Hisilicon/D03/D03.dsc @@ -112,7 +112,6 @@ # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gHisiTokenSpaceGuid.PcdIsItsSupported|TRUE - gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|TRUE [PcdsFixedAtBuild.common] gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"D03" diff --git a/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf b/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf index ee9dbed..61b091f 100644 --- a/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf +++ b/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf @@ -55,7 +55,6 @@ [FeaturePcd] gHisiTokenSpaceGuid.PcdIsItsSupported - gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable [depex] TRUE diff --git a/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.c b/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.c index 8ab7fa3..f420c91 100644 --- a/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.c +++ b/Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitLib.c @@ -315,50 +315,6 @@ PcieEnableItssm ( } -STATIC EFI_STATUS PciPerfTuning(UINT32 soctype, UINT32 HostBridgeNum, UINT32 Port) -{ - UINT32 Value; - UINTN RegSegmentOffset; - - if (Port >= PCIE_MAX_ROOTBRIDGE) { - DEBUG((DEBUG_ERROR, "Invalid port number: %d\n", Port)); - return EFI_INVALID_PARAMETER; - } - - RegSegmentOffset = PCIE_APB_SLAVE_BASE_1610[HostBridgeNum][Port] + PCIE_SYS_REG_OFFSET; - - //Enable SMMU bypass for translation - RegRead(RegSegmentOffset + PCIE_SYS_CTRL13_REG, Value); - //BIT13: controller master read SMMU bypass - //BIT12: controller master write SMMU bypass - //BIT10: SMMU bypass enable - Value |= (BIT13 | BIT12 | BIT10); - RegWrite(RegSegmentOffset + PCIE_SYS_CTRL13_REG, Value); - - //Switch strongly order (SO) to relaxed order (RO) for write transaction - RegRead(RegSegmentOffset + PCIE_CTRL_6_REG, Value); - //BIT13 | BIT12: Enable write merge and SMMU streaming ordered write acknowledge - Value |= (BIT13 | BIT12); - //BIT29 | BIT27 | BIT25 | BIT23 | BIT21 | BIT19 | BIT17: Enable RO for all types of write transaction - Value |= (BIT29 | BIT27 | BIT25 | BIT23 | BIT21 | BIT19 | BIT17); - RegWrite(RegSegmentOffset + PCIE_CTRL_6_REG, Value); - - //Force streamID for controller read operation - RegRead(RegSegmentOffset + PCIE_SYS_CTRL54_REG, Value); - //Force using streamID in PCIE_SYS_CTRL54_REG - Value &= ~(BIT30); - //Set streamID to 0, bit[0:15] is for request ID and should be kept - Value &= ~(0xff << 16); - RegWrite(RegSegmentOffset + PCIE_SYS_CTRL54_REG, Value); - - //Enable read and write snoopy - RegRead(RegSegmentOffset + PCIE_SYS_CTRL19_REG, Value); - Value |= (BIT30 | BIT28); - RegWrite(RegSegmentOffset + PCIE_SYS_CTRL19_REG, Value); - - return EFI_SUCCESS; -} - EFI_STATUS PcieDisableItssm(UINT32 soctype, UINT32 HostBridgeNum, UINT32 Port) { PCIE_CTRL_7_U pcie_ctrl7; @@ -1141,12 +1097,6 @@ PciePortInit ( DisableRcOptionRom (soctype, HostBridgeNum, PortIndex, PcieCfg->PortInfo.PortType); /* assert LTSSM enable */ (VOID)PcieEnableItssm (soctype, HostBridgeNum, PortIndex, PcieCfg); - if (FeaturePcdGet(PcdIsPciPerfTuningEnable)) { - //PCIe will still work even if performance tuning fails, - //and there is warning message inside the function to print - //detailed error if there is. - (VOID)PciPerfTuning(soctype, HostBridgeNum, PortIndex); - } PcieConfigContextHi1610(soctype, HostBridgeNum, PortIndex); /* diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec index 2c02e14..81ba3be 100644 --- a/Silicon/Hisilicon/HisiPkg.dec +++ b/Silicon/Hisilicon/HisiPkg.dec @@ -274,7 +274,6 @@ [PcdsFeatureFlag] gHisiTokenSpaceGuid.PcdIsItsSupported|FALSE|BOOLEAN|0x00000065 - gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|FALSE|BOOLEAN|0x00000066