From patchwork Mon Sep 26 17:55:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12989186 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 6062CC6FA90 for ; Mon, 26 Sep 2022 17:57: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:MIME-Version: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=PNZLvqcx50t1dYRGmt0drRRtESPg81NzuP0KGRxqDD0=; b=K5FXJwdPB5Zxf3 5/wuHRFFSTEFuG9fw3kxyQOCX6mxyKXNTTeDADf6N1KpkzO2usLsR/XPzuICRP8bfZIhSXh9A3P34 JR1UQyGZCx9hHNlq42TfOPeWEqKaIFYnlkcKrMiLbFs3iGt1P7JkCvbzElMPF0VQWrgV9p8LyyDof QvVHe7SxC6GeSYB1igIh5/DmfigswpzOEob+um76dpte7s6ezdthq9hRTI4b7YU7iOSt8ODdZnroM 2ZoboAkz5B0oGP89qjNGedZjE+EUTWtF1sbnDlGWL5rXz3JYPPGvFs60Z8KSDvmipDcv2EIws3fJ1 ty447zwCrSNiXTa8Cbiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsL2-006Aiu-C6; Mon, 26 Sep 2022 17:56:16 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsKl-006ASo-9f for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 17:56:00 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 28QHtl5S109936; Mon, 26 Sep 2022 12:55:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1664214947; bh=ohT/Xt+gQdamRFphhGmgt8mEN9/4WnQBb8A+NOnxztw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=AyIbIWyM+J9K9A0y6PRqWOgNLZkegbdQ3ZMgp12NdrmUl44cvVeDhGt+nqu/rjr5r aXwRRaxioKfGgtlbNDpSpaWch5TRh+urVKKpTl4eoewLtK804PQD+QQSrZATL4CTtX JmuEvZJiihlUeaLP9zAIkBFJ6EIe5i99XcqSND7A= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 28QHtlSl061117 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Sep 2022 12:55:47 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 26 Sep 2022 12:55:47 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 26 Sep 2022 12:55:47 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 28QHtjnw037500; Mon, 26 Sep 2022 12:55:46 -0500 From: Matt Ranostay To: , , , , CC: , , , Matt Ranostay Subject: [PATCH v2 1/3] PCI: j721e: Add PCIe 4x lane selection support Date: Mon, 26 Sep 2022 10:55:36 -0700 Message-ID: <20220926175538.362018-2-mranostay@ti.com> X-Mailer: git-send-email 2.38.0.rc0.52.gdda7228a83 In-Reply-To: <20220926175538.362018-1-mranostay@ti.com> References: <20220926175538.362018-1-mranostay@ti.com> MIME-Version: 1.0 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-20220926_105559_438953_E18A592A X-CRM114-Status: GOOD ( 12.62 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for setting of two-bit field that allows selection of 4x lane PCIe which was previously limited to only 2x lanes. Cc: Kishon Vijay Abraham I Signed-off-by: Matt Ranostay --- drivers/pci/controller/cadence/pci-j721e.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index a82f845cc4b5..d9b1527421c3 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -43,7 +43,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) @@ -207,11 +206,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 val = 0; int ret; + if (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"); From patchwork Mon Sep 26 17:55:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12989185 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 72063C32771 for ; Mon, 26 Sep 2022 17:57:13 +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:MIME-Version: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=5oy/735aZqrbmCVHdvgkqVTFX0kxRgAgu2eKfWbSBmc=; b=bFVdsYDLTfcoSA 2235fRZW4W+WiMiizxJtc4u61e0AtGdO3v6Ftlo/3H9CrNcU57M45s63p9Auqu+QQG/evjfWLmrrz MEoP0yY7cfyVP9jQ+IZFLjsWTE5kmcnWL5YrNomztEzAafQVDtB2GH9FFRrNaVW7wQqJjdbQqAdCS V6pap+8gLsq+O9owlUUlFtv6tdmTxZsdXerG2FXyIkk/fbPJtNgowjzMiIYpxg2HeWSP9HhDgiTYX 8hVP2a/lxsKjsno0Eq1DrBHj6e03gKCrWO1DbIZm8FcVwLVFjwuf7Vu863WjvkurOHgvK9NcILNHi 2lpgwv696PN8dK32axYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsKt-006AcB-VL; Mon, 26 Sep 2022 17:56:08 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsKj-006ASJ-DE for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 17:55:58 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 28QHtpZs084272; Mon, 26 Sep 2022 12:55:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1664214951; bh=kHWCgMdOKoMsZm8pDsiNpeyhIn2XCulJkNOgm7a/zfc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NL1Ju6RNMyve1Ag6uCuFAJHacchufPHK02vLX0nGMZ3N1WZw7Q7if7WtS6VsYC/Hv zm/M0fP2eZdbe3Xb/eeGW7kSZsyMsY0sVLaq7fbj4cGJo2n2UEz5vNuPkGMO2K3Ct8 HQi5VG4jMwiny90X3XwObjOSiC3gRTBo/biIkz0s= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 28QHtp32017486 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Sep 2022 12:55:51 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 26 Sep 2022 12:55:51 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 26 Sep 2022 12:55:51 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 28QHtmnH012623; Mon, 26 Sep 2022 12:55:50 -0500 From: Matt Ranostay To: , , , , CC: , , , Matt Ranostay Subject: [PATCH v2 2/3] PCI: j721e: Add per platform maximum lane settings Date: Mon, 26 Sep 2022 10:55:37 -0700 Message-ID: <20220926175538.362018-3-mranostay@ti.com> X-Mailer: git-send-email 2.38.0.rc0.52.gdda7228a83 In-Reply-To: <20220926175538.362018-1-mranostay@ti.com> References: <20220926175538.362018-1-mranostay@ti.com> MIME-Version: 1.0 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-20220926_105557_545918_4BBC6C3C X-CRM114-Status: GOOD ( 13.35 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Various platforms have different maximum amount of lanes that can be selected. Add max_lanes to struct j721e_pcie to allow for error checking on num-lanes selection from device tree. Cc: Kishon Vijay Abraham I Signed-off-by: Matt Ranostay Signed-off-by: Vignesh Raghavendra --- drivers/pci/controller/cadence/pci-j721e.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index d9b1527421c3..0a537f2d5078 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) @@ -294,11 +293,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 = { @@ -306,23 +307,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 = 4, }; 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 = 4, }; 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[] = { @@ -436,7 +441,7 @@ 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) num_lanes = 1; pcie->num_lanes = num_lanes; From patchwork Mon Sep 26 17:55:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12989188 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 46E60C32771 for ; Mon, 26 Sep 2022 17:57:16 +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:MIME-Version: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=cHUmIddfXCtYAbJtrJwxC7JGQAMhOUtZM5Y2XM0pWB4=; b=zzll1cYEkDP7XM 0XDcsjhICHrHttnyTbrjh6eNfbJvdKCioy9UN2GgdV631D1NXM1NFnKyAhe5+mSB8TfRPUQU83WPh s0Wlht7WwsKzUV9cIJ107E6wZBf3xMgvmrpLxb9SkQ+5EiG0EskwmVDvjiHSk+T9dI1Ww525clpA/ pTW2hVhAa6lp90D8YL+H67rOM/v3kqVwljrSrk9/5jYwIO8sSGrimookqOFDb5nnN177dWWpQBFR+ 2Sg2qfGl85iOFBzaJ/zIClBfhmio/+7GM/vaSBFx+w0jwij2uACm6bh05uggAH4TGw9TIqBqoHR48 oW2Wf8rdFiMRkE+XWE5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsLA-006Alj-Kf; Mon, 26 Sep 2022 17:56:24 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocsKl-006ATF-Ej for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 17:56:00 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 28QHttwu097082; Mon, 26 Sep 2022 12:55:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1664214955; bh=sWx2wPx8jCdiJkLyI83h46G/mn17QkErirFk1IPmVPI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=yreYnYHN8L4/gyn2L/OgITwRSE/HKodDaU+r7pvxEgp13W10cUuiJW37WJSTlb6J4 0wP+LKAJH0s14y93uw5sfsnMhVZ+ukvNK7rrRjtUCKtJ2LSsrBSNJv/B6xIbuqBUKJ lHpcqvkI42VefGpmjjgKozFPJpHhgireXZ+kB9iA= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 28QHttNU061291 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Sep 2022 12:55:55 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 26 Sep 2022 12:55:55 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 26 Sep 2022 12:55:55 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 28QHtqhN037777; Mon, 26 Sep 2022 12:55:54 -0500 From: Matt Ranostay To: , , , , CC: , , , Matt Ranostay Subject: [PATCH v2 3/3] PCI: j721e: Add warnings on num-lanes misconfiguration Date: Mon, 26 Sep 2022 10:55:38 -0700 Message-ID: <20220926175538.362018-4-mranostay@ti.com> X-Mailer: git-send-email 2.38.0.rc0.52.gdda7228a83 In-Reply-To: <20220926175538.362018-1-mranostay@ti.com> References: <20220926175538.362018-1-mranostay@ti.com> MIME-Version: 1.0 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-20220926_105559_597033_3B1CAB75 X-CRM114-Status: GOOD ( 12.42 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Added dev_warn messages to alert of devicetree misconfigurations for incorrect num-lanes setting, or the lack of one being defined. Cc: Kishon Vijay Abraham I Signed-off-by: Matt Ranostay Signed-off-by: Vignesh Raghavendra --- drivers/pci/controller/cadence/pci-j721e.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 0a537f2d5078..ee0ab04ca66e 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -441,8 +441,17 @@ 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 > data->max_lanes) + if (ret) { + dev_warn(dev, "no num-lanes defined, defaulting to 1\n"); num_lanes = 1; + } + + if (num_lanes > data->max_lanes) { + dev_warn(dev, "defined num-lanes %d is greater than the " + "allowed maximum of %d, defaulting to 1\n", + num_lanes, data->max_lanes); + num_lanes = 1; + } pcie->num_lanes = num_lanes; if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48)))