From: E Shattow <e@freeshell.de>
To: Anand Moon <linux.amoon@gmail.com>, u-boot@lists.u-boot-project.org
Cc: Yixun Lan <dlan@kernel.org>, Zixian Zeng <sycamoremoon376@gmail.com>
Subject: Re: [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL
Date: Wed, 25 Nov 2026 08:23:46 -0800 [thread overview]
Message-ID: <20f0a389-8672-45df-b5fe-6593cab0e4e2@freeshell.de> (raw)
In-Reply-To: <CANAwSgQ-vKfciZ+F+vAqmk-kJS1cqMxKWaUrRBbyYnwgWcygXQ@mail.gmail.com>
Hi Anand,
On 11/25/26 07:35, Anand Moon wrote:
> Hi All,
>
> +Zixian Zeng
>
> On Tue, 24 Nov 2026 at 01:07, Anand Moon <linux.amoon@gmail.com> wrote:
>>
>> This series consolidates common U-Boot device tree properties for
>> SpacemiT K1 boards and enables GPIO and pinctrl support in SPL.
>>
>> The device tree changes move common early boot properties into shared
>> DTSI files, reducing duplication between the Banana Pi BPI-F3 and
>> MusePi Pro boards.
>>
>> The remaining patches add SPL build support for the SpacemiT K1/K3
>> GPIO and pinctrl drivers and enable these drivers in the K1 SPL
>> configuration.
>>
>> The series consists of six patches:
>>
>> 1. Move common K1 U-Boot nodes into a shared DTSI.
>> 2. Remove redundant MusePi Pro device tree overrides.
>> 3. Move common K1 U-Boot properties into the shared DTSI.
>> 4. Add SPL support for the K1/K3 pinctrl driver.
>> 5. Add SPL support for the K1/K3 GPIO driver.
>> 6. Enable GPIO and pinctrl support in K1 SPL.
>>
> Following the description on the Linux mainline list:
>
> [1] https://lore.kernel.org/all/20261123-fix-bpf3-eeprom-v1-1-df8cce6ef2b5@gmail.com/
>
> 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.
>
> Since the SD card-detect GPIO polarity differs between the Banana Pi BPI-F3
> and MusePi Pro, selecting the incorrect device tree can result in SD
> card detection
> and boot failures.
>
> The following SPL boot log shows the board detection failure, although
> DDR initialization completes successfully:
>
> ```
> U-Boot SPL 2026.10-01060-gf3080abcfe92-dirty (Oct 24 2026 - 17:30:03 +0530)
> Fail to detect board:-2
> vdd_core, value:900000
> vdd_1v8, value:1800000
> vdd_1v8_mmc, value:1800000
> DDR firmware: [0xc0820900]:0xf0227179, size:0x8d98
> DDR is ready
> ```
> Could you please confirm whether the Product Name TLV entry is
> expected to be programmed into the EEPROM during manufacturing?
>
> Also, is there a recommended approach for handling boards with missing
> product information in the EEPROM to ensure reliable automatic device
> tree selection?
>
Is specialized equipment needed to pulldown the WP pin on these boards,
or would a common office paperclip (and a steady hand) do it?
In other examples we've just invented some reasonable-sounding product
ID and stuck that into the logic. Particularly several Milk-V
product-lines had wrong EEPROM values and majority of their sales
through a vendor that would swap product models without informing the
customer, and Pine64 shipped non-programmed EEPROM on early
manufacturing run of Star64 boards. There's several of the StarFive
JH-7110 SoC -having boards by third party (not StarFive) where the
manufacturer uses the same EEPROM product ID as the StarFive VisionFive
2 1.3b reference board even though the hardware is widely different.
With a steady hand and a paperclip...:
https://freeshell.de/e/riscv64/vf2eeprom/
...it's not too much trouble to pulldown the WP leg of that IC part on
the board and write a new product ID to EEPROM. For the integrated
products like Pine64 PineTab-V however it may require specialized
equipment and/or significant risk of physical damage to the product to
get access to the WP pin of EEPROM IC part.
Something I intend to do and haven't yet is a bare-minimum dts for
JH-7110 SoC -having boards which has just enough functionality to write
new EEPROM values and SPL fastboot by default through the on-SoC USB
interface. Currently in respect for an abundance of caution to prevent
data corruption and hardware breakage if the EEPROM ID does not match it
does not continue to boot. However, not being able to continue to boot
with a non-valid EEPROM also makes this software then useless for
updating EEPROM... so the way it is postured currently is that vendor
BSP is recommended for EEPROM setting actions. This is not a solved
problem in my opinion and it would be welcome to have a general document
that describes this.
>> Changes in v2:
>> - Consolidate additional common U-Boot properties into
>> spacemit-k1-u-boot.dtsi.
>> - Reduce duplication in the board-specific DTSI files.
>> - Retain board-specific configuration where required.
>>
>
> This current series is incomplete, I missed few code cnages
> But I am working on a few changes to fix
>
> Please review the DTS changes and share your feedback.
>
> Thanks
> -Anand
A note about spacemit-k1-u-boot.dtsi it does generally look good however
the per-board property overrides (as determined by Linux upstream
organization) should go in per-board -u-boot.dtsi files. When device
tree changes get merged in Linux upstream for e.g. bootph-pre-ram hints
or prior to being a proper cherry-pick in U-Boot then it's so much less
confusing if there is a 1:to:1 relationship between upstream where/when
something is merged and then looking at U-Boot to figure out if/when it
can be safely deleted as being redundant. I haven't looked at the K1
dtsi with much attention but I trust you're aware of this.
Best regards,
-E
next prev parent reply other threads:[~2026-11-25 16:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
2026-11-23 19:36 ` [PATCH v2 1/6] riscv: dts: spacemit: k1: Move common U-Boot nodes to shared DTSI Anand Moon
2026-11-23 19:37 ` [PATCH v2 2/6] riscv: dts: spacemit: k1-musepi-pro: Drop redundant DT overrides Anand Moon
2026-11-23 19:37 ` [PATCH v2 3/6] riscv: dts: spacemit: k1: Move common U-Boot properties to shared DTSI Anand Moon
2026-11-23 19:37 ` [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver Anand Moon
2026-11-24 10:52 ` Yixun Lan
2026-11-25 3:07 ` Anand Moon
2026-11-23 19:37 ` [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver Anand Moon
2026-11-24 10:53 ` Yixun Lan
2026-11-23 19:37 ` [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL Anand Moon
2026-11-24 6:33 ` Junhui Liu
2026-11-24 7:02 ` Anand Moon
2026-11-25 15:35 ` [PATCH v2 0/6] riscv: spacemit: Add " Anand Moon
2026-11-25 16:23 ` E Shattow [this message]
2026-11-26 6:04 ` Anand Moon
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=20f0a389-8672-45df-b5fe-6593cab0e4e2@freeshell.de \
--to=e@freeshell.de \
--cc=dlan@kernel.org \
--cc=linux.amoon@gmail.com \
--cc=sycamoremoon376@gmail.com \
--cc=u-boot@lists.u-boot-project.org \
/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