Skip to contentSkip to conversation

sm: Rework the Kconfig logic here

PATCH In review Tom Rini 2 participants 3 messages Aug 4, 2025 – Aug 14, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 sm: Rework the Kconfig logic here

The symbol "SM" is a library symbol and should not be prompted for. It should be selected by the drivers that use it. In this case we need to add a SANDBOX_SM symbol for the sandbox driver. The meson SM driver cannot build on other platforms, so add the appropriate dependency.

---
 configs/sandbox_defconfig |  2 +-
 drivers/sm/Kconfig        | 11 ++++++++++-
 drivers/sm/Makefile       |  4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
configs/sandbox_defconfig +1 -1
index 0c030f4a7925..3ae198e448aa 100644
@@ -320,7 +320,7 @@ CONFIG_RTC_RV8803=y
 CONFIG_RTC_HT1380=y
 CONFIG_SCSI=y
 CONFIG_SANDBOX_SERIAL=y
-CONFIG_SM=y
+CONFIG_SANDBOX_SM=y
 CONFIG_SMEM=y
 CONFIG_SANDBOX_SMEM=y
 CONFIG_SOUND=y
drivers/sm/Kconfig +10 -1
index 926af2863308..8e500ed2ede5 100644
@@ -1,8 +1,17 @@
 config SM
-	bool "Enable Secure Monitor driver support"
+	bool
 
 config MESON_SM
 	bool "Amlogic Secure Monitor driver"
+	depends on ARCH_MESON
 	select SM
 	help
 	  Say y here to enable the Amlogic secure monitor driver.
+
+config SANDBOX_SM
+	bool "Sandbox Secure Monitor driver"
+	depends on SANDBOX
+	select SM
+	help
+	  Say y here to enable the Sandbox driver for the secure monitor
+	  uclass.
drivers/sm/Makefile +2 -2
index da81ee898abf..5ac947350bde 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-y += sm-uclass.o
-obj-$(CONFIG_SANDBOX) += sandbox-sm.o
+obj-$(CONFIG_SM) += sm-uclass.o
+obj-$(CONFIG_SANDBOX_SM) += sandbox-sm.o
 obj-$(CONFIG_MESON_SM) += meson-sm.o
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Tom Rini

The symbol "SM" is a library symbol and should not be prompted for. It should be selected by the drivers that use it. In this case we need to add a SANDBOX_SM symbol for the sandbox driver. The meson SM driver cannot build on other platforms, so add the appropriate dependency.

Quoted 57 lines
---
 configs/sandbox_defconfig |  2 +-
 drivers/sm/Kconfig        | 11 ++++++++++-
 drivers/sm/Makefile       |  4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
configs/sandbox_defconfig +1 -1
index 0c030f4a7925..3ae198e448aa 100644
@@ -320,7 +320,7 @@ CONFIG_RTC_RV8803=y
 CONFIG_RTC_HT1380=y
 CONFIG_SCSI=y
 CONFIG_SANDBOX_SERIAL=y
-CONFIG_SM=y
+CONFIG_SANDBOX_SM=y
 CONFIG_SMEM=y
 CONFIG_SANDBOX_SMEM=y
 CONFIG_SOUND=y
drivers/sm/Kconfig +10 -1
index 926af2863308..8e500ed2ede5 100644
@@ -1,8 +1,17 @@
 config SM
-       bool "Enable Secure Monitor driver support"
+       bool
 
 config MESON_SM
        bool "Amlogic Secure Monitor driver"
+       depends on ARCH_MESON
        select SM
        help
          Say y here to enable the Amlogic secure monitor driver.
+
+config SANDBOX_SM
+       bool "Sandbox Secure Monitor driver"
+       depends on SANDBOX
+       select SM
+       help
+         Say y here to enable the Sandbox driver for the secure monitor
+         uclass.
drivers/sm/Makefile +2 -3
index da81ee898abf..5ac947350bde 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-y += sm-uclass.o
-obj-$(CONFIG_SANDBOX) += sandbox-sm.o
+obj-$(CONFIG_SM) += sm-uclass.o
+obj-$(CONFIG_SANDBOX_SM) += sandbox-sm.o
 obj-$(CONFIG_MESON_SM) += meson-sm.o
--

2.43.0

author
#2 lore raw
In reply to Tom Rini
Quoted 6 lines · Tom Rini

The symbol "SM" is a library symbol and should not be prompted for. It should be selected by the drivers that use it. In this case we need to add a SANDBOX_SM symbol for the sandbox driver. The meson SM driver cannot build on other platforms, so add the appropriate dependency.

Applied to u-boot/next, thanks!

[1/1] sm: Rework the Kconfig logic here

      commit: e2837ecddc244198e3ebeac9ddb18fd439b0131f
Signature · 1 line
Tom