u-boot-brain/common
Weijie Gao 84b2416b6a board_r: move initr_watchdog to be called after initr_serial
The initr_watchdog is currently placed before initr_serial. The
initr_watchdog calls printf and printf finally calls ops->putc of a serial
driver.

However, gd->cur_serial_dev points to a udevice allocated in board_f. The
gd->cur_serial_dev->driver->ops->putc points the the code region before
relocation.

Some serial drivers call WATCHDOG_RESET() in ops->putc. When DM is enabled
for watchdog, watchdog_reset() is called. watchdog_reset() calls get_timer
to get current timer.

On some platforms the timer driver is also a DM driver. initr_watchdog is
placed right after initr_dm, which means the timer driver hasn't been
initialized. So dm_timer_init() is called. To create a new udevice, calloc
is called.

However start from ops->putc, u-boot execution flow is redirected into the
memory region before relocation (board_f). In board_f, dlmalloc hasn't
been initialized. The call to calloc will fail, and this will cause DM to
print out an error message, and it will call printf again, causing
recursive error outputs.

This patch places initr_watchdog after initr_serial to solve this issue.

Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Tested-by: Suniel Mahesh <sunil.m@techveda.org>
2019-07-07 17:38:17 -04:00
..
eeprom SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
init spl: Add support for passing handoff info to U-Boot proper 2018-11-26 08:25:37 -05:00
spl spl: atf: Fix uninitialized pointer to bl31_image_info 2019-07-02 10:30:02 +08:00
Kconfig common: Fix a typo abnove -> above 2019-06-14 16:10:48 -04:00
Makefile stm32mp1: ram: add interactive mode for DDR configuration 2019-05-23 11:38:11 +02:00
autoboot.c bootcount: Rewrite autoboot to use wrapper functions from bootcount.h 2018-05-10 20:38:25 -04:00
avb_verify.c avb: add support for named persistent values 2019-04-26 18:58:22 -04:00
bedbug.c Consolidate bool type 2013-04-01 16:33:52 -04:00
bloblist.c Add core support for a bloblist to convey data from SPL 2018-11-26 08:25:32 -05:00
board_f.c CONFIG_SPL_SYS_[DI]CACHE_OFF: add 2019-05-18 08:15:35 -04:00
board_info.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
board_r.c board_r: move initr_watchdog to be called after initr_serial 2019-07-07 17:38:17 -04:00
boot_fit.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bootm.c Make FIT support really optional 2019-05-09 19:52:55 -04:00
bootm_os.c riscv: bootm: Support booting VxWorks 2018-12-31 08:08:51 -05:00
bootretry.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bootstage.c bootstage: Allow calling bootstage_mark() before bootstage_init() 2019-04-23 20:26:43 -06:00
bouncebuf.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cli.c main: add new bootstage ID for entering cli loop 2019-04-26 17:51:51 -04:00
cli_hush.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cli_readline.c cli: handle getch error 2018-09-10 20:20:34 -04:00
cli_simple.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
command.c common: command: Add command execution tracer. 2019-04-23 20:26:43 -06:00
common_fit.c common: Compile error with CONFIG_MULTI_DTB_FIT and not SPL 2018-11-09 10:44:50 -05:00
console.c sandbox: Allow puts() output before global_data is set up 2018-11-26 08:25:36 -05:00
cros_ec.c sandbox: cros_ec: exynos: Drop use of cros_ec_get_error() 2018-11-20 19:14:22 -07:00
ddr_spd.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dfu.c usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers 2018-12-07 16:31:45 +01:00
dlmalloc.c malloc: Fix memalign not honoring alignment prior to full malloc init 2019-04-23 17:57:27 -04:00
dlmalloc.src Consolidate bool type 2013-04-01 16:33:52 -04:00
edid.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
exports.c board/ls2085rdb: Export functions for standalone AQ FW load apps 2015-07-20 11:44:37 -07:00
fdt_support.c common: fdt_support: Check mtdparts cell size 2019-05-21 17:33:23 -06:00
flash.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hash.c Roll CRC16-CCITT into the hash infrastructure 2018-12-08 20:18:44 -05:00
hwconfig.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
image-android-dt.c common: image-android-dt: Fix out-of-bounds access 2019-03-22 12:15:18 -04:00
image-android.c image: android: fix 'iminfo' typo 2019-04-24 07:27:32 -04:00
image-fdt.c Various minor sandbox iumprovements 2019-04-24 12:27:29 -04:00
image-fit.c fit: load all fragments from the extra configurations 2019-04-22 18:13:23 -04:00
image-sig.c rsa: reject images with unknown padding 2019-06-21 10:07:11 -04:00
image.c Support boot Android image without address on bootm command 2019-04-22 18:13:22 -04:00
iomux.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
iotrace.c iotrace: fix behaviour when buffer is full 2018-06-18 14:02:04 -04:00
kallsyms.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
kgdb.c Fix spelling of "occurred". 2016-05-02 18:37:09 -04:00
kgdb_stubs.c Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
lcd.c splash: display splash in DM_VIDEO configurations 2019-06-04 23:20:43 +02:00
lcd_console.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lcd_console_rotation.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lcd_simplefb.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
log.c log: Add a Kconfig option to set the default log level 2019-02-20 15:21:44 +08:00
log_console.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lynxkdi.c Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTR 2018-04-27 14:54:48 -04:00
main.c main: Drop more #ifdefs 2018-12-06 23:26:30 -05:00
malloc_simple.c malloc_simple: Add logging of allocations 2018-11-29 09:30:05 -07:00
memsize.c common/memsize.c: Increase save array for supporting memory size > 4GB 2018-07-10 16:55:59 -04:00
menu.c menu: fix timeout duration 2018-06-05 20:19:08 -04:00
miiphyutil.c miiphy: Add function to retrieve MDIO bus list head 2018-10-24 14:45:36 -05:00
s_record.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
splash.c splash: display splash in DM_VIDEO configurations 2019-06-04 23:20:43 +02:00
splash_source.c splash: Load internal and external data from FIT 2019-05-20 11:56:41 +02:00
stdio.c splash: display splash in DM_VIDEO configurations 2019-06-04 23:20:43 +02:00
system_map.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
update.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
usb.c usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/ 2018-11-26 21:19:03 +01:00
usb_hub.c usb: Make portspeed return a read-only string 2019-04-09 13:11:45 +02:00
usb_kbd.c usb: kbd: Properly translate up/down arrow keys 2019-04-14 14:18:48 +02:00
usb_storage.c usb: storage: s/CONFIG_BLK/CONFIG_IS_ENABLED(BLK)/ 2018-11-26 21:19:04 +01:00
xyzModem.c xyz-modem: Fix timeout loop waiting with WATCHDOG 2019-01-15 15:28:51 -05:00