From patchwork Fri Jul 13 08:15:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 141854 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp511405ljj; Fri, 13 Jul 2018 01:15:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJCjoenFkXwpQdKzCNlae8BuZY3AOH5ghQN4oDoZzqu9RFC9lkvUl1zX58ezrq10MOV3ta X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr5277143plc.241.1531469756316; Fri, 13 Jul 2018 01:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531469756; cv=none; d=google.com; s=arc-20160816; b=0jYqT5iyyaJ88cOOwFud+hqiJ1YsEeC7x1g6awMLiMkTuvY4trcURiAAH1mPZzcw0Q sIRx8fTt3B+j68B3pYCFzxoOI/f5F1VABlL2KgpSwL+18dRCTuCmhGDgUVoHSz/bHX2Y n2N+tZDVf2K/SHE7g7NmEx463HDkwYPirv5BJDmfYaSlKHEDBqxjyCYdEQrBRvXci33J pk3B1pZBELIUlNzzDlUKjoE2Eap+ewKZZ2+PSNIX8zA/fSygi55T6H+J38/ntqiyEIGS pib990sfGjKL58SuCBemBL1ZV3vKDFUEwiWdqmlYRD+4/C4M7wJjMWqNpIDrz3loswat qXNg== 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=3SzEOy3RU/mF1NU3LvVBJqPubNYObohh8XdBV+JpBTY=; b=qBqOahnikfaiDkhRx/vahwI8Qr/yHub41VcQJOzW2m1KvD8v0scmvvPjogDA1fv8xO v9TRbieFycDufic3u61vVu10Jt2SBWh2blUoCcbjvYYNby16gAGYhoL5wXM+Bouxgjdw aNd5uE1DI+HQZbEx8TiVj/rYW9yALS5DHbSSy0k/DTRWAI/tY8IdSAZNhZiql/9wswmL WHzAKixu6WBIZJhMyDz8ln5ISKs9qTjUn1kEefI9JetEsfqLHYbTjf6WVXnYHqMIhpT+ AQS4htGXKAd7FjF/vJsgoVYzFjNR9OSUh5luj1diZkk2meHVw9Kpc+TPk9Ftx1QkrB4X EvHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ULRMtdhs; 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 y12-v6si20432510plt.302.2018.07.13.01.15.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 01:15: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=@linaro.org header.s=google header.b=ULRMtdhs; 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 EDD8A20986AB5; Fri, 13 Jul 2018 01:15: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:c01::244; helo=mail-pl0-x244.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::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 5EF5E20986AAD for ; Fri, 13 Jul 2018 01:15:54 -0700 (PDT) Received: by mail-pl0-x244.google.com with SMTP id p23-v6so620406plo.6 for ; Fri, 13 Jul 2018 01:15:54 -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=eVWucS/j26op3zbHs7QzFX1SIKxDy2ASWOJkY2smFgk=; b=ULRMtdhsM/KYlce3gRlRpylY3znm8+Z+RsBrlSLeY2uBnreUwDesrpboCHnJcHKqiq 1vd8mV9f9zvQZivklv20LS69y88330VUGLxitUMfbfQzUNy29q0itkjI9AxkqG5ng98s TmLC3Hpt+vDhCvhghmR7FtdhsoplHMSXk/nns= 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=eVWucS/j26op3zbHs7QzFX1SIKxDy2ASWOJkY2smFgk=; b=eBGL6mvs0k9KicT1AdLz7om8DbXZTSy81EeikAziHRj3myg1BPljqj9YFFAnFRNrn/ UZZtq3KFPDNZkuw6ETXNOx1uZdUo2UEFmujApU5FuZIirgXi5OfHm66tY/2ltASQEsZu CA6e0EX6GJEI/642j2uK7VfgsNLdC8eQAU9Ds2WY+uCUEMN79UyYxoMLPSiBN6fHavad Q8KwxRr13ngSzQ0TbTESAMH1g23x1H+ZdJ9flbOUcTKil9SdKOeGngV5fUg8kMZiXJaY C4X/j+9Gu0t9KSaGPdOMYISLTr6ZQnYcl4WMSegYEaNwUCo1u83vVhmdPEroXy79ZF3l 0IPQ== X-Gm-Message-State: AOUpUlHFg145F+FAFr8KR9Xxh7s/6YkMCZ2u0F78MbhKJO4j9cETLkNw fZsecL2niDa+gbg3sekamYo1Gw== X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr5536969plc.82.1531469754105; Fri, 13 Jul 2018 01:15:54 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id e7-v6sm24400196pgc.55.2018.07.13.01.15.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jul 2018 01:15:53 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Fri, 13 Jul 2018 16:15:36 +0800 Message-Id: <20180713081540.8414-3-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180713081540.8414-1-ming.huang@linaro.org> References: <20180713081540.8414-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 2/6] Hisilicon/D03/D05: Correct ATU Cfg0/Cfg1 base address X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, john.garry@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Jason Zhang 1. During test PCIe mcs9922 UART card, the card can't work because the IO ATU config is overlap by Cfg0/Cfg1 ATU address. 2. After adjust the ATU windows, Cfg0/Cfg1 config as below: Cfg0 is equal to "ECAM + (BusBase, 0, 0)" Cfg1 is equal to "ECAM + (BusBase + 2, 0, 0)" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jason Zhang Signed-off-by: Heyi Guo Signed-off-by: Ming Huang --- Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c index 55b80aa4e4..e5f66eaa4a 100644 --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c @@ -640,11 +640,12 @@ void SetAtuConfig0RW ( { UINTN RbPciBase = Private->RbPciBar; UINT64 MemLimit = GetPcieCfgAddress (Private->Ecam, Private->BusBase + 1, 1, 0, 0) - 1; + UINT64 Cfg0Base = GetPcieCfgAddress (Private->Ecam, Private->BusBase, 0, 0, 0); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_VIEW_POINT, Index); - MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LOW, (UINT32)(Private->Ecam)); - MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_HIGH, (UINT32)((UINT64)(Private->Ecam) >> 32)); + MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LOW, (UINT32)(Cfg0Base)); + MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_HIGH, (UINT32)(Cfg0Base >> 32)); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LIMIT, (UINT32) MemLimit); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_TARGET_LOW, 0); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_TARGET_HIGH, 0); @@ -666,12 +667,12 @@ void SetAtuConfig1RW ( { UINTN RbPciBase = Private->RbPciBar; UINT64 MemLimit = GetPcieCfgAddress (Private->Ecam, Private->BusLimit + 1, 0, 0, 0) - 1; - + UINT64 Cfg1Base = GetPcieCfgAddress (Private->Ecam, Private->BusBase + 2, 0, 0, 0); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_VIEW_POINT, Index); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_CTRL1, IATU_CTRL1_TYPE_CONFIG1); - MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LOW, (UINT32)(Private->Ecam)); - MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_HIGH, (UINT32)((UINT64)(Private->Ecam) >> 32)); + MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LOW, (UINT32)(Cfg1Base)); + MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_HIGH, (UINT32)(Cfg1Base >> 32)); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_BASE_LIMIT, (UINT32) MemLimit); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_TARGET_LOW, 0); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_REGION_TARGET_HIGH, 0);