public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse
@ 2025-09-16 23:05 Daniel Golle
  2025-09-16 23:05 ` [PATCH 2/4] arm64: dts: mediatek: mt7986a: " Daniel Golle
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Daniel Golle @ 2025-09-16 23:05 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

The efuse of the MediaTek MT7622 contains an 8-byte unique identifier.
Add a 'serial' cell covering those 8 bytes to the nvmem defininition of
the efuse to allow easy access from userspace, eg. to generate a
persistent random MAC address on boards like the BananaPi R64 which
doesn't have any factory-assigned addresses.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 arch/arm64/boot/dts/mediatek/mt7622.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index 917fa39a74f8..0b9803a183b9 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -278,6 +278,10 @@ efuse: efuse@10206000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		serial@140 {
+			reg = <0x140 0x8>;
+		};
+
 		thermal_calibration: calib@198 {
 			reg = <0x198 0xc>;
 		};
-- 
2.51.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] arm64: dts: mediatek: mt7986a: add 'serial' cell to efuse
  2025-09-16 23:05 [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse Daniel Golle
@ 2025-09-16 23:05 ` Daniel Golle
  2025-09-16 23:05 ` [PATCH 3/4] arm64: dts: mediatek: mt7981b: " Daniel Golle
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel Golle @ 2025-09-16 23:05 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

The efuse of the MediaTek MT7986 contains an 8-byte unique identifier.
Add a 'serial' cell covering those 8 bytes to the nvmem defininition of
the efuse to allow easy access from userspace, eg. to generate a
persistent random MAC address on boards like the BananaPi R3 which
doesn't have any factory-assigned addresses.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index a8972330a7b8..0823eb586ec6 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -450,6 +450,10 @@ efuse: efuse@11d00000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 
+			serial@140 {
+				reg = <0x140 0x8>;
+			};
+
 			thermal_calibration: calib@274 {
 				reg = <0x274 0xc>;
 			};
-- 
2.51.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] arm64: dts: mediatek: mt7981b: add 'serial' cell to efuse
  2025-09-16 23:05 [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse Daniel Golle
  2025-09-16 23:05 ` [PATCH 2/4] arm64: dts: mediatek: mt7986a: " Daniel Golle
@ 2025-09-16 23:05 ` Daniel Golle
  2025-09-16 23:05 ` [PATCH 4/4] arm64: dts: mediatek: mt7988a: " Daniel Golle
  2025-09-17  9:06 ` [PATCH 1/4] arm64: dts: mediatek: mt7622: " AngeloGioacchino Del Regno
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel Golle @ 2025-09-16 23:05 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

The efuse of the MediaTek MT7981 contains a 16-byte unique identifier.
Add a 'serial' cell covering those 16 bytes to the nvmem defininition of
the efuse to allow easy access from userspace, eg. to generate a
persistent random MAC address on boards which don't have any
factory-assigned addresses.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
index 277c11247c13..bffbe9a1d836 100644
--- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
@@ -237,6 +237,10 @@ efuse@11f20000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 
+			serial@140 {
+				reg = <0x140 0x10>;
+			};
+
 			thermal_calibration: thermal-calib@274 {
 				reg = <0x274 0xc>;
 			};
-- 
2.51.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] arm64: dts: mediatek: mt7988a: add 'serial' cell to efuse
  2025-09-16 23:05 [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse Daniel Golle
  2025-09-16 23:05 ` [PATCH 2/4] arm64: dts: mediatek: mt7986a: " Daniel Golle
  2025-09-16 23:05 ` [PATCH 3/4] arm64: dts: mediatek: mt7981b: " Daniel Golle
@ 2025-09-16 23:05 ` Daniel Golle
  2025-09-17  9:06 ` [PATCH 1/4] arm64: dts: mediatek: mt7622: " AngeloGioacchino Del Regno
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel Golle @ 2025-09-16 23:05 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

The efuse of the MediaTek MT7988 contains a 16-byte unique identifier.
Add a 'serial' cell covering those 16 bytes to the nvmem defininition of
the efuse to allow easy access from userspace, eg. to generate a
persistent random MAC address on boards like the BananaPi R4 which
doesn't have any factory-assigned addresses.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
index 366203a72d6d..4a70f915f435 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
@@ -714,6 +714,10 @@ efuse@11f50000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 
+			serial@140 {
+				reg = <0x140 0x10>;
+			};
+
 			lvts_calibration: calib@918 {
 				reg = <0x918 0x28>;
 			};
-- 
2.51.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse
  2025-09-16 23:05 [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse Daniel Golle
                   ` (2 preceding siblings ...)
  2025-09-16 23:05 ` [PATCH 4/4] arm64: dts: mediatek: mt7988a: " Daniel Golle
@ 2025-09-17  9:06 ` AngeloGioacchino Del Regno
  2025-09-17 10:08   ` Daniel Golle
  3 siblings, 1 reply; 7+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-09-17  9:06 UTC (permalink / raw)
  To: Daniel Golle, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Matthias Brugger, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

Il 17/09/25 01:05, Daniel Golle ha scritto:
> The efuse of the MediaTek MT7622 contains an 8-byte unique identifier.
> Add a 'serial' cell covering those 8 bytes to the nvmem defininition of
> the efuse to allow easy access from userspace, eg. to generate a
> persistent random MAC address on boards like the BananaPi R64 which
> doesn't have any factory-assigned addresses.

Sorry, but I don't get why this is named "serial" and not "soc-uuid".

Care to explain?

Cheers,
Angelo

> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>   arch/arm64/boot/dts/mediatek/mt7622.dtsi | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
> index 917fa39a74f8..0b9803a183b9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
> @@ -278,6 +278,10 @@ efuse: efuse@10206000 {
>   		#address-cells = <1>;
>   		#size-cells = <1>;
>   
> +		serial@140 {
> +			reg = <0x140 0x8>;
> +		};
> +
>   		thermal_calibration: calib@198 {
>   			reg = <0x198 0xc>;
>   		};



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse
  2025-09-17  9:06 ` [PATCH 1/4] arm64: dts: mediatek: mt7622: " AngeloGioacchino Del Regno
@ 2025-09-17 10:08   ` Daniel Golle
  2025-09-17 11:53     ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Golle @ 2025-09-17 10:08 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek

On Wed, Sep 17, 2025 at 11:06:13AM +0200, AngeloGioacchino Del Regno wrote:
> Il 17/09/25 01:05, Daniel Golle ha scritto:
> > The efuse of the MediaTek MT7622 contains an 8-byte unique identifier.
> > Add a 'serial' cell covering those 8 bytes to the nvmem defininition of
> > the efuse to allow easy access from userspace, eg. to generate a
> > persistent random MAC address on boards like the BananaPi R64 which
> > doesn't have any factory-assigned addresses.
> 
> Sorry, but I don't get why this is named "serial" and not "soc-uuid".
> 
> Care to explain?

I don't have documentation covering the efuse content but only got this
information on an informal way:

https://forum.banana-pi.org/t/bpi-r3-serial-number/14556/10?u=dangowrt

Either name is fine with me, I thought of it as "serial number", but
obviously "soc-uuid" works fine, too.
I can change it to that and send v2 tonight.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse
  2025-09-17 10:08   ` Daniel Golle
@ 2025-09-17 11:53     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 7+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-09-17 11:53 UTC (permalink / raw)
  To: Daniel Golle
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek

Il 17/09/25 12:08, Daniel Golle ha scritto:
> On Wed, Sep 17, 2025 at 11:06:13AM +0200, AngeloGioacchino Del Regno wrote:
>> Il 17/09/25 01:05, Daniel Golle ha scritto:
>>> The efuse of the MediaTek MT7622 contains an 8-byte unique identifier.
>>> Add a 'serial' cell covering those 8 bytes to the nvmem defininition of
>>> the efuse to allow easy access from userspace, eg. to generate a
>>> persistent random MAC address on boards like the BananaPi R64 which
>>> doesn't have any factory-assigned addresses.
>>
>> Sorry, but I don't get why this is named "serial" and not "soc-uuid".
>>
>> Care to explain?
> 
> I don't have documentation covering the efuse content but only got this
> information on an informal way:
> 
> https://forum.banana-pi.org/t/bpi-r3-serial-number/14556/10?u=dangowrt
> 
> Either name is fine with me, I thought of it as "serial number", but
> obviously "soc-uuid" works fine, too.
> I can change it to that and send v2 tonight.
> 

Aaaaaah that's why "serial", okay - I got confused because the eFuses contain
many "calibration data" entries, and that triggered me to think that it could
be a "serial calibration data" entry.

After reading the commit description it became very clear that the initial
impression was wrong, but then still, when reading the devicetree without having
the description of the commit introducing that, it's easy to get confused again.

In any case, well, it could be a serial number, or it could be a randomly generated
UUID - but since we don't know, I think that calling this "serial-no" may actually
be wrong anyway.

We can escape this uncertainty though: a serial number is supposed to be unique,
and it is used as an identifier (which identifies one, or multiple aspects, either
an increasing number for chip number, or one that says the production date and
chip number).

Seeing it like this, calling it "soc-uuid" identifies this array as containing a
number that uniquely identifies the chip, be it a serial number or a randomly
generated number.

In case you find out sure information that this is really a serial number (which
doesn't really look right, it's too many bytes, but you never know) you can always
come back later and add a comment in DT saying that it is just.. that.

For now, let's go with soc-uuid :-)

So please, change the name to soc-uuid on all four commits, after which, feel
free to add my

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

to all four commits.

Cheers,
Angelo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-17 11:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 23:05 [PATCH 1/4] arm64: dts: mediatek: mt7622: add 'serial' cell to efuse Daniel Golle
2025-09-16 23:05 ` [PATCH 2/4] arm64: dts: mediatek: mt7986a: " Daniel Golle
2025-09-16 23:05 ` [PATCH 3/4] arm64: dts: mediatek: mt7981b: " Daniel Golle
2025-09-16 23:05 ` [PATCH 4/4] arm64: dts: mediatek: mt7988a: " Daniel Golle
2025-09-17  9:06 ` [PATCH 1/4] arm64: dts: mediatek: mt7622: " AngeloGioacchino Del Regno
2025-09-17 10:08   ` Daniel Golle
2025-09-17 11:53     ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox