Commit Graph

49 Commits

Author SHA1 Message Date
Andrey Zhizhikin 1fcb783fdc Prepare v2021.07
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDjIUMACgkQFHw5/5Y0
 tyyEuQv9G2grWGZ8ySREjJdkScNmmu9LUjTlkmmcMA/SovnevG9qx/R1gCRJpl77
 bFGqUK6TYAByAzd+7HXPo9EGNGkA9uweD5uD5s+xbUdLfkcF1Eit3cmhd13AfZfO
 aoGlgPl6kaboht+wwcj8UWPVBuly/wyce7//bqf+4Goo4uVM9c1Rkmp2QZLi7lCP
 WeU92Le6b6+Sq9CBJpyooZvBKsbvu0EEvmw/inFyVzS1ScHRVNPWbnhQYq1axqlw
 H0AdNlJUW+L9vr+GSvJdnBeP8UsvZXG/Wk4GKjivtjA2+b7ZgQhFj0ek0R4MPNhe
 8bq3yMDVaY5ul8bQa6hMbzlPW3DiEhXe1hTdSPHHwOiZaVFJ2txsASVxwpb/nFf0
 S1y55NaVBJOLy2ueGMfijdFrvIsToYGwo+zek2q/YxYL0beFoMFaroR8c0VBBnVE
 sc9DOzdN69tssX8SkWHEkdVGaviOsRoP2SGw8erCezv+GroLfKBPMIXR3CTZyBEM
 buht72sv
 =BxIW
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdQaENiSDAlGTDEbB7G51OISzHs0FAmDkFuMACgkQ7G51OISz
 Hs0J7RAAlG26jJV+8y+EzINaPQvmxxtKcpXqJJw02aIinbgU5+jf6n7KGETzKvW1
 Rgh6ExLYiefJcUkdpQCM7LmRJtIPu/G5rMA06z6H42Opf2AuRBGwlSuysLn6z+SU
 cztc9nxLKP8xMlf2E9PuVG6tmv39gB9qEF14jv0gU9fjh8vbVpbWY69WD8DTdRsm
 WPkIVlgNS2kvTYh0dF//0Ir+QVGcYjbtAbRGhcj+VCpk9Mv7B5uSr3qBuxEBhW6U
 OWBgyRay5yPTmUnWX1iT9wwFyNJ3tQEo+kWkcoq5WCWK7AayQA+DndgUu6fYJPx6
 EF7/ppipyF0CD0eH9fQEOsdW8QNjULHa3KEM0RcM5Zb3NrwJV8LoDNSVzT34Z+eh
 UzNhbcAZUhZswlX50u8tr4r9wc0xfaULpXy1vv4KAWoZkxjtaSvQTbw1lkf5d6hK
 7UMZKbtSqaGntZAEyZC5Hb4vTHHGfvANzsVTD4nJ6QjLDuwOq/w9SUvjz8yUmhtX
 o/ujlZBo61BI9zwtIEDOhO8wYE/sOB9i7tkden2aen2zAlSW5/HFPUfvRcr3KO4D
 4Qwo7baRLmJJvn9BTmmFLphZ2IIHfyUg2OwyINZeXO0KtGjX2q3x492jhtCjmVi/
 1oqsqUb6heklRqZMnCJwgJrYNNXYRfiypSKbGGTTuuRGVwPyvGQ=
 =P5k7
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07' into 2021.07+fslc

Prepare v2021.07

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-07-06 08:40:00 +00:00
Da Xue 760d2f9e9e autoboot: fix MENUKEY
replace CONFIG_AUTOBOOT_USE_MENUKEY with CONFIG_AUTOBOOT_MENUKEY

