Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60B00FA373D for ; Tue, 25 Oct 2022 21:52:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6562384EBB; Tue, 25 Oct 2022 23:52:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="ejUM5L7U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F92684ECE; Tue, 25 Oct 2022 23:52:51 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EABCD806EB for ; Tue, 25 Oct 2022 23:52:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ben.dooks@sifive.com Received: by mail-wr1-x42d.google.com with SMTP id bp11so22791536wrb.9 for ; Tue, 25 Oct 2022 14:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zDvzKYX7778AU2oFbVRa1ax+/nlt+kltE8ctVtip0g4=; b=ejUM5L7UD0LVLHhCp3zCC//hOztGmSGn4UY6jS4lrnZrrkFIVJZ18wWL6Ev0TH98oY i4KKnzR1qSXMGoMiGAsK7aEjSZCcrhqBXReyNBAAUPL+CB4Ql0iNSOBaE4gLz7n+Uccv ULy2qMux1lhXnvm0mvGoWSy/owKivUb055SyZIkVU5a1ohD+R3GuFFr6g8om4Kl68oDY +feD1BF/0vGrL/gjldkcgZzZRXh1QcpBcMKzgRbmXg1ZsRI74SQqS3e/G6zHrmmAmQ17 6t2+JEex5yPPon29IrXo6qVkyPLUn7s9srH0KxMb5wQB4tZaa/xlzT6faD6/Fyyp41GR D0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zDvzKYX7778AU2oFbVRa1ax+/nlt+kltE8ctVtip0g4=; b=cHkLIqd4aE5e34pjw1V3LkYaC4GxtqbcV7kB7NK8Uw+wnWCAT4vcpD1IAz9WbYw0TT r22rKocB9JE5p1gLfDfE1mCh2SALX5L8IE5Mckq98rb5biF09/wH78a/wvqowISQGlSo 44iSupwqHkWhs2r6jJm/xNGwJ4IYM7WTI2GKGVA7ryzzvtFJrD7BF04nnnGyJTcMAN7F 6azgC5KWopoR+kWTlC/ljhSlX7SxPB8/ylreyOb/mFIbarfhOLjbMQDLHDaBjxjnDs4t bqvLBbUg+rbBu5DsesxOVYqU+mZ+QO5PCUPqKvYjuJty7wIQYTtvMD9I8Rm/S4bnmYOQ CgEQ== X-Gm-Message-State: ACrzQf23Yjuk+2C3uROvivtobgXxcj3mOSVNPsTP79zSHH3/ydKbzm5b 6wg7ZYwBR0iL/jqym83Ikf2irw== X-Google-Smtp-Source: AMsMyM4NqD2h6lfWhj/jyU5fRH6qtt6bXtIcNrM8d6K0EX/pL1R/lAJw+m1KhCXU7WZ6ay5YjCWBuQ== X-Received: by 2002:a5d:5257:0:b0:236:8a38:4e08 with SMTP id k23-20020a5d5257000000b002368a384e08mr830706wrc.118.1666734768440; Tue, 25 Oct 2022 14:52:48 -0700 (PDT) Received: from [192.168.0.17] (cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net. [86.15.83.122]) by smtp.gmail.com with ESMTPSA id h9-20020a05600c314900b003c6f3e5ba42sm67781wmo.46.2022.10.25.14.52.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 14:52:47 -0700 (PDT) Message-ID: Date: Tue, 25 Oct 2022 22:52:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] drivers: pci: pcie_dw_common: add upper-limit to iATU Content-Language: en-GB To: Bin Meng Cc: u-boot@lists.denx.de, narmstrong@baylibre.com, Paul Walmsley , Sudip Mukherjee , Jude Onyenegecha , william.salmon@sifive.com, adnan.chowdhury@sifive.com References: <20221020155109.66010-1-ben.dooks@sifive.com> From: Ben Dooks In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 20/10/2022 17:13, Bin Meng wrote: > Hi Ben, > > On Thu, Oct 20, 2022 at 11:51 PM Ben Dooks wrote: >> >> The 4.6 spec added an upper 32bits to the ATU limit, and since this >> driver is already assuming the unrolled feature added in the 4.8 >> specification this really should be set. >> >> This is causing a bug with testing against the QEMU model as it > > I guess you are testing QEMU sifive_u machine with some mods to add a > DW PCIe controller, with U-Boot sifive_unmatched defconfig? > > Could you please document the QEMU command line in the commit message? Your guess is wrong, I'm not currently using the sifive_u. This is a test projec to test some of the work we've been doing updating the dw-pcie code for future work. I'll try and sort out adding this to the sifive_u as an option but I expect that won't be until next week. I am wondering whether to add a flag to say use viewport 2 for the config, as logging from the dw-pcie model is showing a lot of updates to windows setting, then restoring the IO view and I am guessing people aren't configuring minimal settings on the Synopsys designs... >> defaults the viewports to fully open and not setting this causes >> the config viewport to become most of memory (obviously stopping >> the emulated system working correctly) >> >> Signed-off-by: Ben Dooks >> --- >> drivers/pci/pcie_dw_common.c | 2 ++ >> drivers/pci/pcie_dw_common.h | 1 + >> 2 files changed, 3 insertions(+) >> >> diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c >> index e66fb1490a..9f8b016d11 100644 >> --- a/drivers/pci/pcie_dw_common.c >> +++ b/drivers/pci/pcie_dw_common.c >> @@ -73,6 +73,8 @@ int pcie_dw_prog_outbound_atu_unroll(struct pcie_dw *pci, int index, >> upper_32_bits(cpu_addr)); >> dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_LIMIT, >> lower_32_bits(cpu_addr + size - 1)); >> + dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_UPPER_LIMIT, >> + upper_32_bits(cpu_addr + size - 1)); >> dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_LOWER_TARGET, >> lower_32_bits(pci_addr)); >> dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_UPPER_TARGET, >> diff --git a/drivers/pci/pcie_dw_common.h b/drivers/pci/pcie_dw_common.h >> index 60bf966d5e..8ec6834fa1 100644 >> --- a/drivers/pci/pcie_dw_common.h >> +++ b/drivers/pci/pcie_dw_common.h >> @@ -32,6 +32,7 @@ >> #define PCIE_ATU_UNR_LIMIT 0x10 >> #define PCIE_ATU_UNR_LOWER_TARGET 0x14 >> #define PCIE_ATU_UNR_UPPER_TARGET 0x18 >> +#define PCIE_ATU_UNR_UPPER_LIMIT 0x20 >> >> #define PCIE_ATU_REGION_INDEX2 (0x2 << 0) >> #define PCIE_ATU_REGION_INDEX1 (0x1 << 0) >> -- > > Regards, > Bin