From patchwork Wed Nov 9 04:22:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 17340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp133917wru; Tue, 8 Nov 2022 20:23:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM7WIsDDnJAd0sLEbhl5l/00iia0Q6+IGXhn9AgXn25Hr98mHEePlcXjUIhjrZQuabik2GD9 X-Received: by 2002:a65:62c7:0:b0:463:9c67:5fe2 with SMTP id m7-20020a6562c7000000b004639c675fe2mr50026001pgv.443.1667967812616; Tue, 08 Nov 2022 20:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667967812; cv=none; d=google.com; s=arc-20160816; b=yUVGAR5eH/ZI5X2BE6412SnJF05Ya80V+KW8l3hA4WE+575yxYOtdCoSkw+N0HuRhL JOMacGT3rBe1I617Gxj4khVM4kaZNEm2PmVRB4ZOlEKFAsCuZw310eBg9lHTe4Zi7GI6 iuX5MU7YkCOBNyof8BRiuwmlYbJ6JhOgRfM9sfXFQg9O/I0Y2wAoWEDDxiH/fp5xbcoT /uvYsyqWTIuUJ7SVPdkEh712ILKTi4w9LO/VwqWKEzBAkEVX/PAOpR/cXVfymX+bedCV qBi49bI2PnDopeHW4uem+sGx94yHTI8oyM++zZ2qQ/18pfAIoUQ2mCkd3VJeQ6tWHf1u L3lg== 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=f+/hD2UAEmnR3+Go/lOUiJffhqgYnLACZh9HsbiXWfc=; b=RbQagzWTPmyBYthF7JNmRvXruS0/KMDkmm0Wyh5syJ3IXYnXMoXZsKfVefC7PomtAp qIhN8daAiyyakSbuCFHxng5qnFKLZU0CPf/muSx4VbOIFHpkvH6vojX0PpJ2hGhNqCc1 3dzv+B4Edk232ocDKqvDZBapc6bcRDIRAWP9csS6UJcV5thpbOw4j+XfZBk1zTt7m2YI D5QnAmzWpmICDm7NJQNys9ag39vnMMAQuSOzX2jZNbB2DMAglHOkmgK6TezvXoWG4Otk cDcbhErF7zswX6fOBRvwT77LC7TU7PKsPZGwzULekBa9pvXQDeUGWXHSyHglfeiYGnP9 mB4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fut7dnNl; 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 q19-20020a635053000000b0044b817adee1si16253649pgl.78.2022.11.08.20.23.19; Tue, 08 Nov 2022 20:23:32 -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=fut7dnNl; 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 S229578AbiKIEWk (ORCPT + 99 others); Tue, 8 Nov 2022 23:22:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiKIEWe (ORCPT ); Tue, 8 Nov 2022 23:22:34 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9862411A15; Tue, 8 Nov 2022 20:22:32 -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 2A94ME33003306; Tue, 8 Nov 2022 22:22:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667967734; bh=f+/hD2UAEmnR3+Go/lOUiJffhqgYnLACZh9HsbiXWfc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fut7dnNlYS/kORGuvbYLB1TZoJv6dpxdbJbbk6j/xpDLRy8LjgyRHoUbBjyf9D64/ E0c5VMlAgAyz9Sau0sfd5mDLSghbaWzM4GtoJQfbyu/q44kTfL4ss2XYYCqocofvZd mdJNLc5L3bXpX1Q7dPgNeql1zI+AggByIxC0y8P4= 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 2A94MESf033959 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Nov 2022 22:22:14 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 8 Nov 2022 22:22:13 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 8 Nov 2022 22:22:14 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A94M4R8111905; Tue, 8 Nov 2022 22:22:09 -0600 From: Siddharth Vadapalli To: , , , , , , , , , , CC: , , , , , Subject: [PATCH net-next v5 1/3] dt-bindings: net: ti: k3-am654-cpsw-nuss: Add J721e CPSW9G support Date: Wed, 9 Nov 2022 09:52:01 +0530 Message-ID: <20221109042203.375042-2-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109042203.375042-1-s-vadapalli@ti.com> References: <20221109042203.375042-1-s-vadapalli@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?1748991017065927204?= X-GMAIL-MSGID: =?utf-8?q?1748991017065927204?= Update bindings for TI K3 J721e SoC which contains 9 ports (8 external ports) CPSW9G module and add compatible for it. Changes made: - Add new compatible ti,j721e-cpswxg-nuss for CPSW9G. - Extend pattern properties for new compatible. - Change maximum number of CPSW ports to 8 for new compatible. Signed-off-by: Siddharth Vadapalli Reviewed-by: Rob Herring --- .../bindings/net/ti,k3-am654-cpsw-nuss.yaml | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml index 821974815dec..900063411a20 100644 --- a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml +++ b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml @@ -57,6 +57,7 @@ properties: - ti,am654-cpsw-nuss - ti,j7200-cpswxg-nuss - ti,j721e-cpsw-nuss + - ti,j721e-cpswxg-nuss - ti,am642-cpsw-nuss reg: @@ -111,7 +112,7 @@ properties: const: 0 patternProperties: - "^port@[1-4]$": + "^port@[1-8]$": type: object description: CPSWxG NUSS external ports @@ -121,7 +122,7 @@ properties: properties: reg: minimum: 1 - maximum: 4 + maximum: 8 description: CPSW port number phys: @@ -186,12 +187,36 @@ allOf: properties: compatible: contains: - const: ti,j7200-cpswxg-nuss + const: ti,j721e-cpswxg-nuss then: properties: ethernet-ports: patternProperties: - "^port@[3-4]$": false + "^port@[5-8]$": false + "^port@[1-4]$": + properties: + reg: + minimum: 1 + maximum: 4 + + - if: + not: + properties: + compatible: + contains: + enum: + - ti,j721e-cpswxg-nuss + - ti,j7200-cpswxg-nuss + then: + properties: + ethernet-ports: + patternProperties: + "^port@[3-8]$": false + "^port@[1-2]$": + properties: + reg: + minimum: 1 + maximum: 2 additionalProperties: false From patchwork Wed Nov 9 04:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 17341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp134043wru; Tue, 8 Nov 2022 20:24:01 -0800 (PST) X-Google-Smtp-Source: AMsMyM43nvpf2o6/7vWdu7EKjVxRB391rr6NR2dcxDGi64I8pTZkZyhnSdVhTv/Xa30Dx4IxEGdb X-Received: by 2002:a17:90b:4a0d:b0:213:587b:206a with SMTP id kk13-20020a17090b4a0d00b00213587b206amr76856669pjb.195.1667967840874; Tue, 08 Nov 2022 20:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667967840; cv=none; d=google.com; s=arc-20160816; b=zO+CsoRfQM8ffk6Fsqsds831tFjBBatXFasmtAjDud8qNQJFfNxGr7AFzZ7+9+aie4 HE1zAid7L4/wFRpPzrDm8bIHI70fkL+k/kys8f5kMsWK0bYjlwXz9U2jUUSpPCOwTIVE 2655+Do4tvzsOGJa5Tc7INu4uyoH/6g1vznh9mXfuwb7sPHypJwbGClfn9jf6W3hiII0 5pQxxGwSmd68R7SeCIYMVVqYYOFqTwlFWom3mBnKwJ80YXp3BE7RtU6zFPEAfarnoCdp GyVUdc7iwJQFxo5kGLiRVA0Aj/IKjyLXTxSA0WY9OeXBSapRfPMZq53IPeHkFMstoAJB EsRQ== 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=uwDWVdwvc4T+2C8d24th+9KozGx9Wgsh2c8fRcplPLY=; b=ZFv83Fv6CwPHWhKonW2OHp/jSzkMS6mkx/wzWE8++imPoqRcQQJSy4B13qSz9GDp43 j9D4A0cafmebqL0svHp8bzw01hDwkdPqCsndv7iKXnvGwAT4Xb2nZ9BJQGx5J1gnR0fR +D7/p77Gdzu9GGmnizQTDpkYH+gg2ke4VRA9BNqfNjyZi/JGd5DYafcXZGVlicOtPaXJ buapuHWzDG9AJDgBP0/CE4uX80BId+ywzDaaucFBT5G5o6Dn1amwZWP5kvdjeMVsFtsb A22wZJwuq4RJ3J8GRwFziHdrEmb/sXvJIEh/j5BVHwPvOJI/1B+l8xNpvidzyUYdASDm 7B8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RffbiMBj; 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 z5-20020a655a45000000b0044d6999624asi18217031pgs.339.2022.11.08.20.23.47; Tue, 08 Nov 2022 20:24:00 -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=RffbiMBj; 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 S229566AbiKIEXR (ORCPT + 99 others); Tue, 8 Nov 2022 23:23:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbiKIEW7 (ORCPT ); Tue, 8 Nov 2022 23:22:59 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A64FC1FCF4; Tue, 8 Nov 2022 20:22:46 -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 2A94MJbU063952; Tue, 8 Nov 2022 22:22:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667967739; bh=uwDWVdwvc4T+2C8d24th+9KozGx9Wgsh2c8fRcplPLY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RffbiMBj4JS1hXnd7/qzoZbRaUCMSY0efkg3oHITFVo4Ujifs1NXozNgq3X1rPZhl c10rvK1OKQYSxvh9pbnraKVZpN/A2pO6YPUbHF/AJ0pBKIis8ppP5jWNtc0BybkbMh qiRHAtgD4lH7CacCO89tt+XcNqwJUYskDGMNX8jc= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A94MJ5W037750 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Nov 2022 22:22:19 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 8 Nov 2022 22:22:18 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 8 Nov 2022 22:22:18 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A94M4R9111905; Tue, 8 Nov 2022 22:22:14 -0600 From: Siddharth Vadapalli To: , , , , , , , , , , CC: , , , , , Subject: [PATCH net-next v5 2/3] net: ethernet: ti: am65-cpsw: Enable QSGMII mode for J721e CPSW9G Date: Wed, 9 Nov 2022 09:52:02 +0530 Message-ID: <20221109042203.375042-3-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109042203.375042-1-s-vadapalli@ti.com> References: <20221109042203.375042-1-s-vadapalli@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?1748991047005147292?= X-GMAIL-MSGID: =?utf-8?q?1748991047005147292?= CPSW9G in J721e supports additional modes like QSGMII. Add new compatible for J721e in am65-cpsw driver. Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 75429ff0c200..bc9f29d10c22 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2681,11 +2681,19 @@ static const struct am65_cpsw_pdata j7200_cpswxg_pdata = { .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII), }; +static const struct am65_cpsw_pdata j721e_cpswxg_pdata = { + .quirks = 0, + .ale_dev_id = "am64-cpswxg", + .fdqring_mode = K3_RINGACC_RING_MODE_MESSAGE, + .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII), +}; + static const struct of_device_id am65_cpsw_nuss_of_mtable[] = { { .compatible = "ti,am654-cpsw-nuss", .data = &am65x_sr1_0}, { .compatible = "ti,j721e-cpsw-nuss", .data = &j721e_pdata}, { .compatible = "ti,am642-cpsw-nuss", .data = &am64x_cpswxg_pdata}, { .compatible = "ti,j7200-cpswxg-nuss", .data = &j7200_cpswxg_pdata}, + { .compatible = "ti,j721e-cpswxg-nuss", .data = &j721e_cpswxg_pdata}, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, am65_cpsw_nuss_of_mtable); From patchwork Wed Nov 9 04:22:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 17342 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp137345wru; Tue, 8 Nov 2022 20:35:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM49lWLUjiqKncn8s+4vnQ6ELcbqP0/aMHXpjdbDXpqn+VNxWXY2Y8QRtlCZ4dUgGT4v1KsB X-Received: by 2002:a17:903:2410:b0:17a:b32:dbec with SMTP id e16-20020a170903241000b0017a0b32dbecmr58710103plo.163.1667968511410; Tue, 08 Nov 2022 20:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667968511; cv=none; d=google.com; s=arc-20160816; b=CFpXum/iKCEw4mfyC35+xKoACJx6ygcnfcICbiCVQKEfqprUofRvvnq7z2lg+G6r+j CnfKRfWFxxYHdeKDk1Li6VhcQIu0kjTCB6gM0Evi7h3P26L5L3BCrydS0n8ykWLIVRwV Ff73gkvZub9E5iTeZ/5jnHhdR221ibYzvtQ9HiUVS20a84b4s78oR/BXbU1R7Qojlik8 jupPE3CgRFiGcNifPgyBDs4/3WEGAOFRCuljdLksYBT9YMttElnIy9rALwPkMHHjwYst Hix/0ISGwu6tVL3yctM70PNOaTRlKWj7GfrRRaaL0IYL0GazI2P+kjS/K7W4QuFpkLNq ndEA== 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=RBnzGDITsnmgAmda1HLuNmjSC20+kjgG18pJ0qrLfgs=; b=abFMCgcZbfcU5lmSiW1GF8K9DaoYsp01d9Ii41FseF94fxjjBiqI5Cf7QIrnnNsbI+ B792O0SK5XWUsnUc8RvyqlIl9yKIH6Ne2HjJUFGfOrBdZ+za0h7OjOZJyk+WrQkJ61RF 9VQoOJQzQVFi7ri0xxT2SwKNKh65xSHy5slVeGB9NGQRqi01w4FwW9hIPk4Bs3DB4ob9 iNDbWf09eSfeep+LRCP3ncCK56wxzix+8cesij67Rw9mx+NBXCLLWcnS3tLkmwKFGCLf WIFSjZM62qQsYOABFZWf+jaf8LNdmxr0KlvtK/EWlr3o9AJsoviZ+6g4kmEFZzAFnBAu EI6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=U8vjFU1V; 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 o6-20020a170902778600b00176841aa2e3si15885619pll.93.2022.11.08.20.34.51; Tue, 08 Nov 2022 20:35: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=U8vjFU1V; 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 S229735AbiKIEXY (ORCPT + 99 others); Tue, 8 Nov 2022 23:23:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiKIEXB (ORCPT ); Tue, 8 Nov 2022 23:23:01 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 122891FF8F; Tue, 8 Nov 2022 20:22:47 -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 2A94MNgs075081; Tue, 8 Nov 2022 22:22:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667967743; bh=RBnzGDITsnmgAmda1HLuNmjSC20+kjgG18pJ0qrLfgs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=U8vjFU1VZCE4U+c4kIx0kOZjTuwF87sEsEbHg2D05NZcBOU7byU6C1P/d4aU+abtO YhxUYUB4hf7H51cUDjiSE9x7zbhsjQ5qk9KZ//ndaZ3kVZ2S/USDGOAl88M5lh0f1h MqCSJovuCj2dfz2vnOEc6Cs6vfUoau2qoX/p4JSE= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A94MNbI032611 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Nov 2022 22:22:23 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 8 Nov 2022 22:22:23 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) 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.6 via Frontend Transport; Tue, 8 Nov 2022 22:22:23 -0600 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A94M4RA111905; Tue, 8 Nov 2022 22:22:19 -0600 From: Siddharth Vadapalli To: , , , , , , , , , , CC: , , , , , Subject: [PATCH net-next v5 3/3] net: ethernet: ti: am65-cpsw: Add support for SERDES configuration Date: Wed, 9 Nov 2022 09:52:03 +0530 Message-ID: <20221109042203.375042-4-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109042203.375042-1-s-vadapalli@ti.com> References: <20221109042203.375042-1-s-vadapalli@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?1748991749597755601?= X-GMAIL-MSGID: =?utf-8?q?1748991749597755601?= Use PHY framework APIs to initialize the SERDES PHY connected to CPSW MAC. Define the functions am65_cpsw_disable_phy(), am65_cpsw_enable_phy(), am65_cpsw_disable_serdes_phy() and am65_cpsw_enable_serdes_phy(). Power on and initialize the SerDes PHY in am65_cpsw_nuss_init_slave_ports() by invoking am65_cpsw_enable_serdes_phy(). Power off the SerDes PHY in am65_cpsw_nuss_remove() by invoking am65_cpsw_disable_serdes_phy(). Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 65 ++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index bc9f29d10c22..83349d24a0e6 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1444,6 +1444,65 @@ static const struct net_device_ops am65_cpsw_nuss_netdev_ops = { .ndo_setup_tc = am65_cpsw_qos_ndo_setup_tc, }; +static void am65_cpsw_disable_phy(struct phy *phy) +{ + phy_power_off(phy); + phy_exit(phy); +} + +static int am65_cpsw_enable_phy(struct phy *phy) +{ + int ret; + + ret = phy_init(phy); + if (ret < 0) + return ret; + + ret = phy_power_on(phy); + if (ret < 0) { + phy_exit(phy); + return ret; + } + + return 0; +} + +static void am65_cpsw_disable_serdes_phy(struct am65_cpsw_common *common) +{ + struct device_node *node, *port_np; + struct device *dev = common->dev; + const char *name = "serdes-phy"; + struct phy *phy; + + node = of_get_child_by_name(dev->of_node, "ethernet-ports"); + + for_each_child_of_node(node, port_np) { + phy = devm_of_phy_get(dev, port_np, name); + am65_cpsw_disable_phy(phy); + } +} + +static int am65_cpsw_init_serdes_phy(struct device *dev, struct device_node *port_np) +{ + const char *name = "serdes-phy"; + struct phy *phy; + int ret; + + phy = devm_of_phy_get(dev, port_np, name); + if (PTR_ERR(phy) == -ENODEV) + return 0; + + ret = am65_cpsw_enable_phy(phy); + if (ret < 0) + goto err_phy; + + return 0; + +err_phy: + devm_phy_put(dev, phy); + return ret; +} + static void am65_cpsw_nuss_mac_config(struct phylink_config *config, unsigned int mode, const struct phylink_link_state *state) { @@ -1941,6 +2000,11 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) goto of_node_put; } + /* Initialize the phy for the port */ + ret = am65_cpsw_init_serdes_phy(dev, port_np); + if (ret) + return ret; + port->slave.mac_only = of_property_read_bool(port_np, "ti,mac-only"); @@ -2868,6 +2932,7 @@ static int am65_cpsw_nuss_remove(struct platform_device *pdev) am65_cpsw_nuss_phylink_cleanup(common); am65_cpsw_unregister_devlink(common); + am65_cpsw_disable_serdes_phy(common); am65_cpsw_unregister_notifiers(common); /* must unregister ndevs here because DD release_driver routine calls