Signed-off-by: Da Xue <da@libre.computer>
2021-07-02 15:03:53 -04:00
Andrey Zhizhikin 73fb2c32f7 Prepare v2021.07-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDaJXgACgkQFHw5/5Y0
 tyySmwwAkW7GVAv+bXSd+8u1IsScl0QrSCoBdfHpdMcAME3gZmXqxClxskfbYJR/
 3IByQFlsn7j8HruR/49+etk0i0Pc4HNfynTLuAy+77/lh+h3Pnru/VPBhQqR7KW0
 NN5STn91QWLl74vRmx5wmEfSMhg7LTE1US8Rh6UXAd2dAiPd+hUawIR9D0Pq5Gzm
 nn7HvamDYspFUgSYYl8h1RtRQ9VqAFpnnPphpLkvX6323uCQwccXu5pnj1fLfGfj
 iO2Q+bDcwpEdUosox/LM1BdMoaSA+opOjk/e72y9V84+Jk6D+Jn5zQEpF5TJnTyI
 Yi2+NuJWS5xFWk1dnJrbGt0HpWM2oO12dZZ7eYy/FdsPJiWAS0ppRuxHVb868vjD
 ulca7acFPUjGyo3vBw1S0iVmPCBFGHBoyg3QLrUHYbpISeBeoa2w2cDxQl90ahw/
 TgRx+yutKfwkBPfILwDylNOgCGRwvLfroRyMEMiQ3gTSOCBmBX/yMv1k8tb9ZvPZ
 /WVsK6dw
 =F7x1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdQaENiSDAlGTDEbB7G51OISzHs0FAmDbKXIACgkQ7G51OISz
 Hs0VJw/+LRufCgQnZ2OsEE2y9cgMDECvFuiprmOCeCD4+z8vitrWhYhd/dv39LLQ
 C8ONhHdCbIsw1ivyKeD2ir8O2DU28a0C0x/zHplwtrL9pFd6XVbj9flf8GBi9FR3
 21y75kvwKScNIJ1iSGxwzcbVTr5VO3rfshDOoH6m68gHc4uqEUG0sZDooUydm1kp
 Xhtsbc5ew/2DbCrdPV0qrUDQ59uKck8jGXKRoKlJBHrL3MOBKExx2epql0Igiv9R
 TAunyiCdTzWF+B0OVY/JWTuu5cHCpYJdp/wV7aP/1lKeFj7W81qc+AyynnXld0hh
 mzxgl3Xl4Uh3nvMXU0+3FU53HuxCgCHfbIStNejedFqtXsA+QGOzpXaB65ZpNThI
 PDBNleGlWJdeDTYDj6XMP6mN4UwbHSoKHnrtfEpJBFVewjJ/qMV39+FPWVcfQvqb
 uZ+/UzUwnkOfS8yew97McfMJJwRLDZZwAMa/8RtoeUxutdLONJwGH2+z6fpHA5+B
 M7J83J7ygDJ9S4Lj3yHwGsXwFaIJNUyApnxnuS0kJY49AoPe1VGyPxvtcFVSkeMl
 dT/OQ5tbaLbr+6knkSoInQ0rYsTDcuj+RHz7sTth91t+vTbyOY0zq4zarhV18i6p
 /8f3jospJraK1ZDGAN4KniHvE/QsKJKJNv2yrkqS9tTQYjEKInM=
 =Vcvn
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07-rc5' into 2021.07+fslc

Prepare v2021.07-rc5

Conflicts (manual resolve):
- configs/imx8mm_evk_defconfig:
- configs/imx8mn_ddr4_evk_defconfig:
- configs/imx8mn_evk_defconfig:
- configs/imx8mp_evk_defconfig:
Drop our local change, which are incuded in the commit 2bba78076b
("configs: Resync with savedefconfig") from upstream.

- configs/mx6sabresd_defconfig:
Merge changes from commit 2f7d3890b6 ("mx6sabre_common: Dynamically
change the video output") with upstream commit 2bba78076b ("configs:
Resync with savedefconfig").

Link: https://lore.kernel.org/u-boot/20210628194137.GU9516@bill-the-cat/
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-06-29 14:03:31 +00:00
Da Xue 5a87df8380 autoboot: fix typos of CONFIG_AUTOBOOT_USE_MENUKEY
Replace typo CONFIG_USE_AUTOBOOT_MENUKEY with
CONFIG_AUTOBOOT_USE_MENUKEY as when they were introduced initially there
was some mismatch in which name was used where.

Fixes: 8fc31e23aa ("autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY")
Signed-off-by: Da Xue <da@libre.computer>
2021-06-22 14:01:22 -04:00
Ye Li 560a81e9cb MLK-21854-2 imx: uuu: Update autoboot to run uuu or fastboot
When booting from USB device, change u-boot autoboot to default
run UUU bootcmd or enter fastboot directly for android.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit eba8710106348a283940b851080b049bc7fbe466)
(cherry picked from commit decfa984826db8ae39e93f2968b8a04d009eef0d)
2021-05-02 14:22:43 -03:00
Simon Glass 401d1c4f5d common: Drop asm/global_data.h from common header
Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-02 15:33:42 -05:00
Yuezhang.Mo@sony.com e088f0c3d8 autoboot: fix illegal memory access when stop key and delay key are empty
If both stop key and delay key are empty, the length of these
keys is 0. The subtraction operation will cause the u_int type
variable to overflow, will cause illegal memory access in key
input loop.

