From: E Shattow <e@freeshell.de>
To: Hung-Chun Tseng <alan.tseng.cs@gmail.com>,
Yixun Lan <dlan@kernel.org>, Huan Zhou <pericycle.cc@gmail.com>,
Eric Chung <eric.chung@riscstar.com>
Cc: Tom Rini <trini@konsulko.com>, Guodong Xu <docular.xu@gmail.com>,
Raymond Mao <raymond.mao@riscstar.com>,
u-boot-spacemit@groups.io, u-boot@lists.u-boot-project.org
Subject: Re: [PATCH 2/2] spacemit: k1: initialise the EEPROM index in read_ddr_info()
Date: Tue, 27 Oct 2026 10:55:11 -0700 [thread overview]
Message-ID: <c58b9c05-3c6f-433a-8333-e56ebd424e7c@freeshell.de> (raw)
In-Reply-To: <20261027154347.1392094-3-alan.tseng.cs@gmail.com>
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>
next prev parent reply other threads:[~2026-10-27 17:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-10-27 21:48 ` [PATCH 0/2] spacemit: k1: two small fixes found on a Milk-V Jupiter Yixun Lan
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=c58b9c05-3c6f-433a-8333-e56ebd424e7c@freeshell.de \
--to=e@freeshell.de \
--cc=alan.tseng.cs@gmail.com \
--cc=dlan@kernel.org \
--cc=docular.xu@gmail.com \
--cc=eric.chung@riscstar.com \
--cc=pericycle.cc@gmail.com \
--cc=raymond.mao@riscstar.com \
--cc=trini@konsulko.com \
--cc=u-boot-spacemit@groups.io \
--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