From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::242; helo=mail-pg0-x242.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::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 80266202E540B for ; Wed, 27 Jun 2018 00:04:59 -0700 (PDT) Received: by mail-pg0-x242.google.com with SMTP id o11-v6so532835pgv.4 for ; Wed, 27 Jun 2018 00:04:59 -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=buApLzbytp/eU+y5SkiUgXplzV/QuA5DH7Tx2BdUVg4=; b=KfiFwJJ9U3Ws4u8o32dCNBiMygFVDWhLGTB/ZidW481m0TWJpA59xsrMuAaGFAU/j8 4a936PktBwSdSu5ItB66QmqWXIpZblN27VJ67lE4PcLe5HbGKBhJp4DKckHbgLlLNdm+ DxjjC+6ORL97mzMKdhMscJxm9NGy4MgKkVYZw= 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=buApLzbytp/eU+y5SkiUgXplzV/QuA5DH7Tx2BdUVg4=; b=OS9i4PU1we8n2Se4h5mxCn00GXPSaSJb1zHmAeEGUXVeM8w/lbcnST7GDJLNU86uJh 6/O1jrPg9KdyD9aP9kTUxKA9Cj/tRa9il1Rf8nw3AdWU3azg6nL1UC+CMxqPsNJl4W+6 JkEwLnT0GPYC4RFETp8/cz0am8FH+D89xxKylDYrh+rPUzhqbB7ozinjLQiA0Nk8Bq1H Fgy+rKLoMaxHHX53EQxdvOIrNym2aWE5Q21wLWRlPSWxpPt+eJUt644oHDlKNcAtE1uF suPM6vsz+o7tJKt+9fdzg4OC1XyvlZE6FDDDl08dOwgpMC3mtEs3GL7qsJMool4SkeeB k66A== X-Gm-Message-State: APt69E1M4L1WvYd0sh/B/g992B29dQAmVAGb08xMmL/N8gdtOrBFV3GN fEKMyy5XrnyiwGRAEK/fQhPW3w== X-Google-Smtp-Source: AAOMgpeKctU0Rgv5T7XgZ+LygbKVg1OpgD0jARhovrG40ZZ30ifRxJ5GmSyXt6RC77Q47e/3HMKnQg== X-Received: by 2002:a65:5784:: with SMTP id b4-v6mr4158061pgr.315.1530083099232; Wed, 27 Jun 2018 00:04:59 -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.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jun 2018 00:04:58 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Cc: ard.biesheuvel@linaro.org, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, Ming Huang , Heyi Guo Date: Wed, 27 Jun 2018 15:04:40 +0800 Message-Id: <20180627070443.42886-4-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: [PATCH edk2-platforms v1 3/6] Hisilicon/D0x: Fix SetAtuConfig1RW bug 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: , X-List-Received-Date: Wed, 27 Jun 2018 07:04:59 -0000 The MemLimit is wrong when the Private->BusLimit equal 0xFF. This patch fix enumerating device plug in switch cart failed issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c index e5f66eaa4a..3f894e8eec 100644 --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c @@ -666,7 +666,7 @@ void SetAtuConfig1RW ( ) { UINTN RbPciBase = Private->RbPciBar; - UINT64 MemLimit = GetPcieCfgAddress (Private->Ecam, Private->BusLimit + 1, 0, 0, 0) - 1; + UINT64 MemLimit = GetPcieCfgAddress (Private->Ecam, Private->BusLimit, 0x1F, 0x07, 0xFFF); UINT64 Cfg1Base = GetPcieCfgAddress (Private->Ecam, Private->BusBase + 2, 0, 0, 0); MmioWrite32 (RbPciBase + IATU_OFFSET + IATU_VIEW_POINT, Index); -- 2.17.0