All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
@ 2026-11-11 21:36 Yixun Lan
  2026-11-13 10:49 ` Eric Chung
  2026-11-16  7:13 ` Hung-Chun Tseng
  0 siblings, 2 replies; 4+ messages in thread
From: Yixun Lan @ 2026-11-11 21:36 UTC (permalink / raw)
  To: u-boot, u-boot-spacemit
  Cc: Bruno Banelli, Eric Chung, Tom Rini, Guodong Xu, Raymond Mao,
	Dave Klotz, Yixun Lan

From: Bruno Banelli <bbanelli@gmail.com>

board_fit_config_name_match() derives the device tree name from the TLV
product name held in the board EEPROM, and only recognises boards whose
product name starts with "k1-x_".

Boards fitted with the higher-binned M1 part report an "m1-x_" prefix
instead.  On those, fdt_name is left empty and the function silently
falls back to "k1-musepi-pro", so an M1 board selects the wrong device
tree with no error or warning.

A Milk-V Jupiter fitted with an M1 reads, from the 24c04 at i2c2 0x50:

  00: 54 6c 76 49 6e 66 6f 00 01 00 1a 21 12 6d 31 2d  TlvInfo....!.m1-
  10: 78 5f 6d 69 6c 6b 76 2d 6a 75 70 69 74 65 72 fe  x_milkv-jupiter.

i.e. TLV code 0x21 (product name), length 0x12, "m1-x_milkv-jupiter".

The device trees are named for the K1 in both cases, so accept either
prefix and keep deriving a "k1-" name.

Signed-off-by: Bruno Banelli <bbanelli@gmail.com>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
I've dropped all Reviewed-by tags due to the change.
---
Changes in v2:
- rework according to recent main code
- Link to v1: https://patch.msgid.link/20260825065257.69536-1-bbanelli@gmail.com
---
 board/spacemit/k1/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c
index 0ce0a811830..8931c5f5362 100644
--- a/board/spacemit/k1/spl.c
+++ b/board/spacemit/k1/spl.c
@@ -149,6 +149,7 @@ static const struct {
 	{ "k1-x_MUSE-Pi-Pro",   "spacemit/k1-musepi-pro"    },
 	{ "k1-x_deb1",          "spacemit/k1-bananapi-f3"   },
 	{ "k1-x_milkv-jupiter", "spacemit/k1-milkv-jupiter" },
+	{ "m1-x_milkv-jupiter", "spacemit/k1-milkv-jupiter" },
 };
 
 int read_product_name(char *name, int size)

---
base-commit: 8ea02c99391d2d922810065206721ead2863f075
change-id: 20261111-04-k1-milkv-m1-prefix-762704637cba

Best regards,
--  
Yixun Lan <dlan@kernel.org>


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

