From: "Chanho Park" <chanho61.park@samsung.com>
To: "'Simon Glass'" <sjg@chromium.org>,
"'U-Boot Mailing List'" <u-boot@lists.denx.de>
Cc: "'Tom Rini'" <trini@konsulko.com>,
"'Heinrich Schuchardt'" <xypron.glpk@gmx.de>,
"'Leo'" <ycliang@andestech.com>,
"'Nikita Shubin'" <n.shubin@yadro.com>,
"'Rick Chen'" <rick@andestech.com>
Subject: RE: [PATCH v2 05/21] riscv: Add a reset_cpu() function
Date: Fri, 15 Dec 2023 15:38:38 +0900 [thread overview]
Message-ID: <000701da2f21$565e5560$031b0020$@samsung.com> (raw)
In-Reply-To: <20231214094939.v2.5.I2c0bbce52ecf7ce9458c481fbd12b6029e5ebd27@changeid>
> -----Original Message-----
> From: Simon Glass <sjg@chromium.org>
> Sent: Friday, December 15, 2023 1:50 AM
> To: U-Boot Mailing List <u-boot@lists.denx.de>
> Cc: Tom Rini <trini@konsulko.com>; Simon Glass <sjg@chromium.org>; Chanho
> Park <chanho61.park@samsung.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>;
> Leo <ycliang@andestech.com>; Nikita Shubin <n.shubin@yadro.com>; Rick Chen
> <rick@andestech.com>
> Subject: [PATCH v2 05/21] riscv: Add a reset_cpu() function
>
> The current do_reset() is called from a command context. Add a function
> which can be used from anywhere, as is done on ARM. Adjust do_reset()
> to call it.
>
> Note that reset_cpu() is normally provided by SYSRESET so make this
> declaration conditional on that being disabled.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Chanho Park <chanho61.park@samsung.com>
> ---
>
> (no changes since v1)
>
> arch/riscv/cpu/cpu.c | 13 +++++++++++++
> arch/riscv/lib/reset.c | 7 ++-----
> 2 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
> index ebd39cb41a60..8445c5823e17 100644
> --- a/arch/riscv/cpu/cpu.c
> +++ b/arch/riscv/cpu/cpu.c
> @@ -3,10 +3,13 @@
> * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
> */
>
> +#include <command.h>
> #include <cpu.h>
> +#include <cpu_func.h>
> #include <dm.h>
> #include <dm/lists.h>
> #include <event.h>
> +#include <hang.h>
> #include <init.h>
> #include <log.h>
> #include <asm/encoding.h>
> @@ -162,3 +165,13 @@ int arch_early_init_r(void)
> __weak void harts_early_init(void)
> {
> }
> +
> +#if !CONFIG_IS_ENABLED(SYSRESET)
> +void reset_cpu(void)
> +{
> + printf("resetting ...\n");
> +
> + printf("reset not supported yet\n");
> + hang();
> +}
> +#endif
> diff --git a/arch/riscv/lib/reset.c b/arch/riscv/lib/reset.c
> index 712e1bdb8e1d..c4153c9e6e02 100644
> --- a/arch/riscv/lib/reset.c
> +++ b/arch/riscv/lib/reset.c
> @@ -4,14 +4,11 @@
> */
>
> #include <command.h>
> -#include <hang.h>
> +#include <cpu_func.h>
>
> int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const
> argv[])
> {
> - printf("resetting ...\n");
> -
> - printf("reset not supported yet\n");
> - hang();
> + reset_cpu();
>
> return 0;
> }
> --
> 2.43.0.472.g3155946c3a-goog
next prev parent reply other threads:[~2023-12-15 6:38 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 16:50 [PATCH v2 00/21] Complete decoupling of bootm logic from commands Simon Glass
2023-12-14 16:50 ` [PATCH v2 01/21] mips: Add a reset_cpu() function Simon Glass
2023-12-14 16:50 ` [PATCH v2 02/21] m68k: " Simon Glass
2023-12-14 16:50 ` [PATCH v2 03/21] ppc: " Simon Glass
2023-12-14 16:50 ` [PATCH v2 04/21] nios2: " Simon Glass
2023-12-14 16:50 ` [PATCH v2 05/21] riscv: " Simon Glass
2023-12-15 6:38 ` Chanho Park [this message]
2023-12-14 16:50 ` [PATCH v2 06/21] bootm: Adjust how the board is reset Simon Glass
2023-12-15 12:01 ` Mattijs Korpershoek
2023-12-14 16:50 ` [PATCH v2 07/21] sandbox: bootm: Enable more bootm OS methods Simon Glass
2023-12-14 16:50 ` [PATCH v2 08/21] bootm: Create a struct for argument information Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 09/21] bootm: Adjust arguments of boot_os_fn Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 10/21] bootm: Add more fields to bootm_info Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 11/21] bootm: Move do_bootm_states() comment to header file Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-15 12:02 ` Mattijs Korpershoek
2023-12-14 16:50 ` [PATCH v2 12/21] booti: Avoid use of #ifdef Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 13/21] bootz: " Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 14/21] bootm: Drop arguments from do_bootm_states() Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 15/21] bootm: Rename do_bootm_states() to bootm_run_states() Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 16/21] bootm: Tidy up boot_selected_os() Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 17/21] bootm: Create a function to run through the bootm states Simon Glass
2023-12-14 17:51 ` Tom Rini
2023-12-14 16:50 ` [PATCH v2 18/21] stm32: Use local vars in stm32prog for initrd and fdt Simon Glass
2023-12-15 11:55 ` Patrick DELAUNAY
2023-12-14 16:50 ` [PATCH v2 19/21] bootm: Create a function to run through the bootz states Simon Glass
2023-12-14 16:50 ` [PATCH v2 20/21] stm32: Use bootm_run() and bootz_run() Simon Glass
2023-12-15 11:57 ` Patrick DELAUNAY
2023-12-14 16:50 ` [PATCH v2 21/21] bootm: Create a function to run through the booti states Simon Glass
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='000701da2f21$565e5560$031b0020$@samsung.com' \
--to=chanho61.park@samsung.com \
--cc=n.shubin@yadro.com \
--cc=rick@andestech.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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