Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1016271lqj; Mon, 3 Jun 2024 07:53:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUreXYl89awRiXFFo+NJw3MHHDEfLmYqceY5uWs7PbqvjvyL++6lKILRVTbl8mArwe6Kb6n8gfetSZLSWE6Q/wZtYL4qESGL0xXj9v3YA== X-Google-Smtp-Source: AGHT+IEXiwKT7qiY9gi5fRzZZy+32OeMwPdGYMLKKvNCm8ZWaunT4lJq3Cv7pr4JgbtrH6peIdMM X-Received: by 2002:a17:906:c0ce:b0:a68:b3e9:b364 with SMTP id a640c23a62f3a-a68b3e9b466mr389780466b.75.1717426388777; Mon, 03 Jun 2024 07:53:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717426388; cv=pass; d=google.com; s=arc-20160816; b=Xuqrm2o7TVteJuhuSO5nkPiUjD4MJxeyUW0PN/aQ4N0Q19JvdQo/xETkXg2QejA0CA 500wymbI31DMkoaf6Ss7jFxz5jxNmIMoXN8kHqiTGG2b+LzvX9GJIThhx+uMa4T4mk7w 11fQllRb8ofoFhbR/PXVPEU4amA4wrKO8dGWCxKG9d5leNavJ0Xx4b99MvzctAx8ljv0 +daipFY/pDuh10uuKVOfwxSMT3pf1voIqHhEwrx8sQrvkAn2FnfzpvGMGZGiZcPxPDE3 b5UzeW5d8UIJ54mRYX/3nbCDAsWsCAtvyImngXSNKeQDhK6T/OYmihHvzNPHW64OjTW5 MwLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=6zIT30E3mgBu2hTiwVS1akuebXnR1+fi7IqPdwgEpfs=; fh=yyGyNE68UCVyoXJTI6pLJi654eZfLnm0N7HajiL3Q3w=; b=jCeHxmqOGZkoV76QKcs4REWb389aMwDjgu3qx2kPQKLi84jolVzhTm0UuDV8I1nS4X EYwJyQULnZ4SeiiSv/dbA05lX067jlMMTzEudeDP42H8oHY8km377bhJJT/4TIUWbuK1 PlxRyzLaREULj6Gyl1TUGOHqqWv6JMloN5/D+YoedU8OGbWUGIfZ+vb1H0d8wUkMa5dT ITfZTQ09a2WHsqBFd+QiL0ecBpdogAdGzuWNrEHVc4HVgNzboC3yq67LmG1ofWIvYsj2 CLQsLWHKxnY7cyNo2Isg84z30OEiaoEW/FNq3Ny+HMufKDVpgCKrW/+HC/hOuoj5APEB no/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-199320-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199320-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a69071324basi122692866b.700.2024.06.03.07.53.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 07:53:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199320-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-199320-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199320-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4886D1F21A80 for ; Mon, 3 Jun 2024 14:53:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3341C132109; Mon, 3 Jun 2024 14:52:36 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBB8B12D750; Mon, 3 Jun 2024 14:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426355; cv=none; b=rfYAp7A5MIQ7fcT5T1hFcMj0ZP54HifyJ2NKzsDr06wKo4dPJAAsmUwRTIHKtezyn6T+NCeT9ZzxiVVtromL54yFimEhAKmceMcvAOt3OwVF5JSg6KUj3GhxyxU5ZaymmcKodnnddDh9AlONFtx9oshGRfrX7j6w+MZuYcU3A4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426355; c=relaxed/simple; bh=+C2ojUOkIqeYkwQ/L7mRv+KIDfzp4HhOkdkKt7cYdgM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B7sJZROhaj4yFrLwTP+aVgmkbpUKeYiEgfFXsJHzsFynRHxov59ui0ocQQIZwBslWnWIlbzdOERLaJHabUQ2hrLPVIKtrVLDYlWKdDaba3vZzHpTjO4XCn9LBmgkOgqhIa8OpmSkRRJxRTIwS4iF1yvuesGRpMB0VSBUZ3A3KcM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.97.1) (envelope-from ) id 1sE92s-000000001ro-13WT; Mon, 03 Jun 2024 14:52:22 +0000 Date: Mon, 3 Jun 2024 15:52:19 +0100 From: Daniel Golle To: "Russell King (Oracle)" Cc: Sky Huang , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Qingfang Deng , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Steven Liu Subject: Re: [PATCH net-next v6 5/5] net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 Message-ID: References: <20240603121834.27433-1-SkyLake.Huang@mediatek.com> <20240603121834.27433-6-SkyLake.Huang@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jun 03, 2024 at 02:41:44PM +0100, Russell King (Oracle) wrote: > On Mon, Jun 03, 2024 at 02:31:46PM +0100, Daniel Golle wrote: > > On Mon, Jun 03, 2024 at 02:25:01PM +0100, Russell King (Oracle) wrote: > > > On Mon, Jun 03, 2024 at 08:18:34PM +0800, Sky Huang wrote: > > > > Add support for internal 2.5Gphy on MT7988. This driver will load > > > > necessary firmware, add appropriate time delay and figure out LED. > > > > Also, certain control registers will be set to fix link-up issues. > > > > > > Based on our previous discussion, it may be worth checking in the > > > .config_init() method whether phydev->interface is one of the > > > PHY interface modes that this PHY supports. As I understand from one > > > of your previous emails, the possibilities are XGMII, USXGMII or > > > INTERNAL. Thus: > > > > > > > +static int mt798x_2p5ge_phy_config_init(struct phy_device *phydev) > > > > +{ > > > > + struct pinctrl *pinctrl; > > > > + int ret; > > > > > > /* Check that the PHY interface type is compatible */ > > > if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL && > > > phydev->interface != PHY_INTERFACE_MODE_XGMII && > > > phydev->interface != PHY_INTERFACE_MODE_USXGMII) > > > return -ENODEV; > > > > The PHY is built-into the SoC, and as such the connection type should > > always be "internal". The PHY does not exist as dedicated IC, only > > as built-in part of the MT7988 SoC. > > That's not how it was described to me by Sky. > > If what you say is correct, then the implementation of > mt798x_2p5ge_phy_get_rate_matching() which checks for interface modes > other than INTERNAL is not correct. Also it means that config_init() > should not permit anything but INTERNAL. The way the PHY is connected to the MAC *inside the chip* is XGMII according the MediaTek. So call it "internal" or "xgmii", however, up to my knowledge it's a fact that there is **only one way** this PHY is connected and used, and that is being an internal part of the MT7988 SoC. Imho, as there are no actual XGMII signals exposed anywhere I'd use "internal" to describe the link between MAC and PHY (which are both inside the same chip package).