boot: zephyr: Remove deprecated GPIO Kconfig entries

Removes the old deprecated Kconfig items for configuring GPIO ports
and pins for entering serial recovery/USB DFU mode. These were
deprecated almost a year ago and should not be used as device tree
has long replaced them.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig
index ed84a12..a583fbe 100644
--- a/boot/zephyr/Kconfig
+++ b/boot/zephyr/Kconfig
@@ -443,31 +443,6 @@
 
 if BOOT_USB_DFU_GPIO
 
-config BOOT_USB_DFU_DETECT_PORT
-	string "GPIO device to trigger USB DFU mode (DEPRECATED)"
-	default GPIO_0 if SOC_FAMILY_NRF
-	help
-	  Zephyr GPIO device that contains the pin used to trigger
-	  USB DFU.
-
-config BOOT_USB_DFU_DETECT_PIN
-	int "Pin to trigger USB DFU mode (DEPRECATED)"
-	default 6 if BOARD_NRF9160DK_NRF9160
-	default 11 if BOARD_NRF52840DK_NRF52840
-	default 13 if BOARD_NRF52DK_NRF52832
-	default 23 if BOARD_NRF5340_DK_NRF5340_CPUAPP || BOARD_NRF5340_DK_NRF5340_CPUAPP_NS
-	default 43 if BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS
-	default -1
-	help
-	  Pin on the DFU detect port that triggers DFU mode.
-
-config BOOT_USB_DFU_DETECT_PIN_VAL
-	int "USB DFU detect pin trigger value (DEPRECATED)"
-	default 0
-	range 0 1
-	help
-	  Logic value of the detect pin that triggers USB DFU mode.
-
 config BOOT_USB_DFU_DETECT_DELAY
 	int "Serial detect pin detection delay time [ms]"
 	default 0
diff --git a/boot/zephyr/Kconfig.serial_recovery b/boot/zephyr/Kconfig.serial_recovery
index aba2d58..b48ee9b 100644
--- a/boot/zephyr/Kconfig.serial_recovery
+++ b/boot/zephyr/Kconfig.serial_recovery
@@ -85,32 +85,6 @@
 	  by the number of receive buffers, BOOT_LINE_BUFS to allow for
 	  optimal data transfer speeds).
 
-config BOOT_SERIAL_DETECT_PORT
-	string "GPIO device to trigger serial recovery mode (DEPRECATED)"
-	default GPIO_0 if SOC_FAMILY_NRF
-	help
-	  Zephyr GPIO device that contains the pin used to trigger
-	  serial recovery mode.
-
-config BOOT_SERIAL_DETECT_PIN
-	int "Pin to trigger serial recovery mode (DEPRECATED)"
-	default 6 if BOARD_NRF9160DK_NRF9160
-	default 11 if BOARD_NRF52840DK_NRF52840
-	default 13 if BOARD_NRF52DK_NRF52832 || BOARD_NRF52833DK_NRF52833
-	default 23 if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPP_NS || \
-		BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
-	default -1
-	help
-	  Pin on the serial detect port that triggers serial recovery mode.
-
-config BOOT_SERIAL_DETECT_PIN_VAL
-	int "Serial detect pin trigger value (DEPRECATED)"
-	default 0
-	range 0 1
-	help
-	  Logic value of the detect pin that triggers serial recovery
-	  mode.
-
 config BOOT_SERIAL_DETECT_DELAY
 	int "Serial detect pin detection delay time [ms]"
 	default 0
diff --git a/boot/zephyr/boards/conexio_stratus.conf b/boot/zephyr/boards/conexio_stratus.conf
index 6bc5f8c..5a29000 100644
--- a/boot/zephyr/boards/conexio_stratus.conf
+++ b/boot/zephyr/boards/conexio_stratus.conf
@@ -11,9 +11,6 @@
 
 # MCUboot serial recovery
 CONFIG_MCUBOOT_SERIAL=y
-CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0"
-CONFIG_BOOT_SERIAL_DETECT_PIN=12
-CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0
 CONFIG_BOOT_SERIAL_DETECT_DELAY=450
 CONFIG_MCUBOOT_INDICATION_LED=y
 
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index 09ac1d9..5412796 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -400,39 +400,9 @@
 
 static const struct gpio_dt_spec button0 = GPIO_DT_SPEC_GET(BUTTON_0_NODE, gpios);
 
-#else /* fallback to legacy configuration */
+#elif defined(CONFIG_MCUBOOT_SERIAL) || defined(CONFIG_BOOT_USB_DFU_GPIO)
 
-#if defined(CONFIG_MCUBOOT_SERIAL)
-
-/* The value of -1 is used by default. It must be properly specified for a board before used. */
-BUILD_ASSERT(CONFIG_BOOT_SERIAL_DETECT_PIN != -1);
-
-#define BUTTON_0_GPIO_LABEL CONFIG_BOOT_SERIAL_DETECT_PORT
-#define BUTTON_0_GPIO_PIN CONFIG_BOOT_SERIAL_DETECT_PIN
-#define BUTTON_0_GPIO_FLAGS ((CONFIG_BOOT_SERIAL_DETECT_PIN_VAL) ?\
-                                (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN) :\
-                                (GPIO_ACTIVE_LOW | GPIO_PULL_UP))
-
-#elif defined(CONFIG_BOOT_USB_DFU_GPIO)
-
-/* The value of -1 is used by default. It must be properly specified for a board before used. */
-BUILD_ASSERT(CONFIG_BOOT_USB_DFU_DETECT_PIN != -1);
-
-#define BUTTON_0_GPIO_LABEL CONFIG_BOOT_USB_DFU_DETECT_PORT
-#define BUTTON_0_GPIO_PIN CONFIG_BOOT_USB_DFU_DETECT_PIN
-#define BUTTON_0_GPIO_FLAGS ((CONFIG_BOOT_USB_DFU_DETECT_PIN_VAL) ?\
-                                (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN) :\
-                                (GPIO_ACTIVE_LOW | GPIO_PULL_UP))
-
-#endif
-
-#define BUTTON_0_LEGACY 1
-
-static struct gpio_dt_spec button0 = {
-	.port = NULL,
-	.pin = BUTTON_0_GPIO_PIN,
-	.dt_flags = BUTTON_0_GPIO_FLAGS
-};
+#error "Serial recovery/USB DFU button must be declared in device tree as 'mcuboot_button0'"
 
 #endif
 
@@ -441,18 +411,10 @@
     int rc;
     int pin_active;
 
-#ifdef BUTTON_0_LEGACY
-    button0.port = device_get_binding(BUTTON_0_GPIO_LABEL);
-    if (button0.port == NULL) {
-        __ASSERT(false, "Error: Bad port for boot detection.\n");
-        return false;
-    }
-#else
     if (!device_is_ready(button0.port)) {
         __ASSERT(false, "GPIO device is not ready.\n");
         return false;
     }
-#endif
 
     rc = gpio_pin_configure_dt(&button0, GPIO_INPUT);
     __ASSERT(rc == 0, "Failed to initialize boot detect pin.\n");