U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Junhui Liu" <junhui.liu@pigmoral.tech>
To: "Zhuxu Ran" <zhuxu_ran@zohomail.com>,
	<u-boot@lists.u-boot-project.org>, "Yao Zi" <me@ziyao.cc>
Cc: "Lukasz Majewski" <lukma@denx.de>,
	"Tom Rini" <trini@konsulko.com>, "Peng Fan" <peng.fan@nxp.com>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Stefan Roese" <stefan.roese@mailbox.org>,
	"Hiago De Franco" <hfranco@baylibre.com>,
	"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>,
	"Kongyang Liu" <seashell11234455@gmail.com>,
	"Tim Ouyang" <tim609@andestech.com>,
	"Leo Liang" <leo.liang@sifive.com>,
	"Guodong Xu" <guodong@riscstar.com>,
	"Andreas Schwab" <schwab@suse.de>,
	"Junhui Liu" <junhui.liu@pigmoral.tech>
Subject: Re: [PATCH v3 3/7] riscv: licheerv_nano: Enable hardware system reset
Date: Thu, 06 Aug 2026 22:19:39 +0800	[thread overview]
Message-ID: <DKHXDBYX3IR2.M4Z0EXRW0620@pigmoral.tech> (raw)
In-Reply-To: <20260806-milkv-duo-upstream-dts-v3-3-917cf70a2337@zohomail.com>

Hi Zhuxu,

On Thu Aug 6, 2026 at 8:13 PM CST, Zhuxu Ran wrote:
> The LicheeRV Nano configuration disables board_init(), so the existing
> CV1800B sysreset driver is never bound. This is an existing board issue
> exposed while validating the upstream SG2002 devicetree conversion.
>
> SG2002 uses the same RTC system reset registers as CV1800B. Enable
> board-specific initialization and bind the driver in board_init(),
> following the approach used by Milk-V Duo.
>
> Signed-off-by: Zhuxu Ran <zhuxu_ran@zohomail.com>
> ---
>  board/sophgo/licheerv_nano/board.c     | 9 +++++++++
>  configs/sipeed_licheerv_nano_defconfig | 1 -
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/board/sophgo/licheerv_nano/board.c b/board/sophgo/licheerv_nano/board.c
> index e6099d35dbf..c0685c44662 100644
> --- a/board/sophgo/licheerv_nano/board.c
> +++ b/board/sophgo/licheerv_nano/board.c
> @@ -3,3 +3,12 @@
>   * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com>
>   */
>  
> +#include <dm/lists.h>
> +
> +int board_init(void)
> +{
> +	if (IS_ENABLED(CONFIG_SYSRESET_CV1800B))
> +		device_bind_driver(gd->dm_root, "cv1800b_sysreset", "sysreset", NULL);
> +
> +	return 0;
> +}

This looks the same as what Milk-V Duo already does. Since this is an
SoC-level driver that doesn’t change across different boards, could you
please look into extracting it into common code instead?

Also see:

https://lists.u-boot-project.org/pipermail/u-boot/2026-July/625352.html

> diff --git a/configs/sipeed_licheerv_nano_defconfig b/configs/sipeed_licheerv_nano_defconfig
> index 9aa3ede10c5..ab29f327d7a 100644
> --- a/configs/sipeed_licheerv_nano_defconfig
> +++ b/configs/sipeed_licheerv_nano_defconfig
> @@ -17,7 +17,6 @@ CONFIG_SD_BOOT=y
>  CONFIG_BOOTCOMMAND="run distro_bootcmd"
>  CONFIG_SYS_CBSIZE=512
>  CONFIG_SYS_PBSIZE=544
> -# CONFIG_BOARD_INIT is not set
>  CONFIG_SYS_PROMPT="licheerv_nano# "
>  # CONFIG_CMD_BOOTDEV is not set
>  CONFIG_CMD_MBR=y

-- 
Best regards,
Junhui Liu


  reply	other threads:[~2026-08-06 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 12:13 [PATCH v3 0/7] riscv: sophgo: Use upstream devicetrees for CV18xx boards Zhuxu Ran via U-Boot
2026-08-06 12:13 ` [PATCH v3 1/7] clk: sophgo: cv1800b: Add SoC-specific compatible strings Zhuxu Ran via U-Boot
2026-08-06 12:13 ` [PATCH v3 2/7] mmc: cv1800b: Add SG2002 compatible string Zhuxu Ran via U-Boot
2026-08-06 12:13 ` [PATCH v3 3/7] riscv: licheerv_nano: Enable hardware system reset Zhuxu Ran via U-Boot
2026-08-06 14:19   ` Junhui Liu [this message]
2026-08-06 12:13 ` [PATCH v3 4/7] riscv: milkv_duo: Use upstream devicetree Zhuxu Ran via U-Boot
2026-08-06 12:45   ` Zhuxu Ran via U-Boot
2026-08-06 14:22   ` Junhui Liu
2026-08-27 17:35   ` Andrei Lalaev
2026-08-06 12:13 ` [PATCH v3 5/7] riscv: licheerv_nano: " Zhuxu Ran via U-Boot
2026-08-06 12:13 ` [PATCH v3 6/7] riscv: dts: sophgo: Drop local CV18xx devicetrees Zhuxu Ran via U-Boot
2026-08-06 12:13 ` [PATCH v3 7/7] clk: sophgo: cv1800b: Drop legacy compatible string Zhuxu Ran via U-Boot

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=DKHXDBYX3IR2.M4Z0EXRW0620@pigmoral.tech \
    --to=junhui.liu@pigmoral.tech \
    --cc=guodong@riscstar.com \
    --cc=hfranco@baylibre.com \
    --cc=jh80.chung@samsung.com \
    --cc=leo.liang@sifive.com \
    --cc=lukma@denx.de \
    --cc=me@ziyao.cc \
    --cc=peng.fan@nxp.com \
    --cc=schwab@suse.de \
    --cc=seashell11234455@gmail.com \
    --cc=stefan.roese@mailbox.org \
    --cc=thomas.bonnefille@bootlin.com \
    --cc=tim609@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=zhuxu_ran@zohomail.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