From patchwork Wed Jun 27 07:04:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 140302 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp505794ljj; Wed, 27 Jun 2018 00:04:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLXnXqUkCLl7bj5q6EUB7P2LYDv8QV884YCjRzoN9XaEfcXBxGkHaOdRp0ePoOpihay6S0L X-Received: by 2002:a65:5c4b:: with SMTP id v11-v6mr4138691pgr.445.1530083097874; Wed, 27 Jun 2018 00:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530083097; cv=none; d=google.com; s=arc-20160816; b=qeZkDi8GqAumwMtOXmzr9249NNVlSGgTEQLgsMnbEC5aACLBGaW/d/hpdKJ8wxkzyN ws64O7OEz1x+TzjkJ7sogeMNv2iJlGqkO5WOPw94Mgp6fHa3yLvVCSmjiyz7y6jEs3PU 7dbaNj1WBwImpLFirVEr99N/30EQt6ihSxNg5yKoKMArBM8VOH9Qr8nO5bbyqyPYaBHR OQnruwSj6gt8KfBuitG6ZKpkSuqUjUK+4n40UZbPkjHyv8fP372fgGz/QVckEOEXuGNj H1t/yjJUpyjI7JTKA913FHsYqxP1t07kCpdCeoWkZQrWgblyajOYYR9VlbWG6Q8I1MQc CgEw== 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=E8lj+zAsvK24h09rig3buYin+9wc0UJTZFz5Hr6XRDNm1eg4a3xrztB6HR6agGj9F0 U8mnPkPF1t6YcPyN12avfXN4Z+R1z5cjqCU8whoxe8UpgSVeqn6OFFIoQO/RLXgdpW+Y 2HSokUba3hGeSwFap48q3khsQGNW/XE8yd9AuXTcypk8gHKt7QBrWIFmyZb4gXlq57yG gthTHWPyoIBQvri9NofOhVHmmHXMoqk9UtF+0hBm+U9MCke6Xcsgm8Bu3wIv/JvFn+zL ViGIvdh2UcawOo8z9I5hSQysUbXDLZMW1d2Ywy2Yy4Gizxxwu6OpbwRL6FazxdTdSXjF bphw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FCSK5BYN; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id l23-v6si3534907pfg.326.2018.06.27.00.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 00:04:57 -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=@linaro.org header.s=google header.b=FCSK5BYN; 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; 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 7E49D202E5402; Wed, 27 Jun 2018 00:04:57 -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::243; helo=mail-pf0-x243.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::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 7EC92202E53E5 for ; Wed, 27 Jun 2018 00:04:56 -0700 (PDT) Received: by mail-pf0-x243.google.com with SMTP id q1-v6so558159pff.13 for ; Wed, 27 Jun 2018 00:04:56 -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=FCSK5BYNhd9CNkU/tR2LfpBzH9PVt/8eqjijh+urREEgkPu6NwLfanZTX5flW33rbq fseSMyBkAoi5+u6VcKEoZmJWthVdH7k+AHXQAmzfJU8VLif1Mj7HlBL5HYxyu8/LIFwO VkOc7jCA0W7De1D6F8lNiqHYQV0X75QbeKIko= 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=n9YTk4kGNLektFqfc6k6o+OebXJrRasez7aBjYQrnsfolA1RA/0/MvP61D0wueR2Vh ZIDe35vmZN9dqReSpDQzIygafAgo1Ubw9fAVEwRKE+62bT+8r40wXuRVXMO54/9X6N6B PWHal3m/Ofmn3pd1JlEMsdgWSxpE5kS4Rl+35iOlQxgaGbcjqk/q3g06Tp1vAGq7uH9g 6GMQKOrgtjKcEcEn9jL0DnfWp1S9zKcrOqkpI0YsEO2ybp4N/S1asVZn5yFfxw7gm1Z+ Qg1KkXBNX3leFDvDvc+6UExW32wCYrUDp64gHrgHw3gAHTEa/6Hjv1nOgn477u8ZiGAu 1/Uw== X-Gm-Message-State: APt69E0ur5k5h6Y4afLUAZ0PeNDi9jVjhvHevGt/rO7JhEOVrfOIc4L2 2zXu5Kmn+SpzwHDhE/d8RREqhQ== X-Received: by 2002:a62:c819:: with SMTP id z25-v6mr4061146pff.44.1530083096198; Wed, 27 Jun 2018 00:04:56 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id q6-v6sm4128833pgc.21.2018.06.27.00.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jun 2018 00:04:55 -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: Wed, 27 Jun 2018 15:04:39 +0800 Message-Id: <20180627070443.42886-3-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180627070443.42886-1-ming.huang@linaro.org> References: <20180627070443.42886-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 2/6] Hisilicon/D03/D05: Correct ATU Cfg0/Cfg1 base address X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 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, Ming Huang , 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);