public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: E Shattow <e@freeshell.de>
To: Hal Feng <hal.feng@starfivetech.com>, Leo <ycliang@andestech.com>,
	Tom Rini <trini@konsulko.com>, Rick Chen <rick@andestech.com>,
	Sumit Garg <sumit.garg@kernel.org>,
	Emil Renner Berthing <emil.renner.berthing@canonical.com>,
	Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH v1 4/9] eeprom: starfive: Correct get_pcb_revision_from_eeprom()
Date: Fri, 24 Oct 2025 04:30:15 -0700	[thread overview]
Message-ID: <5baade67-579e-494e-8161-0f17ceeecf0b@freeshell.de> (raw)
In-Reply-To: <20251024085932.83596-5-hal.feng@starfivetech.com>


On 10/24/25 01:59, Hal Feng wrote:
> pcb_revision is stored in the pcb_revision field of ATOM4. Correct it.
> Move the function description to the header file.
> Return 0 instead of 0xFF if read_eeprom() fails.
> 
> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Fixes: aea1bd95b61e ("eeprom: starfive: Enable ID EEPROM configuration")
> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
> ---
>  arch/riscv/include/asm/arch-jh7110/eeprom.h         |  5 +++++
>  board/starfive/visionfive2/visionfive2-i2c-eeprom.c | 11 ++---------
>  2 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/arch-jh7110/eeprom.h b/arch/riscv/include/asm/arch-jh7110/eeprom.h
> index 1ae9f2b840a..8b689a75013 100644
> --- a/arch/riscv/include/asm/arch-jh7110/eeprom.h
> +++ b/arch/riscv/include/asm/arch-jh7110/eeprom.h
> @@ -9,6 +9,11 @@
>  
>  #include <linux/types.h>
>  
> +/**
> + * get_pcb_revision_from_eeprom() - get the PCB revision
> + *
> + * @return: the PCB revision or 0 on error.
> + */
>  u8 get_pcb_revision_from_eeprom(void);
>  
>  /**
> diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
> index ca5039ee433..986dcc94992 100644
> --- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
> +++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
> @@ -535,19 +535,12 @@ int mac_read_from_eeprom(void)
>  	return 0;
>  }
>  
> -/**
> - * get_pcb_revision_from_eeprom - get the PCB revision
> - *
> - * 1.2A return 'A'/'a', 1.3B return 'B'/'b',other values are illegal
> - */
>  u8 get_pcb_revision_from_eeprom(void)
>  {
> -	u8 pv = 0xFF;
> -
>  	if (read_eeprom())
> -		return pv;
> +		return 0;
>  
> -	return pbuf.eeprom.atom1.data.pstr[6];
> +	return pbuf.eeprom.atom4.data.pcb_revision;
>  }
>  
>  u8 get_ddr_size_from_eeprom(void)

LGTM

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

  reply	other threads:[~2025-10-24 11:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  8:59 [PATCH v1 0/9] Add support for StarFive VisionFive 2 Lite board Hal Feng
2025-10-24  8:59 ` [PATCH v1 1/9] riscv: dts: starfive: jh7110-common: Move out some nodes to the board dts Hal Feng
2025-10-24 11:17   ` E Shattow
2025-10-24  8:59 ` [PATCH v1 2/9] riscv: dts: starfive: Add VisionFive 2 Lite board device tree Hal Feng
2025-10-24 10:58   ` E Shattow
2025-10-27  8:14     ` Hal Feng
2025-12-04  9:37       ` Leo Liang
2025-12-04  9:46         ` Conor Dooley
2025-12-04 10:37           ` Leo Liang
2025-12-05  6:43             ` Hal Feng
2025-10-24  8:59 ` [PATCH v1 3/9] eeprom: starfive: Simplify get_ddr_size_from_eeprom() Hal Feng
2025-10-24 11:24   ` E Shattow
2025-10-24  8:59 ` [PATCH v1 4/9] eeprom: starfive: Correct get_pcb_revision_from_eeprom() Hal Feng
2025-10-24 11:30   ` E Shattow [this message]
2025-10-24  8:59 ` [PATCH v1 5/9] eeprom: starfive: Support eeprom data format v3 Hal Feng
2025-10-24 12:41   ` E Shattow
2025-10-24  8:59 ` [PATCH v1 6/9] pcie: starfive: Add a optional power gpio support Hal Feng
2025-10-24 13:09   ` E Shattow
2025-10-27  8:26     ` Hal Feng
2025-10-24  8:59 ` [PATCH v1 7/9] configs: visionfive2: Add VisionFive 2 Lite DT to OF_LIST Hal Feng
2025-10-24  8:59 ` [PATCH v1 8/9] board: starfive: spl: Support VisionFive 2 Lite Hal Feng
2025-10-24  8:59 ` [PATCH v1 9/9] board: starfive: visionfive2: Add VisionFive 2 Lite fdt selection Hal Feng
2026-02-09 11:21 ` [PATCH v1 0/9] Add support for StarFive VisionFive 2 Lite board Leo Liang
2026-02-09 19:10   ` E Shattow
2026-02-14  9:26     ` Hal Feng

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=5baade67-579e-494e-8161-0f17ceeecf0b@freeshell.de \
    --to=e@freeshell.de \
    --cc=emil.renner.berthing@canonical.com \
    --cc=hal.feng@starfivetech.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=rick@andestech.com \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /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