Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3542474pxf; Mon, 5 Apr 2021 15:12:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2WZxg8+h2M7jBTw0phoWGITAE7ffJcB+ms5Vhe/S+lOvVwVaz68uS5BdjtwUirK9gmY9X X-Received: by 2002:aa7:dd97:: with SMTP id g23mr33972311edv.154.1617660766032; Mon, 05 Apr 2021 15:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617660766; cv=none; d=google.com; s=arc-20160816; b=VZhTZ2WrST+XGO6oP9LJSifHgwibV5oYcCEXbY1+yxLdOdRBOVVmHYX4TGz8X9K+r4 PUvYoqzn1rvl+9SoBUPa4WjmKKOAdhW7XQQFlcEhiuCdAlxQsROeJOH+aa5oVVkAjieZ 5T9khQ4H65JLh77eEeBdDbsU2qaeRjANRbAkh4eTU3M20TeqQhDlNUnTYydgLHGyw5MI 5rU4ydvp1UKWD1T4O8x3Dn3msacuH4fAbfSvPkZC2831/IP6umoyba+LLeIQRpvmFj2K hG7+RGSsFsT8+cVLyJ9FLojHhr55LlbiIotgUb8+yszCGeDILMpyKYeBIPyKOfDyUTHB 5aLQ== 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; bh=vmnwUxcpyStI+pGuPlx9bsjYTtrEfg0K/IW5f1p77NE=; b=XzZpzqa/my5G/r5JDneyIpD9OZY+i59MAuhEzfXaUJy8/Lzi/ksYP74O0ECVwdSur4 YjGp19lbXvhWs19Keih2arP8n1jO+Su2Qf64JJYJCa2PUMaGhdqNFDYfZQrk6ge12f1k ZP+6kjWsvxeRVY2yk+6MLMUC0XfRtPGOEhDYes7oAMQgslygEN3oq8GxFZc2s+1pw5Jn qPMe1JsSgJjvQSQgBRQVYS1AHISmqTjRQdPwvOnMJK5zTyPbRK9ECa7ywT1e4NhnQ1OH uDXWSe2FA2uJ4bXWZaf7TQHrP5cMwrI09vg7DBjBRVsNVGd8hSlqNyj/78Qo7DB9ilfF uXaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si4488919edd.395.2021.04.05.15.12.22; Mon, 05 Apr 2021 15:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237709AbhDEOfh (ORCPT + 99 others); Mon, 5 Apr 2021 10:35:37 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34056 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235915AbhDEOfh (ORCPT ); Mon, 5 Apr 2021 10:35:37 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lTQJp-00EwLg-1z; Mon, 05 Apr 2021 16:35:09 +0200 Date: Mon, 5 Apr 2021 16:35:09 +0200 From: Andrew Lunn To: "Sit, Michael Wei Hong" Cc: "peppe.cavallaro@st.com" , "alexandre.torgue@st.com" , "joabreu@synopsys.com" , "davem@davemloft.net" , "kuba@kernel.org" , "mcoquelin.stm32@gmail.com" , "linux@armlinux.org.uk" , "Voon, Weifeng" , "Ong, Boon Leong" , "qiangqing.zhang@nxp.com" , "Wong, Vee Khee" , "fugang.duan@nxp.com" , "Chuah, Kim Tatt" , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "hkallweit1@gmail.com" Subject: Re: [PATCH net-next v2 0/2] Enable 2.5Gbps speed for stmmac Message-ID: References: <20210405112953.26008-1-michael.wei.hong.sit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > You have a MAC and an PCS in the stmmac IP block. That then has > > some > > sort of SERDES interface, running 1000BaseX, SGMII, SGMII > > overclocked > > at 2.5G or 25000BaseX. Connected to the SERDES you have a PHY > > which > > converts to copper, giving you 2500BaseT. > > > > You said earlier, that the PHY can only do 2500BaseT. So it should > > be > > the PHY driver which sets supported to 2500BaseT and no other > > speeds. > > > > You should think about when somebody uses this MAC with a > > different > > PHY, one that can do the full range of 10/half through to 2.5G > > full. What generally happens is that the PHY performs auto-neg to > > determine the link speed. For 10M-1G speeds the PHY will > > configure its > > SERDES interface to SGMII and phylink will ask the PCS to also be > > configured to SGMII. If the PHY negotiates 2500BaseT, it will > > configure its side of the SERDES to 2500BaseX or SGMII > > overclocked at > > 2.5G. Again, phylink will ask the PCS to match what the PHY is > > doing. > > > > So, where exactly is the limitation in your hardware? PCS or PHY? > The limitation in the hardware is at the PCS side where it is either running > in SGMII 2.5G or SGMII 1G speeds. > When running on SGMII 2.5G speeds, we disable the in-band AN and use 2.5G speed only So there is no actual limitation! The MAC should indicate it can do 10Half through to 2500BaseT. And you need to listen to PHYLINK and swap the PCS between SGMII to overclocked SGMII when it requests. PHYLINK will call stmmac_mac_config() and use state->interface to decide how to configure the PCS to match what the PHY is doing. Andrew