All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter
@ 2026-10-27 15:43 Hung-Chun Tseng
  2026-10-27 15:43 ` [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support Hung-Chun Tseng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hung-Chun Tseng @ 2026-10-27 15:43 UTC (permalink / raw)
  To: Yixun Lan, Huan Zhou, Eric Chung
  Cc: Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit, u-boot

Two small fixes I ran into while booting the mainline SPL and U-Boot
from an SD card on a Milk-V Jupiter.

Patch 1 enables the GigaDevice SPI NOR ID table, which the Jupiter's
GD25Q64 needs; "sf probe" detects it on the board with the patch.

Patch 2 initialises the EEPROM index that read_ddr_info() passes to
read_tlvinfo_tlv_eeprom(). It is build-tested only; on the Jupiter the
current compiler happens to pass 0 already, and the DDR TLV fields are
read correctly.

Hung-Chun Tseng (2):
  configs: k1: enable GigaDevice SPI NOR flash support
  spacemit: k1: initialise the EEPROM index in read_ddr_info()

 board/spacemit/k1/spl.c       | 2 +-
 configs/spacemit_k1_defconfig | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.43.0


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

* [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support
  2026-10-27 15:43 [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Hung-Chun Tseng
@ 2026-10-27 15:43 ` Hung-Chun Tseng
  2026-10-27 17:54   ` E Shattow
  2026-10-27 15:43 ` [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info() Hung-Chun Tseng
  2026-10-27 21:48 ` [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Yixun Lan
  2 siblings, 1 reply; 6+ messages in thread
From: Hung-Chun Tseng @ 2026-10-27 15:43 UTC (permalink / raw)
  To: Yixun Lan, Huan Zhou, Eric Chung
  Cc: Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit, u-boot

The Milk-V Jupiter boots from a GigaDevice GD25Q64 SPI NOR flash, but
spacemit_k1_defconfig only enables the Winbond ID table, so neither the
SPL nor U-Boot proper can detect it:

  jedec_spi_nor flash@0: unrecognized JEDEC id bytes: c8, 40, 17

Enable SPI_FLASH_GIGADEVICE. With it, "sf probe" on a Jupiter reports:

  SF: Detected gd25q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB

Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
---
 configs/spacemit_k1_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
index 8ee9baa13..b8f777e89 100644
--- a/configs/spacemit_k1_defconfig
+++ b/configs/spacemit_k1_defconfig
@@ -88,6 +88,7 @@ CONFIG_MMC_HS400_ES_SUPPORT=y
 CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SPACEMIT=y
+CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_NVME_PCI=y
 CONFIG_PCIE_DW_SPACEMIT=y
-- 
2.43.0


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

* [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info()
  2026-10-27 15:43 [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Hung-Chun Tseng
  2026-10-27 15:43 ` [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support Hung-Chun Tseng
@ 2026-10-27 15:43 ` Hung-Chun Tseng
  2026-10-27 17:55   ` E Shattow
  2026-10-27 21:48 ` [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Yixun Lan
  2 siblings, 1 reply; 6+ messages in thread
From: Hung-Chun Tseng @ 2026-10-27 15:43 UTC (permalink / raw)
  To: Yixun Lan, Huan Zhou, Eric Chung
  Cc: Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit, u-boot

read_ddr_info() passes i to read_tlvinfo_tlv_eeprom() as the EEPROM
device index before giving it a value, so which device is read depends
on whatever is on the stack. read_product_name() does the same call
with i set to 0.

Initialise i to 0 in read_ddr_info() as well.

Fixes: 83026cf8f90b ("spacemit: k1: Add DDR firmware support to SPL")
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
---
 board/spacemit/k1/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c
index cc0e26bb0..60f5d8c56 100644
--- a/board/spacemit/k1/spl.c
+++ b/board/spacemit/k1/spl.c
@@ -332,7 +332,7 @@ int read_ddr_info(struct ddr_cfg *cfg)
 	struct tlvinfo_header *tlv_hdr;
 	struct tlvinfo_tlv *tlv_entry;
 	u32 size, entry_size;
-	int ret, i;
+	int ret, i = 0;
 	bool found = false;
 
 	if (!cfg)
-- 
2.43.0


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

* Re: [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support
  2026-10-27 15:43 ` [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support Hung-Chun Tseng
@ 2026-10-27 17:54   ` E Shattow
  0 siblings, 0 replies; 6+ messages in thread
From: E Shattow @ 2026-10-27 17:54 UTC (permalink / raw)
  To: Hung-Chun Tseng, Yixun Lan, Huan Zhou, Eric Chung
  Cc: Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit, u-boot

On 10/27/26 08:43, Hung-Chun Tseng wrote:
> The Milk-V Jupiter boots from a GigaDevice GD25Q64 SPI NOR flash, but
> spacemit_k1_defconfig only enables the Winbond ID table, so neither the
> SPL nor U-Boot proper can detect it:
> 
>   jedec_spi_nor flash@0: unrecognized JEDEC id bytes: c8, 40, 17
> 
> Enable SPI_FLASH_GIGADEVICE. With it, "sf probe" on a Jupiter reports:
> 
>   SF: Detected gd25q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB
> 
> Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> ---
>  configs/spacemit_k1_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
> index 8ee9baa13..b8f777e89 100644
> --- a/configs/spacemit_k1_defconfig
> +++ b/configs/spacemit_k1_defconfig
> @@ -88,6 +88,7 @@ CONFIG_MMC_HS400_ES_SUPPORT=y
>  CONFIG_MMC_HS400_SUPPORT=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_SPACEMIT=y
> +CONFIG_SPI_FLASH_GIGADEVICE=y
>  CONFIG_SPI_FLASH_WINBOND=y
>  CONFIG_NVME_PCI=y
>  CONFIG_PCIE_DW_SPACEMIT=y

LGTM

Reviewed-by: E Shattow <e@freeshell.de>

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

* Re: [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info()
  2026-10-27 15:43 ` [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info() Hung-Chun Tseng
@ 2026-10-27 17:55   ` E Shattow
  0 siblings, 0 replies; 6+ messages in thread
From: E Shattow @ 2026-10-27 17:55 UTC (permalink / raw)
  To: Hung-Chun Tseng, Yixun Lan, Huan Zhou, Eric Chung
  Cc: Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit, u-boot

On 10/27/26 08:43, Hung-Chun Tseng wrote:
> read_ddr_info() passes i to read_tlvinfo_tlv_eeprom() as the EEPROM
> device index before giving it a value, so which device is read depends
> on whatever is on the stack. read_product_name() does the same call
> with i set to 0.
> 
> Initialise i to 0 in read_ddr_info() as well.
> 
> Fixes: 83026cf8f90b ("spacemit: k1: Add DDR firmware support to SPL")
> Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> ---
>  board/spacemit/k1/spl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c
> index cc0e26bb0..60f5d8c56 100644
> --- a/board/spacemit/k1/spl.c
> +++ b/board/spacemit/k1/spl.c
> @@ -332,7 +332,7 @@ int read_ddr_info(struct ddr_cfg *cfg)
>  	struct tlvinfo_header *tlv_hdr;
>  	struct tlvinfo_tlv *tlv_entry;
>  	u32 size, entry_size;
> -	int ret, i;
> +	int ret, i = 0;
>  	bool found = false;
>  
>  	if (!cfg)

LGTM

Reviewed-by: E Shattow <e@freeshell.de>

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

* Re: [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter
  2026-10-27 15:43 [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Hung-Chun Tseng
  2026-10-27 15:43 ` [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support Hung-Chun Tseng
  2026-10-27 15:43 ` [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info() Hung-Chun Tseng
@ 2026-10-27 21:48 ` Yixun Lan
  2 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2026-10-27 21:48 UTC (permalink / raw)
  To: Hung-Chun Tseng
  Cc: Huan Zhou, Eric Chung, Tom Rini, Guodong Xu, Raymond Mao,
	u-boot-spacemit, u-boot

Hi Hung-Chun,

On 23:43 Tue 27 Oct     , Hung-Chun Tseng wrote:
> Two small fixes I ran into while booting the mainline SPL and U-Boot
> from an SD card on a Milk-V Jupiter.
> 
> Patch 1 enables the GigaDevice SPI NOR ID table, which the Jupiter's
> GD25Q64 needs; "sf probe" detects it on the board with the patch.
> 
> Patch 2 initialises the EEPROM index that read_ddr_info() passes to
> read_tlvinfo_tlv_eeprom(). It is build-tested only; on the Jupiter the
> current compiler happens to pass 0 already, and the DDR TLV fields are
> read correctly.
> 
> Hung-Chun Tseng (2):
>   configs: k1: enable GigaDevice SPI NOR flash support
>   spacemit: k1: initialise the EEPROM index in read_ddr_info()
> 
>  board/spacemit/k1/spl.c       | 2 +-
>  configs/spacemit_k1_defconfig | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
for the series, with

Reviewed-by: Yixun Lan <dlan@kernel.org>

-- 
Yixun Lan (dlan)

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

end of thread, other threads:[~2026-10-27 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 15:43 [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Hung-Chun Tseng
2026-10-27 15:43 ` [PATCH 1/2] configs: k1: enable GigaDevice SPI NOR flash support Hung-Chun Tseng
2026-10-27 17:54   ` E Shattow
2026-10-27 15:43 ` [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info() Hung-Chun Tseng
2026-10-27 17:55   ` E Shattow
2026-10-27 21:48 ` [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter 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.