* [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
@ 2026-11-23 4:41 Zixian Zeng
2026-11-23 21:58 ` Aurelien Jarno
2026-11-24 1:00 ` Troy Mitchell
0 siblings, 2 replies; 5+ messages in thread
From: Zixian Zeng @ 2026-11-23 4:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
Troy Mitchell, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Aurelien Jarno, Vivian Wang, Junhui Liu,
Michael Opdenacker
Cc: Zixian Zeng, devicetree, linux-riscv, spacemit
The bananapi-f3 carries an AT24C02 compatible EEPROM GT24C02B [1]:
256 bytes with an 8-byte write page, which can be found in schematic[2].
The device tree declares pagesize = <16>, which does not match the
eeprom chip datasheet which declares pagesize 8 bytes.
EEPROM pagesize of k1-bananapi-cm6-io[3] and k1-orangepi-rv2[4] changed
together, based on the chip model shown in the schematic diagram.
The TLV EEPROM on this board 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.
Link: https://www.giantec-semi.com/uploads/20230414/GT24C02B.pdf [1]
Link: https://drive.google.com/file/d/19iLJ5xnCB_oK8VeQjkPGjzAn39WYyylv/view?usp=sharing [2]
Link: https://pan.baidu.com/s/13UTY_qM4gGuVxsZ9U7_Xpw?pwd=8888 [3]
Link: https://drive.google.com/drive/folders/1pcI_U0C3VJKTCg8A1zj08CwNbohnONSR?usp=sharing [4]
Fixes: bfce75e2345f ("riscv: dts: spacemit: add 24c02 eeprom on BPI-F3")
Fixes: 46a8c01700ac ("riscv: dts: spacemit: k1: Add Banana Pi BPI-CM6 IO board")
Fixes: ac436e6879f5 ("riscv: dts: spacemit: enable onboard eeprom for OrangePi")
Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
---
A TLV write through u-boot's i2c_eeprom driver scrambled the EEPROM
contents and left both ports without a MAC address on bananapi-f3.
I checked boards schematic and eeprom chip datasheet of bananapi-f3,
whose links can be found in commit message. After changing pagesize
to 8, TLV write and read works as expected.
Other k1 boards which includes k1-bananapi-cm6-io and k1-orangepi-rv2
changed together. However, I don’t have these two board. Be grateful
if someone could test it. Schematic of k1-orangepi-r2s not found,
so keep it as it is, but true knowledge comes from practice.
---
arch/riscv/boot/dts/spacemit/k1-bananapi-cm6-io.dts | 2 +-
arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 2 +-
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6-io.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6-io.dts
index 2c2d78aee98a..23a1323df30d 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6-io.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-cm6-io.dts
@@ -101,7 +101,7 @@ eeprom@54 {
compatible = "atmel,24c08";
reg = <0x54>;
vcc-supply = <&buck3_1v8>;
- pagesize = <16>;
+ pagesize = <8>;
size = <1024>;
};
};
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 58035d886bf6..1db896536256 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -195,7 +195,7 @@ eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
- pagesize = <16>;
+ pagesize = <8>;
read-only;
size = <256>;
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 790234f3550a..8fd95c8f9db2 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -185,7 +185,7 @@ &i2c2 {
eeprom@50 {
compatible = "atmel,24c02";
reg = <0x50>;
- pagesize = <16>;
+ pagesize = <8>;
size = <256>;
read-only;
vcc-supply = <&buck3_1v8>;
---
base-commit: 4843f6873f7c4835e62f2c73ba0fd538e57a2f22
change-id: 20261122-fix-bpf3-eeprom-51ba6e0f110a
Best regards,
--
Zixian Zeng <sycamoremoon376@gmail.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
2026-11-23 4:41 [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size Zixian Zeng
@ 2026-11-23 21:58 ` Aurelien Jarno
2026-11-24 3:31 ` Zixian Zeng
2026-11-24 1:00 ` Troy Mitchell
1 sibling, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2026-11-23 21:58 UTC (permalink / raw)
To: Zixian Zeng
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
Troy Mitchell, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Vivian Wang, Junhui Liu, Michael Opdenacker,
devicetree, linux-riscv, spacemit
Hi,
On 2026-11-23 12:41, Zixian Zeng wrote:
> The bananapi-f3 carries an AT24C02 compatible EEPROM GT24C02B [1]:
> 256 bytes with an 8-byte write page, which can be found in schematic[2].
> The device tree declares pagesize = <16>, which does not match the
> eeprom chip datasheet which declares pagesize 8 bytes.
Oops, I am not sure how I got that wrong. Sorry about that.
> EEPROM pagesize of k1-bananapi-cm6-io[3] and k1-orangepi-rv2[4] changed
> together, based on the chip model shown in the schematic diagram.
The k1-milkv-jupiter board is also affected with the same issue, despite
using a slightly different EEPROM (24C04).
> The TLV EEPROM on this board 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.
>
> Link: https://www.giantec-semi.com/uploads/20230414/GT24C02B.pdf [1]
> Link: https://drive.google.com/file/d/19iLJ5xnCB_oK8VeQjkPGjzAn39WYyylv/view?usp=sharing [2]
> Link: https://pan.baidu.com/s/13UTY_qM4gGuVxsZ9U7_Xpw?pwd=8888 [3]
> Link: https://drive.google.com/drive/folders/1pcI_U0C3VJKTCg8A1zj08CwNbohnONSR?usp=sharing [4]
> Fixes: bfce75e2345f ("riscv: dts: spacemit: add 24c02 eeprom on BPI-F3")
> Fixes: 46a8c01700ac ("riscv: dts: spacemit: k1: Add Banana Pi BPI-CM6 IO board")
> Fixes: ac436e6879f5 ("riscv: dts: spacemit: enable onboard eeprom for OrangePi")
> Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
Thanks for fixing that.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
2026-11-23 4:41 [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size Zixian Zeng
2026-11-23 21:58 ` Aurelien Jarno
@ 2026-11-24 1:00 ` Troy Mitchell
1 sibling, 0 replies; 5+ messages in thread
From: Troy Mitchell @ 2026-11-24 1:00 UTC (permalink / raw)
To: Zixian Zeng, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Yixun Lan, Troy Mitchell, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Aurelien Jarno, Vivian Wang,
Junhui Liu, Michael Opdenacker
Cc: devicetree, linux-riscv, spacemit
[-- Attachment #1.1: Type: text/plain, Size: 1391 bytes --]
On Mon Nov 23, 2026 at 4:41 AM GMT, Zixian Zeng wrote:
> The bananapi-f3 carries an AT24C02 compatible EEPROM GT24C02B [1]:
> 256 bytes with an 8-byte write page, which can be found in schematic[2].
> The device tree declares pagesize = <16>, which does not match the
> eeprom chip datasheet which declares pagesize 8 bytes.
> EEPROM pagesize of k1-bananapi-cm6-io[3] and k1-orangepi-rv2[4] changed
> together, based on the chip model shown in the schematic diagram.
>
> The TLV EEPROM on this board 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.
>
> Link: https://www.giantec-semi.com/uploads/20230414/GT24C02B.pdf [1]
> Link: https://drive.google.com/file/d/19iLJ5xnCB_oK8VeQjkPGjzAn39WYyylv/view?usp=sharing [2]
> Link: https://pan.baidu.com/s/13UTY_qM4gGuVxsZ9U7_Xpw?pwd=8888 [3]
> Link: https://drive.google.com/drive/folders/1pcI_U0C3VJKTCg8A1zj08CwNbohnONSR?usp=sharing [4]
> Fixes: bfce75e2345f ("riscv: dts: spacemit: add 24c02 eeprom on BPI-F3")
> Fixes: 46a8c01700ac ("riscv: dts: spacemit: k1: Add Banana Pi BPI-CM6 IO board")
> Fixes: ac436e6879f5 ("riscv: dts: spacemit: enable onboard eeprom for OrangePi")
> Signed-off-by: Zixian Zeng <sycamoremoon376@gmail.com>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
--
Troy Mitchell
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
2026-11-23 21:58 ` Aurelien Jarno
@ 2026-11-24 3:31 ` Zixian Zeng
2026-11-24 18:15 ` Aurelien Jarno
0 siblings, 1 reply; 5+ messages in thread
From: Zixian Zeng @ 2026-11-24 3:31 UTC (permalink / raw)
To: Aurelien Jarno
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
Troy Mitchell, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Vivian Wang, Junhui Liu, Michael Opdenacker,
devicetree, linux-riscv, spacemit
Hi Aurelien,
On 2026/11/24 5:58, Aurelien Jarno wrote:
> Hi,
>
> On 2026-11-23 12:41, Zixian Zeng wrote:
>> The bananapi-f3 carries an AT24C02 compatible EEPROM GT24C02B [1]:
>> 256 bytes with an 8-byte write page, which can be found in schematic[2].
>> The device tree declares pagesize = <16>, which does not match the
>> eeprom chip datasheet which declares pagesize 8 bytes.
>
> Oops, I am not sure how I got that wrong. Sorry about that.
>
>> EEPROM pagesize of k1-bananapi-cm6-io[3] and k1-orangepi-rv2[4] changed
>> together, based on the chip model shown in the schematic diagram.
>
> The k1-milkv-jupiter board is also affected with the same issue, despite
> using a slightly different EEPROM (24C04).
>
The GT24C04A EEPROM used on k1-milkv-jupiter board doesn't seem to have
the same issue, which you can find "Page Size: 16 bytes" in datasheet:
https://www.giantec-semi.com/uploads/20220929/GT24C04A.pdf
But I don't have the board, simple test would be appreciated. Perhaps I
should include test steps in the commit message for the next revision.
Best regards,
Zixian
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size
2026-11-24 3:31 ` Zixian Zeng
@ 2026-11-24 18:15 ` Aurelien Jarno
0 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2026-11-24 18:15 UTC (permalink / raw)
To: Zixian Zeng
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
Troy Mitchell, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Vivian Wang, Junhui Liu, Michael Opdenacker,
devicetree, linux-riscv, spacemit
Hi Zixian,
On 2026-11-24 11:31, Zixian Zeng wrote:
> Hi Aurelien,
>
> On 2026/11/24 5:58, Aurelien Jarno wrote:
> > Hi,
> >
> > On 2026-11-23 12:41, Zixian Zeng wrote:
> > > The bananapi-f3 carries an AT24C02 compatible EEPROM GT24C02B [1]:
> > > 256 bytes with an 8-byte write page, which can be found in schematic[2].
> > > The device tree declares pagesize = <16>, which does not match the
> > > eeprom chip datasheet which declares pagesize 8 bytes.
> >
> > Oops, I am not sure how I got that wrong. Sorry about that.
The question of the page size has been raised in the initial review [1],
and it seems that the GT24C02 has a 16-byte page size, while the
GT24C02B [2] has a 8-byte page size. The BPI-F3 schematics confirms that
the B version is used. Sorry about the mistake.
> > > EEPROM pagesize of k1-bananapi-cm6-io[3] and k1-orangepi-rv2[4] changed
> > > together, based on the chip model shown in the schematic diagram.
> >
> > The k1-milkv-jupiter board is also affected with the same issue, despite
> > using a slightly different EEPROM (24C04).
> >
>
> The GT24C04A EEPROM used on k1-milkv-jupiter board doesn't seem to have
> the same issue, which you can find "Page Size: 16 bytes" in datasheet:
> https://www.giantec-semi.com/uploads/20220929/GT24C04A.pdf
Indeed you are correct, and I confirm that this is the exact version
used on the schematics. Therefore there is no need to extend your patch,
it can be merged that way.
> But I don't have the board, simple test would be appreciated. Perhaps I
> should include test steps in the commit message for the next revision.
Unfortunately the board has the EEPROM write protection pin connected to
VCC, which means the write protection is enabled. Therefore testing is
not so easy.
Regards
Aurelien
[1] https://lore.kernel.org/linux-riscv/aNLzRJcKCYOngc7z@aurel32.net/
[2] https://www.giantec-semi.com/juchen1123/uploads/pdf/GT24C02_DS_Au.pdf
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-24 18:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 4:41 [PATCH] riscv: dts: spacemit: k1: fix the EEPROM page size Zixian Zeng
2026-11-23 21:58 ` Aurelien Jarno
2026-11-24 3:31 ` Zixian Zeng
2026-11-24 18:15 ` Aurelien Jarno
2026-11-24 1:00 ` Troy Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox