From patchwork Wed Jan 18 12:59:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 45281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2341047wrn; Wed, 18 Jan 2023 05:38:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+29S01Ja1KRScDkaCURUJ89TboKmKZ00yO1yulZRZFIVg6Ah5/Dzie2lrCT7xDIxCTY6z X-Received: by 2002:a05:6402:1003:b0:49e:1e:14ee with SMTP id c3-20020a056402100300b0049e001e14eemr7412111edu.34.1674049102229; Wed, 18 Jan 2023 05:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049102; cv=none; d=google.com; s=arc-20160816; b=U+AJ0uuqyZSplvtXWwVSSyz2s7q7nXAd7hgZP5p50TkeYFWp3dZ6Pt+BAhsaKmg1LQ TndZVMzI56kNq0JnElWKbLqa5ZDhjxsth1XvzOsEpzoqaBtge1IQNHsM77ozAgMt1bYM kmNGhLQZ43T+RbvoU+JqgKoqLcurwYMWj7h3ILyf1Yf5rcDFtmBMc2hevSmaZ5MN2wUm DtvEPKlgBTuU5OjbKZZmK58eok8PYaOcdJQc0+2r2mByLHwAK0IY/xRpWBSbBIOgAqfn gMIhLlSOyAYO4Q8FhzpI2BfDM5MfP+xWSi58996feWAv0Z0nblBCybRIEEjrOKsyGg8w 63IQ== 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=OmDhyxusumxXEVyuH5Sjllr2iDvvrq2e6vgSiOeP5YM=; b=JzGafwznwTX6JsYVbmBKN69oxdk5ejgORjpK9RzlEo5X+i2QsB7W6VvtQoFw7f3aVt JJLmepnjNo57mo0/V+NY/U/koJaUBwgzKP1WaY/JWzuOre6ga1pMIiGdIkFRBdq+PuoZ DYCtVo6c8ROz6+5laMKGiBYK7Esp6NIXcBiZNjzou5L7YwpZExyHfNohK01hlNC9AJ/E MzRFSiG3N0L7ZOlhqYKSYYCrBs7579CJekOtDsoHEV2ZlDX4MPH9g22pJRKeGgi2vRgw +YZj0ADyS5BmTPVPIzAELgmqLs9bhU5aL1aUeHkAI6jgaR0R/hlBfTLSQgF3uNUdB4a1 l5Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KmOBihnf; 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 m21-20020aa7d355000000b0049e39fae3f9si3784097edr.87.2023.01.18.05.37.56; Wed, 18 Jan 2023 05:38:22 -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=KmOBihnf; 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 S231386AbjARNd1 (ORCPT + 99 others); Wed, 18 Jan 2023 08:33:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjARNc6 (ORCPT ); Wed, 18 Jan 2023 08:32:58 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C5358964; Wed, 18 Jan 2023 04:59:57 -0800 (PST) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxd5C042737; Wed, 18 Jan 2023 06:59:39 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674046780; bh=OmDhyxusumxXEVyuH5Sjllr2iDvvrq2e6vgSiOeP5YM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KmOBihnfjfv9Qu0r/HhsNxQdion004LK+Ke+onUX4sHSZ0Nur7mzbw2I5dNMSmW8F WmiAmxlj8tyqcvBaVkzooqQMAnxJ7MvEs+qFNU+CFE1QKp72QdjddHLu8DDrksD4e8 aWaxFQF9wSIC9lQSeUlhJRAzrg8MsitgrmGfABzc= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30ICxdQD010085 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jan 2023 06:59:39 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Wed, 18 Jan 2023 06:59:39 -0600 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.16 via Frontend Transport; Wed, 18 Jan 2023 06:59:39 -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 30ICxc2V016777; Wed, 18 Jan 2023 06:59:39 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v8 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Date: Wed, 18 Jan 2023 18:29:32 +0530 Message-ID: <20230118125936.3456716-2-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118125936.3456716-1-a-verma1@ti.com> References: <20230118125936.3456716-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 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?1755367711282096062?= X-GMAIL-MSGID: =?utf-8?q?1755367711282096062?= 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 --- .../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..403cd3ef1177 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..7bd78cfca845 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 Wed Jan 18 12:59:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 45283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2342033wrn; Wed, 18 Jan 2023 05:40:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXuqcBBt/eulXSPUGRt1CDQI2iqNcgf94MwXYColoX4wawoAt7KBa1Hcr6z8r/qcERqLPoit X-Received: by 2002:a05:6402:1956:b0:45c:835b:9448 with SMTP id f22-20020a056402195600b0045c835b9448mr7358753edz.4.1674049234278; Wed, 18 Jan 2023 05:40:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049234; cv=none; d=google.com; s=arc-20160816; b=fpCfTuNZBhPWkNWPsNJchCxIWaw/6zT/XFE1yHCBJCtT3TBBKS5Q21lGfVPT7pY5/G BrkeICllcWtrn6+HqxNQQIxLbtib5Qr0qYJFr4Gzd4iBzVTbtt+eR3HJKdB2tlUycwij y1yEeFlvq9dzaq/29VrlYvFe9PJH6k4eaoGr3KRsx+cXNAXj6FcS0wyUVnFmO2yghMft sndV1SuWOKAV8w2SpHaJA+IHUK3Er+yd+kkx/w7cmMZ5xlc88hXZ2O7XflS/QGbqD5Rb CrxkT/TgJeTnygzx0mTJ+mphxsbnOO/tRsEKp/P47sapIbf3EKEvn4FmZCMoxIX83lEw gCAg== 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=GPIlvChnuVDNc3Y8TYxOW2nhtb1n29SSkMjpvQO4Zzz+jWmI6gmIeHBvI5o+Lk3Ias ED/OyHOmwsMro/kqJTZH7bljhWb9iN/JeCzGtKmU7Eyax45/+Mn2cAQq+OJf0VB7Za5U 5b/xmxScR0RKgQFqZhYbwtttuOS81C/8a8fpNDwwATapKZLOkVz57/UOKiUlRjcak91i 4khJFxy86Xhzq8J8i5c4hOXARQCvV7f14PAj9BOLFKPMTuVQgvRtLQpvRxE9SvpbvkOY XJ+Ua+kHx4K8Y0px1gLppIYPl4wA0B2lDjGIQ1NjMp5HO8CY2WCpqfQnA7zAELxmoIMF RDBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=g4uD3aON; 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 z4-20020a05640235c400b0048c44c8cfcdsi225260edc.167.2023.01.18.05.40.09; Wed, 18 Jan 2023 05:40:34 -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=g4uD3aON; 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 S230195AbjARNdv (ORCPT + 99 others); Wed, 18 Jan 2023 08:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbjARNdB (ORCPT ); Wed, 18 Jan 2023 08:33:01 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8235158954; Wed, 18 Jan 2023 05:00:03 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxfRY079760; Wed, 18 Jan 2023 06:59:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674046781; bh=6txK6JhGNmC1mVhE7nu+ujxZBb0FV1uO3fUqV2jp4bY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=g4uD3aONbWA5QTotkEAoAh8rtZYiGe2WKO9Nwoyoi8wGAjTI+QLoWua7qAeNz9S5j I/W5IF57131YC1Xl+E1XbquDX+z5W1EGbzoMIVC1QmwgN2av+9S0Ad7AFxikOJfrjT tBlAI9lJDgx7ZB/1jDGuWLo9DfV9/M9y626IlQn0= 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 30ICxfI9033217 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jan 2023 06:59:41 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) 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; Wed, 18 Jan 2023 06:59:41 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) 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; Wed, 18 Jan 2023 06:59:41 -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 30ICxedL110636; Wed, 18 Jan 2023 06:59:40 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v8 2/5] PCI: j721e: Add per platform maximum lane settings Date: Wed, 18 Jan 2023 18:29:33 +0530 Message-ID: <20230118125936.3456716-3-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118125936.3456716-1-a-verma1@ti.com> References: <20230118125936.3456716-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 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?1755367849653442431?= X-GMAIL-MSGID: =?utf-8?q?1755367849653442431?= 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 Wed Jan 18 12:59:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 45279 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2340944wrn; Wed, 18 Jan 2023 05:38:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKNXbMj3QpRIH/vJQeXjUoNQ+fMhX4WkKpIZINrZbm2MR5+dWYC1GDlRcGvUZC3L1XLdxY X-Received: by 2002:a17:906:489b:b0:850:52f8:5ca9 with SMTP id v27-20020a170906489b00b0085052f85ca9mr7092771ejq.28.1674049091486; Wed, 18 Jan 2023 05:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049091; cv=none; d=google.com; s=arc-20160816; b=SglRrMVczmyAH0nW2rDNR8Cspq2F4nhLAciUJv2YnB1aN6cpefWfE2k4hHG8Ee23NS /2347RA5FVPEOkcZ2fg+Q1iNBmwIKRmNs/uSbe3xEZas+kS2abwwuedqKcuOHHewsvbW pq7mc6Dllrc1DBH0Ynf2WibW37tNmXJrmvSoibThlIVIFKCALHji/eiDYroCTZP2b/7U G/PDX66AcK5pjyQA+JHmPL2vmqYY8d1qs2cxDl3NpjH4wsx0IV6bgAOTABZpQrGgOHYo VpNnahlolOlHIcHQik1eIMlMGkD+55Smymyn4+nndVM6N4CvdXhlCnQfkavvdaD5qEHJ KvMQ== 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=NDkR2+Eo3Bawa8K8grIqm0BhRHbWo8m9JJpvLoqivAui8HkdJ2eqnDLmlVW1wasJ31 qa7+6Lek1kg0SWexpQ4R8Byr4N0mMmvajFKBSo7PZ5hmr8fKQo4u8t/U7DpOnEme9aK2 ruGqxaQnTMuW479VbdjRM2TKWMGFMCbiUvajFaqiJPKU1RehbTDIqxBIeKioNMdk3Obs 2lkQHTFBVHfpvhPxh270ITKPeusT+wIAggI9tH4J2kRozjLaBl5de/hmfaFSyBBC5SzZ jXMnhn6mLELJpnxviB2LZWx6zEHy+TXoD4+JIoZ5BmpECJ4rqzydPmivduMdq7pcWDjI jYAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HtmLhoiO; 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 xa11-20020a170906fd8b00b0078d9f02b452si38891064ejb.861.2023.01.18.05.37.45; Wed, 18 Jan 2023 05:38:11 -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=HtmLhoiO; 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 S230371AbjARNdd (ORCPT + 99 others); Wed, 18 Jan 2023 08:33:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbjARNc7 (ORCPT ); Wed, 18 Jan 2023 08:32:59 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593FD58972; Wed, 18 Jan 2023 04:59:58 -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 30ICxgYp018304; Wed, 18 Jan 2023 06:59:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674046783; bh=TISRczCqqClgTnuh9Jgbp4YdFIC7Href1UTZ0gVUQ5I=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HtmLhoiO7Kmq5E6oAlRzpG22Wi/dDRUW/IkIM5rR0Tc4g4CzTpq6vSCR69GICWEvh GEDkyMqCY/EpAQ+YFf4O+KIdBeEHvjZ+uTvDjg6v3qat3PnvdPVrfF+0KlMArS+gUv YSXtTqqXJJijq85Avd1RPztwfI/g1OZVxV3XAd/M= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30ICxgBH033224 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jan 2023 06:59:42 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 18 Jan 2023 06:59:42 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE104.ent.ti.com (157.170.170.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; Wed, 18 Jan 2023 06:59:42 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxfBG003256; Wed, 18 Jan 2023 06:59:42 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v8 3/5] PCI: j721e: Add PCIe 4x lane selection support Date: Wed, 18 Jan 2023 18:29:34 +0530 Message-ID: <20230118125936.3456716-4-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118125936.3456716-1-a-verma1@ti.com> References: <20230118125936.3456716-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 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?1755367699845831118?= X-GMAIL-MSGID: =?utf-8?q?1755367699845831118?= 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 Wed Jan 18 12:59:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 45280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2340993wrn; Wed, 18 Jan 2023 05:38:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8qdN9DKxLp/TSjVRPtNkVKaX0y9v1yDjidKEIgLtHan7P/J9wVHh2NyNMCFrbNp8Vhmvz X-Received: by 2002:a05:6402:448a:b0:472:46bf:fb3c with SMTP id er10-20020a056402448a00b0047246bffb3cmr18995993edb.35.1674049096993; Wed, 18 Jan 2023 05:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049096; cv=none; d=google.com; s=arc-20160816; b=uUIAAALkNLYFyHUkVCgj7rYqchlQGq/WvUpkQZ8DrtUonMByDPfLx8ncv3dFiqTjw8 AkwQnv8zl2YDKSFK4eOXaYHI7hO2/fzUeoDrNjs++BT0JeMkgcFfYvaNHWGz4r8ziDC5 GDLiUBs1LFy9EiKkSckQtvq38RSDly/MV9XGqqyVcPHqp4679a9Rnlml9kvRcgrImmNU OtBofNwQd8l54UV0KytpFIa8J30uJefYKe6hT+iLWYIJ4DHuGGv6p9ZjOtbSZPynOyMr wofjVn+gbx5bvcaWuIbvhBXGHD4CpztkjXQrDjQ0yrKlAXCAqSpSw2vTF3tK1l85k8mw mTYg== 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=YAqElOXhzT46KPkEsmhZokUdEmoR/hwjHhCnO56UkJM=; b=HRFiQLtEiambNSftVvzKfY52DXSccKrNxdLRDx01232CGF4p6E6h6rJR/HcJihjjGP xaCYCZOOpSsYDJltF+Cx5pakmGmVQL1cAy1oR5LOP1gIZQ+LmmVbInXjlEay58Z/1gbT uGlBUqBQxPCDDkKBHlcBdovsZtoBn8rx0fu0UWDWPmmluQJE2yT/1naTcAvm1S7W9HKA Iw9asFF6GoKzxKa2OX6ipJNzys+vN/NupinNDs4EbjL+XQr/X7tVsxFnegJiazeDxFx7 VPA5WG+XT+ddn9e9RSaMWNTeqec6R2xQhKGKW7hpCJb6FBliB9Huc1KX3O4Xg/vmU7GX IwGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Dp7R+4jQ; 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 cs12-20020a170906dc8c00b0085ca2799671si8080572ejc.136.2023.01.18.05.37.51; Wed, 18 Jan 2023 05:38:16 -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=Dp7R+4jQ; 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 S230037AbjARNdq (ORCPT + 99 others); Wed, 18 Jan 2023 08:33:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjARNc7 (ORCPT ); Wed, 18 Jan 2023 08:32:59 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3362A86EF2; Wed, 18 Jan 2023 04:59:59 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxitP042744; Wed, 18 Jan 2023 06:59:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674046784; bh=YAqElOXhzT46KPkEsmhZokUdEmoR/hwjHhCnO56UkJM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Dp7R+4jQIW9e6WWWftVyi4cM321cjRQrW4R7D6v10+MAnfABll4KDePvldlHDY5NA pqUw10Olr6+4JuMG61udvqw8dItSxqjePgwVgwJuhZgqkmU9GiQi5uM/CWyh1mx/Z5 Ofmg2/jItI3eTD+dFUEahFhWE6pCZo1OCyTwdZHg= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30ICxix2041234 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jan 2023 06:59:44 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 18 Jan 2023 06:59:43 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE107.ent.ti.com (157.170.170.37) 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; Wed, 18 Jan 2023 06:59:43 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxhfZ003323; Wed, 18 Jan 2023 06:59:43 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v8 4/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Date: Wed, 18 Jan 2023 18:29:35 +0530 Message-ID: <20230118125936.3456716-5-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118125936.3456716-1-a-verma1@ti.com> References: <20230118125936.3456716-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 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?1755367705779800799?= X-GMAIL-MSGID: =?utf-8?q?1755367705779800799?= 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 403cd3ef1177..0c93832e381b 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 7bd78cfca845..6b1521c6b607 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 Wed Jan 18 12:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Achal Verma X-Patchwork-Id: 45282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2341069wrn; Wed, 18 Jan 2023 05:38:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXtpU0pCgy0xUzvaMfE1lgaNtUQ+ADqj3PliPYJzwTx4kc7QYzon73YrEE/44EQ4Cdz655+4 X-Received: by 2002:a17:907:d606:b0:86f:b541:cd02 with SMTP id wd6-20020a170907d60600b0086fb541cd02mr8182443ejc.28.1674049107119; Wed, 18 Jan 2023 05:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049107; cv=none; d=google.com; s=arc-20160816; b=fhXXb1INub5uB62Mt+EnUHxveo3OHDXz4NZy8bDZ8LgfJBZw5jgycJopYMfHqflgFf OYr1pFPFb2ty7d5aIweNArjS8rJPCYod7xTxk0yzA4SgDkWbeJePANj/M2nTdMqXfFXp AYTLqAD+irRjEiEIzFDl512rLAG+xlVKkfUqIk3XvECEItxDt4lM4qx9eN3HVcCWO0JT az/q871JYlfmETpyc4U+3BbR9CJoDZlak8D6NmuxuJyjgH+YU7kChqmx8Ik9Z2tPF73S Q7d2b9a9L5WkDKkbSliw2Zr07Bd4kIuVEv0IHKQX8rJ7im+jQfUmrKL5Icz3X8rRTHVy qP2A== 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=HikkTogplLNoxciGnDpCA7y+uTGLjkDq+gkT3YAOSg202U9q7MvapdADmG1ZX7bqQv P5lNDzpzE6wlipXEQPRuT9iNv7UOG2GF3144ctQ6RLHufjlPtXY5HUGr7DRtepF02utD bQ7410HH2Ic6/7WbGirhUdrTxEkJ+sHt3XL8IAnebtGrFhCuO89QYCY+yC45iVaPzBhb ZDIv5sX/id21DM+DGVOJFH6KN6p6HmdqMFe+eeXaZxh2iagAn/mLcs+HqJUil/czGqD2 P7po3Q/XL76vUCI5prcA9mcMSFJ+a5Wd7aUlFfnqs1msJP64OBq+/uJ2bLBqodrT51Wa jSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fyegISrH; 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 qf21-20020a1709077f1500b0087122fab4c0si10044368ejc.155.2023.01.18.05.38.03; Wed, 18 Jan 2023 05:38:27 -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=fyegISrH; 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 S229982AbjARNd4 (ORCPT + 99 others); Wed, 18 Jan 2023 08:33:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbjARNdB (ORCPT ); Wed, 18 Jan 2023 08:33:01 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8287E58960; Wed, 18 Jan 2023 05:00:03 -0800 (PST) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxjJg079768; Wed, 18 Jan 2023 06:59:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674046785; bh=GGrsVB2NuWgQ/IDsTg782FJLIK98IZjp/7pCe7Mspxs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fyegISrHOR3VLzHGX4VOcPbatNpOqZXzkGjMvx1y9GCuZiLHPClz5NAJyevYEHomy QDC5oI9VBCqGbK2t4OHivYP+cEHS1QJkOwlqHxSLMm4pvkr+qzwKqyKO/KE/4GL/fN 57E0x5O/Q/CK1T/zuoBaU0a0tLU6Mf+ZE5UH+06c= 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 30ICxjLn010120 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jan 2023 06:59:45 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) 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; Wed, 18 Jan 2023 06:59:45 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE107.ent.ti.com (157.170.170.37) 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; Wed, 18 Jan 2023 06:59:45 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30ICxi51003334; Wed, 18 Jan 2023 06:59:45 -0600 From: Achal Verma To: , , , , , , , , , , , CC: , , , Subject: [PATCH v8 5/5] PCI: j721e: add j784s4 PCIe configuration Date: Wed, 18 Jan 2023 18:29:36 +0530 Message-ID: <20230118125936.3456716-6-a-verma1@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118125936.3456716-1-a-verma1@ti.com> References: <20230118125936.3456716-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 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?1755367716640685002?= X-GMAIL-MSGID: =?utf-8?q?1755367716640685002?= 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, + }, {}, };