From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796350688; b=qp1pRcS4fNNGCkKqGUv7qJry7ndwzA3mVwM+sICe/jZp56zZ6GHB5jzSwMLlUV0tyNSo wOEoitboATU/lRoTkWFade6TIj+HNP4d69bodUnC/UYIAvNSn3UflEot/KSJB4wYQpHl8 6TMKx24C5vNIhz8qKPY2/bf6mApdgmnwJLRim4fGJvsFESJ/L/8ngmBxrmZaaW0NIXyQ1 Ls37CzG2LNU8yw4rJtK+aaPc1bz07Hc0o4/GgzYK70ywT4BurEkSAU0UHm+03F+YMgo4r N4NQZBcf3Q3fsRaslRFmVZdWZqcDk4/SbuOvqChtf7b7FwbJzhGPLYD19JSwcfou/cA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796350688; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=rRo+bxhoPfN/3D69ZpgUhDT5DaatId3qIH16kABOoxc=; b=gNv05xuT7VG0Gazol/Xfmq2bB10cJcEmFiREn7A9jeQiYmUnlmsPr+ZY1bhhpe/irtL7 Rcs9DR3NBDO0uw9Ig6vV4FJD/m4jN1RLRHPWCBQ+eFnoE+OOxsQ238nMtPbU6DUPd05xF Cp3NTYytn2u4ctLT7I/Vsft6cgDmoR47FtBneEQNGI2gIEgeLGiz/8jGNYaHFi71dYf1N IjvNT/hSYqM3Mz3xknGDq9rrZOqGb7i5cK1JFHJF7GUyel6pNAVl3Hd+uEC1veKEv9+jf 237LLaK1b4L2W0sdA1VEq6eZG16YQf+rfBS2zhJyDOY0VgitcCsC24izzSxpuew1Aag== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=pardini.net; spf=pass smtp.mailfrom=pardini.net; dkim=pass header.d=pardini.net header.i=@pardini.net header.a=rsa-sha256 header.s=google header.b=TR0+WV6i; arc=none smtp.remote-ip=209.85.208.47 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA84606A32F for ; Fri, 4 Dec 2026 02:18:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3EA84606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pardini.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pardini.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pardini.net header.i=@pardini.net header.a=rsa-sha256 header.s=google header.b=TR0+WV6i Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-6b547d6c07bso506581a12.1 for ; Thu, 03 Dec 2026 18:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pardini.net; s=google; t=1796350686; x=1796955486; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rRo+bxhoPfN/3D69ZpgUhDT5DaatId3qIH16kABOoxc=; b=TR0+WV6iT5N0u/Xl5lltyBiCEVsKgmA1RGilNM3hzZqhFXFwqLCP5Ald7lIjxP31qu 9Ez1qHgJNKAH39IFgvIPhQyMCN9nsIwdwLciNFYU0lzu9BMNZ7Newx1/wiVZT1dmbezk 0om3CYBsUsv+14U3uyVGmiZBVec1cGTEjkVSYYWinuwwMieT62Zf9/vc8ExKEE7fZLvm wPmjVmhW8RJFNMf2fR9n1R3ei2lMUANhZS5RxE68abqinhAeMC8jEODYy6HD6PZGmvCH TTcCR2trHweSfv++rfDymJSc+MFCuiAZF2QTEO0q81dHyPhULP0cq22Y9ldMx+c7D7mh BLEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796350686; x=1796955486; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rRo+bxhoPfN/3D69ZpgUhDT5DaatId3qIH16kABOoxc=; b=G8Z0aRaBEC9kfFpf4OXD1fW85x4XExNzoFTF0lPsq+CA4quSU+IF4S9YkqUbPZr4j6 SO4ik+auIzjv6+Fe/8Zttp3GCQNjCuoTNFtKnan8S6XUOuHL2xycYD+Y/2pcJMhvZyGU qpqsDIWu1ErcWDLNb/nxEoUndEA/JRkubN8fsv3pUU1vQwiDP53AoRESCrf4GFiagWbH gJETtI6cPOvQ6G1iF8t9z7Voq1iWzZK3k2lxUP8+Lg+YTdKDS91caxCD3rWUgdte63q9 vCp7z4JJp/i3u3h7cdkcmQSqb3eMdZmxos7hVRvNm+YgWRrE1oCkfeTWELy9L9yLYkgp avsA== X-Forwarded-Encrypted: i=1; AL+hErFBy3FYCZAZ9x0+gruN0ItIHm/VY1MVysl3LWSHp5tNRjCBjA66mgu0O2v21XpqzU56b1vH88U=@vger.kernel.org X-Gm-Message-State: APuU4Z/d/nzeNZa2SoV1kTIjepU872XbL2D0uI4eozqkPpTkTzL7MMjZ XG7JGsNRTqQy5PfaT5otBFyr/BHmiXrtw9JuFMvJyIC8IQin/Xynpv5MSfDa45gGgw== X-Gm-Gg: AZFdTZdhwMWM8R2izbZAnPE43TUrz6Sl+9N23Y31MxvKIpD3LZl8F1P0U7UC+mUeqHm 7uZOXkqXBtVr4ngba8Cdi/UAEX1s9QAaYiDUyTPEMzwLaXfnMIDEcSnxEuKc8H2Zas+fIIFVcg7 xVSwl4KE93RY6kAw0/siCHBP6O+vQ0UdAodftRrQzAX9bq1lOQ48dKFe5bXCSiLtJqoGK7ufs8V jLyfwqoQ2NTM6MqAdVY7sUfEjQlWYx28n8Ev4h/l6mgJpwF+wuqpQru9+8LDp1ZpNbM2OAEgUrD i5krnfPNWEY4dq+JUcLgYEb+/gQvf0E+qnZALCltG69WmB88w8cFgaPujeIIKQJLip38dIpUO3x aO8PcD0vo9L6whjoKDSKK+pOwGSL989ibMwWvu5jZq4Fl5FMaa2vm1E0ybTQfBb02QO9onTZQEw PR9SEOZCqmTjCbaCSCNKUUtcK8f0GOWp4I/xO2iJpnq3SJHVP/jmzw3WrnD3mRAb5MgoHej2ywl cFvjJpus4pYrN4QJj+uH0yDuQnELj9Yl1XWiGlqJtO6H6lVjejEt+B/ju+vuw6Iv0tlyvYsoNnV OePhyESvGZbr39gUKixvVL8FaZ84TNu3PnuprhWVCG7AHMd5Kds4Ou1g5G+OpmH4mqs8Skblyhk vDqfj3yHjx/K5mfwafvvRfiyh4zxemI+Tgi3uc2F8MfhNmmmECXB8ZM9HuGnkGm7Pvw47umuyFi UVEhzt7yhvm6gL3b13ONay X-Received: by 2002:a05:6402:eaa:b0:6b7:221c:beb with SMTP id 4fb4d7f45d1cf-6bcbee5892fmr425271a12.0.1796350685740; Thu, 03 Dec 2026 18:18:05 -0800 (PST) Received: from ?IPV6:2a02:a466:4d7a:0:e97d:7def:c516:347a? (2a02-a466-4d7a-0-e97d-7def-c516-347a.fixed6.kpn.net. [2a02:a466:4d7a:0:e97d:7def:c516:347a]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6bcbbfa1eb9sm351968a12.12.2026.12.03.18.18.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 18:18:04 -0800 (PST) Message-ID: <7fcf8e87-fe69-469a-a116-2eede651f843@pardini.net> Date: Fri, 4 Dec 2026 03:18:02 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/5] net: Derive stable MAC addresses from a unique device ID To: Alexey Charkov , Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King , Willem de Bruijn , Simon Horman Cc: Ryan Leung , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261125-rk3576-otp-cpuid-mac-v5-0-b3125c9a5fc8@flipper.net> Content-Language: en-US From: Ricardo Pardini In-Reply-To: <20261125-rk3576-otp-cpuid-mac-v5-0-b3125c9a5fc8@flipper.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 25/11/2026 20:36, Alexey Charkov wrote: > Rockchip SoCs are shipped with a unique CPU ID in their internal OTP > memory, and Rockchip bootloaders use it to give boards which have no > dedicated storage for a MAC address a stable one anyway: they hash the CPU > ID and patch the resulting addresses into the device tree they hand over. > > Kernels started without that fixup, e.g. straight from the SPL in Falcon > mode or by any other loader which does not implement Rockchip's derivation, > fall back to random MAC addresses which change on every boot. > > Derive the addresses in of_get_mac_address() instead, as the last resort > after any stored address, from a "unique-id" NVMEM cell referenced by > the Ethernet controller, so that a Linux image can use the same stable > addresses regardless of the boot flow. > [...] Hi Alexey, I tested the whole series on v7.4-rc5 on a Seeed reComputer RK3576 Dev Kit (both GMACs, ethernet0/1; DT for the board is submitted with an upcoming v2). With U-Boot (mainline v2026.07) the fixed-up local-mac-address still wins, as intended. Without u-boot proper, it gives both GMACs exactly the addresses U-Boot would assign, and both links come up. Thus: Tested-by: Ricardo Pardini # Seeed reComputer RK3576 Dev Kit I also carried the approach over to RK3588 and RK356x, and it fits them well: - the RK3588 OTP cells move into a fixed layout without trouble, the same as your RK3576 patch; RK356x already had one - the "rockchip,cpuid" compatible goes onto the RK3588 (id@7) and RK356x (id@a) CPU ID cells as is - the GMAC "unique-id" references apply the same way. On a Mekotronics R58X-Pro (RK3588, gmac0 + gmac1) both GMACs got exactly U-Boot's addresses, and so did the single GMAC (gmac1) on a Mixtile Edge 2 (RK3568) - it also works for PCIe NICs: on a Mixtile Blade 3 (RK3588, not submitted yet), the two RTL8125B behind the PCIe switch get ethernet0/1 aliases and a "unique-id" reference each, and r8169 picks the derived addresses up through of_get_mac_address() with no driver changes. So all in all, the approach works and carries over nicely to RK356x/88. I can send the RK3588 and RK356x DT patches once this lands, unless you'd rather carry them, just let me know; they'd be: - arm64: dts: rockchip: Derive GMAC MAC addresses from OTP on RK356x - arm64: dts: rockchip: Derive GMAC MAC addresses from OTP on RK3588 - arm64: dts: rockchip: Move RK3588 OTP cells into a fixed layout Plus a few different instances of - arm64: dts: rockchip: Derive RTL8125 MAC addresses from OTP on Foo Thanks, Ricardo