From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D4B5320D for ; Tue, 26 Dec 2023 12:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cQTjLb+d" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a26fa26e7aeso98926266b.3 for ; Tue, 26 Dec 2023 04:46:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703594779; x=1704199579; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=gCxEDWbrZHKoIpuDswAlqmbXQH5G1gESIMUb8vNGV1o=; b=cQTjLb+dDxEiqLkwBJWUYqGLBtVotbx1fWNnR+Vv7DJ7GxdSurBgXhb1umlQAMG6HB 5Riqjm2d0y7gvD05DrPaAF/Sc+hCtg94v06/1srry3hrZ3363RExr/Yf5fZdvbhspdCb owcV90xObWdFhQAMqXGEhgKcubb4uaTHE/btm+520qytzl+zd1e74TIyaj5Q2mwxhfG4 KQwQ5H8c+NU1xAyY+zvyaiB08DELmw0ZDEEfJqERX8B9w+NHTxfiSY5pfv6bepLdj2nA CKXpLihjLIJyh+ScDM8HOEGjecHuMDVJRntzQEZWATqODHy1GVPRJrK+n2bTWeHeDzK2 7whQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703594779; x=1704199579; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gCxEDWbrZHKoIpuDswAlqmbXQH5G1gESIMUb8vNGV1o=; b=gCxsp1F1em78CkFG5N/US1JfV+GoSibRixf5pUX4WBFYF9GUbClXFCve+xaJEndDvP kFL9DKzv/KiumVmzotmiVnwA+j7YhpLHdZTvNk9urZCz0a5gGxStSUMnMdpYpPRejs7Y ZTBWxNY7UlJxnXPyLxkEm+heEgBQ+Wn6c2FcMh2fV8dp61yoasJnGk/JS+tC1Qm4PZCt qH7KC2zqJD0sZBD8H2X6rqRJQdRWx/DL9VZNwXilU9yixO4yxBt5oQ+F6tMJYx4hmSVq wzgig7l9de8ccQVmUIN/C32wpE064fJa/0AJ9QerIRIktorAOmwohzlJxCeRexeItohS TZ9Q== X-Gm-Message-State: AOJu0Yw+Og84ZrzIMldQQ72BROVhohSI/Yf2SsyrDOONsf8ZmSYPBgGa QETaIi/IvPv/g1DZTE/B6Dw= X-Google-Smtp-Source: AGHT+IFGX5NDwVkMr/xoFeR/wQ3QmdsWMxWnclK7EDyi1LGFsxrSjhe3gAG9TA4NIjje4qppuoM/Og== X-Received: by 2002:a17:906:10dd:b0:a26:d9a9:ffeb with SMTP id v29-20020a17090610dd00b00a26d9a9ffebmr1929220ejv.82.1703594779342; Tue, 26 Dec 2023 04:46:19 -0800 (PST) Received: from ?IPV6:2a01:c23:b98b:d900:ec97:e072:2e43:cf1d? (dynamic-2a01-0c23-b98b-d900-ec97-e072-2e43-cf1d.c23.pool.telefonica.de. [2a01:c23:b98b:d900:ec97:e072:2e43:cf1d]) by smtp.googlemail.com with ESMTPSA id l2-20020a170907914200b00a269b4692a9sm5712548ejs.84.2023.12.26.04.46.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Dec 2023 04:46:18 -0800 (PST) Message-ID: <86c4c55b-511d-4b46-86b2-7d58df3b0c15@gmail.com> Date: Tue, 26 Dec 2023 13:46:17 +0100 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 00/15] Realtek RTL822x PHY rework to c45 and SerDes interface switching To: =?UTF-8?Q?Marek_Beh=C3=BAn?= Cc: netdev@vger.kernel.org, Andrew Lunn , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Russell King , Alexander Couzens , Daniel Golle , Willy Liu , Ioana Ciornei , =?UTF-8?Q?Marek_Moj=C3=ADk?= , =?UTF-8?Q?Maximili=C3=A1n_Maliar?= References: <20231220155518.15692-1-kabel@kernel.org> <20231220172518.50f56aaa@dellmb> <5b9ae8ea-5817-47b0-9d51-0b15098db5cf@gmail.com> <20231225112831.65e3a942@thinkpad> Content-Language: en-US From: Heiner Kallweit Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzw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Nrf52YMD7hL6rXXuis7R6zY8WnnBhW0uCfhajx q+KuARXC0sDLztcjaS3ayXonpoCPZep2Bd5xqE4Ln8/COCslP7E92W1uf1EcdXXIrx1acg21 H/0Z53okMykVs3a8tECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <20231225112831.65e3a942@thinkpad> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 25.12.2023 11:28, Marek Behún wrote: > On Sat, 23 Dec 2023 20:09:33 +0100 > Heiner Kallweit wrote: > >> On 20.12.2023 17:25, Marek Behún wrote: >>> On Wed, 20 Dec 2023 17:20:07 +0100 >>> Heiner Kallweit wrote: >>> >>>> On 20.12.2023 16:55, Marek Behún wrote: >>>>> Hi, >>>>> >>>>> this series reworks the realtek PHY driver's support for rtl822x >>>>> 2.5G transceivers: >>>>> >>>>> - First I change the driver so that the high level driver methods >>>>> only use clause 45 register accesses (the only clause 22 accesses >>>>> are left when accessing c45 registers indirectly, if the MDIO bus >>>>> does not support clause 45 accesses). >>>>> The driver starts using the genphy_c45_* methods. >>>>> >>>>> At this point the driver is ready to be used on a MDIO bus capable >>>>> of only clause 45 accesses, but will still work on clause 22 only >>>>> MDIO bus. >>>>> >>>>> - I then add support for SerDes mode switching between 2500base-x >>>>> and sgmii, based on autonegotiated copper speed. >>>>> >>>>> All this is done so that we can support another 2.5G copper SFP >>>>> module, which is enabled by the last patch. >>>>> >>>> >>>> Has been verified that the RTL8125-integrated PHY's still work >>>> properly with this patch set? >>>> >>> >>> Hi Heiner, >>> >>> no, I wanted to send you an email to test this. I do not have the >>> controllers with integrates PHYs. >>> >>> Can you test this? >>> >>> Also do you have a controller where the rtlgen driver is used but it >>> only supports 1gbps ? I.e. where the PHY ID is RTL_GENERIC_PHYID >>> (0x001cc800). >>> >>> I am asking because I am told that it also is clause 45, so the drivers >>> can potentially be merged completely (the rtl822x_ functions can be >>> merged with rtlgen_ functions and everything rewritten to clause 45, >>> and gentphy_c45_ functions can be used). >>> >> At least on RTL8168h indirect MMD reads return 0 always. >> IIRC this was the reason why the rtlgen functions use the vendor-specific >> registers. > > Looking at the code in r8169_phy_config.c, I see function > rtl8168h_config_eee_phy() > with three paged writes to vendor registers, but the writes do not access > the same registers as the .read_mmd() methods for the PCS_EEE / AN_EEE registers > in realtek.c PHY driver. > That's some other undocumented EEE-related magic copied from the vendor driver. > It seems for now it would be best to keep the methods for paged > accesses. > > Could you test the patchset without the patch that removes the paged > access methods? > > The rewrite of the read_mmd / write_mmd methods should not cause > problems. I am told by the realtek contact you gave me that: > I tested on RTL8125A and RTL8125B, and on both indirect MMD reads return 0. I tested with reading MDIO_MMD_PCS / MDIO_PCS_EEE_ABLE. Reading this register should return 6. So it seems indirect MMD access was somehow and for whatever reason disabled by Realtek for the RTL8125-internal PHY's (provided that indirect C22 MMD access is supported by the standalone versions). Note: Internal PHY of RTL8125A has PHY ID 0x001cc800 (RTL8226 2.5Gbps PHY) Internal PHY of RTL8125B has PHY ID 0x001cc840 (RTL8226B_RTL8221B 2.5Gbps PHY) Consequence is that we can't replace reading the vendor-specific registers with standard MMD reads. > If FE PHY supports EEE, then it will support MMD register and it will > also support use internal registers to access theses MMD registers. > > Marek Heiner