Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1522434ybv; Fri, 14 Feb 2020 01:08:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwUFmjGwZScDUg+Gr9LT8uRTaBhfgy/NpYU8wtYmstjahZNHqYjfdkWWBGXQ2JzKXGbmc1E X-Received: by 2002:a9d:2264:: with SMTP id o91mr1454383ota.328.1581671314387; Fri, 14 Feb 2020 01:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581671314; cv=none; d=google.com; s=arc-20160816; b=NqWDfyAODksuxBr6KPBnl7gnC/8KP+DUM+bECQvkRM0i/FjKlGqGOpE6WWfDmcTezc ZMGNXMXKxnQ1gke3MX7vGku3ciZHsiw95QfD63d6VYbwh9t3EN4M4u/s6HtKVz19LrRY 0AvL+zoccg1fSBkKzi1eeo825Y7zbcxKv/jKXZrfnmaCTblUJzUEJYBt5eNIoEhzjBqr 36Vq+ed8zbeu2/aUFjbjsvzWMV+g7ejHAkgkQzx5RKCzT6W6Khab1cGGwGMsY5NaPqHA /129d6jiWZ9XMYzNQluAJi4PgvPI8+cT8Z450YEyY4gfjQPiq6BEi2RSZdOlGBoqzqJs HqrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=qy0XvTHcC8pot/ZjZIhKaSQ2gDdL8G3BCty6LC5OqoA=; b=s/EDclRvMUsjm8W+U2WI6JUG0dZ+IvXbXT4E46eFwcQ5CPb6enPxRhmXmW3/8CByMz VDiCxorH8vNI54FkYg5+RhB4nbkDBrCMjJ2K2JtD2iddTQpkTo7PMNJ00Y98yjKdeVOH 3dcy/zE1R9mtoNy+g7lBjzookHeXh631JrXefDpcWrOb5zahNSMIn5rJha8GyhcRrmoi zPWGOjKcYgHaT/P+YErlQkGjoFTy2R93Y4z8DMEYUjixD2SavTkoUepZFVWCMs3Cj3Bv AbBLV8Bo5FwRVwpEA2KrNcgIgI/U2pM7+MWmd5IICt9puAa8aTjaF7jqKtZ3leslxA6P sdlw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si2504944ote.3.2020.02.14.01.08.21; Fri, 14 Feb 2020 01:08:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728954AbgBNJIQ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 14 Feb 2020 04:08:16 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:35868 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbgBNJIQ (ORCPT ); Fri, 14 Feb 2020 04:08:16 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID 01E97nY8000710, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTEXMB06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id 01E97nY8000710 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Feb 2020 17:07:49 +0800 Received: from RTEXMB05.realtek.com.tw (172.21.6.98) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 14 Feb 2020 17:07:49 +0800 Received: from RTEXMB04.realtek.com.tw (172.21.6.97) by RTEXMB05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 14 Feb 2020 17:07:49 +0800 Received: from RTEXMB04.realtek.com.tw ([fe80::d9c5:a079:495e:b999]) by RTEXMB04.realtek.com.tw ([fe80::d9c5:a079:495e:b999%6]) with mapi id 15.01.1779.005; Fri, 14 Feb 2020 17:07:49 +0800 From: Hau To: Kai-Heng Feng CC: Heiner Kallweit , Andrew Lunn , Linux Netdev List , Kernel development list , Anthony Wong , Jason Yen Subject: RE: SFP+ support for 8168fp/8117 Thread-Topic: SFP+ support for 8168fp/8117 Thread-Index: AQHVwTo87C9FPgb4q0K7N9j/9Mzg+6fW+ByAgAAXwwCAAE15gIAAfZ0AgECGEQCAAkeigA== Date: Fri, 14 Feb 2020 09:07:49 +0000 Message-ID: <995bddbc4f9d48cbb3a289a7e9799f15@realtek.com> References: <2D8F5FFE-3EC3-480B-9D15-23CACE5556DF@canonical.com> <20200102152143.GB1397@lunn.ch> <02F7CBDE-B877-481C-A5AF-2F4CBF830A2C@canonical.com> <80E9C881-91C8-4F29-B9CE-652F9EE0B018@canonical.com> In-Reply-To: <80E9C881-91C8-4F29-B9CE-652F9EE0B018@canonical.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.177.157] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Chun-Hao, > > > On Jan 3, 2020, at 12:53, Kai-Heng Feng > wrote: > > > > > > > >> 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) > > Would it be possible to share some info on SFP support? Hi Kai-Heng, Could you use r8168 to dump hardware info with following command. cat /proc/net/r8168/ethx/* I want to make sure which chip you use and try to add support it in r8168/r8169. Hau > > Kai-Heng > > > > > Kai-Heng > > > >> > >>> Kai-Heng > >>> > >>>> > >>>> Andrew > >>> > >> Heiner > > > > > ------Please consider the environment before printing this e-mail.