1 --- a/board/mediatek/mt7622/mt7622_rfb.c
2 +++ b/board/mediatek/mt7622/mt7622_rfb.c
12 +#ifndef CONFIG_RESET_BUTTON_LABEL
13 +#define CONFIG_RESET_BUTTON_LABEL "reset"
16 DECLARE_GLOBAL_DATA_PTR;
19 @@ -19,7 +25,15 @@ int board_init(void)
21 int board_late_init(void)
23 - gd->env_valid = 1; //to load environment variable from persistent store
24 + struct udevice *dev;
27 + ret = !!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev);
30 + ret = !button_get_state(dev);
32 + gd->env_valid = ret; //to load environment variable from persistent store