Linux SpacemiT device drivers
 help / color / mirror / Atom feed
From: Zixian Zeng <sycamoremoon376@gmail.com>
To: 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>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Michael Opdenacker <michael.opdenacker@rootcommit.com>,
	Junhui Liu <junhui.liu@pigmoral.tech>,
	Chukun Pan <amadeus@jmu.edu.cn>,
	Anand Moon <linux.amoon@gmail.com>,
	Andre Heider <a.heider@gmail.com>, Rob Herring <robh@kernel.org>
Cc: Zixian Zeng <sycamoremoon376@gmail.com>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	spacemit@lists.linux.dev
Subject: [PATCH v2 0/4] riscv: dts: spacemit: k1: fix EEPROM page size on boards
Date: Thu,  3 Dec 2026 11:36:18 +0800	[thread overview]
Message-ID: <20261203-fix-bpf3-eeprom-v2-0-4e62be7bf32a@gmail.com> (raw)

The EEPROM page sizes on several k1 boards do not match the populated
parts. The BPI-F3, the BPI-CM6 core board, the OrangePi RV2 and R2S
use the Giantec GT24C02B with an 8-byte write page, but their device
tree nodes declare pagesize = <16>.

The BPI-F3 TLV EEPROM holds the base MAC address and the MAC count, so a
corrupted write leaves both Ethernet ports without a MAC address, which
is how this was found. Problem logs in u-boot are as following:

```
=> tlv_eeprom
TLV: 0
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 18
TLV Name             Code Len Value
==================== ==== === =====
Base MAC Address     0x24   6 FE:FE:FE:90:1E:F0
MAC Addresses        0x2A   2 2
CRC-32               0xFE   4 0xDC3129B4
Checksum is valid.
=> tlv_eeprom set 0x21 "k1-x_deb1"
=> tlv_eeprom
TLV: 0
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 29
TLV Name             Code Len Value
==================== ==== === =====
Base MAC Address     0x24   6 FE:FE:FE:90:1E:F0
MAC Addresses        0x2A   2 2
Product Name         0x21   9 k1-x_deb1
CRC-32               0xFE   4 0x14813093
Checksum is valid.
=> tlv_eeprom write
Programming passed.
=> tlv_eeprom read
EEPROM data loaded from device to memory.
=> tlv_eeprom
TLV: 0
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 6
TLV Name             Code Len Value
==================== ==== === =====
CRC-32               0xFE   4 0xD4431C18
Checksum is valid.
```

After executing the `tlv_eeprom write` command to write data to
the EEPROM, a subsequent `tlv_eeprom read` operation which should
have retrieved "Product Name k1-x_deb1" along with other data.
But it failed to load anything because previous write was broken.
With pagesize = <8>, "tlv_eeprom write" through u-boot's i2c_eeprom
driver and the following readback succeed.

Tested on a Banana Pi BPI-F3. The BPI-CM6 page sizes were confirmed and
corrected by Junhui Liu. Correct the page size per board, one patch
per board dts, and the stable tree can pick the fixes independently.
So that's rather a quite big change, I didn't pick rb tags from
Aurelien Jarno Troy Mitchell and Anand Moon. If you don't any problems
with this version, maintainers, can you please add tags when committing.

---
Changes in v2:
- Split the fixes per board dts.
- Drop the BPI-CM6 IO change; only the CM6 core board's eeprom@50 is
  changed. The IO board's eeprom@54 stays 24c08 with pagesize = <16>.
- Add change to R2S board, since the EEPROM model was mentioned
  in a previous commit message.
- Link to v1: https://patch.msgid.link/20261123-fix-bpf3-eeprom-v1-1-df8cce6ef2b5@gmail.com

To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Yixun Lan <dlan@kernel.org>
To: Troy Mitchell <troy.mitchell@linux.spacemit.com>
To: Paul Walmsley <pjw@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
To: Albert Ou <aou@eecs.berkeley.edu>
To: Alexandre Ghiti <alex@ghiti.fr>
To: Aurelien Jarno <aurelien@aurel32.net>
To: Vivian Wang <wangruikang@iscas.ac.cn>
To: Michael Opdenacker <michael.opdenacker@rootcommit.com>
To: Junhui Liu <junhui.liu@pigmoral.tech>
To: Chukun Pan <amadeus@jmu.edu.cn>
To: Anand Moon <linux.amoon@gmail.com>
To: Andre Heider <a.heider@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: spacemit@lists.linux.dev

---
Zixian Zeng (4):
      riscv: dts: spacemit: k1-bananapi-f3: fix EEPROM page size
      riscv: dts: spacemit: k1-bananapi-cm6: fix core board EEPROM page size
      riscv: dts: spacemit: k1-orangepi-r2s: fix EEPROM page size
      riscv: dts: spacemit: k1-orangepi-rv2: fix EEPROM page size

 arch/riscv/boot/dts/spacemit/k1-bananapi-cm6.dtsi | 2 +-
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts   | 2 +-
 arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts  | 2 +-
 arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: 4843f6873f7c4835e62f2c73ba0fd538e57a2f22
change-id: 20261122-fix-bpf3-eeprom-51ba6e0f110a

Best regards,
--  
Zixian Zeng <sycamoremoon376@gmail.com>


             reply	other threads:[~2026-12-03  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  3:36 Zixian Zeng [this message]
2026-12-03  3:36 ` [PATCH v2 1/4] riscv: dts: spacemit: k1-bananapi-f3: fix EEPROM page size Zixian Zeng
2026-12-03  3:36 ` [PATCH v2 2/4] riscv: dts: spacemit: k1-bananapi-cm6: fix core board " Zixian Zeng
2026-12-03  3:36 ` [PATCH v2 3/4] riscv: dts: spacemit: k1-orangepi-r2s: fix " Zixian Zeng
2026-12-03  3:36 ` [PATCH v2 4/4] riscv: dts: spacemit: k1-orangepi-rv2: " Zixian Zeng
2026-12-03  5:48 ` [PATCH v2 0/4] riscv: dts: spacemit: k1: fix EEPROM page size on boards Yixun Lan

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=20261203-fix-bpf3-eeprom-v2-0-4e62be7bf32a@gmail.com \
    --to=sycamoremoon376@gmail.com \
    --cc=a.heider@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=amadeus@jmu.edu.cn \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox