From mboxrd@z Thu Jan 1 00:00:00 1970 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 61078C4332F for ; Fri, 25 Nov 2022 12:32:19 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LwDnzh+kkCq3SBwFUJeVacGs0EMfx8AMIQLOPecPm24=; b=nsVwobQwXKwWkE HqUuWmiJQ8yEequK6Q1QRBaw1iMWlLvD/oy7BGDO9g1PdEU8Gkw3l/Dqxyhb/HYvXElB13Dp3vVUM 3WDCh1HKSJf4qElzp7APHaxbvGhmW+7+84X/wPaMxLepw1LryWXrlB/jatrBVPkR5lU+d/0rTY2X7 w+w8TBMWSzNLtF5scCFqQGDzhrd7/p9yuf/c0iPuNdDWAYl6mOzRDH0SIBhN5kbqGikmF4hdnfSfG HbnKvYSgxgH+yF3wFPsw056TdwbvWrKJZ4PfRTlttQWCtrxQOkRvOL85phgdyjsZgBVaKiKKCytzx MGTCwKHTCxAKng6SkKvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyXrX-00GQZP-NX; Fri, 25 Nov 2022 12:31:23 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyXrU-00GQY9-OS for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 12:31:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18CC0B82A7F; Fri, 25 Nov 2022 12:31:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 693BDC433C1; Fri, 25 Nov 2022 12:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669379477; bh=OaKU45W8QrLKhHbu9Oxkvgt4uPosAwQSsVZwp8dqIt8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=XhY0vJlYEac/H484fM0aU3vBaJIItaF69xIuOAAln63lKPc/WelGEx0hz0VXOzYVp 8+ZPXfBNSdzsWF+CrOvh91Nno4keWAJa3eyXmBRPCOtfm3d1VBXiO4g+ioduQRLOyz 5eLu9FEaxZNG2kUgOwG5cGRi3DrfX5QZ0rsQvCTL2B7mwnOdTlYJhIA4MJJtp6WC21 q4ukhvy43tIkOoyvb6kC/54MbSkd1zt2OXIL+9PYVcd2SbHAmGkXb4KShmQyOW2v6P D2RdFzjeSLmrLw2t/PCG36KBRYr/wuW8vKYGG5Dx56KjOKI72zaqH74kmTH4S2shaG XgofdlZA2XujA== Message-ID: <23ecae8e-e4bf-60d9-1fa5-18894834d585@kernel.org> Date: Fri, 25 Nov 2022 14:31:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v7 3/5] PCI: j721e: Add PCIe 4x lane selection support Content-Language: en-US To: Matt Ranostay , lpieralisi@kernel.org, robh@kernel.org, kw@linux.com, bhelgaas@google.com, krzysztof.kozlowski@linaro.org, vigneshr@ti.com, tjoseph@cadence.com, sergio.paracuellos@gmail.com, pthombar@cadence.com, linux-pci@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221124081221.1206167-1-mranostay@ti.com> <20221124081221.1206167-4-mranostay@ti.com> From: Roger Quadros In-Reply-To: <20221124081221.1206167-4-mranostay@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_043120_980718_7349DD18 X-CRM114-Status: GOOD ( 19.28 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24/11/2022 10:12, Matt Ranostay wrote: > Add support for setting of two-bit field that allows selection of 4x lane > PCIe which was previously limited to only 2x lanes. > > Signed-off-by: Matt Ranostay > Reviewed-by: Vignesh Raghavendra > --- > drivers/pci/controller/cadence/pci-j721e.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c > index 8990f58d64d5..dab3db9be6d8 100644 > --- a/drivers/pci/controller/cadence/pci-j721e.c > +++ b/drivers/pci/controller/cadence/pci-j721e.c > @@ -42,7 +42,6 @@ enum link_status { > }; > > #define J721E_MODE_RC BIT(7) > -#define LANE_COUNT_MASK BIT(8) > #define LANE_COUNT(n) ((n) << 8) > > #define GENERATION_SEL_MASK GENMASK(1, 0) > @@ -52,6 +51,7 @@ struct j721e_pcie { > struct clk *refclk; > u32 mode; > u32 num_lanes; > + u32 max_lanes; > void __iomem *user_cfg_base; > void __iomem *intd_cfg_base; > u32 linkdown_irq_regfield; > @@ -205,11 +205,15 @@ static int j721e_pcie_set_lane_count(struct j721e_pcie *pcie, > { > struct device *dev = pcie->cdns_pcie->dev; > u32 lanes = pcie->num_lanes; > + u32 mask = GENMASK(8, 8); u32 mask = BIT(8); > u32 val = 0; > int ret; > > + if (pcie->max_lanes == 4) > + mask = GENMASK(9, 8); > + > val = LANE_COUNT(lanes - 1); > - ret = regmap_update_bits(syscon, offset, LANE_COUNT_MASK, val); > + ret = regmap_update_bits(syscon, offset, mask, val); > if (ret) > dev_err(dev, "failed to set link count\n"); > > @@ -439,6 +443,8 @@ static int j721e_pcie_probe(struct platform_device *pdev) > ret = of_property_read_u32(node, "num-lanes", &num_lanes); > if (ret || num_lanes > data->max_lanes) > num_lanes = 1; > + > + pcie->max_lanes = data->max_lanes; > pcie->num_lanes = num_lanes; > > if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48))) Reviewed-by: Roger Quadros cheers, -roger _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel