Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18205085ybl; Thu, 2 Jan 2020 20:54:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwIUcMA5EK8y1oPFopjQXH3+YoSqP3CfBgE3NuZiG7CyRkoaZs4Ex6TRHRVx0Rzw/TZzdf2 X-Received: by 2002:a9d:6251:: with SMTP id i17mr23674170otk.14.1578027279384; Thu, 02 Jan 2020 20:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578027279; cv=none; d=google.com; s=arc-20160816; b=x2bHrWJe9K6Qm3BU/dJCwRgIL+lfgKRSChUhJ1fWiupYXdlqgZSNDljr1iHeSTdpYT 0/NXjTUCS7TW/7FhlqOTnfoblTN69ZyqKze3YRQgPQ7G+fBhmrAyAOdOmZgh05Sm4aqv ngtdQLp9iszspejjve64Cvc1utA/bk9zz1tglgcTxN+3mhdo2hgRvr17FeFcm8i7ZKhK VQTf6YCS5P/XuF9ffSxVw7SmfNNHcxmrpA0znfrwf4Qr4aKiJewewf0nMt2cNzs4eZNz srKlChBOMsgnPqrTPXXkiCtTzZ+8m2oVwP8Q3AkDBMus9RmGVCe5VUU5/WiAlbix/5Fd 2nkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=m7JMI47ExWXrWPoJmaJR/FJ8naFtGenBJcKJ33BkSyM=; b=ttW9oy7uek5pLpXSUGj+2Zfra3Ur/32RfcB6DpgREj2FSO5DdiCjJdkzhWAaMnvl00 jbBKJjxiiOO542GRR8G1Sps5xwZbqiHAP/XNyCxaOfEEPmIfJN9NSe+cN54GmPbtRzq7 FfJqG11FNeKOybXOIBfr4oNW/KhMrpoMW8r5UPx6qTyFpyGnKqQNXWmiyysxR7qCz+/F lLLEWdktNPTXlW2bYW2+EE2PIMyuGBSEvCn49YeNbc5MgjzWkOmVJg65QRdMBLlBT6bk Y2rNbb9OTRP8HMTVlU93i0zt5pIk8OXLl13sI6AwQ+WB8Oa6Uv7u3aJwrdfyqV9e5nH4 GqGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u62si23044713oig.29.2020.01.02.20.54.27; Thu, 02 Jan 2020 20:54:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727278AbgACExr convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Jan 2020 23:53:47 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:50298 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgACExq (ORCPT ); Thu, 2 Jan 2020 23:53:46 -0500 Received: from mail-pj1-f70.google.com ([209.85.216.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1inEy0-0005BA-5s for linux-kernel@vger.kernel.org; Fri, 03 Jan 2020 04:53:44 +0000 Received: by mail-pj1-f70.google.com with SMTP id c31so6386591pje.9 for ; Thu, 02 Jan 2020 20:53:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nKqZexjELWegBXPMGK5MiRW3PCznSDINX5EDFriPXxU=; b=Qb+SOHTqB97VX7z5VEhJCu4pL0UIxMvmVSD5ENIL9nOL3vosB4NPkDAA6KKoRQYAhc owtI96Uw2qG5pmynkTakCy9suYOSEY9v97cS8ml4/k8DyFB4VBsGeb8TvX+ketXtW29k vsLZId6SevgV+33oCyh9QFjkvtnyBg7G5EbNU2Co1WoqgEfQn27Mo3UYFq1GSVaWoaNI rDMs2Tws5Hbj6cDxd+aCEedRK/jWHSzFV7ZwfMtnSS27gkfjSdeMQwY1UKJJDZMMZ2YK +ifA9XD7Z5ZKIv91AsCDBcLOC0zkVKMuI267ZfJ+emke4Wpd3RfE4VH5Pj1NLj1bZQoO O94w== X-Gm-Message-State: APjAAAUMUUoBq8l42uGfuuW+uXoHfBwNorXG7rSAkajNLU8UQ1ckURbu 0KM5ja5+K9stM5hn+wnA5yIGv3OZTRQXT8kxA05iG+wARZKVbGO+E9a+kgc9AamnEFvGS14S7Ib uRnoZ/X3p9eEX5BJDc8bWa6xhhmx5au2XWPkkVXyt9Q== X-Received: by 2002:a63:e30a:: with SMTP id f10mr92066810pgh.331.1578027222140; Thu, 02 Jan 2020 20:53:42 -0800 (PST) X-Received: by 2002:a63:e30a:: with SMTP id f10mr92066776pgh.331.1578027221750; Thu, 02 Jan 2020 20:53:41 -0800 (PST) Received: from 2001-b011-380f-35a3-58a8-ce0f-e12f-6096.dynamic-ip6.hinet.net (2001-b011-380f-35a3-58a8-ce0f-e12f-6096.dynamic-ip6.hinet.net. [2001:b011:380f:35a3:58a8:ce0f:e12f:6096]) by smtp.gmail.com with ESMTPSA id s130sm60077705pgc.82.2020.01.02.20.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2020 20:53:41 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: SFP+ support for 8168fp/8117 From: Kai-Heng Feng In-Reply-To: Date: Fri, 3 Jan 2020 12:53:38 +0800 Cc: Andrew Lunn , Chun-Hao Lin , Linux Netdev List , Kernel development list , Anthony Wong , Jason Yen Content-Transfer-Encoding: 8BIT Message-Id: <02F7CBDE-B877-481C-A5AF-2F4CBF830A2C@canonical.com> References: <2D8F5FFE-3EC3-480B-9D15-23CACE5556DF@canonical.com> <20200102152143.GB1397@lunn.ch> To: Heiner Kallweit X-Mailer: Apple Mail (2.3608.40.2.2.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 3, 2020, at 05:24, Heiner Kallweit wrote: > > On 02.01.2020 17:46, Kai-Heng Feng wrote: >> Hi Andrew, >> >>> On Jan 2, 2020, at 23:21, Andrew Lunn wrote: >>> >>> On Thu, Jan 02, 2020 at 02:59:42PM +0800, Kai Heng Feng wrote: >>>> Hi Heiner, >>>> >>>> There's an 8168fp/8117 chip has SFP+ port instead of RJ45, the phy device ID matches "Generic FE-GE Realtek PHY" nevertheless. >>>> The problems is that, since it uses SFP+, both BMCR and BMSR read are always zero, so Realtek phylib never knows if the link is up. >>>> >>>> However, the old method to read through MMIO correctly shows the link is up: >>>> static unsigned int rtl8169_xmii_link_ok(struct rtl8169_private *tp) >>>> { >>>> return RTL_R8(tp, PHYstatus) & LinkStatus; >>>> } >>>> >>>> Few ideas here: >>>> - Add a link state callback for phylib like phylink's phylink_fixed_state_cb(). However there's no guarantee that other parts of this chip works. >>>> - Add SFP+ support for this chip. However the phy device matches to "Generic FE-GE Realtek PHY" which may complicate things. >>>> >>>> Any advice will be welcome. >>> >>> Hi Kai >>> >>> Is the i2c bus accessible? >> >> I don't think so. It seems to be a regular Realtek 8168 device with generic PCI ID [10ec:8168]. >> >>> Is there any documentation or example code? >> >> Unfortunately no. >> >>> >>> In order to correctly support SFP+ cages, we need access to the i2c >>> bus to determine what sort of module has been inserted. It would also >>> be good to have access to LOS, transmitter disable, etc, from the SFP >>> cage. >> >> Seems like we need Realtek to provide more information to support this chip with SFP+. >> > Indeed it would be good to have some more details how this chip handles SFP+, > therefore I add Hau to the discussion. > > As I see it the PHY registers are simply dummies on this chip. Or does this chip > support both, PHY and SFP+? Hopefully SFP presence can be autodetected, we could > skip the complete PHY handling in this case. Interesting would be which parts of > the SFP interface are exposed how via (proprietary) registers. > Recently the STMMAC driver was converted from phylib to phylink, maybe we have > to do the same with r8169 one fine day. But w/o more details this is just > speculation, much appreciated would be documentation from Realtek about the > SFP+ interface. > > Kai, which hardware/board are we talking about? It's a regular Intel PC. The ethernet is function 1 of the PCI device, function 0 isn't bound to any driver: 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device [10ec:816e] (rev 1a) 02:00.1 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 22) Kai-Heng > >> Kai-Heng >> >>> >>> Andrew >> > Heiner