From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f1.google.com (mail-pj2-f1.google.com [74.125.227.129]) (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 8DF942DFA2F for ; Sun, 2 Aug 2026 03:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.129 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785641306; cv=none; b=hgaqK93U0tVNGEETwB4AIwcMtjzaab6G0ndtNkqCoAS4zWyJJOPbjjl/feAEUUV4asLILq5xtGK1ANTYr+B8+wovqWXUjUHfkHcPjJ5CJog4NhqJDATj1iNGUf4dk9v3vJnotUY2zh60QBRTQBZPTTbE/58zDYqcYejZqYY6G8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785641306; c=relaxed/simple; bh=zVW9y8ku2uvDPevPqPFRUhCMmyFyJ7Yqdg2TMwGw9u4=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=uOL4S1/KwVRVMiCLQQeNpYwSlMLUqRPxXKQs89zWhvvSxLRqQG89SyDiBbtdkduhzlAln8p0lbeSqNifXXK/mBHb3q9ATw3unQUkhoeOw8QZ3U9kIaMkbB/DN57RO8hdmwhFcuifXOgbIraMZjuBYv269h6lh860/3HvVo4TRps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GPm/Qn/+; arc=none smtp.client-ip=74.125.227.129 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="GPm/Qn/+" Received: by mail-pj2-f1.google.com with SMTP id d9443c01a7336-2cabf1f1051so5801075ad.0 for ; Sat, 01 Aug 2026 20:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785641305; x=1786246105; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:user-agent:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=TpANIRIXCFEaCO+NoYgeEquheHUazRAsrSjmXdnDLkw=; b=GPm/Qn/+ajQIxPFAcut+9aW2WJFPy70NDWjQ/dx3sk/AK35IYp12HwPJyfX1gPK5B9 Wsm8ez83eBCOq7BcICvdJRH63dveQ/r9xqBuAKhbazHKYUEzcA6Pa1wk6U4aCAvegjFZ DmpDb8HVWCG5Ju/KCwiY5s0RtbI57fFvuykIu7q/xFXaSKOIMwPaKctox2/SG7AMyidk NbCjl6YrvDyNh4DQTE2Kc5TckoB2ew46GAtfsWeURi9bgs2nAV8TvRBUVgxGprgm7PDN +GBpeE+xfR2un2ZW703FB20+gXIhCmSv/wVKZvDRxcO1BmPMAjn2gIe8o3JDyScnk6r0 lTfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785641305; x=1786246105; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=TpANIRIXCFEaCO+NoYgeEquheHUazRAsrSjmXdnDLkw=; b=mOXMBKhltT7ICl3ZSAb9pSLPLVaAvGXG+WTxU2FhMVxu8JkYuAGaQp7Ec8kCM//Z1A e3U1gUZXQB4deCETijKkpRqtbY6fCRPuxmZtOsKA1O62K+k6GDx9taAujtLNgnaxOqtX rlneKF+PtzLm1tiMiCs+VjyUL5loMFuFzPqc2EaQjLThcD5OIznz3K2W99kZADv6J5Le EskHknzNX9F+66ibyUI0yx84BFKIvo67VdzI465FwQYUKliqYCgvM9tUQxqKmLWYqHBy tuDdooguhA9y3QkZWlbdk6jiPPckRSvwkI2Njp1OhYF3Y1EgiHMSqG7i00IVfGD8ZHlq kR4w== X-Forwarded-Encrypted: i=1; AHgh+RppCr4do/jQLotOYoYcsLyLDfyYgiwQ2mAFn2Bc0F5oqGYLdMXuj9v8gpxYLKAlFqeh0tJrUbUnzUw/@vger.kernel.org X-Gm-Message-State: AOJu0YxzE8akoP7I29C1IrRgYeBCfD6o8r81Q+0WzSVFJNjc9KxDUL1t 02uav1oofvY83akX5jb0Kwkx3Jxrxhej6bXfvCjmkWhQh8F1UR7eMeuX X-Gm-Gg: AR+sD118m8VSQ2Kh5bu728EiyTh0EoNZN5vwFLEtyOG56KJgU8vEQEuAOxzTgqnAVQf LBDPcGjryJuvdpsXjzl7B7OiliE4Cb8pHVJ2vR/gJAQ9nUw/KTLZSzwHIWQZUnSEbYuxHBt2sHH Sf51sixGss3cOdgLjc2s7HhQMAFdE3mVgZ6htCtOuhkuGLgll91CgA4+aJqoB43ho8rDGul1dck 1uoJYinY8ZX9qmUD/orIRt+cXfEmRQffclei+APBgzI7/dXPBMYE2eVySDhuhF4PUiwxwpq4f3+ nphGmFl0HuxOfYDQlqLye5J4TQXWJT3XP/XrhEdsj8/D7ESWavrOlC3NROIJAKenz2DUpGgNK/Y xeycA0TQb5tvBXPBKf8ZEgc2BjQoQgVsndpLP93oQRYeegjFlgPH7E/aviNWC8Hp8h7EeQmUHHl yaSr4q4wPQiBF5EerFaorFNfKd0sXVLh4DVZhd+1XO02IIoWa3oLS6O22TKMrPXnH8x/E= X-Received: by 2002:a17:902:ea0c:b0:2cf:6f7f:55d8 with SMTP id d9443c01a7336-2d0523f76edmr54404665ad.37.1785641304908; Sat, 01 Aug 2026 20:28:24 -0700 (PDT) Received: from ehlo.thunderbird.net ([103.213.4.16]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d04ae19ba5sm23124875ad.17.2026.08.01.20.28.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Aug 2026 20:28:24 -0700 (PDT) Date: Sun, 02 Aug 2026 10:51:37 +0800 From: Coia Prant To: Andrew Lunn CC: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Vinod Koul , Maxime Chevallier , Maxime Coquelin , Alexandre Torgue , Lad Prabhakar , Romain Gantois , Heiner Kallweit , Neil Armstrong , Russell King , Shawn Lin , David Heidelberg , netdev@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-renesas-soc@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v2_03/10=5D_phy=3A_rockchip=3A_naneng-?= =?US-ASCII?Q?combphy=3A_add_SGMII_MAC_selection_for_RK3568?= User-Agent: K-9 Mail for Android In-Reply-To: <0cf1f734-69d4-471f-aa22-e1a2e7d0341b@lunn.ch> References: <20260801142244.679437-2-coiaprant@gmail.com> <20260801142244.679437-5-coiaprant@gmail.com> <0cf1f734-69d4-471f-aa22-e1a2e7d0341b@lunn.ch> Message-ID: <7F609DE6-F3C6-487E-9113-449F5BE05D94@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On August 2, 2026 4:58:39 AM GMT+08:00, Andrew Lunn wrot= e: >On Sat, Aug 01, 2026 at 10:22:27PM +0800, Coia Prant wrote: >> On RK3568, the SGMII interface can be routed to either GMAC0 or >> GMAC1 via the GRF register pipe_sgmii_mac_sel=2E >>=20 >> Add support for this selection by introducing >> the "rockchip,sgmii-mac-sel" DT property=2E >>=20 >> The hardware reset value is GMAC1 (1)=2E If the property is set to 0, >> the driver routes SGMII to GMAC0; if set to 1 (or omitted), it >> remains at GMAC1=2E >>=20 >> This is necessary for boards such as the Ariaboard Photonicat, which >> uses the SGMII interface connected to GMAC0=2E > >If SGMII is not selected, what MII is used? RGMII? > >Can this setting be implied from phy-mode? > > Andrew Hi Andrew, If phy-mode is not "sgmii" (e=2Eg=2E, "rgmii" or "rmii"), the GMAC works i= n the corresponding mode and this register is not touched=2E The reset default (GMAC1) remains, but it has no effect in non-SGMII modes because the register only controls SGMII signal routing=2E Regarding inference from phy-mode: phy-mode =3D "sgmii" only tells the MAC driver that the interface is SGMII=2E It does not specify whether the SGMII signals are physically routed to GMAC0 or GMAC1 on the board=2E That routing is a board-level decision and cannot be derived from any other DT property=2E Also, the PHY (Naneng Combo PHY) is initialized by the XPCS glue driver (pcs-xpcs-rk), not by the GMAC driver=2E The PHY driver has no way to know which GMAC is using it=2E Making the PHY aware of the MAC ID would require significant changes to the PHY layer, which is out of scope for this series=2E Therefore, an explicit DT property is the cleanest and most maintainable way to describe this hardware routing=2E Thanks, Coia