diff options
Diffstat (limited to 'package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch')
-rw-r--r-- | package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch b/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch index 8b38248757..e794e0a0db 100644 --- a/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch +++ b/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch @@ -17,7 +17,7 @@ DECLARE_GLOBAL_DATA_PTR; -@@ -20,7 +27,19 @@ int board_init(void) +@@ -20,7 +27,20 @@ int board_init(void) int board_late_init(void) { @@ -25,16 +25,17 @@ + struct udevice *dev; + int ret; + -+ ret = !!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev); -+ -+ if (!ret) { ++ if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) { ++ puts("reset button found\n"); +#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY -+ udelay(1000 * CONFIG_RESET_BUTTON_SETTLE_DELAY); ++ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY); +#endif -+ ret = !button_get_state(dev); ++ if (button_get_state(dev) == BUTTON_ON) { ++ puts("button pushed, resetting environment\n"); ++ gd->env_valid = ENV_INVALID; ++ } + } + -+ gd->env_valid = ret; //to load environment variable from persistent store env_relocate(); return 0; } |