Blame view
common/main.c
1.36 KB
c609719b8 Initial revision |
1 2 3 4 |
/* * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * |
1a4596601 Add GPL-2.0+ SPDX... |
5 |
* SPDX-License-Identifier: GPL-2.0+ |
c609719b8 Initial revision |
6 |
*/ |
a6c7ad2f6 * Fix startup pro... |
7 |
/* #define DEBUG */ |
c609719b8 Initial revision |
8 |
#include <common.h> |
66ded17df Move autoboot cod... |
9 |
#include <autoboot.h> |
18d66533a move CLI prototyp... |
10 |
#include <cli.h> |
24b852a7a Move console defi... |
11 |
#include <console.h> |
fbcdf32af main: Correct hea... |
12 |
#include <version.h> |
bdccc4fed * Map ISP1362 USB... |
13 |
|
9272a9b4f m68k: powerpc: Cl... |
14 |
DECLARE_GLOBAL_DATA_PTR; |
fad634071 make show_boot_pr... |
15 16 17 |
/* * Board-specific Platform code can reimplement show_boot_progress () if needed */ |
3422299dc common: main.c: m... |
18 |
__weak void show_boot_progress(int val) {} |
fad634071 make show_boot_pr... |
19 |
|
1364a0e48 Simplify the main... |
20 21 |
static void run_preboot_environment_command(void) { |
bc2b4c27d main: Move boot_d... |
22 |
#ifdef CONFIG_PREBOOT |
1364a0e48 Simplify the main... |
23 |
char *p; |
bc2b4c27d main: Move boot_d... |
24 25 26 27 28 29 30 31 32 33 34 35 36 |
p = getenv("preboot"); if (p != NULL) { # ifdef CONFIG_AUTOBOOT_KEYED int prev = disable_ctrlc(1); /* disable Control C checking */ # endif run_command_list(p, -1, 0); # ifdef CONFIG_AUTOBOOT_KEYED disable_ctrlc(prev); /* restore Control C checking */ # endif } #endif /* CONFIG_PREBOOT */ |
1364a0e48 Simplify the main... |
37 |
} |
affb21562 main: Make the ex... |
38 |
/* We come here after U-Boot is initialised and ready to process commands */ |
1364a0e48 Simplify the main... |
39 40 |
void main_loop(void) { |
affb21562 main: Make the ex... |
41 |
const char *s; |
1364a0e48 Simplify the main... |
42 |
bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop"); |
1364a0e48 Simplify the main... |
43 44 45 |
#ifdef CONFIG_VERSION_VARIABLE setenv("ver", version_string); /* set version variable */ #endif /* CONFIG_VERSION_VARIABLE */ |
c1bb2cd0b main: Hide the hu... |
46 |
cli_init(); |
1364a0e48 Simplify the main... |
47 48 |
run_preboot_environment_command(); |
bc2b4c27d main: Move boot_d... |
49 50 |
#if defined(CONFIG_UPDATE_TFTP) |
c7ff55284 update: tftp: dfu... |
51 |
update_tftp(0UL, NULL, NULL); |
bc2b4c27d main: Move boot_d... |
52 |
#endif /* CONFIG_UPDATE_TFTP */ |
affb21562 main: Make the ex... |
53 54 55 56 57 |
s = bootdelay_process(); if (cli_process_fdt(&s)) cli_secure_boot_cmd(s); autoboot_command(s); |
c1bb2cd0b main: Hide the hu... |
58 |
|
6493ccc7c Split out simple ... |
59 |
cli_loop(); |
045e6f0d4 Panic when no com... |
60 |
panic("No CLI available"); |
c609719b8 Initial revision |
61 |
} |