$(call echo_yellow, GPIO reset button:\tnot specified) \
)
- $(if $(filter $(5),1),
- $(call echo_yellow, Button active low:\tyes), \
- $(call echo_yellow, Button active low:\tno) \
+ $(if $(5),
+ $(if $(filter $(5),1),
+ $(call echo_yellow, Button active low:\tyes), \
+ $(call echo_yellow, Button active low:\tno) \
+ ), \
+ $(call echo_yellow, Button active low:\tn/a) \
)
$(if $(filter $(COMPRESSED_UBOOT),1), \
*/
int reset_button_status(void)
{
-#ifdef CONFIG_GPIO_RESET_BTN
+#if defined(CONFIG_GPIO_RESET_BTN)
u32 gpio;
gpio = qca_soc_reg_read(QCA_GPIO_IN_REG);
* button && echo pressed!
* button || echo not pressed!
*/
-#if defined(CONFIG_CMD_BUTTON)
+#if defined(CONFIG_CMD_BUTTON) &&\
+ defined(CONFIG_GPIO_RESET_BTN)
int do_button(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
#if defined(CFG_HUSH_PARSER)
U_BOOT_CMD(button, 1, 1, do_button,
"get reset button status\n", NULL);
-#endif /* CONFIG_CMD_BUTTON */
+#endif /* CONFIG_CMD_BUTTON && CONFIG_GPIO_RESET_BTN */
/*
* Allows to delay execution
char *bootcmd;
int rc = 0;
-#if defined(CONFIG_BTN_RECOVERY_SCRIPT)
+#if defined(CONFIG_BTN_RECOVERY_SCRIPT) &&\
+ defined(CONFIG_GPIO_RESET_BTN)
int stop_boot;
char *c;
#endif
#endif
/* Recovery mode before normal boot */
-#if defined(CONFIG_BTN_RECOVERY_SCRIPT)
+#if defined(CONFIG_BTN_RECOVERY_SCRIPT) &&\
+ defined(CONFIG_GPIO_RESET_BTN)
if (reset_button_status()) {
#if defined(CONFIG_SILENT_CONSOLE)
if (gd->flags & GD_FLG_SILENT) {
printf_err("recovery script is missing in env!\n\n");
}
}
-#endif /* CONFIG_RECOVERY_MODE */
+#endif /* CONFIG_BTN_RECOVERY_SCRIPT && CONFIG_GPIO_RESET_BTN */
#if defined(CONFIG_BOOTDELAY) &&\
(CONFIG_BOOTDELAY >= 0)
/*
* Recovery
*/
-#if defined(CONFIG_BTN_RECOVERY_SCRIPT)
+#if defined(CONFIG_BTN_RECOVERY_SCRIPT) &&\
+ defined(CONFIG_GPIO_RESET_BTN)
#if !defined(CONFIG_CMD_BUTTON) ||\
!defined(CONFIG_CMD_SLEEP) ||\
#error "Commands setexpr, itest, sleep, button and led{on, off} are required for recovery"
#endif
- #if !defined(CONFIG_GPIO_RESET_BTN)
- #error "Reset button definition is required for recovery"
- #endif
-
#if defined(CONFIG_CMD_HTTPD)
#define SCRIPT_HTTP_PART_1 \
"echo - 3s for web based recovery;"
"setenv cnt;" \
"fi\0"
-#endif /* CONFIG_BTN_RECOVERY_SCRIPT */
+#endif /* CONFIG_BTN_RECOVERY_SCRIPT && CONFIG_GPIO_RESET_BTN */
#endif /* _ENV_SCRIPTS_H_ */