1 --- a/board/mediatek/mt7622/mt7622_rfb.c
2 +++ b/board/mediatek/mt7622/mt7622_rfb.c
12 #include <asm/global_data.h>
14 +#ifndef CONFIG_RESET_BUTTON_LABEL
15 +#define CONFIG_RESET_BUTTON_LABEL "reset"
18 DECLARE_GLOBAL_DATA_PTR;
21 @@ -20,7 +27,15 @@ int board_init(void)
23 int board_late_init(void)
25 - gd->env_valid = 1; //to load environment variable from persistent store
26 + struct udevice *dev;
29 + ret = !!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev);
32 + ret = !button_get_state(dev);
34 + gd->env_valid = ret; //to load environment variable from persistent store