arm-trusted-firmware-mediatek: update to v2.7+ from MediaTek
[openwrt/staging/stintel.git] / package / boot / arm-trusted-firmware-mediatek / patches / 0002-mediatek-mt7622-initialize-watchdog-after-DDR-init.patch
1 From 2a012775b3ab6e72091c8be1c2d4bf5972407eb5 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Sat, 27 Aug 2022 21:38:33 +0100
4 Subject: [PATCH] mediatek: mt7622: initialize watchdog after DDR init
5
6 Initializing the WDT before memory calibration breaks reboot at least
7 on some MT7622 boards like the Bananapi BPi-R64:
8 NOTICE: BL2: v2.7(release):OpenWrt v2022-08-18-9c9c4994-2 (mt7622-emmc-2ddr)
9 NOTICE: BL2: Built : 04:00:25, Aug 27 2022
10 ERROR: Cannot find any pass-window
11 ERROR: no DATLAT taps pass, DATLAT calibration fail!
12 ERROR: DATLAT calibration fail, write back to 20!
13 ERROR: EMI: complex R/W mem test failed: -2
14
15 Move watchdog initialization to happen only after memory initialization
16 has completed to avoid the problem.
17
18 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 ---
20 plat/mediatek/mt7622/bl2_plat_setup.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 --- a/plat/mediatek/mt7622/bl2_plat_setup.c
24 +++ b/plat/mediatek/mt7622/bl2_plat_setup.c
25 @@ -277,7 +277,6 @@ void bl2_platform_setup(void)
26 plat_mt_cpuxgpt_init();
27 generic_delay_timer_init();
28
29 - mtk_wdt_init();
30 mtk_pin_init();
31 #ifndef USING_BL2PL
32 mtk_pll_init();
33 @@ -285,6 +284,7 @@ void bl2_platform_setup(void)
34 mtk_pwrap_init();
35 mtk_pmic_init();
36 mtk_mem_init();
37 + mtk_wdt_init();
38
39 mtk_io_setup();
40 }