This commit fixes this bug by using int type instead of u_init.
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-01-27 17:07:48 -05:00
Joel Peshkin 652b504ff2 Add optional salt to AUTOBOOT_STOP_STR_SHA256
Adds an optional SALT value to AUTOBOOT_STOP_STR_SHA256.   If a string
followed by a ":" is prepended to the sha256, the portion to the left
of the colon will be used as a salt and the password will be appended
to the salt before the sha256 is computed and compared.

Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Joel Peshkin <joel.peshkin@broadcom.com>
To: u-boot@lists.denx.de
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2021-01-16 14:49:09 -05:00
Heinrich Schuchardt c670aeee3d common: rename getc() to getchar()
The sandbox is built with the SDL2 library with invokes the X11 library
which in turn calls getc(). But getc() in glibc is defined as

    int getc(FILE *)

This does not match our definition.

    int getc(void)

The sandbox crashes when called with parameter -l.

Rename our library symbol getc() to getchar().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22 09:54:53 -04:00
Heiko Schocher 6ebe6b387f common, autoboot: sync functionality with Kconfig description
add back again special case: -2
autoboot with no delay and no check for abort

as described in Kconfig option, see common/Kconfig
help text for option BOOTDELAY.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22 09:54:53 -04:00
Simon Glass c05ed00afb common: Drop linux/delay.h from common header
Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 21:19:23 -04:00
Simon Glass f7ae49fc4f common: Drop log.h from common header
Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 21:19:18 -04:00
Simon Glass 336d4615f8 dm: core: Create a new header file for 'compat' features
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass 288b29e44d common: Move command functions out of common.h
Move these functions into the command.h header file which is a better fit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:25:02 -05:00
Simon Glass 1045315df0 common: Move get_ticks() function out of common.h
This function belongs in time.h so move it over and add a comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:23:13 -05:00
Simon Glass c7694dd483 env: Move env_set_hex() to env.h
Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11 16:43:41 -04:00
Heiko Schocher ecaae801d6 autoboot: fix bug using with CAAM and AUTOBOOT_ENCRYPTION
if  CONFIG_AUTOBOOT_KEYED, CONFIG_AUTOBOOT_ENCRYPTION and
CONFIG_AUTOBOOT_STOP_STR_SHA256 are enabled in conjunction
with CONFIG_SHA_HW_ACCEL and CONFIG_FSL_CAAM, we get the
Error when pressing a key while waiting for bootdelay:

Error: Address arguments are not aligned
CAAM was not setup properly or it is faulty

Reason is, that used variables are not cache aligned,
so malloc this variables cache aligned.

Probably this is also a bugfix for other hw accelerators
than CAAM.

Signed-off-by: Heiko Schocher <hs@denx.de>
2019-08-07 15:31:02 -04:00
Simon Glass 5ec35ff3eb autoboot: Adjust the implementation in autoboot_command()
Avoid use of #ifdef and keep the common condion in a variable. This makes
the code easier to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 5fa3fd25ed autoboot: Move a few more options from #ifdef to if()
Adjust some of the code which can be trivially moved to use IS_ENABLED()
instead of #ifdef.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass e231306e48 autoboot: Rename CONFIG_MENU_SHOW to include AUTOBOOT
Rename this option to CONFIG_AUTOBOOT_MENU_SHOW this it relates to the
autoboot functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass d915ad277a autoboot: Tidy up use of menukey
Move the variable to the top of the file and adjust the code which uses it
to use if() rather than #ifdef, to make it easier to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 8fc31e23aa autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY
Since this is part of the autoboot functionality, it makes sense to name
it with an AUTOBOOT prefix. No mainline boards use it so this should be
safe, and downstream boards will need to adjust.

