OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <apatel@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v8 14/17] platform: generic: Use kconfig to set platform version and default name
Date: Mon,  8 Aug 2022 09:27:37 +0530	[thread overview]
Message-ID: <20220808035740.69335-15-apatel@ventanamicro.com> (raw)
In-Reply-To: <20220808035740.69335-1-apatel@ventanamicro.com>

The generic platform version and default name should be set based
on kconfig options so that users can override it.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Tested-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Atish Patra <atishp@rivosinc.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
---
 platform/generic/Kconfig    | 14 ++++++++++++++
 platform/generic/platform.c |  6 ++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/platform/generic/Kconfig b/platform/generic/Kconfig
index c76bd12..63d1be4 100644
--- a/platform/generic/Kconfig
+++ b/platform/generic/Kconfig
@@ -9,6 +9,20 @@ config PLATFORM_GENERIC
 
 if PLATFORM_GENERIC
 
+config PLATFORM_GENERIC_NAME
+	string "Platform default name"
+	default "Generic"
+
+config PLATFORM_GENERIC_MAJOR_VER
+	int "Platform major version"
+	range 0 65535
+	default 0
+
+config PLATFORM_GENERIC_MINOR_VER
+	int "Platform minor version"
+	range 0 65535
+	default 1
+
 config PLATFORM_ALLWINNER_D1
 	bool "Allwinner D1 support"
 	depends on FDT_IRQCHIP_PLIC
diff --git a/platform/generic/platform.c b/platform/generic/platform.c
index bf93af6..cc3620f 100644
--- a/platform/generic/platform.c
+++ b/platform/generic/platform.c
@@ -265,8 +265,10 @@ const struct sbi_platform_operations platform_ops = {
 
 struct sbi_platform platform = {
 	.opensbi_version	= OPENSBI_VERSION,
-	.platform_version	= SBI_PLATFORM_VERSION(0x0, 0x01),
-	.name			= "Generic",
+	.platform_version	=
+		SBI_PLATFORM_VERSION(CONFIG_PLATFORM_GENERIC_MAJOR_VER,
+				     CONFIG_PLATFORM_GENERIC_MINOR_VER),
+	.name			= CONFIG_PLATFORM_GENERIC_NAME,
 	.features		= SBI_PLATFORM_DEFAULT_FEATURES,
 	.hart_count		= SBI_HARTMASK_MAX_BITS,
 	.hart_index2id		= generic_hart_index2id,
-- 
2.34.1



  parent reply	other threads:[~2022-08-08  3:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08  3:57 [PATCH v8 00/17] OpenSBI Kconfig Support Anup Patel
2022-08-08  3:57 ` [PATCH v8 01/17] scripts: Add Kconfiglib v14.1.0 under scripts directory Anup Patel
2022-08-08  3:57 ` [PATCH v8 02/17] Makefile: Add initial kconfig support for each platform Anup Patel
2022-08-08  3:57 ` [PATCH v8 03/17] Makefile: Compile lib/utils sources separately " Anup Patel
2022-08-08  3:57 ` [PATCH v8 04/17] lib: utils/serial: Use kconfig for enabling/disabling drivers Anup Patel
2022-08-08  3:57 ` [PATCH v8 05/17] lib: utils/reset: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 06/17] lib: utils/sys: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 07/17] lib: utils/timer: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 08/17] lib: utils/ipi: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 09/17] lib: utils/irqchip: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 10/17] lib: utils/i2c: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 11/17] lib: utils/gpio: " Anup Patel
2022-08-08  3:57 ` [PATCH v8 12/17] lib: utils/fdt: Use kconfig for enabling/disabling Anup Patel
2022-08-08  3:57 ` [PATCH v8 13/17] platform: generic: Use kconfig for enabling/disabling overrides Anup Patel
2022-08-08  3:57 ` Anup Patel [this message]
2022-08-08  3:57 ` [PATCH v8 15/17] platform: Remove redundant config.mk from all platforms Anup Patel
2022-08-08  3:57 ` [PATCH v8 16/17] docs: Update documentation for kconfig support Anup Patel
2022-08-08  3:57 ` [PATCH v8 17/17] Makefile: Fix typo related to object.mk Anup Patel
2022-08-08  4:06 ` [PATCH v8 00/17] OpenSBI Kconfig Support Anup Patel

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=20220808035740.69335-15-apatel@ventanamicro.com \
    --to=apatel@ventanamicro.com \
    --cc=opensbi@lists.infradead.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