Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added uEnv.txt to specify uboot wait time. #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion u-boot-2021.10/cmd/cvi_vo.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static void dsi_panel_init(void)
}
#endif

static int get_value_from_header(const char *filepath, const char *key, char *buffer, size_t buff_len)
int get_value_from_header(const char *filepath, const char *key, char *buffer, size_t buff_len)
{
#if defined(CONFIG_NAND_SUPPORT) || defined(CONFIG_SPI_FLASH)
const char *storage = "mmc 0:1"; // 假设 FAT 文件在 mmc 0:1
Expand Down
11 changes: 9 additions & 2 deletions u-boot-2021.10/common/autoboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,22 @@ static void process_fdt_options(const void *blob)
#endif /* CONFIG_SYS_TEXT_BASE */
}

extern int get_value_from_header(const char *filepath, const char *key, char *buffer, size_t buff_len);

const char *bootdelay_process(void)
{
char *s;
int bootdelay;

bootcount_inc();

s = env_get("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
char buff[64];
if (0 == get_value_from_header("uEnv.txt", "bootdelay", buff, sizeof(buff))) {
bootdelay = (int)simple_strtol(buff, NULL, 10);
} else {
s = env_get("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
}

if (IS_ENABLED(CONFIG_OF_CONTROL))
bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay",
Expand Down