| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
poller_call() is called by is_timeout(), no need to do this again in a
timeout loop.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Consoles can be unregistered, this happens for example when barebox
implements the barebox serial USB gadget. Before using the console
we have to explicitly test if the pointer is still valid each time.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When CONFIG_PASSWORD_DEFAULT is unset, the default_passwd buffer is set
to the empty string. The read_default_passwd() function wants to read at
least two characters from that buffer, causing GCC to generate an array
bounds warning:
barebox/common/password.c: In function 'login':
barebox/common/password.c:173:5: warning: array subscript [1, 2147483647] is outside array bounds of 'const char[1]' [-Warray-bounds]
In file included from barebox/common/password.c:30:
include/generated/passwd.h:1:19: note: while referencing 'default_passwd'
Add an ARRAY_SIZE check to default_passwd so that the loop is optimized
away and the warning is no longer generated. Since the
read_default_passwd() function is only called when default_passwd is not
the empty string, this is not a functional change.
Signed-off-by: David Dgien <dgienda125@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This function is used only in common/password.c itself, so it doesn't
need to be exported.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
The Boot Loader Spec says:
"This key is optional and may appear more than once in which case all
specified parameters are used in the order they are listed."
Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit 18895514dc5e ("kconfig: update to v3.18-rc6"), tristate
symbols cannot become 'm'.
In old days of Linux, CONFIG_MODULES was the special option hard-coded
in Kconfig.
The current Kconfig does not know which option is it. You need to
specify 'option modules' to teach Kconfig that it is the module
support switch.
Add 'option modules' to revive the module builds.
Fixes: 18895514dc5e ("kconfig: update to v3.18-rc6")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
With fastboot over ethernet we now can have two instances of fastboot
running in parallel. Make sure that both instances use a different
temporary file to store data so that they do not influence each other.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When downloading to a buffer, download_fd is never assigned a valid file
descriptor. We should therefore avoid calling close on the value found
in that variable.
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The fastboot specification describes other protocols beyond USB. Allow
these to reuse the generic parts of the existing fastboot code when they
are implemented.
Most of the changes in common/fastboot.c are due to the renaming of struct
f_fastboot *f_fb to struct fastboot *fb.
Signed-off-by: Edmund Henniges <eh@emlix.com>
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
The poller command allows to print which pollers are registered and also
how many times we can run the registered pollers in one second.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
| |
It helps debugging when pollers have a name, so give them one.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Add a filetype for i.MX23/28 SD card images so that they can be
detected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
lregion_overlap() is only used by common/startup.c
There is no need to define it in include/common.h
While I was here, I also renamed it to region_overlap(), and got rid
of the 'inline' keyword.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't just ignore the return value of write_file.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97
("Remove the CREDITS file"). Remove references to it from several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, unsigned TEE binaries can be booted. This patch ensures
that CONFIG_BOOTM_FORCE_SIGNED_IMAGES is also enforced for TEE
binaries.
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We already have a global_autoboot_state variable that controls barebox
init behavior on startup:
* ABORT abort and fall into shell
* MENU display boot menu
* BOOT boot immediately, only abortable via ctrl+c
during init
* COUNTDOWN regular boot after count down
Exporting this as a device parameter allows us to support some
different boot scenarios:
* COUNTDOWN is the default
* ABORT boot always while debugging
* display MENU by default (e.g. for graphical boots)
* BOOT while ignoring external code calling console_countdown_abort()
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
do_autoboot_countdown changes autoboot state if the user presses m for
menu or ctrl+c to abort during count down. This is an internal detail
and doesn't need to be reflected in the state of the global variable.
This will improve UX when exporting the variable in the follow-up
commit, because on a regular boot it $autoboot will expand to countdown
instead of abort/boot/menu dependent on prior user input.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If we export the autoboot state variable for customization, having
unknown as default is not so helpful. Rename it to what actually happens
(abortable countdown).
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| | |
global.autoboot_abort_key and global.autoboot_timeout lack a magicvar
description. Add one.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
All these symbols are defined, but unused anywhere in the barebox tree.
Remove them.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The 'filechk' in the latest Linux works more simply, reliably.
- Do not show CHK every time
- Delete the *.tmp file when the filechk_$(1) fails
- Do not open the first prerequisite. This is unneeded in most cases.
I deleted pointeless dependency on Makefile.
Also delete the meaningless assignment to 'targets' because filechk
does not generate .cmd file.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, the -A option of mkimage is determined based on $(SRCARCH).
I want to rename arch/ppc/ to arch/powerpc/.
Support 'powerpc' for the -A option of mkimage beforehand, otherwise
the barebox.uimage build would be broken.
common/image.c in U-Boot supports both 'powerpc' and 'ppc' for the
name of IH_ARCH_PPC. Let's do likewise in barebox.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Most of the Kconfig commands (except defconfig and all*config) read
the .config file as a base set of CONFIG options.
When it does not exist, the files in DEFCONFIG_LIST are searched in
this order and loaded if found.
This is not working for barebox because ARCH_DEFCONFIG is not set by
anyone, nor arch/$(ARCH)/defconfig exists.
Fix this.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some Kconfig options we have are promptless and off-by-default and
instead can only be enabled by being selected from platform options.
For some of those that aren't compile testable, add a new
COMPILE_TEST-only prompt.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compile-time analysis may help us catch latent bugs in barebox. For this
to be most effective, we need an easy way to compile as much of barebox
as possible. Giving all driver options prompts would do this, but at the
cost of making user experience worse, by asking them about drivers for HW
that's clearly not relevant to the platform they selected.
Do as Linux does and provide a default-off COMPILE_TEST option, which we
can use to make extra drivers selectable.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| | |
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When barebox concatenates all dynamic bootargs string for linux, if they
are empty, the resulting string might be composed of only spaces.
Currently, there is no check for such string and it leads to
overwriting bootargs in the device tree by an empty string. To avoid
this behavior, use skip_spaces to trim leading spaces and then check if
the string is empty. If so, simply returns and don't patch device tree
bootargs.
Signed-off-by: Clement Leger <cleger@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
request_sdram_region() can fail in which case it's interesting which
region we tried to request. Add some printfs for it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
| |
To avoid compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have a few places where driver code prints reset_source_name() to
console after setting the reset source.
This working is probe order dependent, because reset_source_name()
prints the highest priority reset_source so far, which doesn't
necessarily have to be the one that was just computed.
Implement reset_source_to_string, so drivers can be migrated to use it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The state.dirty flag controls whether state_save will actually
persist state. It is cleared when we successfully load or save
state and set on writing a state parameter.
When the state however becomes corrupt during barebox runtime and
state.dirty == 0, reinitializing the state to defaults is quite
cumbersome:
1. We reset twice. After the first reset, the dirty flag is reset
and before the second, state_save will reinitialize to defaults
2. We write any state variable and then run the state -s command
Both workarounds are quite obscure, improve the user experience
by having state -l set the dirty flag when it fails, so a subsequent
state -s may persist the default values to state.
Steps to reproduce:
barebox$ state -l
state: Using bucket 0@0x00000000
barebox$ memcpy -s /dev/zero -d /dev/eeprom0.state 0 0 0x400
barebox$ state -s
barebox$ state -l
ERROR: state: No meta data header found
ERROR: state: No meta data header found
ERROR: state: No meta data header found
ERROR: state: Failed to find any valid state copy in any bucket
ERROR: state: Failed to read state with format raw, -2
state: No such file or directory
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Corrupting an already selected bucket and then reading it again will
crash barebox when it attempts the refresh:
barebox$ state -l
barebox$ mw -d /dev/eeprom0.state 0 0x42
barebox$ state -l
ERROR: state: No meta data header found
state: Using bucket 1@0x00000040
unable to handle NULL pointer dereference at address 0x00000000
pc : [<4fe4f1ea>] lr : [<4fe0bcb1>]
sp : 4ffefd5c ip : 00000000 fp : 2ff68f04
r10: 4ffefdc8 r9 : 4b434d63 r8 : 30155f50
r7 : 00000024 r6 : 2ff68b60 r5 : 2ff68e90 r4 : 00000000
r3 : 00000024 r2 : 00000024 r1 : 30155f50 r0 : 00000000
Flags: Nzcv IRQs off FIQs off Mode SVC_32
WARNING: [<4fe4f1ea>] (memcmp+0x14/0x1a) from [<4fe0bcb1>] (bucket_refresh.isra.0+0x4d/0x78)
WARNING: [<4fe0bcb1>] (bucket_refresh.isra.0+0x4d/0x78) from [<4fe0be1d>] (state_storage_read+0xd1/0x104)
WARNING: [<4fe0be1d>] (state_storage_read+0xd1/0x104) from [<4fe0a5bd>] (state_do_load+0x1d/0x78)
WARNING: [<4fe0a5bd>] (state_do_load+0x1d/0x78) from [<4fe04137>] (execute_command+0x23/0x4c)
The memcmp called here is an optimization to skip I/O if the used bucket
and the one to be refreshed compare equal. Unfortunately, if the now
corrupt bucket was previously the used one, bucket->len will hold the
old value and we'll run into a NULL pointer dereference.
While this is quite inconvenient, it appears it doesn't affect
correctness: after the reset, the corrupt bucket will be refreshed
as expected.
Improve upon this by setting the length to zero when we are NULLing the
buffer. The zero length of the corrupted bucket will then compare unequal
to used_bucket->len in bucket_refresh() and ensure we will always refresh
the buffer if it becomes corrupted without an intermittent reset.
Fixes: 238008b4bd8f ("state: Drop cache bucket")
Cc: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On 12/13/19 2:12 PM, Sascha Hauer wrote:
> On Tue, Dec 10, 2019 at 03:44:52PM +0100, Hubert Feurstein wrote:
>> With v2015.06.0 the indicated progress of the copy command is very
>> smooth. Calling "cp -v /dev/zero /dev/mmc3.root" takes about 80
>> seconds for 256MB. But with v2019.12.0 the progress is very bumpy and
>> the copy takes about 280 seconds.
>>
>> I've tracked this down to this commit which destroys the performance:
>> "block: Adjust cache sizes" (b6fef20c1215c6ef0004f6af4a9c4b77af51dc43)
>
> We could just revert this patch. I can't find any workload that gets
> faster with b6fef20c1215. It's rather the other way round.
Do this by reverting commit b6fef20c1215c6ef0004f6af4a9c4b77af51dc43.
Reported-by: Hubert Feurstein <h.feurstein@gmail.com>
Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This implements the discard_range hook. When a range of data is
discarded then we do not have to read it from the device and can
pass a zeroed buffer instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The following commit will change the return value of dev_add_param()
from -ENOSYS to NULL if CONFIG_PARAMETER is disabled. After that,
building without CONFIG_PARAMETER will return a NULL pointer to
__nvvar_add() instead of an error.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After adding the parameter, the pointer isn't required anymore.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|