From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796350687; b=rgnqjTKQHJwujfwYC5h/Qd1Z9vbcnl+Rj1q4Z0qsMmBk11tJOQwWu2tRvuJc3GvftIo5 GfEZsuvF4+L5ts3BDPztWYN4Xdfor6IxkZDl0Rb1Bfr5hOCHU2ADJ4DWC9FTtG3eOSKaL ovuYVx++s7r4tpm0tlGEqqrArdy4BWMnMOBFIcLX6mUc+KCWrLDjUL0DIyuWNbJKcTSz+ VenKP3O8lLVtMhWWe3R6lgVDnGW4FLDAtlHIgDOKrApYRcRXYo2ts05Zjel/FBQEYmZ7q 3ym8gsfbndEbK1+oEGP6LwrV9rAJl2vaRJqRyPH8wPoqoyTG3qiFiZDJ50qpS6N4NzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796350687; 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=QuooYxr6PTgdyzg4fjZjO1yYWncAyaI2lcjuxRc4lND4I6BUBkw9EXACzWUDdeF+ZtQj xvQHv+2EIVOsYeDaVO+/T93NdTsGzLAMDl8XFXe5X43cXEURpqGmr21U+45KRyaWgukI7 gN9XmzzTlbdNZIdsN0j0EalaIIvg19ecS2kazWadwGFrzIc1LObyjdPZrSTXAHcrMBwMr RAaGdhukboBMN9J2VL4HF65zJowxU19NIpvX5qBk1tMAzZMtWlzjgHtNyXEqyG0bADizy oW7Rt/3YdO5Y9TgIoasdJHBcvoLHnhLRiFutDQYQ2SnB51PXgncHaerxNIUXCauTuEw== 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.50 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 3B998606A32D for ; Fri, 4 Dec 2026 02:18:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3B998606A32D 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, unprotected) header.d=pardini.net header.i=@pardini.net header.a=rsa-sha256 header.s=google header.b=TR0+WV6i Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-6bc91681ccbso554552a12.3 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=Q8NyDF2IYM+Gi2eozaUJ+N2c+klpDgXn/2+ieLexAw8cKPwkFsLprMThPG6qbdzNjH 75PhfVmLxyiMEn9m0KKKrgmMMiEIVxOP6LpaY4ujlqpNeMNGVTHcp13f2fL/Va04oSGH ySpCzMZP8CmFqrmgzh+B3ZUD76N4TODlQl+6dUnb6np5IM43NszbDCtt55fXQP1vE90G Uzum9knh76oeDPPc+Jt3A90y4kjmbrmWOwmoHyEaCiXvqBLOBb7HgtnksejRxOKDma4W TbZFV/5dRBIsmgvTeGtmBWwE4us0EeE/0ym7tjS9XBdnETgjt9svXVwifcae6V0Pz6rw loXQ== X-Forwarded-Encrypted: i=1; AL+hErFeUoURd2LvX6UQkN2VLiKt6Cr2JO+UW+YE1x21CoK5QCUk8xHb81qufKLXO7rSgIyiVN2Ucw3Y9epf@vger.kernel.org X-Gm-Message-State: APuU4Z++pSb2sYrwJVGZnm1alol0XWe8QB1K54jw4PZtbG5+vGm1P01p nKA3IbnazBrqIuYXi6B4VQObMsSajeKT2C41G+FH9d/TBj6drMZHXoW6AS1tNc7L7Q== X-Gm-Gg: AZFdTZfzdQg4dQCK+IAQUOiAAOxbK3F1ipHOa2rzguUPgRimQMHloHQolXQZUXO0Ln8 wDMOoYAQs7VgdFqZ3RdK3sQlDvgs0mQDqZJVjRQ0kpQhF/lSvxRIyy8aeoQJyAp+ovi1W1dm2D1 T3YUj0JA9eM6qPXaur7iUdnDY8CnzpnLC36B68xhh8ZXwkU23WkPOUg5hiaqHRY0Nnlb3eDOZ/V /6jsdN0iO4moNskhvG7TWmsY6g0oZfOHto+xNDAKnwh4crk1WrsH8o5nalC+oEOKdRI80H5rIxG OsjpgSVpEKa9mSLqklua9meaEsWqP2nWtJGUY63mcFfDYBEzTx3NTw1pELkewZuCaWctlzcIEPO WVIWhSmkh33jiLYwAGwaRjWBzpOWhrX5VSupS79S0Pwh1LIrdhTI2LB+3g9+f13dP6nrgRq49ZG df5N2HWiHIFht+2ImV4YCvdYcbopp8GyeBY8++GwZoLbsU2Yc7eJc3ftbRfzTb1qXikPQaxDfVE Kti7GauWYGu8CrEfwcGGNDaQVQ/u2YxwSBqvsQESs2sXlJAqWmGOcQR7XWjxtAK0axzB/LvrFjw IXm7CZFbBkcfKmEotG64g7keGO7YvZP3/sY9qGAZkh5dpOguh+mkNTY7WgadCGmWi9Z4pfq5jFL 9SSpgQGmcvI348QYxep+hUZCfk6+QX9OMPxmMEsuN/qS4uQhIvQu03XEmre+TRa3WqRvaFmvp5x A67AVOpODC04Q6CXZoeowm 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: devicetree@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