From patchwork Thu Nov 24 08:12:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 25365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3258931wrr; Thu, 24 Nov 2022 00:15:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QCRLvKAungWaAHc2el2LwkW84X4wNBgg4k8olz+VTgEpzqnUj/UDKKiM5CSz7NDDOodH9 X-Received: by 2002:a17:902:b908:b0:189:1ef4:237b with SMTP id bf8-20020a170902b90800b001891ef4237bmr12853177plb.20.1669277702954; Thu, 24 Nov 2022 00:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669277702; cv=none; d=google.com; s=arc-20160816; b=k55nQvOq5xPolxDgVI6m5qAmBiJKD2+0ZguXO5wABjnEyPG7xQQrTjmOpDizyRbypW 49QfnO1zKVO2sT7qRX3pJPHJgNN4f998a1mKdUBMaoIsDr+gQF1xqWReiqw1wAFoh+qP MIXT2Rie0p+Qt3rYardOM9j014QQLMyShCW4JMNDMdrwTnl9OXGgrDDxid5I9Ak+KU/B DcyaFCjrjh2tYpdhjyBp6HbtYgDIM9fY7XblKOWnJfYkQ2KJHEqWUcC0xZXZhI4eF7RB 2fk4cAt4PuAszCCwKDklub7i7arJAuh16SzKOWPG7CIr8Av/2F89c2o3/6gNDbZfB6FC tkmQ== 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=THaNyo3HhYLvjcOyg5mmXhOiGWwB/c47R2AQOF2zeU8=; b=eKyMS7cAkxZyOiuM0272dTOq4ld74NSLkQtoCBdn7+WzDBCB/uHeVyF9+mDo0MjErL T45HsJXDSUzLOVGn/kzCHHP6A6IkABHkyH6XtEqQ5/S7MdfqcJEUXRiUPw9AWjw4LrZb tGpz47LFtew0/Il0lPSo0uaj1eKJCc9c3F4zMpYEpHiO4gHbR6SwajLgB30nGfl85b7M e4m5TnGA0DFxlC/j4hqOZ8ESgNlqwyr6sMFko9GFT91C6ZfzInryTBYLasaKdaxQbMWk 5pIVRtvpmNxWv1D/Qs0RJNbO9FhE2LQ30Bqq8XP6MJpsU8HWoEPLfwjqo5U1orcfLXs0 WbVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=rAICvLjq; 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 iz17-20020a170902ef9100b001874910a2c6si390395plb.286.2022.11.24.00.14.50; Thu, 24 Nov 2022 00:15:02 -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=rAICvLjq; 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 S230018AbiKXIOU (ORCPT + 99 others); Thu, 24 Nov 2022 03:14:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiKXINQ (ORCPT ); Thu, 24 Nov 2022 03:13:16 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4509B28E3B; Thu, 24 Nov 2022 00:12:54 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8Cadh130275; Thu, 24 Nov 2022 02:12:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669277556; bh=THaNyo3HhYLvjcOyg5mmXhOiGWwB/c47R2AQOF2zeU8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=rAICvLjqKFwDLHHRGoaCPr0oJ97AoqMEeIyD4sFkqaulzh0pslkKfB5TbO/rAUW57 LBCt3Pz0T6hKyTgZeHtDwq7Vc1i3dEISjCCc403Fez9kpKAZjZL2M2is2/kZak7ar+ eXZJVgmZ8stGnrUIHg3P9dpv8nAuWShrYq+34D3U= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AO8CaZn064024 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Nov 2022 02:12:36 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) 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.16; Thu, 24 Nov 2022 02:12:36 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE103.ent.ti.com (10.64.6.24) 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; Thu, 24 Nov 2022 02:12:35 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8CWih009876; Thu, 24 Nov 2022 02:12:34 -0600 From: Matt Ranostay To: , , , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v7 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Date: Thu, 24 Nov 2022 00:12:17 -0800 Message-ID: <20221124081221.1206167-2-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221124081221.1206167-1-mranostay@ti.com> References: <20221124081221.1206167-1-mranostay@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_NONE,SPF_PASS 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?1750364536567015343?= X-GMAIL-MSGID: =?utf-8?q?1750364536567015343?= Add num-lanes schema checks based on compatible string on available lanes for that platform. Signed-off-by: Matt Ranostay --- .../bindings/pci/ti,j721e-pci-ep.yaml | 28 +++++++++++++++++-- .../bindings/pci/ti,j721e-pci-host.yaml | 28 +++++++++++++++++-- 2 files changed, 50 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..1aeea168d3d0 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,31 @@ properties: items: - const: link_state +allOf: + - $ref: "cdns-pcie-ep.yaml#" + - if: + properties: + compatible: + enum: + - ti,am64-pcie-ep + then: + properties: + num-lanes: + minimum: 1 + maximum: 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..8eca0d08303f 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,31 @@ properties: interrupts: maxItems: 1 +allOf: + - $ref: "cdns-pcie-host.yaml#" + - if: + properties: + compatible: + enum: + - ti,am64-pcie-host + then: + properties: + num-lanes: + minimum: 1 + maximum: 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 Thu Nov 24 08:12:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 25369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3262245wrr; Thu, 24 Nov 2022 00:24:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4xQ+1LaUHyB7uXvXQiu8YQhzyK8oGuG8PdLCxnZyNKCxLkoW/E8jVv1A8cT+Ufw1QlHhrN X-Received: by 2002:a17:90b:804:b0:213:de70:9eb5 with SMTP id bk4-20020a17090b080400b00213de709eb5mr39965547pjb.145.1669278263789; Thu, 24 Nov 2022 00:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669278263; cv=none; d=google.com; s=arc-20160816; b=aKA5DURiRRVTqmirHvV/HSu5erDCRj3SJ/sU9NN5GMHXITC+HGaX7FE8aZIiiAG66C 7YWPAKV9DKm+1Be0HMM3ScJOHP4Nk9UNFDnbtXZweTp4FWA4imrgqQJDzjnrhnc8PVUv PLaWMy7dAJDLTePdMmZ81GQhDpZdaeWnaW4C42IE7SeV4c3Jcg3v8/7utvF5C8ko1oCj lFPCY6+p9G6KoFIc+FdDHoR9SGHCw6+m8He5HwZl/tL5NIsEiRVWFAmVO7Pu57ed7daJ 1ouvgPuTWGNk5TDcpa9fzdGFQeqM58WbJBNQjZqn4pBUQURYKFSsTd0v72zeVcj6bNAE nGDw== 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=icwkXwdDLLRLIgqPgrJxrVgU12rVdFpd1ApN1dUhl/A=; b=dLkvpFMendgM7VtR8Pwwaf/1eG7Pr8baq9I/7DN2ayUgf+TFzU6V0qmyFM2HYbAnxs hNQJrpgi4lGjMAN62SWpM36dQ3krM8uMrGFWUasgEWxsogEC5LXIi1RUeMH04+cRg3t6 ZP7rUENd6MO3g8+CR8jW9nR9zn2YUDZus5J4R+JkFZd9PQYZcSkMwtgnHG9VbLqNyCMw 9cg9t5KrFu53DCS4mYON2Mirkyxvbc19VPiSxP+VpsHeeKQOERklZeWPY2qDNWXoJxoI eCMT4P6mogBeuzoD4dAqGTU5PzS+nruNlDfU7yma2CV8M9KguqBcbOJwnYb7SROKTFjj 8DzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=g9Q1l2nf; 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 u11-20020a056a00124b00b0056befaa95a1si596729pfi.50.2022.11.24.00.24.10; Thu, 24 Nov 2022 00:24:23 -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=g9Q1l2nf; 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 S229961AbiKXIOa (ORCPT + 99 others); Thu, 24 Nov 2022 03:14:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbiKXINj (ORCPT ); Thu, 24 Nov 2022 03:13:39 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079D013E05; Thu, 24 Nov 2022 00:13:01 -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 2AO8CfWu048765; Thu, 24 Nov 2022 02:12:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669277561; bh=icwkXwdDLLRLIgqPgrJxrVgU12rVdFpd1ApN1dUhl/A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=g9Q1l2nf//4na4ZLYXBpFGW77gO+rNar66tacimwymwfmH/E0dqvELe3X8L4m52lt TITLcF0xjJvphkXSPKmwcMJswzCQLcgIt68CDuU3t34FTvxxKbn0n3AQ6RqqKDi2g7 orbQ/uEMe/ZBtwB995Rtdp01M/snHjPDaCpWSIaw= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AO8Cflh036658 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Nov 2022 02:12:41 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 24 Nov 2022 02:12:41 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) 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; Thu, 24 Nov 2022 02:12:41 -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 2AO8CcRc022226; Thu, 24 Nov 2022 02:12:40 -0600 From: Matt Ranostay To: , , , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v7 2/5] PCI: j721e: Add per platform maximum lane settings Date: Thu, 24 Nov 2022 00:12:18 -0800 Message-ID: <20221124081221.1206167-3-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221124081221.1206167-1-mranostay@ti.com> References: <20221124081221.1206167-1-mranostay@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_NONE,SPF_PASS 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?1750365124445154695?= X-GMAIL-MSGID: =?utf-8?q?1750365124445154695?= 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 --- 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 cc83a8925ce0..8990f58d64d5 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,7 +437,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 Thu Nov 24 08:12:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 25366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3259379wrr; Thu, 24 Nov 2022 00:16:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf40/gaDH2MOExMmY0Zu7OLXcO6GvzWAqVhR434tSr8RjkOCivTUwCbYlUiFnSE2kuIq/0uo X-Received: by 2002:a17:902:d711:b0:188:c7b2:2dd with SMTP id w17-20020a170902d71100b00188c7b202ddmr14235159ply.88.1669277775788; Thu, 24 Nov 2022 00:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669277775; cv=none; d=google.com; s=arc-20160816; b=iMLmV23G5tJlnU7z5xBTB4I+O5j4lqyV+1To5YQ3FaaW33+hdQd/8th2ifiuenQNLI rp2o+AJpUQZMMVdnxVlv72oQO5T+v2aJw7FvAy9M9Pa0S1Os/Vh3ymtwbqKsQrTyQEoO eqqSUl5KosgPt//tL1bOQFAnLrFPf9nxgGl3RyMbBqWtwKStNMCjawgI+9eCPVWq/5k7 lnhXmSMbgXalNHyAmJS6L+8rN1FNQf+wBwC3E7m8hoBzdnjMRSIxyr1nVkM5qTCig11R ZcjHvSHymW4PbIlOLk32rHc/JUSRbBPU3N9PRrCHg0XWF+cjSBUFKOD0JPjKmHKZ4RCZ rgYA== 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=8t12a/i1HdTF340cTJEw4enSchYXbeF3/TOGg+nFG4o=; b=ucJUus2hJtU8eB4lIS2c9FZ6zOQyEgeIFQiULclOClq3uH0uM+tM3GTh2CLpLadWM7 D4Ez5p+FlaAwQ3FuahNHuuNS6hKI9aQTABLuEFLxi1AURhUP6Hv4u0HF06IHOeTf+YxZ vWi7hRJJLTBmd4PyLYVlLWLwa3R99fUgu5GQqA8riF8h3dnT0ZqCNN1Nnp0OfFf+6rL4 ZwbDG5fHYlXBIiZRloeq3KeIEQ/rCedBbo1iWwrYMUehMjreDxzso0A6wft5SYFVpJPh ThDi+T5LTw57ISsODURIcusWv+uT1++RkmnPW6wRBhoPo2v7rKR7FOoN/dGf4iy5OB/S NJBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fERWTGWe; 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 w4-20020a170902904400b0017e20ec5490si410511plz.301.2022.11.24.00.16.01; Thu, 24 Nov 2022 00:16:15 -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=fERWTGWe; 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 S229766AbiKXIOV (ORCPT + 99 others); Thu, 24 Nov 2022 03:14:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiKXINQ (ORCPT ); Thu, 24 Nov 2022 03:13:16 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BFF2CC8D; Thu, 24 Nov 2022 00:12:55 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8ClDb130315; Thu, 24 Nov 2022 02:12:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669277567; bh=8t12a/i1HdTF340cTJEw4enSchYXbeF3/TOGg+nFG4o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fERWTGWellBd0Op+pVspPHWs9kdJPaXuSFAbylagNqq3ektEbzcnMLhE32Qt7EvBM eH+LkvUz/WoabyLcZo+0mZQOUICr5TJotdn6z2OPJK8q7UURMo3Ymg2DOA9LBGyRAc 8M+C1tB+J9N1tcLh4nyGephAHSus5qQfOFY5jgF8= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AO8ClE4064095 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Nov 2022 02:12:47 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) 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; Thu, 24 Nov 2022 02:12:46 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE102.ent.ti.com (10.64.6.23) 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; Thu, 24 Nov 2022 02:12:46 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8ChYt026061; Thu, 24 Nov 2022 02:12:45 -0600 From: Matt Ranostay To: , , , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v7 3/5] PCI: j721e: Add PCIe 4x lane selection support Date: Thu, 24 Nov 2022 00:12:19 -0800 Message-ID: <20221124081221.1206167-4-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221124081221.1206167-1-mranostay@ti.com> References: <20221124081221.1206167-1-mranostay@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_NONE,SPF_PASS 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?1750364613015980011?= X-GMAIL-MSGID: =?utf-8?q?1750364613015980011?= 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 --- 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 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))) From patchwork Thu Nov 24 08:12:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 25368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3261852wrr; Thu, 24 Nov 2022 00:23:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf47LP19Fo7kCkxpsgC8JP7h2cUv1UEFQDOefF0PWDOmlWT0dTwfHYZjunF8czQN84CY2wxo X-Received: by 2002:a63:e712:0:b0:477:7f69:2749 with SMTP id b18-20020a63e712000000b004777f692749mr11317852pgi.372.1669278189200; Thu, 24 Nov 2022 00:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669278189; cv=none; d=google.com; s=arc-20160816; b=oBN8WEZl8hvQjh0ZrutcxZVvjBbbinAy+17MZpTT8zJ+6k2n9/J1QnhiaCnzoSBkLU rCXINrzsaW9R7F1qO5qT9myyDK6Hah6uba7cMm84uHAm9/E34vccDk4BiAFjUttxmbp9 idQB7Uue7wkK1bma+Sompdtl5gKs934rPOOL+22Avaq+6aTe6hNMXx3mSVvmcz3YnTTy 4P8NqAkZEIvddPdDD1+a5T3+M3V508btwYQeaSRniXUftMyC5Jf0ArMLm5grrB743AGR v7PgC2En7sDRMuBjseHj/TTFEP5tOdHk0MEI6j3kKrMxKqVolt+mq13r1y0xaO63fr8R SaJA== 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=32Ubr6pDmwWnVPRGFAMV+5MACScah3nsX53UXKG5qPs=; b=CyNqqFAXkJQaZZliGfYuKRN3YvoMLuEmowJEouxcecMEKH0uMPWdz9zKAq61s8AIdU knIh58mqTElrCWNqWbQI0geuGUEo1Oj3Gh7OiscINcgGSJ+PAPrkYYY9++MCA9200Fe/ WzfPx556S/3VXfTXLWyUfjP9t+PQj/gPAX77Z5n3tF5V7SjQ0E8hvrPCLyHvsiWr/oK2 EFk6OhqSr+z8DQ40Z+E0W+ECq6X/IIIG292GmesyivBxHLjjnFZxrA4Px/zBmd5/0c2a DB88LW1IkvrYHCMc6KCwNIc7y7ieeDnjVaFWH+7qshXTLZlX3Tv7DpFeN+4qaQP69WT5 N4IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=n5NJZjya; 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 m3-20020a1709026bc300b001869ba21491si447735plt.8.2022.11.24.00.22.56; Thu, 24 Nov 2022 00:23:09 -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=n5NJZjya; 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 S229968AbiKXIOZ (ORCPT + 99 others); Thu, 24 Nov 2022 03:14:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbiKXINj (ORCPT ); Thu, 24 Nov 2022 03:13:39 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 523B453EE1; Thu, 24 Nov 2022 00:13:00 -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 2AO8CqZ7025091; Thu, 24 Nov 2022 02:12:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669277572; bh=32Ubr6pDmwWnVPRGFAMV+5MACScah3nsX53UXKG5qPs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=n5NJZjya4w2wmH047lBAXkjaTZVRRemzt5Erx6L8AAqofXpYdsN2KINByQnv75ZW9 xPfp0ZL3ZX9ArViPNswVlklLj+yAu1IS75sJOUDn7w05qPUzUJGu23XkO6ceXLZ3I0 WoNzVBkVxNK6LagtYV+PJKQi1Z65mkwAJqDHsIu4= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AO8Cqd7064121 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Nov 2022 02:12:52 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 24 Nov 2022 02:12:52 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Thu, 24 Nov 2022 02:12:52 -0600 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 2AO8Cm1D022325; Thu, 24 Nov 2022 02:12:50 -0600 From: Matt Ranostay To: , , , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v7 4/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Date: Thu, 24 Nov 2022 00:12:20 -0800 Message-ID: <20221124081221.1206167-5-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221124081221.1206167-1-mranostay@ti.com> References: <20221124081221.1206167-1-mranostay@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_NONE,SPF_PASS 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?1750365046762487042?= X-GMAIL-MSGID: =?utf-8?q?1750365046762487042?= 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 --- .../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 1aeea168d3d0..2e6226cbd1d3 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 @@ -87,6 +88,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 8eca0d08303f..100d3f556adb 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 @@ -120,6 +121,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 Thu Nov 24 08:12:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 25367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3261251wrr; Thu, 24 Nov 2022 00:21:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf69A8qO/ds2PY+dunDhDUs9xJMGCzu1wVg8m2u1OcJHRi0SrLw2mQ8GrI0HUDMjNCfAk6RD X-Received: by 2002:a63:548:0:b0:477:b4f4:84c with SMTP id 69-20020a630548000000b00477b4f4084cmr7421364pgf.24.1669278091922; Thu, 24 Nov 2022 00:21:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669278091; cv=none; d=google.com; s=arc-20160816; b=xc0EVjIEx2B7R7cUMi1eQcXS30bphUHcevmbpLPF4ots5R8/1291++Gh2LgJFgakkX PJYRQB4IX9kvFDQWHPNjypv/PJsAkcScFW3OY2eNqb7Zx7p8DFnpsM7Yb6oEnFAiV6r2 BGei/a8bjPPXQ1TEAfF+q8DjKT7Mz/UO9BR4Gd5AxCBnpdN9pLlT5NVddGn08cRiwDDl kYWWNKFLx03osD6GZccjzvM/PS70BWov7v0TZpwujv9CK7L7HNdIPei8jRS48lYLr4rM HB4opcN0d/R3l+hx0w2kxExuNOca8y0RIMgATWN7UrQLPtJ+R0TUxdI6mT0PpwOX0XRd p+6A== 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=pQRNSGirOQXjd3vm3b5fncqcHi4AeVKpPaZV1zeypiI=; b=uAvXRfcsD/eCmv6Ipth3b4ZLQrhiI1peAJl/7GGsg5QWb85Q0utVmoXO1tiZy+cRR3 jllTio+FSuOS9Owx37XcfKr2BvhFGv4hPh3Pjxj4BnyDvT2r5SbwPOH5QJR3ITDlKwe5 YnMgzlyefLE7IXsLysofz/ibYez5iKksFP8OsLIlp0CkHcuzgPs2wwy2BNRnKCiZC6Y2 k8s6Bny2rM7KzggazXm4e71d92ezqoKQGcH1yZdJ8nZFLWbiFq+p4pVKFcRs/wotr1PA BEbATdYCKgLtdxUv5I7b6+IaHliBaMvF+csqIgu6piyJRP0mCsDFkct20HoUqURCdV1/ ouMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="cNqv/qkf"; 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 q5-20020a170902c74500b0018927073070si334333plq.589.2022.11.24.00.21.09; Thu, 24 Nov 2022 00:21:31 -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="cNqv/qkf"; 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 S229878AbiKXIOt (ORCPT + 99 others); Thu, 24 Nov 2022 03:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbiKXIOI (ORCPT ); Thu, 24 Nov 2022 03:14:08 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F0991C2B; Thu, 24 Nov 2022 00:13:13 -0800 (PST) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8CvFH028202; Thu, 24 Nov 2022 02:12:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669277577; bh=pQRNSGirOQXjd3vm3b5fncqcHi4AeVKpPaZV1zeypiI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cNqv/qkfAfNjBdcTYA/5r4/6cQa59T0HTvpNacBRLazkMGNWIEO+hDP84Ti1rJd6V osB5tJKGP0Mp27hhZsPjwQk4fqmwjD/ne28eV7+UBGRgohCGr6v4d8cnhCTBwhvbUF 9E7NxVVnUKVH5h9Vr3mgFat+TrNCOFqk/W2FahTw= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AO8Cvx2021586 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Nov 2022 02:12:57 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) 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; Thu, 24 Nov 2022 02:12:57 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE109.ent.ti.com (157.170.170.41) 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; Thu, 24 Nov 2022 02:12:57 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2AO8Cs01010102; Thu, 24 Nov 2022 02:12:56 -0600 From: Matt Ranostay To: , , , , , , , , , , CC: , , , , Matt Ranostay , Achal Verma Subject: [PATCH v7 5/5] PCI: j721e: add j784s4 PCIe configuration Date: Thu, 24 Nov 2022 00:12:21 -0800 Message-ID: <20221124081221.1206167-6-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221124081221.1206167-1-mranostay@ti.com> References: <20221124081221.1206167-1-mranostay@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_NONE,SPF_PASS 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?1750364944398687111?= X-GMAIL-MSGID: =?utf-8?q?1750364944398687111?= Add PCIe configuration for j784s4 platform which has 4x lane support. Tested-by: Achal Verma Signed-off-by: Matt Ranostay Reviewed-by: Roger Quadros --- drivers/pci/controller/cadence/pci-j721e.c | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index dab3db9be6d8..c484d658c18a 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -330,6 +330,21 @@ 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, + .is_intc_v1 = 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 +370,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, + }, {}, };