summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2022-09-02 15:10:46 +0300
committerStefan Roese <sr@denx.de>2022-09-18 11:26:33 +0300
commit29caf9305b6fafe8f6d6b18fa1f825dff8686e61 (patch)
tree6530f6a2373b7af6fb4fdceca823b21f7c79ed7f /common
parent881d4108257a45ac890ef27c523783dbe401e462 (diff)
downloadu-boot-29caf9305b6fafe8f6d6b18fa1f825dff8686e61.tar.xz
cyclic: Use schedule() instead of WATCHDOG_RESET()
Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c4
-rw-r--r--common/board_r.c2
-rw-r--r--common/cli_readline.c4
-rw-r--r--common/console.c2
-rw-r--r--common/dfu.c2
-rw-r--r--common/lcd.c10
-rw-r--r--common/menu.c6
-rw-r--r--common/usb_kbd.c2
-rw-r--r--common/xyzModem.c2
9 files changed, 17 insertions, 17 deletions
diff --git a/common/board_f.c b/common/board_f.c
index deb46be182..f92d7b9faf 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -114,14 +114,14 @@ static int init_func_watchdog_init(void)
hw_watchdog_init();
puts(" Watchdog enabled\n");
# endif
- WATCHDOG_RESET();
+ schedule();
return 0;
}
int init_func_watchdog_reset(void)
{
- WATCHDOG_RESET();
+ schedule();
return 0;
}
diff --git a/common/board_r.c b/common/board_r.c
index 062bc3e688..50670b5615 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -341,7 +341,7 @@ static int initr_flash(void)
/*
* Compute and print flash CRC if flashchecksum is set to 'y'
*
- * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
+ * NOTE: Maybe we should add some schedule()? XXX
*/
if (env_get_yesno("flashchecksum") == 1) {
const uchar *flash_base = (const uchar *)CONFIG_SYS_FLASH_BASE;
diff --git a/common/cli_readline.c b/common/cli_readline.c
index f883b7ffac..f6e2bcdece 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -274,7 +274,7 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
while (!tstc()) { /* while no incoming data */
if (get_ticks() >= etime)
return -2; /* timed out */
- WATCHDOG_RESET();
+ schedule();
}
first = 0;
}
@@ -595,7 +595,7 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
for (;;) {
if (bootretry_tstc_timeout())
return -2; /* timed out */
- WATCHDOG_RESET(); /* Trigger watchdog, if needed */
+ schedule(); /* Trigger watchdog, if needed */
c = getchar();
diff --git a/common/console.c b/common/console.c
index bde9412239..66b9813b3a 100644
--- a/common/console.c
+++ b/common/console.c
@@ -480,7 +480,7 @@ int fgetc(int file)
* Effectively poll for input wherever it may be available.
*/
for (;;) {
- WATCHDOG_RESET();
+ schedule();
if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
/*
* Upper layer may have already called tstc() so
diff --git a/common/dfu.c b/common/dfu.c
index 16bd1ba588..96190889ab 100644
--- a/common/dfu.c
+++ b/common/dfu.c
@@ -101,7 +101,7 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
if (dfu_reinit_needed)
goto exit;
- WATCHDOG_RESET();
+ schedule();
usb_gadget_handle_interrupts(usbctrl_index);
}
exit:
diff --git a/common/lcd.c b/common/lcd.c
index 0898bc025d..a462b22a47 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -294,9 +294,9 @@ void lcd_logo_plot(int x, int y)
BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS);
if (bpix < 12) {
- WATCHDOG_RESET();
+ schedule();
lcd_logo_set_cmap();
- WATCHDOG_RESET();
+ schedule();
for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
memcpy(fb, bmap, BMP_LOGO_WIDTH);
@@ -320,7 +320,7 @@ void lcd_logo_plot(int x, int y)
}
}
- WATCHDOG_RESET();
+ schedule();
lcd_sync();
}
#else
@@ -459,7 +459,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
byte_width = width * 2;
for (i = 0; i < height; ++i) {
- WATCHDOG_RESET();
+ schedule();
for (j = 0; j < width; j++) {
if (bpix != 16) {
fb_put_byte(&fb, &bmap);
@@ -488,7 +488,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
#if defined(CONFIG_BMP_16BPP)
case 16:
for (i = 0; i < height; ++i) {
- WATCHDOG_RESET();
+ schedule();
for (j = 0; j < width; j++)
fb_put_word(&fb, &bmap);
diff --git a/common/menu.c b/common/menu.c
index 0d19601cf5..8fe00965c0 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -435,7 +435,7 @@ void bootmenu_autoboot_loop(struct bootmenu_data *menu,
printf("Hit any key to stop autoboot: %d ", menu->delay);
for (i = 0; i < 100; ++i) {
if (!tstc()) {
- WATCHDOG_RESET();
+ schedule();
mdelay(10);
continue;
}
@@ -483,7 +483,7 @@ void bootmenu_loop(struct bootmenu_data *menu,
if (tstc()) {
c = getchar();
} else {
- WATCHDOG_RESET();
+ schedule();
mdelay(10);
if (tstc())
c = getchar();
@@ -492,7 +492,7 @@ void bootmenu_loop(struct bootmenu_data *menu,
}
} else {
while (!tstc()) {
- WATCHDOG_RESET();
+ schedule();
mdelay(10);
}
c = getchar();
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index d385bea532..4cbc9acb73 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -446,7 +446,7 @@ static int usb_kbd_getc(struct stdio_dev *sdev)
data = usb_kbd_dev->privptr;
while (data->usb_in_pointer == data->usb_out_pointer) {
- WATCHDOG_RESET();
+ schedule();
usb_kbd_poll_for_event(usb_kbd_dev);
}
diff --git a/common/xyzModem.c b/common/xyzModem.c
index a68d392902..fb319f7119 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -68,7 +68,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)
{
ulong now = get_timer(0);
- WATCHDOG_RESET();
+ schedule();
while (!tstc ())
{
if (get_timer(now) > xyzModem_CHAR_TIMEOUT)