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 584B6C4167B for ; Tue, 5 Dec 2023 05:13:14 +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=LwwxSqP75SbkfU2si+fyay01lX5mCBccGec3GAXtcPI=; b=4DjSlv/MKTJf8T kBkfP7gid5FzrIWCuE6MtnV0TLtAzIGCCn2puKkN9D7bX8RePgLdQM+jqipP9LZPeXjpjJnjLw4fr /4yTCCbv1CrcqDXPE7/vydXVyaF7OJ42wuN3s9GGkuoNrBfnHvkzr11XP/iFYyLKvQxZhKVPzHN1Y Ktwbx88lpZKq7lPlFyHmW3j7Qx3gr5l5hS3xLZpXdosplJGl13HtzEKAmfzZ6+wjDr5laUtSfQ7ch KPbHlPOhqOCqFgEvCjIg37bPcjTD+72l8dFrKak479gwXtiXvQrnKA1OC0/p+ebe9iYNTNX1fWmAd uvb2EWSsCg/sYWA8w8rg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rANje-006HnJ-2D; Tue, 05 Dec 2023 05:12:42 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rANjb-006HmH-0x for linux-arm-kernel@lists.infradead.org; Tue, 05 Dec 2023 05:12:40 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3B55CM09093592; Mon, 4 Dec 2023 23:12:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1701753142; bh=0A6QOgLi7WtkHW5ZuVLDo3tJJa1jINJ9fG5kLANsTAA=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=zG4kbJzcI53kU3CXYb3aXSGzf+DvT0hNy75ybUvWrhocZaBS03p+DU3TorEwUK+Ai azcTQ/eI6bGUslyb6KrV0bgUHOfSNQt5tF6Hqrlgp7OUY+BpF8Y0YvGAU7GyAWxckY AbpGTlZYFLq1UDQbIngA5rozJ94RRLZX0y2mpY/U= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3B55CMYD092166 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Dec 2023 23:12:22 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 4 Dec 2023 23:12:22 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 4 Dec 2023 23:12:21 -0600 Received: from [172.24.227.247] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3B55CGXj033095; Mon, 4 Dec 2023 23:12:17 -0600 Message-ID: Date: Tue, 5 Dec 2023 10:42:16 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings Content-Language: en-US To: Siddharth Vadapalli , , , , , , , , CC: , , , , , , , Ravi Gunasekaran References: <20231128054402.2155183-1-s-vadapalli@ti.com> <20231128054402.2155183-4-s-vadapalli@ti.com> From: Ravi Gunasekaran In-Reply-To: <20231128054402.2155183-4-s-vadapalli@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231204_211239_436271_D7E165FC X-CRM114-Status: GOOD ( 19.65 ) 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 11/28/23 11:14 AM, Siddharth Vadapalli wrote: > From: Matt Ranostay > > Various platforms have different maximum amount of lanes that can be > selected. Add max_lanes to struct j721e_pcie to allow for detection of this > which is needed to calculate the needed bitmask size for the possible lane > count. > > Signed-off-by: Matt Ranostay > Signed-off-by: Achal Verma > Signed-off-by: Siddharth Vadapalli > --- > drivers/pci/controller/cadence/pci-j721e.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c > index 2c87e7728a65..63c758b14314 100644 > --- a/drivers/pci/controller/cadence/pci-j721e.c > +++ b/drivers/pci/controller/cadence/pci-j721e.c > @@ -47,8 +47,6 @@ enum link_status { > > #define GENERATION_SEL_MASK GENMASK(1, 0) > > -#define MAX_LANES 2 > - > struct j721e_pcie { > struct cdns_pcie *cdns_pcie; > struct clk *refclk; > @@ -71,6 +69,7 @@ struct j721e_pcie_data { > unsigned int quirk_disable_flr:1; > u32 linkdown_irq_regfield; > unsigned int byte_access_allowed:1; > + unsigned int max_lanes; > }; > > static inline u32 j721e_pcie_user_readl(struct j721e_pcie *pcie, u32 offset) > @@ -290,11 +289,13 @@ static const struct j721e_pcie_data j721e_pcie_rc_data = { > .quirk_retrain_flag = true, > .byte_access_allowed = false, > .linkdown_irq_regfield = LINK_DOWN, > + .max_lanes = 2, > }; > > static const struct j721e_pcie_data j721e_pcie_ep_data = { > .mode = PCI_MODE_EP, > .linkdown_irq_regfield = LINK_DOWN, > + .max_lanes = 2, > }; > > static const struct j721e_pcie_data j7200_pcie_rc_data = { > @@ -302,23 +303,27 @@ static const struct j721e_pcie_data j7200_pcie_rc_data = { > .quirk_detect_quiet_flag = true, > .linkdown_irq_regfield = J7200_LINK_DOWN, > .byte_access_allowed = true, > + .max_lanes = 2, > }; > > static const struct j721e_pcie_data j7200_pcie_ep_data = { > .mode = PCI_MODE_EP, > .quirk_detect_quiet_flag = true, > .quirk_disable_flr = true, > + .max_lanes = 2, > }; > > static const struct j721e_pcie_data am64_pcie_rc_data = { > .mode = PCI_MODE_RC, > .linkdown_irq_regfield = J7200_LINK_DOWN, > .byte_access_allowed = true, > + .max_lanes = 1, > }; > > static const struct j721e_pcie_data am64_pcie_ep_data = { > .mode = PCI_MODE_EP, > .linkdown_irq_regfield = J7200_LINK_DOWN, > + .max_lanes = 1, > }; > > static const struct of_device_id of_j721e_pcie_match[] = { > @@ -432,8 +437,10 @@ static int j721e_pcie_probe(struct platform_device *pdev) > pcie->user_cfg_base = base; > > ret = of_property_read_u32(node, "num-lanes", &num_lanes); > - if (ret || num_lanes > MAX_LANES) > + if (ret || num_lanes > data->max_lanes) { > + dev_warn(dev, "num-lanes property not provided or invalid, setting num-lanes to 1\n"); > num_lanes = 1; > + } > pcie->num_lanes = num_lanes; > > if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48))) Reviewed-by: Ravi Gunasekaran -- Regards, Ravi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel