All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Heider <a.heider@gmail.com>
To: Anand Moon <linux.amoon@gmail.com>,
	Zixian Zeng <sycamoremoon376@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@kernel.org>,
	Troy Mitchell <troy.mitchell@linux.spacemit.com>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Junhui Liu <junhui.liu@pigmoral.tech>,
	Michael Opdenacker <michael.opdenacker@rootcommit.com>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	spacemit@lists.linux.dev
Subject: Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
Date: Wed, 25 Nov 2026 21:01:25 +0100	[thread overview]
Message-ID: <68a8dc53-9eca-412a-8098-3f69cd7ab95c@gmail.com> (raw)
In-Reply-To: <CANAwSgSNuEC72PM=1ai3xj31+=veLkDhAfuNJ3pmCggBtx9v-Q@mail.gmail.com>

On 25.11.26 3:21 PM, Anand Moon wrote:
>>> Apologies, this is a different issue.
>>>
>>> I am currently working on enabling multi-DTB support in U-Boot SPL
>>> for SpacemiT K1 boards.
>>>
>>> While investigating the board detection issue, I noticed that the EEPROM
>>> on my Banana Pi BPI-F3 does not contain a Product Name TLV entry.
>>>
>>> alarm@k1:~$ sudo hexdump -C /sys/bus/i2c/devices/2-0050/eeprom
>>> 00000000  54 6c 76 49 6e 66 6f 00  01 00 20 24 06 fe fe fe  |TlvInfo... $....|
>>> 00000010  d5 52 bd 2a 02 00 02 23  0c 39 38 61 39 63 33 61  |.R.*...#.98a9c3a|
>>> 00000020  32 62 64 34 37 fe 04 3b  e3 ff bd ff ff ff ff ff  |2bd47..;........|
>>> 00000030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
>>> *
>>> 00000100
>>>
>>> Although the EEPROM is readable, the missing Product Name TLV entry
>>> explains why read_product_name() returns `-ENOENT` (-2), assuming the
>>> EEPROM read and validation succeed.
>>>
>>> Consequently, automatic board detection fails, and U-Boot falls back to
>>> CONFIG_DEFAULT_DEVICE_TREE, which may select an incorrect device
>>> tree for the target board.

I encountered the very same issue [0]. The BPI-CM6 doesn't have a product name in there either, so we just made one up and wrote it to make the detection work... [1].

I'd be surprised if the eeprom is write protected on any board, because the vendor uboot contains code to write a mac if there is none. And I've only seen fe:fe:fe... macs so far, which is the output of the code generating one (iirc, it's been a minute).

In case it helps, here's my collected notes about the topic:

musepipro: commit 6bc75cfa56e885c2eab80e215f0a610075505846
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 58
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Product Name         0x21  16 k1-x_MUSE-Pi-Pro
     Serial Number        0x23  17 BPMIMXXXXXXXXXXXX
     Unknown              0x41   1  0x02
     Base MAC Address     0x24   6 FE:FE:FE:XX:XX:XX
     MAC Addresses        0x2A   2 2
     CRC-32               0xFE   4 0x395ECD34
     Checksum is valid.

r2s: commit ac436e6879f5bf25e971d80f96f9392b61ff54c6
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 38
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 .....
     MAC Addresses        0x2A   2 2
     Product Name         0x21  15 x1_orangepi-r2s
     Unknown              0x41   1  0x01
     CRC-32               0xFE   4 0xE5A74B18
     Checksum is valid.

cm6-io: https://github.com/openwrt/openwrt/pull/23231#issuecomment-5943699070
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 18
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 FE:FE:FE:XX:XX:XX
     MAC Addresses        0x2A   2 2
     CRC-32               0xFE   4 0x9775FAA7
     Checksum is valid.

f3: https://github.com/openwrt/openwrt/pull/23231#issuecomment-6339373545
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 32
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 FE:FE:FE:AD:18:9C
     MAC Addresses        0x2A   2 2
     Serial Number        0x23  12 0ca91c835b74
     CRC-32               0xFE   4 0x85C81AEE
     Checksum is valid.

     also: commit bfce75e2345fa1ecbf046e696994132f56d6db1c
         no product name

rv2: ?

milkv: commit 77156216f1d0f57e1cfce3452410db20468edca4
     only a product name

[0] https://lore.kernel.org/u-boot/d1a8bab8-4d88-48f2-9ddb-89e8c0e323b8@gmail.com/
[1] https://github.com/openwrt/openwrt/pull/23231#issuecomment-5972395785

WARNING: multiple messages have this Message-ID (diff)
From: Andre Heider <a.heider@gmail.com>
To: Anand Moon <linux.amoon@gmail.com>,
	Zixian Zeng <sycamoremoon376@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@kernel.org>,
	Troy Mitchell <troy.mitchell@linux.spacemit.com>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Junhui Liu <junhui.liu@pigmoral.tech>,
	Michael Opdenacker <michael.opdenacker@rootcommit.com>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	spacemit@lists.linux.dev
Subject: Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
Date: Wed, 25 Nov 2026 21:01:25 +0100	[thread overview]
Message-ID: <68a8dc53-9eca-412a-8098-3f69cd7ab95c@gmail.com> (raw)
In-Reply-To: <CANAwSgSNuEC72PM=1ai3xj31+=veLkDhAfuNJ3pmCggBtx9v-Q@mail.gmail.com>

On 25.11.26 3:21 PM, Anand Moon wrote:
>>> Apologies, this is a different issue.
>>>
>>> I am currently working on enabling multi-DTB support in U-Boot SPL
>>> for SpacemiT K1 boards.
>>>
>>> While investigating the board detection issue, I noticed that the EEPROM
>>> on my Banana Pi BPI-F3 does not contain a Product Name TLV entry.
>>>
>>> alarm@k1:~$ sudo hexdump -C /sys/bus/i2c/devices/2-0050/eeprom
>>> 00000000  54 6c 76 49 6e 66 6f 00  01 00 20 24 06 fe fe fe  |TlvInfo... $....|
>>> 00000010  d5 52 bd 2a 02 00 02 23  0c 39 38 61 39 63 33 61  |.R.*...#.98a9c3a|
>>> 00000020  32 62 64 34 37 fe 04 3b  e3 ff bd ff ff ff ff ff  |2bd47..;........|
>>> 00000030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
>>> *
>>> 00000100
>>>
>>> Although the EEPROM is readable, the missing Product Name TLV entry
>>> explains why read_product_name() returns `-ENOENT` (-2), assuming the
>>> EEPROM read and validation succeed.
>>>
>>> Consequently, automatic board detection fails, and U-Boot falls back to
>>> CONFIG_DEFAULT_DEVICE_TREE, which may select an incorrect device
>>> tree for the target board.

I encountered the very same issue [0]. The BPI-CM6 doesn't have a product name in there either, so we just made one up and wrote it to make the detection work... [1].

I'd be surprised if the eeprom is write protected on any board, because the vendor uboot contains code to write a mac if there is none. And I've only seen fe:fe:fe... macs so far, which is the output of the code generating one (iirc, it's been a minute).

In case it helps, here's my collected notes about the topic:

musepipro: commit 6bc75cfa56e885c2eab80e215f0a610075505846
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 58
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Product Name         0x21  16 k1-x_MUSE-Pi-Pro
     Serial Number        0x23  17 BPMIMXXXXXXXXXXXX
     Unknown              0x41   1  0x02
     Base MAC Address     0x24   6 FE:FE:FE:XX:XX:XX
     MAC Addresses        0x2A   2 2
     CRC-32               0xFE   4 0x395ECD34
     Checksum is valid.

r2s: commit ac436e6879f5bf25e971d80f96f9392b61ff54c6
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 38
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 .....
     MAC Addresses        0x2A   2 2
     Product Name         0x21  15 x1_orangepi-r2s
     Unknown              0x41   1  0x01
     CRC-32               0xFE   4 0xE5A74B18
     Checksum is valid.

cm6-io: https://github.com/openwrt/openwrt/pull/23231#issuecomment-5943699070
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 18
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 FE:FE:FE:XX:XX:XX
     MAC Addresses        0x2A   2 2
     CRC-32               0xFE   4 0x9775FAA7
     Checksum is valid.

f3: https://github.com/openwrt/openwrt/pull/23231#issuecomment-6339373545
     TlvInfo Header:
        Id String:    TlvInfo
        Version:      1
        Total Length: 32
     TLV Name             Code Len Value
     -------------------- ---- --- -----
     Base MAC Address     0x24   6 FE:FE:FE:AD:18:9C
     MAC Addresses        0x2A   2 2
     Serial Number        0x23  12 0ca91c835b74
     CRC-32               0xFE   4 0x85C81AEE
     Checksum is valid.

     also: commit bfce75e2345fa1ecbf046e696994132f56d6db1c
         no product name

rv2: ?

milkv: commit 77156216f1d0f57e1cfce3452410db20468edca4
     only a product name

[0] https://lore.kernel.org/u-boot/d1a8bab8-4d88-48f2-9ddb-89e8c0e323b8@gmail.com/
[1] https://github.com/openwrt/openwrt/pull/23231#issuecomment-5972395785

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2026-11-25 20:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  4:41 [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size Zixian Zeng
2026-11-23  4:41 ` Zixian Zeng
2026-11-23  4:48 ` sashiko-bot
2026-11-23 21:58 ` Aurelien Jarno
2026-11-23 21:58   ` Aurelien Jarno
2026-11-24  3:31   ` Zixian Zeng
2026-11-24  3:31     ` Zixian Zeng
2026-11-24 18:15     ` Aurelien Jarno
2026-11-24 18:15       ` Aurelien Jarno
2026-11-25  7:52       ` Anand Moon
2026-11-25  7:52         ` Anand Moon
2026-11-25  9:38         ` Zixian Zeng
2026-11-25  9:38           ` Zixian Zeng
2026-11-25 14:21           ` Anand Moon
2026-11-25 14:21             ` Anand Moon
2026-11-25 20:01             ` Andre Heider [this message]
2026-11-25 20:01               ` Andre Heider
2026-11-26  3:00             ` Zixian Zeng
2026-11-26  3:00               ` Zixian Zeng
2026-11-26  7:22               ` Anand Moon
2026-11-26  7:22                 ` Anand Moon
2026-11-25 17:28         ` Aurelien Jarno
2026-11-25 17:28           ` Aurelien Jarno
2026-11-24  1:00 ` Troy Mitchell
2026-11-24  1:00   ` Troy Mitchell
2026-11-30  4:28 ` Junhui Liu
2026-11-30  4:28   ` Junhui Liu
2026-12-01  2:43   ` Zixian Zeng
2026-12-01  2:43     ` Zixian Zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68a8dc53-9eca-412a-8098-3f69cd7ab95c@gmail.com \
    --to=a.heider@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=aurelien@aurel32.net \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@kernel.org \
    --cc=junhui.liu@pigmoral.tech \
    --cc=krzk+dt@kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux.amoon@gmail.com \
    --cc=michael.opdenacker@rootcommit.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=sycamoremoon376@gmail.com \
    --cc=troy.mitchell@linux.spacemit.com \
    --cc=wangruikang@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.