diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 288aacc2ddc4ec6928e137ee2279319994969026..b911c0219fab1f27c49d8b90b6a421cbd6e54867 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -17,3 +17,4 @@ CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
+CONFIG_SANDBOX_GPIO=y
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 7b5178a23a4f623b8fddc3ea2520bf9c4fca2d5f..0840a30fbae2439f9a77c7f8d4d8ceb2915c768b 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -14,3 +14,24 @@ config LPC32XX_GPIO
 	default n
 	help
 	  Support for the LPC32XX GPIO driver.
+
+config SANDBOX_GPIO
+	bool "Enable sandbox GPIO driver"
+	depends on SANDBOX && DM && DM_GPIO
+	help
+	  This driver supports some simulated GPIOs which can be adjusted
+	  using 'back door' functions like sandbox_gpio_set_value(). Then the
+	  GPIOs can be inspected through the normal get_get_value()
+	  interface. The purpose of this is to allow GPIOs to be used as
+	  normal in sandbox, perhaps with test code actually driving the
+	  behaviour of those GPIOs.
+
+config SANDBOX_GPIO_COUNT
+	int "Number of sandbox GPIOs"
+	depends on SANDBOX_GPIO
+	default 128
+	help
+	  The sandbox driver can support any number of GPIOs. Generally these
+	  are specified using the device tree. But you can also have a number
+	  of 'anonymous' GPIOs that do not belong to any device or bank.
+	  Select a suitable value depending on your needs.
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 630e5033832fcdf64cf1e1e33e234238a81c250a..5ad4761c720b8bd26e99bfc09137c6629cef7a02 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -51,8 +51,6 @@
 #define CONFIG_SYS_VSNPRINTF
 
 #define CONFIG_CMD_GPIO
-#define CONFIG_SANDBOX_GPIO
-#define CONFIG_SANDBOX_GPIO_COUNT	128
 
 #define CONFIG_CMD_GPT
 #define CONFIG_PARTITION_UUIDS