Since this option is just an integer value, it really needs another option
to control whether the feature is enabled or not. Add a new
CONFIG_USE_AUTOBOOT_MENUKEY for that. This fits better with how things are
done with Kconfig, avoiding the need to use a specific value to disable
the feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 2452bb7636 autoboot: Drop unused CONFIG_MENUPROMPT
This is not defined by any board. We could use CONFIG_AUTOBOOT_PROMPT
instead perhaps, but this depends on CONFIG_AUTOBOOT_KEYED which is not
used for the single-key case.

So let's just remove CONFIG_MENUPROMPT.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass e79e4b250a autoboot: Drop #ifdef CONFIG_AUTOBOOT_KEYED
At present we have two functions named __autoboot() which do different
things. This is confusing. Fix it by using if() instead of #ifdef for
selecting the functions, and renaming them to meaningful names.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 42b4d14e34 autoboot: Use if() for CONFIG_SILENT_CONSOLE
Avoid an #ifdef in this function, to improve readability.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 88fa4beb63 autoboot: Improve docs for CONFIG_AUTOBOOT_ENCRYPTION
This option is not documented properly at present. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass e8c780560a autoboot: Drop #ifdef for CONFIG_AUTOBOOT_ENCRYPTION
Use if() instead for this option, renaming the two different
passwd_abort() functions to indicate their purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Simon Glass 0c4bd318f5 autoboot: Use CONFIG_AUTOBOOT_STOP_STR_SHA256 indirectly
This CONFIG option is only present if CONFIG_AUTOBOOT_ENCRYPTION is
enabled so it cannot be used in code without that #ifdef. But we want to
reduce the use of #ifdef in this file and in particular to avoid having
two different functions both named passwd_abort() but which do different
things.

In preparation for this, create an intermediate value which is set to an
empty string if there is no value for CONFIG_AUTOBOOT_STOP_STR_SHA256.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02 11:19:14 -04:00
Lukasz Majewski bc8c440fa4 bootcount: Rewrite autoboot to use wrapper functions from bootcount.h
The code has been refactored to use common wrappers from bootcount.h
header.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-05-10 20:38:25 -04:00
Tom Rini 83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07 09:34:12 -04:00
Martin Etnestad 2d06fd839d Initialize SHA buffer size var in passwd_abort
The call to hash_block in passwd_abort fails with error ENOSPC on some
systems. The reason is that the variable which specifies the size of the
buffer to contain the computed hash does not get initialized.

This patch initializes the variable with the size of the buffer.

Signed-off-by: Martin Etnestad <martin.etnestad@appeartv.com>
2018-01-28 09:36:28 -05:00
Simon Glass bfebc8c965 env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()
We are now using an env_ prefix for environment functions. Rename these
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:32 -04:00
Simon Glass 00caae6d47 env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:24 -04:00
Simon Glass 018f530323 env: Rename common functions related to setenv()
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:23:32 -04:00
Masahiro Yamada 4632739202 autoboot: move bootdelay >= 0 check to abortboot()
Move the bootdelay >= 0 check to the caller, which simplifies
the callees.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01 17:42:56 -04:00
Masahiro Yamada 09b9d9e55f autoboot: move CONFIG_SILENT_CONSOLE handling
Factor out the same code from the callees to the caller.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01 17:42:56 -04:00
Masahiro Yamada d8da8298ad autoboot: rename abortboot_{keyed, normal} to __abortboot
Because abortboot_keyed() and abortboot_normal() are not compiled
at the same time, we can rename both of them to __abortboot().
This allows to drop #ifdef from the caller.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01 17:42:55 -04:00
Masahiro Yamada 2fbb8462b0 autoboot: remove CONFIG_ZERO_BOOTDELAY_CHECK
As the help message of CONFIG_BOOTDELAY says, CONFIG_BOOTDELAY=-2
means the autoboot with no delay, with no abort check even if
CONFIG_ZERO_BOOTDELAY_CHECK is defined.

To sum up, the autoboot behaves as follows:

 [1] CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=y
    autoboot with no delay, but you can abort it by key input

 [2] CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=n
    autoboot with no delay, with no check for abort

 [3] CONFIG_BOOTDELAY=-1
    disable autoboot

 [4] CONFIG_BOOTDELAY=-2
    autoboot with no delay, with no check for abort

