From patchwork Tue Oct 11 18:42:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13004258 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB0E0C433F5 for ; Tue, 11 Oct 2022 18:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BLmoz3rm5720vDzaFCMdhYgzm/p1Ffi5J2mvtxvO620=; b=RiGumSmrXjv0CE M5ymAIFk3YXIPOucs8IDUelWVFM5NdNhc/rgeGkympcT07ikGsec0VxTBoT3vBVsD20Z9ukfLBxNS DU2siRWsnNagT7VA8j1HrHiDbP10jpq9tt1QFKnah1RCmdh2lx0s5POARTCeJf1eyhRWn2HJmcDtX 7qSmzVwMavpOUcbLieoggUZjKhzE1cfVm9rGF4mYbvhfI+6qOp/lyDKxVvH9bmYpvGfr+mws+UIvW DojNwG4Uw6qYmGSJA4eXH4pyBVODqv9Jlf0xA3am+BL+IO4BwjrHnp6mGZMmu2ovwKboMoLVVD+Ik m+U5Isd3+1CXktlxTGhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiKDR-005TMx-2x; Tue, 11 Oct 2022 18:42:57 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiKCu-005TCe-A7; Tue, 11 Oct 2022 18:42:25 +0000 Received: by mail-qv1-xf35.google.com with SMTP id df9so9502295qvb.9; Tue, 11 Oct 2022 11:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=EpuVq5iO2zl1W3X3kc36q+RPKt7tweIdU1vHs5t+3eg=; b=Gj5Nqr+LDbbfdcwkpISaFWC3XdZGLsNhMyp9yQ7I2jPcpQFr3j9ML16AFN5gJP5fqd BggKYoQCVRge/F/uQcDXmxPixlp26y/RiwefonggUi8wI5Tlwj9BOqncJN50vyboUfsG e1KfLU7BdpAPHtq7FjP0mMGBepXyaQm3kwLTR2uAqZn0I/OboA/lrzEZJh+vYUoBmKj4 FoOnn8aDImOV0axl6bToLeNcYB88xFfEQfErGYk5v0Hq7aRZ0/L7CfN1yJtl2G6pIo1X yM5JxaruyYzUbEp8e/GyPnWxEHcvIzLSnOuA99XIpnKk3U32vJyhVpxYqW4undxRX6Ip 8REw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EpuVq5iO2zl1W3X3kc36q+RPKt7tweIdU1vHs5t+3eg=; b=Hp1Hnu+bf2/ohECkDLmc4HIfCVS4GFaMKztVSYp761Qidd1KPfEhV50pH2YHz9thAV q4tl7k8i1x0q8VM1z0RI8p3/ejnM+PRXRI5XM21MhneOKHI3bt9WKmH4hin5tZaIV7GJ PnB8EuNeNA84G7p67XYc+k+15+399yo93Ws/0jSb5MgL9OiWuTPc0cr74cIOlBAbtfQZ YGBYV0/GGoz5fPziswMzt+fo1aLWFDfHzmH214FifCry77aeIbHf0n4sXimQmCJbK4IG Nskm0G2kOo+IKIfyQS2o0xgRbvT2kazSw5DNQR8qQd+9IYvChosS2xuyqKMHuneP1TJz +TkQ== X-Gm-Message-State: ACrzQf24v/f9gFwj5oIbysASk2VnZaUN7Wbr6rvXptw5GbUar6RGaDmh jLbXGJiMIUo5N3W/L43qzJg= X-Google-Smtp-Source: AMsMyM4cEoY8/pxM0W8zIScP7/MI6kym/0Bnwf2jYpcX+HtPFjAmBxPBvLmmdBInV4CuI83G8h7/kg== X-Received: by 2002:a05:6214:2aaa:b0:4b1:8f0b:97ac with SMTP id js10-20020a0562142aaa00b004b18f0b97acmr20181393qvb.84.1665513740738; Tue, 11 Oct 2022 11:42:20 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id fc8-20020a05622a488800b003938a65479bsm10961732qtb.10.2022.10.11.11.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 11:42:20 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, james.quinlan@broadcom.com Cc: Florian Fainelli , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 5/5] PCI: brcmstb: Set RCB_{MPS,64B}_MODE bits Date: Tue, 11 Oct 2022 14:42:10 -0400 Message-Id: <20221011184211.18128-6-jim2101024@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011184211.18128-1-jim2101024@gmail.com> References: <20221011184211.18128-1-jim2101024@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_114224_390126_D5CC6C85 X-CRM114-Status: GOOD ( 10.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set RCB_MPS mode bit so that data for PCIe read requests up to the size of the Maximum Payload Size (MPS) are returned in one completion, and data for PCIe read requests greater than the MPS are split at the specified Read Completion Boundary setting. Set RCB_64B so that the Read Compeletion Boundary is 64B. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index e3045f1eadbc..edf283e2b5dd 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -53,6 +53,8 @@ #define PCIE_RC_DL_MDIO_RD_DATA 0x1108 #define PCIE_MISC_MISC_CTRL 0x4008 +#define PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK 0x80 +#define PCIE_MISC_MISC_CTRL_PCIE_RCB_MPS_MODE_MASK 0x400 #define PCIE_MISC_MISC_CTRL_SCB_ACCESS_EN_MASK 0x1000 #define PCIE_MISC_MISC_CTRL_CFG_READ_UR_MODE_MASK 0x2000 #define PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_MASK 0x300000 @@ -900,11 +902,16 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) else burst = 0x2; /* 512 bytes */ - /* Set SCB_MAX_BURST_SIZE, CFG_READ_UR_MODE, SCB_ACCESS_EN */ + /* + * Set SCB_MAX_BURST_SIZE, CFG_READ_UR_MODE, SCB_ACCESS_EN, + * RCB_MPS_MODE, RCB_64B_MODE + */ tmp = readl(base + PCIE_MISC_MISC_CTRL); u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_SCB_ACCESS_EN_MASK); u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_CFG_READ_UR_MODE_MASK); u32p_replace_bits(&tmp, burst, PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_MASK); + u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_PCIE_RCB_MPS_MODE_MASK); + u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK); writel(tmp, base + PCIE_MISC_MISC_CTRL); ret = brcm_pcie_get_rc_bar2_size_and_offset(pcie, &rc_bar2_size,