All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>
Cc: "Bin Meng" <bmeng.cn@gmail.com>, "Simon Glass" <sjg@chromium.org>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Green Wan" <green.wan@sifive.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Chee Hong Ang" <chee.hong.ang@intel.com>,
	"Ley Foon Tan" <ley.foon.tan@intel.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Siew Chin Lim" <elly.siew.chin.lim@intel.com>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	u-boot@lists.denx.de,
	"Heinrich Schuchardt" <heinrich.schuchardt@canonical.com>
Subject: [PATCH v5 2/4] cmd/sbi: use constants instead of numerical values
Date: Fri, 10 Sep 2021 16:15:27 +0200	[thread overview]
Message-ID: <20210910141529.69841-3-heinrich.schuchardt@canonical.com> (raw)
In-Reply-To: <20210910141529.69841-1-heinrich.schuchardt@canonical.com>

Use constants for extension IDs.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
v5:
	no change
v4:
	no change
---
 cmd/riscv/sbi.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c
index 90c0811e14..65a2c93290 100644
--- a/cmd/riscv/sbi.c
+++ b/cmd/riscv/sbi.c
@@ -29,21 +29,21 @@ static struct sbi_imp implementations[] = {
 };
 
 static struct sbi_ext extensions[] = {
-	{ 0x00000000, "sbi_set_timer" },
-	{ 0x00000001, "sbi_console_putchar" },
-	{ 0x00000002, "sbi_console_getchar" },
-	{ 0x00000003, "sbi_clear_ipi" },
-	{ 0x00000004, "sbi_send_ipi" },
-	{ 0x00000005, "sbi_remote_fence_i" },
-	{ 0x00000006, "sbi_remote_sfence_vma" },
-	{ 0x00000007, "sbi_remote_sfence_vma_asid" },
-	{ 0x00000008, "sbi_shutdown" },
-	{ 0x00000010, "SBI Base Functionality" },
-	{ 0x54494D45, "Timer Extension" },
-	{ 0x00735049, "IPI Extension" },
-	{ 0x52464E43, "RFENCE Extension" },
-	{ 0x0048534D, "Hart State Management Extension" },
-	{ 0x53525354, "System Reset Extension" },
+	{ SBI_EXT_0_1_SET_TIMER,	      "sbi_set_timer" },
+	{ SBI_EXT_0_1_CONSOLE_PUTCHAR,	      "sbi_console_putchar" },
+	{ SBI_EXT_0_1_CONSOLE_GETCHAR,	      "sbi_console_getchar" },
+	{ SBI_EXT_0_1_CLEAR_IPI,	      "sbi_clear_ipi" },
+	{ SBI_EXT_0_1_SEND_IPI,		      "sbi_send_ipi" },
+	{ SBI_EXT_0_1_REMOTE_FENCE_I,	      "sbi_remote_fence_i" },
+	{ SBI_EXT_0_1_REMOTE_SFENCE_VMA,      "sbi_remote_sfence_vma" },
+	{ SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, "sbi_remote_sfence_vma_asid" },
+	{ SBI_EXT_0_1_SHUTDOWN,		      "sbi_shutdown" },
+	{ SBI_EXT_BASE,			      "SBI Base Functionality" },
+	{ SBI_EXT_TIME,			      "Timer Extension" },
+	{ SBI_EXT_IPI,			      "IPI Extension" },
+	{ SBI_EXT_RFENCE,		      "RFENCE Extension" },
+	{ SBI_EXT_HSM,			      "Hart State Management Extension" },
+	{ SBI_EXT_SRST,			      "System Reset Extension" },
 };
 
 static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,
-- 
2.30.2


  parent reply	other threads:[~2021-09-10 14:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 14:15 [PATCH v5 0/4] riscv: enable SBI system reset Heinrich Schuchardt
2021-09-10 14:15 ` [PATCH v5 1/4] riscv: add missing SBI extension definitions Heinrich Schuchardt
2021-09-10 14:15 ` Heinrich Schuchardt [this message]
2021-09-10 14:15 ` [PATCH v5 3/4] sysreset: provide SBI based sysreset driver Heinrich Schuchardt
2021-09-11 11:58   ` Bin Meng
2021-09-12  1:53   ` Sean Anderson
2021-09-10 14:15 ` [PATCH v5 4/4] configs: enable SYSRESET_SBI on qemu-riscvXX_smode_defconfig Heinrich Schuchardt
2021-09-11 12:01   ` Bin Meng

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=20210910141529.69841-3-heinrich.schuchardt@canonical.com \
    --to=heinrich.schuchardt@canonical.com \
    --cc=bmeng.cn@gmail.com \
    --cc=chee.hong.ang@intel.com \
    --cc=elly.siew.chin.lim@intel.com \
    --cc=green.wan@sifive.com \
    --cc=ley.foon.tan@intel.com \
    --cc=marek.behun@nic.cz \
    --cc=priyanka.jain@nxp.com \
    --cc=rick@andestech.com \
    --cc=seanga2@gmail.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=sjg@chromium.org \
    --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 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.