Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5283327rdb; Wed, 13 Dec 2023 04:38:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4krMIQT2pAs9LyuO2YCYYqEJTEjZXnn31EVg7+Mf6gEIemvYyQT693XAgbDatTz09qY+l X-Received: by 2002:a17:902:f551:b0:1d3:3f80:fe5 with SMTP id h17-20020a170902f55100b001d33f800fe5mr2622564plf.116.1702471129377; Wed, 13 Dec 2023 04:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702471129; cv=none; d=google.com; s=arc-20160816; b=X5TORfBhPyVjG+Eag8wEqNfFuvn0Bp/BbyrXtcTrNlUdCcWdoPYoVYe5mfj1ZOH0Wt 6hxqCXikKK0/x/L+rcM9DyRlhG3cPgykfCvJHKKRCcVJRw3ZJu7F7gQAA7D4UnxcO/+S y5mYA7v34eGgYiftN2XiMPvSidm78r2Nt9rF7skUNfxOdVMf46DUP04qM8f4nEk6iTK0 XM0Pl8audgczoU6quWzPoMed9hUNLltU4KwTnvzeFBxDlk1qunpBhS3mCR93opJZvPL6 WL620yG7hFWWFIaq1DcmH4Lfp5NT017sNA40vajq1QIxwwoJY5TyZ965zYwg2gFxGHIJ iDnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gy1qArKSqhsRjFGn+LP95Xdrzj0gXfcfs2ST9SpwNn4=; fh=cgr+i0oQbjzJOfCF9Iz3LM1pX/9aEH0Zkrl8pj2z4Go=; b=TtRdcV868fkkhCSpbmn5uSjnI1ROy0GhnYiKh5oQwAS0+2mlvBLHuBTKtnoh+oMa58 +Zk6F6QLBEJrtFnPU+wzB7nnePcJfHlk4/ULYZC8pVtKnnp6pYrt19t7By/q0MWPBvww koSP0YGMOqLEAS9BMiEyjh7fIOkITMX/kppamaD+25OrpvFZVGqAq8K5VC/SPvhUqXAv XGEUYoXlWNNeMJOOIlnbbwyPbnbYvQU718wyM6YTck9296689e7UM9OWiJcF0CeRsU6o yipOEtEEFkwzh5s/Mtyf0lge1qo8dsh49aN0/3fNxvhOpmFe8cQT+tU/WRYJVV3qtfp7 Sveg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=liKKZ5hM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f8-20020a170902ce8800b001d3563c87a4si448088plg.195.2023.12.13.04.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:38:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=liKKZ5hM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3E03F80BE2DB; Wed, 13 Dec 2023 04:38:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377544AbjLMMiY (ORCPT + 99 others); Wed, 13 Dec 2023 07:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbjLMMiX (ORCPT ); Wed, 13 Dec 2023 07:38:23 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF2DA4; Wed, 13 Dec 2023 04:38:29 -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 3BDCcKvL068102; Wed, 13 Dec 2023 06:38:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1702471100; bh=gy1qArKSqhsRjFGn+LP95Xdrzj0gXfcfs2ST9SpwNn4=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=liKKZ5hMZe+vJrml3OdKgNrLlksoOh5bus+6J0oQeGCHBRgUfGrk/C/Q737dQ+QbO k2nxif5jntJCmkTngoJG73nRByGBUaJAfJJ5Fhg9zBn1xZyVcSurYBoVhniDa9z1K7 sX7IUp91VPb6HYDptNb4mJFB1wklczLiopE/D1Sg= 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 3BDCcKPI083754 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 13 Dec 2023 06:38:20 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) 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.23; Wed, 13 Dec 2023 06:38:19 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) 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.23 via Frontend Transport; Wed, 13 Dec 2023 06:38:19 -0600 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3BDCcJNF080616; Wed, 13 Dec 2023 06:38:19 -0600 Date: Wed, 13 Dec 2023 06:38:19 -0600 From: Nishanth Menon To: Siddharth Vadapalli CC: , , , , , , , , , , Subject: Re: [PATCH v2] arm64: dts: ti: k3-am654-icssg2: Enable PHY interrupts for ICSSG2 Message-ID: <20231213123819.tqh3lm2ceir3qjbk@swimmer> References: <20231213080216.1710730-1-s-vadapalli@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231213080216.1710730-1-s-vadapalli@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:38:46 -0800 (PST) On 13:32-20231213, Siddharth Vadapalli wrote: > Enable interrupt mode of operation of the DP83867 Ethernet PHY which is > used by ICSSG2. The DP83867 PHY driver already supports interrupt handling > for interrupts generated by the PHY. Thus, add the necessary device-tree > support to enable it. > > Since the GPIO1_87 line is muxed with EXT_REFCLK1 and SYNC1_OUT, update > the pinmux to select GPIO1_87 for routing the interrupt. > > As the same interrupt line and therefore the same pinmux configuration is > applicable to both Ethernet PHYs used by ICSSG2, allocate the pinmux > resource to the first Ethernet PHY alone. > > Signed-off-by: Siddharth Vadapalli > Reviewed-by: MD Danish Anwar > --- > Hello, > > This patch is based on linux-next tagged next-20231213. > > v1: > https://lore.kernel.org/r/20231120063159.539306-1-s-vadapalli@ti.com/ > Changes since v1: > - Rebased patch on next-20231213. > - Collected Reviewed-by tag from > MD Danish Anwar > - Moved pinctrl from MDIO node to Ethernet PHY node based on feedback from > Nishanth Menon > - Replaced the hard-coded value 0x2 with IRQ_TYPE_EDGE_FALLING for > setting the interrupt trigger type and level flag based on feedback from > Nishanth Menon > - Included dt-bindings/interrupt-controller/irq.h in the overlay. > - Updated commit message with details of the pinmux resource allocation. > > Regards, > Siddharth. > > arch/arm64/boot/dts/ti/k3-am654-icssg2.dtso | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/arch/arm64/boot/dts/ti/k3-am654-icssg2.dtso b/arch/arm64/boot/dts/ti/k3-am654-icssg2.dtso > index ec8cf20ca3ac..6eabdfa0d602 100644 > --- a/arch/arm64/boot/dts/ti/k3-am654-icssg2.dtso > +++ b/arch/arm64/boot/dts/ti/k3-am654-icssg2.dtso > @@ -8,6 +8,7 @@ > /dts-v1/; > /plugin/; > > +#include > #include > #include "k3-pinctrl.h" > > @@ -124,6 +125,15 @@ AM65X_IOPAD(0x0088, PIN_INPUT, 2) /* (AG17) PRG2_PRU0_GPO4.PRG2_RGMII1_RX_CTL */ > }; > }; > > +&main_pmx1 { > + /* Select GPIO1_87 for ICSSG2 PHY interrupt */ > + icssg2_phy_irq_pins_default: icssg2-phy-irq-default-pins { > + pinctrl-single,pins = < > + AM65X_IOPAD(0x0014, PIN_INPUT, 7) /* (A22) EXT_REFCLK1.GPIO1_87 */ > + >; > + }; > +}; > + > &icssg2_mdio { > status = "okay"; > pinctrl-names = "default"; > @@ -132,13 +142,20 @@ &icssg2_mdio { > #size-cells = <0>; > > icssg2_phy0: ethernet-phy@0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&icssg2_phy_irq_pins_default>; > + > reg = <0>; > + interrupt-parent = <&main_gpio1>; > + interrupts = <87 IRQ_TYPE_EDGE_FALLING>; > ti,rx-internal-delay = ; > ti,fifo-depth = ; > }; > > icssg2_phy1: ethernet-phy@3 { > reg = <3>; > + interrupt-parent = <&main_gpio1>; > + interrupts = <87 IRQ_TYPE_EDGE_FALLING>; https://www.ti.com/lit/ds/symlink/dp83867ir.pdf -> it looks like the interrupt pin is level event. but drivers/gpio/gpio-davinci.c:: gpio_irq_type() -> The SoC cannot handle level, only edge. A bit confused here.. GPIO 87 is shared between two phys. isn't it a case of race? PHY1 assets low phy1 handler starts, but before the driver it clears the condition: PHY2 asserts low - but since the signal is already low, there is no pulse phy1 handler clears phy1 condition, but signal is still low due to phy2? now phy2 OR phy1 never gets handled since there is never a pulse event ever again. > ti,rx-internal-delay = ; > ti,fifo-depth = ; > }; > -- > 2.34.1 > -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D