Remove upstreamed patches: 001-pinctrl-mediatek-MT7981-fix-GPIO9-register-map.patch [1] 010-clk-mediatek-mt7622-fix-infracfg-and-pericfg-clock-o.patch [2] We also need to backport two new patches from v2026.07-rc2 to address the yaml build error[3] and MT7621 boot issue[4]. [1] https://github.com/u-boot/u-boot/commit/a1d1fc8d8c8699d80e1b9ab3214752e5882d3740 [2] https://github.com/u-boot/u-boot/commit/52d84fccfd7d8b99e91a70192eec8e0379d63b4b [3] https://github.com/u-boot/u-boot/commit/8ef8dee4f3a2b2021decfefd853dbd2a1632b77f [4] https://github.com/u-boot/u-boot/commit/de79075f0f6b8795d1f9e30ff36435583b1a119a Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
63 lines
1.3 KiB
Diff
63 lines
1.3 KiB
Diff
--- a/board/mediatek/mt7622/mt7622_rfb.c
|
|
+++ b/board/mediatek/mt7622/mt7622_rfb.c
|
|
@@ -5,9 +5,16 @@
|
|
*/
|
|
|
|
#include <config.h>
|
|
+#include <dm.h>
|
|
+#include <button.h>
|
|
#include <env.h>
|
|
#include <init.h>
|
|
#include <asm/global_data.h>
|
|
+#include <linux/delay.h>
|
|
+
|
|
+#ifndef CONFIG_RESET_BUTTON_LABEL
|
|
+#define CONFIG_RESET_BUTTON_LABEL "reset"
|
|
+#endif
|
|
|
|
#include <mtd.h>
|
|
#include <linux/mtd/mtd.h>
|
|
@@ -16,6 +23,28 @@
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
+int board_late_init(void)
|
|
+{
|
|
+ struct udevice *dev;
|
|
+
|
|
+ if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) {
|
|
+ puts("reset button found\n");
|
|
+#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY
|
|
+ if (CONFIG_RESET_BUTTON_SETTLE_DELAY > 0) {
|
|
+ button_get_state(dev);
|
|
+ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY);
|
|
+ }
|
|
+#endif
|
|
+ if (button_get_state(dev) == BUTTON_ON) {
|
|
+ puts("button pushed, resetting environment\n");
|
|
+ gd->env_valid = ENV_INVALID;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ env_relocate();
|
|
+ return 0;
|
|
+}
|
|
+
|
|
int board_nmbm_init(void)
|
|
{
|
|
#ifdef CONFIG_ENABLE_NAND_NMBM
|
|
--- a/arch/arm/mach-mediatek/Kconfig
|
|
+++ b/arch/arm/mach-mediatek/Kconfig
|
|
@@ -173,4 +173,11 @@ config MTK_TZ_MOVABLE
|
|
select OF_SYSTEM_SETUP
|
|
bool
|
|
|
|
+config RESET_BUTTON_LABEL
|
|
+ string "Button to trigger factory reset"
|
|
+ default "reset"
|
|
+
|
|
+config RESET_BUTTON_SETTLE_DELAY
|
|
+ int "Delay to wait for button to settle"
|
|
+ default 0
|
|
endif
|