* Re: [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-11-11 21:36 [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Yixun Lan
@ 2026-11-13 10:49 ` Eric Chung
  2026-11-16  7:13 ` Hung-Chun Tseng
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Chung @ 2026-11-13 10:49 UTC (permalink / raw)
  To: Yixun Lan
  Cc: u-boot, u-boot-spacemit, Bruno Banelli, Tom Rini, Guodong Xu,
	Raymond Mao, Dave Klotz

On Thu, Nov 12, 2026 at 5:36 AM Yixun Lan <dlan@kernel.org> wrote:
>
> From: Bruno Banelli <bbanelli@gmail.com>
>
> board_fit_config_name_match() derives the device tree name from the TLV
> product name held in the board EEPROM, and only recognises boards whose
> product name starts with "k1-x_".
>
> Boards fitted with the higher-binned M1 part report an "m1-x_" prefix
> instead.  On those, fdt_name is left empty and the function silently
> falls back to "k1-musepi-pro", so an M1 board selects the wrong device
> tree with no error or warning.
>
> A Milk-V Jupiter fitted with an M1 reads, from the 24c04 at i2c2 0x50:
>
>   00: 54 6c 76 49 6e 66 6f 00 01 00 1a 21 12 6d 31 2d  TlvInfo....!.m1-
>   10: 78 5f 6d 69 6c 6b 76 2d 6a 75 70 69 74 65 72 fe  x_milkv-jupiter.
>
> i.e. TLV code 0x21 (product name), length 0x12, "m1-x_milkv-jupiter".
>
> The device trees are named for the K1 in both cases, so accept either
> prefix and keep deriving a "k1-" name.
>
> Signed-off-by: Bruno Banelli <bbanelli@gmail.com>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> I've dropped all Reviewed-by tags due to the change.
> ---
> Changes in v2:
> - rework according to recent main code
> - Link to v1: https://patch.msgid.link/20260825065257.69536-1-bbanelli@gmail.com
> ---
>  board/spacemit/k1/spl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c
> index 0ce0a811830..8931c5f5362 100644
> --- a/board/spacemit/k1/spl.c
> +++ b/board/spacemit/k1/spl.c
> @@ -149,6 +149,7 @@ static const struct {
>         { "k1-x_MUSE-Pi-Pro",   "spacemit/k1-musepi-pro"    },
>         { "k1-x_deb1",          "spacemit/k1-bananapi-f3"   },
>         { "k1-x_milkv-jupiter", "spacemit/k1-milkv-jupiter" },
> +       { "m1-x_milkv-jupiter", "spacemit/k1-milkv-jupiter" },
>  };
>
>  int read_product_name(char *name, int size)
>
> ---
> base-commit: 8ea02c99391d2d922810065206721ead2863f075
> change-id: 20261111-04-k1-milkv-m1-prefix-762704637cba
>
> Best regards,
> --
> Yixun Lan <dlan@kernel.org>
>

Reviewed-by: Eric Chung <eric.chung@riscstar.com>

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

* Re: [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-11-11 21:36 [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Yixun Lan
  2026-11-13 10:49 ` Eric Chung
@ 2026-11-16  7:13 ` Hung-Chun Tseng
  2026-11-16 10:52   ` Yixun Lan
  1 sibling, 1 reply; 4+ messages in thread
From: Hung-Chun Tseng @ 2026-11-16  7:13 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Bruno Banelli, Eric Chung, Tom Rini, Guodong Xu, Raymond Mao,
	Dave Klotz, u-boot, u-boot-spacemit

Hi Yixun,

On Wed, 11 Nov 2026 21:36:41 +0000, Yixun Lan wrote:
> board_fit_config_name_match() derives the device tree name from the TLV
> product name held in the board EEPROM, and only recognises boards whose
> product name starts with "k1-x_".

After the rework this no longer matches the code: the mapping is now
done in fixup_product_name() through k1_board_map, which matches full
product names, not a "k1-x_" prefix.

> The device trees are named for the K1 in both cases, so accept either
> prefix and keep deriving a "k1-" name.

The diff adds one entry for the Jupiter only, so an M1 MUSE Pi Pro or
BPI-F3 would still fall back to the default. Maybe something like "Add
the M1 Jupiter's product name to k1_board_map" for the subject and last
paragraph?

Also, spacemit/k1-milkv-jupiter is not in CONFIG_OF_LIST on main, so
neither Jupiter entry can find its device tree in the FIT yet. My
Jupiter board patch adds it there.

The change itself looks fine to me.

Thanks,
Hung-Chun

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

* Re: [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-11-16  7:13 ` Hung-Chun Tseng
@ 2026-11-16 10:52   ` Yixun Lan
  0 siblings, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-11-16 10:52 UTC (permalink / raw)
  To: Hung-Chun Tseng
  Cc: Bruno Banelli, Eric Chung, Tom Rini, Guodong Xu, Raymond Mao,
	Dave Klotz, u-boot, u-boot-spacemit

Hi Hung-Chun,

On 15:13 Mon 16 Nov     , Hung-Chun Tseng wrote:
> Hi Yixun,
> 
> On Wed, 11 Nov 2026 21:36:41 +0000, Yixun Lan wrote:
> > board_fit_config_name_match() derives the device tree name from the TLV
> > product name held in the board EEPROM, and only recognises boards whose
> > product name starts with "k1-x_".
> 
> After the rework this no longer matches the code: the mapping is now
> done in fixup_product_name() through k1_board_map, which matches full
> product names, not a "k1-x_" prefix.
> 
> > The device trees are named for the K1 in both cases, so accept either
> > prefix and keep deriving a "k1-" name.
> 
Right..

> The diff adds one entry for the Jupiter only, so an M1 MUSE Pi Pro or
> BPI-F3 would still fall back to the default. Maybe something like "Add
> the M1 Jupiter's product name to k1_board_map" for the subject and last
> paragraph?
> 
I can adjust it

> Also, spacemit/k1-milkv-jupiter is not in CONFIG_OF_LIST on main, so
> neither Jupiter entry can find its device tree in the FIT yet. My
> Jupiter board patch adds it there.
> 
Yes, we still need patches for supporting this board, give me some time,
I will review your patches

> The change itself looks fine to me.
> 
Thanks

-- 
Yixun Lan (dlan)

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

end of thread, other threads:[~2026-11-16 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11 21:36 [PATCH v2] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Yixun Lan
2026-11-13 10:49 ` Eric Chung
2026-11-16  7:13 ` Hung-Chun Tseng
2026-11-16 10:52   ` Yixun Lan

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.