As you notice, [2] and [4] come to the same result, which means we
do not need CONFIG_ZERO_BOOTDELAY_CHECK.  We can control all the
cases only by CONFIG_BOOTDELAY, like this:

 [1] CONFIG_BOOTDELAY=0
    autoboot with no delay, but you can abort it by key input

 [2] CONFIG_BOOTDELAY=-1
    disable autoboot

 [3] CONFIG_BOOTDELAY=-2
    autoboot with no delay, with no check for abort

This commit converts the logic as follow:
  CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=n
    --> CONFIG_BOOTDELAY=-2

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Christian Riesch <christian.riesch@omicronenergy.com>
Acked-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2016-07-01 17:42:55 -04:00
Stefan Roese 9f73690ceb autoboot.c: Fill env vars in process_fdt_options() only if TEXT_BASE is set
The x86 build target "efi-x86" has no TEXT_BASE configured. And with the
introduction of CONFIG_BOOTDELAY for x86, this function is now called
for this board as well. Resulting in compile errors for this target.

Without TEXT_BASE it makes no sense to fill these values. So lets only
configure the env variable if TEXT_BASE is defined.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-02-05 12:47:20 +08:00
Simon Glass 24b852a7a2 Move console definitions into a new console.h file
The console includes a global variable and several functions that are only
used by a small subset of U-Boot files. Before adding more functions, move
the definitions into their own header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-19 20:27:50 -07:00
Stefan Roese 8f0b1e24e2 autoboot.c: Add feature to stop autobooting via SHA256 encrypted password
This patch adds the feature to only stop the autobooting, and therefor
boot into the U-Boot prompt, when the input string / password matches
a values that is encypted via a SHA256 hash and saved in the environment.

This feature is enabled by defined these config options:
     CONFIG_AUTOBOOT_KEYED
     CONFIG_AUTOBOOT_STOP_STR_SHA256

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-06-08 17:32:40 -04:00
Stefan Roese d126e01649 autoboot.c: Move config options to Kconfig
This patch moves the following config options to Kconfig:

CONFIG_AUTOBOOT_KEYED
CONFIG_AUTOBOOT_PROMPT
CONFIG_AUTOBOOT_DELAY_STR
CONFIG_AUTOBOOT_STOP_STR
AUTOBOOT_KEYED_CTRLC

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Drop ip04 and pm9263 configs/ additions, those boards previously
 set CONFIG_AUTOBOOT_PROMPT but never used it, re-run savedefconfig over
 all boards that did change. Make digsy_mtc_* string include seconds to
 match others and not warn. ]
Signed-off-by: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-06-08 17:32:16 -04:00
Stefan Roese 2d908fa084 autoboot.c: Remove CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2
These defines for a 2nd autoboot stop and delay string are nearly unused. Only
sc3 defines CONFIG_AUTOBOOT_DELAY_STR2. And a patch to remove this most likely
unmaintained board is also posted to the list.

By removing these defines the code will become cleaner and moving the remaining
compile options to Kconfig will get easier.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2015-06-08 10:45:11 -04:00
Jeroen Hofstee 39e1230ed0 autoboot: add its own header
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-07-18 17:53:24 -04:00
Jeroen Hofstee 9e546ee9c9 cosmetic: autoboot: update old style GNU struct init
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-19 11:19:07 -04:00
Simon Glass affb215626 main: Make the execution path a little clearer in main.c
bootdelay_process() never returns in some circumstances, whichs makes the
control flow confusing. Change it so that the decision about how to execute
the boot command is made in the main_loop() code, so it is easier to follow.
Move CLI stuff to cli.c.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-29 17:52:03 -04:00
Simon Glass b26440f1fa Rename bootretry functions and remove #ifdefs
Add a bootretry_ prefix to these two functions, and remove the need for
the #ifdef around everything (it moves to the Makefile).

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-29 17:49:00 -04:00
Simon Glass 0098e179e1 Move bootretry code into bootretry.c and clean up
This code is only used by one board, so it seems a shame to clutter up
the readline code with it. Move it into its own file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-29 17:48:21 -04:00
Simon Glass 66ded17dfc Move autoboot code to autoboot.c
The autoboot code is complex and long. It deserves its own file with
a simple interface from main.c.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-29 17:45:31 -04:00