Commit 9551b6ef authored by Jamie McCrae's avatar Jamie McCrae Committed by Dominik Ermel
Browse files

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: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent dc8ef879
Loading
Loading
Loading
Loading
+0 −25
Changes for boot/zephyr/Kconfig: 0 added lines, 25 removed lines.
Original line number Diff line number Diff line
@@ -443,31 +443,6 @@ config BOOT_USB_DFU_WAIT_DELAY_MS

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
+0 −26
Changes for boot/zephyr/Kconfig.serial_recovery: 0 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -85,32 +85,6 @@ config BOOT_SERIAL_MAX_RECEIVE_SIZE
	  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
+0 −3
Changes for boot/zephyr/boards/conexio_stratus.conf: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -11,9 +11,6 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256

# 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

+2 −40
Changes for boot/zephyr/main.c: 2 added lines, 40 removed lines.
Original line number Diff line number Diff line
@@ -400,39 +400,9 @@ void zephyr_boot_log_stop(void)

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 @@ static bool detect_pin(void)
    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");