From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796350688; b=T5G616s0+V0VsSGEH/cRdbCVKkLyZnPzmphqEMTpHmDo6UQLXvHWXj+TdCCWn1PdmlJD eNuZgrz8B4oRxx9KLOKcFKDdmn7yTnn9UxcvKfSO1psuomTo0g/Jj7Z+yB/VvsWCm7FRR yvlgFWXKnt+nGtD0w9qJOuO3l0glWzMI+IEoWp4k56N+A0UEZ7FNxSCd5SNUbG6Cv1cW0 3k9vR/ww4p8FZm5Q9eFZnLblXCZiYrQQKP+UUv92VeG+v9+gmTotDd5N9u4765QmcjG+D poByzalz4DZNuacNmzcjHMC7028Uifvd+wKUZqpngyeGO18yZ/j+iPcZOCoDXDRFhig== 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=I4EisLanDCnAOuMOUyrBjjvcK0SfbKiZzAtoH/ecJQigc9El12OgEryMtS20YhcPg0Dq YLf/qJrCTsYOT5N1jsqwM2QNx8U8lH1pvxNnaZh2/OLU1x62ggreRXSfg8ieIgPYnd8Tm JLpXCtXvuvy+5+41M1cMhCe6thkSKs7eVYOaxQtupeSjmXt78muNEO0085p2b2DJDs/mw x8TeD218sdssStmUnj0vpHIcPLjO5pdEzjZZI8xYZ/weLA2v6wHY+BPFNXYHj/mWNweqr SHlbZJWCeeK9nFC3DXg4Obb/geptMisPxXITx6dV6A6z55SSWUysM6OLSxHSctPvjyQ== 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.46 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 47054606A330 for ; Fri, 4 Dec 2026 02:18:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47054606A330 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-f46.google.com with SMTP id 4fb4d7f45d1cf-6baa6f27904so545980a12.0 for ; Thu, 03 Dec 2026 18:18:07 -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=BRC7zD1lFZKkDdHNG4e0rdXdPFOY26OKmVzLz4R5vyLmBvQyLEdSqhK33F/JKaLFBC nLCJqwKVqIokoVZuXEiN633/ZObNaVhONUbWkLZQ8YWAPFqzGzM5gGK6dEGpsxI6rvPc kiOBcOoH3fY96ALyGjqcGk5s5o5fpT9G/r/JskyD0k3BLbzDyLHIxsIPnw4Puz/p/vOR FRi5RpdO87ssvm6Nt4bD5Q5Qru7oYDiEsp0GhcS5xJCgb/E545OIN3mb/M6Y7foxglXd D8MhWdljm2Hs+7Iodkam3l337qI8jFTLWA3isjpBMGZytQkNALU2mOnwkV1kNoNL9Kku Fbaw== X-Forwarded-Encrypted: i=1; AL+hErHwIfqE025zcDXGyvx0j+ut9WjkSb2fWABC0BB4rqs+E4XM45tNCKziWy5FU3TlLua21F7U0igxVlqBMpU=@vger.kernel.org X-Gm-Message-State: APuU4Z9nJDO4V3j99rE4oatj3j18DFy9r+ZNgn06iADn+wFFpGXYtKF6 kyxeK9gYzHI1/XZYS58DL5+XoJSvYh0YjvtQa9FZBfckakjVSkl7KXgIChHv09RbhQ== X-Gm-Gg: AZFdTZejiZwLdsMmxrr6PtQr+CnB6WvrGpLPpt2nmk6LqHG6mPeU4zC8QvEsmjtKBoq /XGPk55wmdvN8N0zAxMIE7ZuCX97pZdzhKQFpDNKWySoo8geV+trbwWhUb5M6c7xhMog9pkEQhC fhITB7u5ix2y4ONaMZQbfgOYeYYwBBbsVctFokZTHuRGjVZBd/czH+ZMw0J33vEvl6JGYVbKyoO woshpfip9+JXgvkSSRv3saBRbJxB4CMs4JjqeGVvfUlDKAndjyz5WHYZos7sQFPyd1vQ20ambps 0M7s1JfR5tzLW/IsaHHW6/KLIIr/s3hz1e9eGaSdt/dVotwmFABoEq9VsUTpMVPbQH5icR5BPTo gsNIVQ36vtk2XSlDz/Lus23Gxgaynmo/ePuJBxUFsjp9vTifTVDapW4jCuTioSOmsv4EDol+kX2 PtTS8y/DAf/fHTkLWWg/682qINQ3/9zwKDV6+ylVrQlYlPKzrCb0+gDdCarg0u/mO0y0cP5zXML 4Ln0Ll7TxqkEIWBkCWo33tsv2GVUFZoxLpkJ9sn/65m7mH+7bKM5GvF/ZdEjhYBGMltsoswLSza lYboXS4cuyQDjDPhwUSvMzWMnHJIxNCI3zjGqNFCjZEonN5GsInT/MqcUDpWM3JvIWeAK6vawO4 BgClVk7H0NXLF7WkGXsgvLO3fxsAZgcv+FssAkdhJWzubogJx6ipu2zzfR+pN9DKqPj2QJPKgQ7 cLx9YQgeeBq28Pg+zj4E/1 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: linux-kernel@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