hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
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
38
/*
 * (C) Copyright 2019 Rockchip Electronics Co., Ltd
 *
 * SPDX-License-Identifier:     GPL-2.0+
 */
 
#include <common.h>
#include <command.h>
#include <console.h>
 
static int do_download(cmd_tbl_t *cmdtp, int flag,
              int argc, char * const argv[])
{
   disable_ctrlc(1);
#ifdef CONFIG_CMD_ROCKUSB
   const char *devtype = env_get("devtype");
 
   /*
    * pass partnum ":0" to active 'allow_whole_dev' partition
    * search mechanism on multi storage, where there maybe not
    * valid partition table.
    */
   if (!strcmp("nvme", devtype))
       run_command("rockusb 0 ${devtype} ${devnum}:0", 0);
   else
       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", ""
);