new file mode 100644
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+/*
+ * feature_config.h - Vendor feature-configuration drivers.
+ *
+ * Copyright (c) 2026 SiFive Inc.
+ */
+
+#ifndef __FEATURE_CONFIG_H__
+#define __FEATURE_CONFIG_H__
+
+#include <sbi/sbi_types.h>
+
+/**
+ * A single feature-configuration CSR programming request
+ */
+struct feature_config_csr {
+ unsigned long csr_num;
+ unsigned long value;
+};
+
+/**
+ * Vendor feature-configuration driver
+ *
+ * Registered through the feature_config_drivers carray, so adding a
+ * vendor never requires touching common code.
+ */
+struct feature_config_driver {
+ const char *name;
+ /** mvendorid of the harts this driver applies to */
+ unsigned long mvendorid;
+ /**
+ * Match the current hart's identity and cache its CSR write
+ * via sbi_hart_feature_config_set().
+ * No match is not an error: the hart is left untouched.
+ *
+ * @return 0 on success or a negative error code on failure
+ */
+ int (*init)(void);
+};
+
+extern const struct feature_config_driver *const feature_config_drivers[];
+
+/**
+ * Match and cache the current hart's feature-configuration values
+ *
+ * Matches the hart's mvendorid against the registered drivers and
+ * calls the matching driver's init().
+ *
+ * Meant to be wired up as a platform's feature_config_init operation,
+ * called on every hart so a heterogeneous or AMP system picks the
+ * right driver per hart.
+ *
+ * No matching vendor is not an error: the hart is left at its reset
+ * configuration.
+ *
+ * @return 0 on success or a negative error code on failure
+ */
+#ifdef CONFIG_FEATURE_CONFIG
+
+int feature_config_probe(void);
+
+#else
+
+static inline int feature_config_probe(void)
+{
+ return 0;
+}
+
+#endif
+
+#endif /* __FEATURE_CONFIG_H__ */
@@ -8,6 +8,8 @@ source "$(OPENSBI_SRC_DIR)/lib/utils/cppc/Kconfig"
source "$(OPENSBI_SRC_DIR)/lib/utils/fdt/Kconfig"
+source "$(OPENSBI_SRC_DIR)/lib/utils/feature/Kconfig"
+
source "$(OPENSBI_SRC_DIR)/lib/utils/gpio/Kconfig"
source "$(OPENSBI_SRC_DIR)/lib/utils/hsm/Kconfig"
new file mode 100644
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: BSD-2-Clause
+
+menu "Feature Configuration Support"
+
+endmenu
new file mode 100644
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: BSD-2-Clause
+/*
+ * feature_config.c - Vendor feature-configuration drivers.
+ *
+ * Copyright (c) 2026 SiFive Inc.
+ *
+ * Matches the current hart's mvendorid against the registered vendor
+ * drivers and hands off to the matching driver's init().
+ */
+
+#include <sbi/riscv_asm.h>
+#include <sbi/riscv_encoding.h>
+#include <sbi/sbi_console.h>
+#include <sbi/sbi_scratch.h>
+#include <sbi_utils/feature/feature_config.h>
+
+int feature_config_probe(void)
+{
+ unsigned long mvendorid = csr_read(CSR_MVENDORID);
+
+ for (int i = 0; feature_config_drivers[i]; i++) {
+ const struct feature_config_driver *drv =
+ feature_config_drivers[i];
+
+ if (drv->mvendorid != mvendorid)
+ continue;
+
+ return drv->init();
+ }
+
+ /* Unknown vendor: leave the hart at its reset configuration */
+ sbi_dprintf("hart%lu: no driver registered for mvendorid 0x%lx\n",
+ current_hartindex(), mvendorid);
+
+ return 0;
+}
new file mode 100644
@@ -0,0 +1,3 @@
+HEADER: sbi_utils/feature/feature_config.h
+TYPE: const struct feature_config_driver
+NAME: feature_config_drivers
new file mode 100644
@@ -0,0 +1,8 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2026 SiFive Inc.
+#
+
+libsbiutils-objs-$(CONFIG_FEATURE_CONFIG) += feature/feature_config.o
+libsbiutils-objs-$(CONFIG_FEATURE_CONFIG) += feature/feature_config_drivers.carray.o