aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-04-29 02:06:09 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-05-07 22:50:15 +0100
commitaf3a1adee063fa31cc05649f718f6ef2488a5232 (patch)
tree7009e833c14d8ba332ed52265ec9c715a8a7313f /package/boot/uboot-mediatek/patches/300-mt7622-generic-reset-button-ignore-env.patch
parentcde31976e37513cf2977e6d4b691f561344e61ed (diff)
downloadupstream-af3a1adee063fa31cc05649f718f6ef2488a5232.tar.gz
upstream-af3a1adee063fa31cc05649f718f6ef2488a5232.tar.bz2
upstream-af3a1adee063fa31cc05649f718f6ef2488a5232.zip
uboot-mediatek: unifi-6-lr: fix erase of production parition
mtd erase needs to be aligned with erase blocks. Use padded image size for erasing the production volume. As the environment grew above the current size of 0x1000 bytes by introducing the new padding function, increase the env size to 0x4000. While at it, clean up reset button function to work to more reliable on that board. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
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.patch15
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;
}