diff options
author | Anup Patel <apatel@ventanamicro.com> | 2022-08-08 07:04:20 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-08-08 07:04:20 +0300 |
commit | bc317a378f17ad462fdc2ee672e9bb05098506b4 (patch) | |
tree | 73d442a62c0525aa4916f6d9e88c1c799eb5fee1 /platform | |
parent | d514a8f0dcc3a0a310bbbe33a6ab62d9e10adea8 (diff) | |
download | opensbi-bc317a378f17ad462fdc2ee672e9bb05098506b4.tar.xz |
platform: generic: Use kconfig to set platform version and default name
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>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/generic/Kconfig | 14 | ||||
-rw-r--r-- | 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, |