hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * (C) Copyright 2019 Rockchip Electronics Co., Ltd
 *
 * SPDX-License-Identifier:     GPL-2.0+
 */
 
#include <common.h>
#include <command.h>
#include <console.h>
 
__weak void do_board_download(void)
{
}
 
static int do_download(cmd_tbl_t *cmdtp, int flag,
              int argc, char * const argv[])
{
   disable_ctrlc(1);
 
   /* Allow board specific download, maybe noreturn */
   do_board_download();
 
   /* Generic download */
#ifdef CONFIG_CMD_ROCKUSB
   run_command("rockusb 0 $devtype $devnum", 0);
#endif
   printf("Enter rockusb failed, fallback to bootrom...\n");
   flushc();
   run_command("rbrom", 0);
 
   return 0;
}
 
U_BOOT_CMD_ALWAYS(
   download, 1, 1, do_download,
   "enter rockusb/bootrom download mode", ""
);