All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
@ 2026-08-25  6:52 Bruno Banelli
  2026-08-25 22:44 ` Yixun Lan
  2026-10-26  0:31 ` Leo Liang
  0 siblings, 2 replies; 6+ messages in thread
From: Bruno Banelli @ 2026-08-25  6:52 UTC (permalink / raw)
  To: Huan Zhou, Guodong Xu; +Cc: Tom Rini, u-boot-spacemit, u-boot, Bruno Banelli

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>
---
 board/spacemit/k1/spl.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c
index d749e21a..e82fad23 100644
--- a/board/spacemit/k1/spl.c
+++ b/board/spacemit/k1/spl.c
@@ -367,7 +367,14 @@ int board_fit_config_name_match(const char *name)
 	int i;
 
 	memset(fdt_name, 0, I2C_BUF_SIZE);
-	if (!strncmp(product_name, "k1-x_", 5)) {
+	/*
+	 * The TLV product name is prefixed with the SoC variant fitted to
+	 * the board: "k1-x_" for a K1, "m1-x_" for the higher-binned M1.
+	 * Device trees are named for the K1 in both cases, so accept
+	 * either prefix and always derive a "k1-" name from it.
+	 */
+	if (!strncmp(product_name, "k1-x_", 5) ||
+	    !strncmp(product_name, "m1-x_", 5)) {
 		snprintf(fdt_name, I2C_BUF_SIZE, "%s-%s", "k1",
 			 &product_name[5]);
 	}

base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
-- 
2.43.0


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

* Re: [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-08-25  6:52 [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Bruno Banelli
@ 2026-08-25 22:44 ` Yixun Lan
  2026-08-25 22:50   ` Yixun Lan
  2026-10-26  0:31 ` Leo Liang
  1 sibling, 1 reply; 6+ messages in thread
From: Yixun Lan @ 2026-08-25 22:44 UTC (permalink / raw)
  To: Bruno Banelli; +Cc: Huan Zhou, Guodong Xu, Tom Rini, u-boot-spacemit, u-boot

Hi Bruno,
 Cc Guodong's new mail address

On 08:52 Tue 25 Aug     , Bruno Banelli 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_".
> 
> 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>

Looks good
Reviewd-by: Yixun Lan <dlan@kernel.org>


-- 
Yixun Lan (dlan)

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

* Re: [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-08-25 22:44 ` Yixun Lan
@ 2026-08-25 22:50   ` Yixun Lan
  0 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2026-08-25 22:50 UTC (permalink / raw)
  To: Bruno Banelli; +Cc: Huan Zhou, Guodong Xu, Tom Rini, u-boot-spacemit, u-boot

On 22:44 Tue 25 Aug     , Yixun Lan wrote:
> Hi Bruno,
>  Cc Guodong's new mail address
> 
> On 08:52 Tue 25 Aug     , Bruno Banelli 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_".
> > 
> > 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>
> 
> Looks good
> Reviewd-by: Yixun Lan <dlan@kernel.org>
sorry, have a typo here ..
Reviewed-by: Yixun Lan <dlan@kernel.org>

-- 
Yixun Lan (dlan)

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

* Re: [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-08-25  6:52 [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Bruno Banelli
  2026-08-25 22:44 ` Yixun Lan
@ 2026-10-26  0:31 ` Leo Liang
  2026-10-26  1:20   ` Yixun Lan
  1 sibling, 1 reply; 6+ messages in thread
From: Leo Liang @ 2026-10-26  0:31 UTC (permalink / raw)
  To: Bruno Banelli; +Cc: Huan Zhou, Guodong Xu, Tom Rini, u-boot-spacemit, u-boot

Hi Bruno,

So sorry for the late reply!
Could you rebase your patch against current master and send again.
I will merge the patch once you send out the patch.

Best regards,
Leo

On Tue, Aug 25, 2026 at 08:52:57AM +0200, Bruno Banelli 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_".
> 
> 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>
> Reviewed-by: Yixun Lan <dlan@kernel.org>
> ---
>  board/spacemit/k1/spl.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> 
> base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc

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

* Re: [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-10-26  0:31 ` Leo Liang
@ 2026-10-26  1:20   ` Yixun Lan
  2026-10-29  8:38     ` Leo Liang
  0 siblings, 1 reply; 6+ messages in thread
From: Yixun Lan @ 2026-10-26  1:20 UTC (permalink / raw)
  To: Leo Liang
  Cc: Bruno Banelli, Huan Zhou, Guodong Xu, Tom Rini, u-boot-spacemit,
	u-boot

Hi Leo, Bruno

On 08:31 Mon 26 Oct     , Leo Liang wrote:
> Hi Bruno,
> 
> So sorry for the late reply!
> Could you rebase your patch against current master and send again.
> I will merge the patch once you send out the patch.
> 
Sorry, I've also missed this patch.

But since currently there is a dedicated custodian tree[1] for
SpacemiT SoC, let's merge it via there..

[1] https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit

> Best regards,
> Leo
> 
> On Tue, Aug 25, 2026 at 08:52:57AM +0200, Bruno Banelli 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_".
> > 
> > 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>
> > Reviewed-by: Yixun Lan <dlan@kernel.org>
> > ---
> >  board/spacemit/k1/spl.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > 
> > base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc

-- 
Yixun Lan (dlan)

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

* Re: [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix
  2026-10-26  1:20   ` Yixun Lan
@ 2026-10-29  8:38     ` Leo Liang
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Liang @ 2026-10-29  8:38 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Bruno Banelli, Huan Zhou, Guodong Xu, Tom Rini, u-boot-spacemit,
	u-boot

Hi Yixun,

On Mon, Oct 26, 2026 at 9:20 AM Yixun Lan <dlan@kernel.org> wrote:
>
> Hi Leo, Bruno
>
> On 08:31 Mon 26 Oct     , Leo Liang wrote:
> > Hi Bruno,
> >
> > So sorry for the late reply!
> > Could you rebase your patch against current master and send again.
> > I will merge the patch once you send out the patch.
> >
> Sorry, I've also missed this patch.
>
> But since currently there is a dedicated custodian tree[1] for
> SpacemiT SoC, let's merge it via there..
>
> [1] https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit
>

Of course! Thanks for your help, Yixun!

Best regards
Leo

> > Best regards,
> > Leo
> >
> > On Tue, Aug 25, 2026 at 08:52:57AM +0200, Bruno Banelli 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_".
> > >
> > > 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>
> > > Reviewed-by: Yixun Lan <dlan@kernel.org>
> > > ---
> > >  board/spacemit/k1/spl.c | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > >
> > > base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
>
> --
> Yixun Lan (dlan)

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

end of thread, other threads:[~2026-10-29  8:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  6:52 [PATCH] board: spacemit: k1: accept the "m1-x_" TLV product name prefix Bruno Banelli
2026-08-25 22:44 ` Yixun Lan
2026-08-25 22:50   ` Yixun Lan
2026-10-26  0:31 ` Leo Liang
2026-10-26  1:20   ` Yixun Lan
2026-10-29  8:38     ` Leo Liang

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.