From patchwork Sun Jan 22 12:21:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 46939 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1128075wrn; Sun, 22 Jan 2023 04:22:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXt1hCoYQdP4tChbki5H3cML+nW2MVI+zjzod6SbX9990XTYjkiTKUe5c6kJe9XXPUrfq8XK X-Received: by 2002:a17:90a:528e:b0:229:eae4:bef9 with SMTP id w14-20020a17090a528e00b00229eae4bef9mr12726638pjh.43.1674390138361; Sun, 22 Jan 2023 04:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674390138; cv=none; d=google.com; s=arc-20160816; b=W1mxwaUNaxWOkpIEngAzX1sGsz034lp2QA/EcXbDch5c9xZqTk4HJVT0cVV/eR3Mnx yJwqt/XYUrF8a6Sd3y3C/fLFtgr1FI+alg3hLzi0PrfTt7LyS2OyRcUCGsUjcLU71Jo2 3fJji2qSYYEFO29p1lbRPjQC8mvfIcQ2n/8PLvg1kE5n8/WK+Iv1MN4eY9w7E8P01pRn phjFL4dZrTuUftWKEAGiffXmmAeV0iio4IKF3dYdd4DcYytVir/GMlDQ64uUTlo0cyre bFDBDsISyeg674/OmZ2V1x63RsWoXBD6edhNXD+ZjpIURmFn8CIQcFGctKkajYMuh5oO ctjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TvLXqGFP62Kxbj9vLoF4VkS0d1KSy83RMoiHtO0IdzA=; b=AVJaSl9IEXaSZ7+8srRt6jB+NVF3eCxMIy+AhO+/DI7M1XYY7bwSk3utfuw3fGBHyM VvNoFC/SM8B9jDTRKu2VOLl5amfA4AiAXjKYUEevYa2FU3I7eHF62IvMb8vWUM6IwSaK h/FqTmoCiPWMMsSxS9S11sHKRylNU+ORaWT1kW9QIFXgttGICcuw6cdSvx55pGGtokDT E90GaA5Y1OyJ0MimTRBFX1W5bNEpuudlv2//A5Dwhvti1U8LEbC1bEIb7uuvRbBz5ZvF a9MzDsH9cF1T6kTkC9j/4qmWp4tWO/usYe/1zboIzyAgHtaa7LwcfXwFOLWeSzdtaqrH gJEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=C7DsTRmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a63e445000000b004792b08adaasi48520313pgk.418.2023.01.22.04.22.05; Sun, 22 Jan 2023 04:22:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=C7DsTRmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbjAVMVl (ORCPT + 99 others); Sun, 22 Jan 2023 07:21:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbjAVMVi (ORCPT ); Sun, 22 Jan 2023 07:21:38 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 640035BB7; Sun, 22 Jan 2023 04:21:37 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLOu5106723; Sun, 22 Jan 2023 06:21:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674390084; bh=TvLXqGFP62Kxbj9vLoF4VkS0d1KSy83RMoiHtO0IdzA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=C7DsTRmRz2zG8zyIKBkpcJQ9v6OTfepRGfzgrLPkCMR+TyKf1Fsi2Vm4Z47IWq0zE FaMCkwwQKaEmf47aLhDEasL2fRmqWiAJB0zCHMRLD6NaTekTaRaCiFBssTKsSM2LOi Mdi5PpQ1q/xkdnTCQqxKBBCCa5Lroc8mkiH/zH3o= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30MCLOsS075614 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 22 Jan 2023 06:21:24 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 22 Jan 2023 06:21:24 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) 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.16 via Frontend Transport; Sun, 22 Jan 2023 06:21:24 -0600 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 30MCLNTH029933; Sun, 22 Jan 2023 06:21:24 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v9 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Date: Sun, 22 Jan 2023 17:51:17 +0530 Message-ID: <20230122122121.3552375-2-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230122122121.3552375-1-a-verma1@ti.com> References: <20230122122121.3552375-1-a-verma1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755725313450597666?= X-GMAIL-MSGID: =?utf-8?q?1755725313450597666?= From: Matt Ranostay Add num-lanes schema checks based on compatible string on available lanes for that platform. Signed-off-by: Matt Ranostay Signed-off-by: Achal Verma Reviewed-by: Krzysztof Kozlowski --- .../bindings/pci/ti,j721e-pci-ep.yaml | 27 ++++++++++++++++--- .../bindings/pci/ti,j721e-pci-host.yaml | 27 ++++++++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml index 10e6eabdff53..32e0c70ed801 100644 --- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml @@ -10,9 +10,6 @@ title: TI J721E PCI EP (PCIe Wrapper) maintainers: - Kishon Vijay Abraham I -allOf: - - $ref: "cdns-pcie-ep.yaml#" - properties: compatible: oneOf: @@ -65,6 +62,30 @@ properties: items: - const: link_state +allOf: + - $ref: cdns-pcie-ep.yaml# + - if: + properties: + compatible: + enum: + - ti,am64-pcie-ep + then: + properties: + num-lanes: + const: 1 + + - if: + properties: + compatible: + enum: + - ti,j7200-pcie-ep + - ti,j721e-pcie-ep + then: + properties: + num-lanes: + minimum: 1 + maximum: 2 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml index b0513b197d08..9d4611387387 100644 --- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml @@ -10,9 +10,6 @@ title: TI J721E PCI Host (PCIe Wrapper) maintainers: - Kishon Vijay Abraham I -allOf: - - $ref: "cdns-pcie-host.yaml#" - properties: compatible: oneOf: @@ -98,6 +95,30 @@ properties: interrupts: maxItems: 1 +allOf: + - $ref: cdns-pcie-host.yaml# + - if: + properties: + compatible: + enum: + - ti,am64-pcie-host + then: + properties: + num-lanes: + const: 1 + + - if: + properties: + compatible: + enum: + - ti,j7200-pcie-host + - ti,j721e-pcie-host + then: + properties: + num-lanes: + minimum: 1 + maximum: 2 + required: - compatible - reg From patchwork Sun Jan 22 12:21:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 46940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1128487wrn; Sun, 22 Jan 2023 04:23:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXtkZfVdw8nBMoPt/AxdPGZn9AobwCLwFg0WhbtCXCPGS4X3ou7dFbnVAPcR4MShyd+QcZjV X-Received: by 2002:a17:90a:4b84:b0:226:5900:f2f4 with SMTP id i4-20020a17090a4b8400b002265900f2f4mr23229789pjh.4.1674390220360; Sun, 22 Jan 2023 04:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674390220; cv=none; d=google.com; s=arc-20160816; b=S8i/sHEKFaLRIjiSmsREAQssYi+iu6+HK3Ea79g/3YTRGvxmzfdieRX+qsbZSnZPet 4ceCn2w2nGo8Fvsh1R9TIDCy5Ic5358fMdkg3YyH72K3j3Z8aKt5YueTaukP+K8JjHRG NvC7dJy6UG+OuU+iMiXZ7sFHK3tYZepUdtfFqnDkULRdYPVAqmxjpBcPA/7v55b0GkVz yy3JtJswuE8CsQQC54yRjTmhwZEZ+PsCJ3RhztslLlGR7nuIyzCLXAPjnQm3PaQ0XhqQ +raq5Q1GQcytAd+QUbPZ9EhbEW3O290AUttj21ZZr2ebsox4mwr4nFRfSNdD5CnSJyS7 Z15Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6txK6JhGNmC1mVhE7nu+ujxZBb0FV1uO3fUqV2jp4bY=; b=oDHhzp2y2KPGJwNFuyFTnwr484/8xzp7nNMYumYZmhwAiOCwDs11fZuOHx6zPdjKMT 3SNNDC8Iogr8y2gIvntLqVjl1DCDX0/5BcTTnHzuFxMIjhZ07mWobeyjzzby+dTssnLV m0ciTEVLe1NnDkjV6f0keWQttLcBCMtz2kEzC/mKxSXI/1uIGmsnolM+UXH9HmQ2kuUD 8Sx1IC3ZN7asVXyZ/WWzMiBoqghJZa+c+H1flmVRbl5zhNsWQmV9m2ulH0yCfTHNgQ12 wZe20yCo8kA/F6s8vfhmkPkjUiW7BSprmR8OXNOpOqKHLUI/eMyJt7Tb5pelHYP6jczc bSFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uUD0wdUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r2-20020a632b02000000b004ce425ce69esi20072805pgr.378.2023.01.22.04.23.27; Sun, 22 Jan 2023 04:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uUD0wdUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbjAVMVo (ORCPT + 99 others); Sun, 22 Jan 2023 07:21:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjAVMVj (ORCPT ); Sun, 22 Jan 2023 07:21:39 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C00899EC9; Sun, 22 Jan 2023 04:21:37 -0800 (PST) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLQGx106729; Sun, 22 Jan 2023 06:21:26 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674390086; bh=6txK6JhGNmC1mVhE7nu+ujxZBb0FV1uO3fUqV2jp4bY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uUD0wdUcGMaWaRNapg1jUIaE8rsytnwXeUV0aotHoz6HwgiJA07zrOV+va6qVEpd1 mHIaOK1ckBHRivrv6Ce3fZZgYI62fjJviHX7Tz27AZiuAwEJjftSWosnsp7LZQID6w nPF8WZJxhnDQZ+TuPCwrQ64RxEIb/gmTgukBAJo0= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30MCLQbJ066532 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 22 Jan 2023 06:21:26 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 22 Jan 2023 06:21:25 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Sun, 22 Jan 2023 06:21:25 -0600 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 30MCLPtf076458; Sun, 22 Jan 2023 06:21:25 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v9 2/5] PCI: j721e: Add per platform maximum lane settings Date: Sun, 22 Jan 2023 17:51:18 +0530 Message-ID: <20230122122121.3552375-3-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230122122121.3552375-1-a-verma1@ti.com> References: <20230122122121.3552375-1-a-verma1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755725399661395097?= X-GMAIL-MSGID: =?utf-8?q?1755725399661395097?= 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: Vignesh Raghavendra Signed-off-by: Achal Verma --- 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 cc83a8925ce0..f4dc2c5abedb 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))) From patchwork Sun Jan 22 12:21:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 46938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1128068wrn; Sun, 22 Jan 2023 04:22:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXuyb4wHWiKjqu8mT5QxrSxvqEzi8G/0AF26WkKga28cgBn1F1a83aWi1+JrS0D8IxywfR92 X-Received: by 2002:a17:902:db10:b0:194:d9d7:88c2 with SMTP id m16-20020a170902db1000b00194d9d788c2mr14399614plx.21.1674390137370; Sun, 22 Jan 2023 04:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674390137; cv=none; d=google.com; s=arc-20160816; b=efZ16qc1xAuYk2MBl3+Az6D3oviGjFQJfvG6Q6KqKHEAsVNnVBaJxkRxZqtC9spfth m+VFdIkg4DO2H/haqS3gnD2g3t62NLmakW5knJmJCVM+5hPTkaFZqw7Q6DWJGpExueVl 7+GCgwmNPon8mEER1FSGS/97yGPfkGK/aCrrodJRFCfItl8/bseC3Ea3fKp3eYpVyKj2 raYHBORTUCwYSnMI1D7jwgXLz41dpC1ntOeh3Y52LSk3J8MEwnz+8U/SSvhxD04vipHZ CBVmOBYCTeDwpbpqIDg9zYXRATyaZsyJBFiFllPTn3g5W6+uRGUeFanMWc2+pcKvXUuD LmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TISRczCqqClgTnuh9Jgbp4YdFIC7Href1UTZ0gVUQ5I=; b=QGe/ZwK/6NKgpGuU2+0UeZeMS2QUNumFroGtcQl9+jc0pfeKP+x2PokXxcfTKL+jNk r8EddrV4SWSRWfWcBZnlqNwcy7tDNMXIOyZ5fIpACxnBdTWt490gBsJq02R62ITxptdZ amXM7eRyLWL/xa9Pqb1uzqJURHucT7eCxi2u104AYviJSvnRLRl5ngKzJWlW1oJpGXT3 UhFcsPvGoRYWMFqj17lylxh05vU5DTfFXetATi3sRMaImrxugkOFgX/GBnPjDNqNE3zo ZpQY6b3s2XeiWM6lzJG9zCBGlqMcLwBGdJRV5bEjdNOZP/IiroPmd1hDgn1roTZM2VRc WUoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vEINhMjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020a170903110600b0019274931758si1044706plh.577.2023.01.22.04.22.05; Sun, 22 Jan 2023 04:22:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vEINhMjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbjAVMVj (ORCPT + 99 others); Sun, 22 Jan 2023 07:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbjAVMVi (ORCPT ); Sun, 22 Jan 2023 07:21:38 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855E961A4; Sun, 22 Jan 2023 04:21:37 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLRLH106734; Sun, 22 Jan 2023 06:21:27 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674390087; bh=TISRczCqqClgTnuh9Jgbp4YdFIC7Href1UTZ0gVUQ5I=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vEINhMjtD19zKyn81aKyiO8PEEYlg97ZkguUPjq6lA79zoe9+q7jb13wTyTtLdId5 9pOhwf79bQ5GIDtIP2xjd6Yd1LMqA0uW6Cwpmf4FeiZnOdYLzLO8W1ET5kWq0hzH+G yYk/Kyd53aAGLjcgLeMIBm6apoU6AxNSd9NvdPWQ= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30MCLRab102324 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 22 Jan 2023 06:21:27 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 22 Jan 2023 06:21:27 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) 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.16 via Frontend Transport; Sun, 22 Jan 2023 06:21:27 -0600 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 30MCLQWM029950; Sun, 22 Jan 2023 06:21:27 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v9 3/5] PCI: j721e: Add PCIe 4x lane selection support Date: Sun, 22 Jan 2023 17:51:19 +0530 Message-ID: <20230122122121.3552375-4-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230122122121.3552375-1-a-verma1@ti.com> References: <20230122122121.3552375-1-a-verma1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755725313192262362?= X-GMAIL-MSGID: =?utf-8?q?1755725313192262362?= From: Matt Ranostay 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 Reviewed-by: Roger Quadros Signed-off-by: Achal Verma --- 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 f4dc2c5abedb..58dcac9021e4 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 = 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"); @@ -441,7 +445,9 @@ static int j721e_pcie_probe(struct platform_device *pdev) dev_warn(dev, "num-lanes property not provided or invalid, setting num-lanes to 1\n"); num_lanes = 1; } + pcie->num_lanes = num_lanes; + pcie->max_lanes = data->max_lanes; if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48))) return -EINVAL; From patchwork Sun Jan 22 12:21:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 46941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1128906wrn; Sun, 22 Jan 2023 04:25:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXuo4fIxzDKhp+phbE+yiEViNkBG9kSXwbVlDE1yfoKP+erCqdMJnY5RSY2FKln4Ljl2mjxp X-Received: by 2002:a05:6a20:3820:b0:b8:5eb4:a817 with SMTP id p32-20020a056a20382000b000b85eb4a817mr19305169pzf.44.1674390314073; Sun, 22 Jan 2023 04:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674390314; cv=none; d=google.com; s=arc-20160816; b=jq7xMzDvDm1NN0fwEb1u6+SIoN7hHtcfUJ6iwSoYGAsSX4o9FJGSN/MILTJWpAW4QF cULRzj+ygHyCXgpbMadUj6q4jj5U1ON/T0amA12bnmfrrbtCGKszW2yO2fb+2hFEpW0f KzRty5z77UBI1LdgMzDII0zOmVJ5xrvsUeIh0nwNvFRYaFxTPr91lcU2DoXxSnhg7K3B nJ4USTzHPugCAMzF/iCXFxeVUKKAzjNo8GKU8Jq5lkBhOVwgAxQt+7v5QYQegR6dlZ/n RWXOORbr/xTVK/LMEz212TDmazMbUXNZxAwIq8NzCK4O5ReMhT8DC6+pbkjjTPAGiiQ3 wt/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fRSHuSmZfTiBYZk4PRNH9gbEGntiiMWgmXGkY1eFdQQ=; b=r1pzlasSR6Y/HapKDnLmPoRhlbbSDhHHfECNnDm3JhVw0HuIec5gWsKhRahKiToMQh 5LIkmBDoodu0orhtUsuP8A1mQ4d1OkC54xRZRW2qPa6ArowEi3ZHARcqIXt+Qtp+h28V tv2YVWf+sf1MRrDKC0H1JdQkFs2h4SmRcCNPJR9tMLnYvpc+O3/p+5ibQ2I5JVRpIt90 jJxfqwE+nAy2cgLUbY/mKjyHdCbm3VnnUhIHvC75HJ2GHMb3CZBKk0SuNnvDNEzsfBpK FCSQPKVLT5Y6ERkRsWds1YH3bdWMm+5x8Vud0XoesiKtDaVygqlTFYTasrMT5RRTAEni /DCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=YN9Ap80v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g32-20020a632020000000b004a5f0b510d2si49022125pgg.258.2023.01.22.04.25.01; Sun, 22 Jan 2023 04:25:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=YN9Ap80v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230127AbjAVMVq (ORCPT + 99 others); Sun, 22 Jan 2023 07:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjAVMVj (ORCPT ); Sun, 22 Jan 2023 07:21:39 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 309194ECF; Sun, 22 Jan 2023 04:21:38 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLTgN106747; Sun, 22 Jan 2023 06:21:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674390089; bh=fRSHuSmZfTiBYZk4PRNH9gbEGntiiMWgmXGkY1eFdQQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=YN9Ap80vwY+HOduvdurX1Qiaew3l7YQ+jag7FKouXhlUo2JAdCjWUdfIiswxrzVnX jISgbNjqXsPjZC7vHcWNfwh5iRaCgi7lu7tBMU9MKVy8ClpbM61Pj8ZVscou4O8f6R CkPhHWDiVSqCQ/JyI8vAe6OeYfo3DytQORPJO8SI= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30MCLTk3102331 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 22 Jan 2023 06:21:29 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 22 Jan 2023 06:21:28 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Sun, 22 Jan 2023 06:21:28 -0600 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 30MCLSLR076479; Sun, 22 Jan 2023 06:21:28 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v9 4/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Date: Sun, 22 Jan 2023 17:51:20 +0530 Message-ID: <20230122122121.3552375-5-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230122122121.3552375-1-a-verma1@ti.com> References: <20230122122121.3552375-1-a-verma1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755725498081894747?= X-GMAIL-MSGID: =?utf-8?q?1755725498081894747?= From: Matt Ranostay Add definition for j784s4-pci-ep + j784s4-pci-host devices along with schema checks for num-lanes. Signed-off-by: Matt Ranostay Acked-by: Krzysztof Kozlowski Signed-off-by: Achal Verma --- .../devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 12 ++++++++++++ .../devicetree/bindings/pci/ti,j721e-pci-host.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml index 32e0c70ed801..d2fbf1f7aa54 100644 --- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml @@ -14,6 +14,7 @@ properties: compatible: oneOf: - const: ti,j721e-pcie-ep + - const: ti,j784s4-pcie-ep - description: PCIe EP controller in AM64 items: - const: ti,am64-pcie-ep @@ -86,6 +87,17 @@ allOf: minimum: 1 maximum: 2 + - if: + properties: + compatible: + enum: + - ti,j784s4-pcie-ep + then: + properties: + num-lanes: + minimum: 1 + maximum: 4 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml index 9d4611387387..6522daf1f89c 100644 --- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml @@ -14,6 +14,7 @@ properties: compatible: oneOf: - const: ti,j721e-pcie-host + - const: ti,j784s4-pcie-host - description: PCIe controller in AM64 items: - const: ti,am64-pcie-host @@ -119,6 +120,17 @@ allOf: minimum: 1 maximum: 2 + - if: + properties: + compatible: + enum: + - ti,j784s4-pcie-host + then: + properties: + num-lanes: + minimum: 1 + maximum: 4 + required: - compatible - reg From patchwork Sun Jan 22 12:21:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 46944 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1131776wrn; Sun, 22 Jan 2023 04:33:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXvpDDQw5/FzvRv5n9J1A0s7i7Vh1ylyhPGEIqE1ql35LHQBvSNu/2x+Hox2HKmtWAhQ6y5K X-Received: by 2002:a17:906:3a4d:b0:873:393f:1bda with SMTP id a13-20020a1709063a4d00b00873393f1bdamr18838660ejf.47.1674390831694; Sun, 22 Jan 2023 04:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674390831; cv=none; d=google.com; s=arc-20160816; b=HKvA9YevfPcHRQp5lsgNNCB5Ll6mzfmAGZDiZUIoI+wodPZhdE5Jv3qSofjXXIIVG1 i9Gc6K2o75tNO//Rvoz79cbvcu969C2eaia6ojwD0zb11KAwQoqfdg8piltiWy61L3Rb f3N0qtomb5j5M/zGEmL0T6P2mPzTHJHyGRGmwY0pAqiMtwAYoac2PmDRRtXzLA04qzZ/ UYP4nmcatX8/z9YuHpesNYLD2tRm8h6L6KlwDQlHvSNJBCwxjfmxYkCf3UlWta6MIvN+ K1RKkO5y7lWbvY2nCTa2BRhArq+kllwOyOeDTPRwB0TH1kd6RejVEuym/6blSU3W72fW Dpew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GGrsVB2NuWgQ/IDsTg782FJLIK98IZjp/7pCe7Mspxs=; b=r0zVZANAoKsrXGJ+c1dW72RLnkAl8ZOr2wB4hUJYqOxvvD6BcsIJjynyGTZ9xKm2UL tKjdEMixA3th3JQ+/dsV23VZH20OFiVIwPFXJSOM1JsyKR0UA7RIDaoDDPsWZdXgvwoj UU8DAmfif2WbBBWrDQ2UveZDwHjX5CKA+L4mrwUdVqpt5O2sNTn0UFA3OWysABCrvz+2 dqHT4gDNJfMUjQdi2GskFMM7AyJi1iPnRi/6YEkTCykWjShB8s51giowTA28gw44W3Dv yKHPWaBEdhMHlHtutzSV1sLbzHl/4nvcVZfS1NP/KICx+XPxgo2DhF6aLotlC4qk73Rf 7AGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=f8nmQIrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr5-20020a170907720500b008327270a7ffsi19771234ejc.663.2023.01.22.04.33.28; Sun, 22 Jan 2023 04:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=f8nmQIrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbjAVMWD (ORCPT + 99 others); Sun, 22 Jan 2023 07:22:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjAVMWC (ORCPT ); Sun, 22 Jan 2023 07:22:02 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F7729EC9; Sun, 22 Jan 2023 04:21:49 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLU4M118101; Sun, 22 Jan 2023 06:21:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674390090; bh=GGrsVB2NuWgQ/IDsTg782FJLIK98IZjp/7pCe7Mspxs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=f8nmQIrqBKxewIRmuG39303yaIZlvaG4IBCqtSupTJUVDW4zlzAuHK1OUtgHpa4XC UrkVBa+7eu28+hSU/uLOEvdR2gUmXAu1ia7smVQmxTgPWOUVZHhMBCJJUxe2lOzrfd IRPbwymuDn/DLl2BIPVhfsk0K32cyR6GAYCCu6eM= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30MCLUUA102341 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 22 Jan 2023 06:21:30 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Sun, 22 Jan 2023 06:21:30 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) 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.16 via Frontend Transport; Sun, 22 Jan 2023 06:21:30 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30MCLTIJ008319; Sun, 22 Jan 2023 06:21:29 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v9 5/5] PCI: j721e: add j784s4 PCIe configuration Date: Sun, 22 Jan 2023 17:51:21 +0530 Message-ID: <20230122122121.3552375-6-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230122122121.3552375-1-a-verma1@ti.com> References: <20230122122121.3552375-1-a-verma1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755726041150974298?= X-GMAIL-MSGID: =?utf-8?q?1755726041150974298?= From: Matt Ranostay Add PCIe configuration for j784s4 platform which has 4x lane support. Tested-by: Achal Verma Signed-off-by: Matt Ranostay Reviewed-by: Roger Quadros Signed-off-by: Achal Verma --- drivers/pci/controller/cadence/pci-j721e.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 58dcac9021e4..cce7b391f931 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -330,6 +330,20 @@ static const struct j721e_pcie_data am64_pcie_ep_data = { .max_lanes = 1, }; +static const struct j721e_pcie_data j784s4_pcie_rc_data = { + .mode = PCI_MODE_RC, + .quirk_retrain_flag = true, + .byte_access_allowed = false, + .linkdown_irq_regfield = LINK_DOWN, + .max_lanes = 4, +}; + +static const struct j721e_pcie_data j784s4_pcie_ep_data = { + .mode = PCI_MODE_EP, + .linkdown_irq_regfield = LINK_DOWN, + .max_lanes = 4, +}; + static const struct of_device_id of_j721e_pcie_match[] = { { .compatible = "ti,j721e-pcie-host", @@ -355,6 +369,14 @@ static const struct of_device_id of_j721e_pcie_match[] = { .compatible = "ti,am64-pcie-ep", .data = &am64_pcie_ep_data, }, + { + .compatible = "ti,j784s4-pcie-host", + .data = &j784s4_pcie_rc_data, + }, + { + .compatible = "ti,j784s4-pcie-ep", + .data = &j784s4_pcie_ep_data, + }, {}, };