| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The FCB on NAND has a special page layout and thus can't be read with
the normal MTD driver. Add a fcb command for printing information about
the installed FCB on the console.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The ROM event log[1] of the i.MX8M* can help with debugging boot
failures as it lists various information about boot mode, image,
fallback and recovery as well as timestamps when some actions along
the boot process occurred.
Add a new bootrom -l command that supports reading this out. A generic
name is intentionally chosen, as other SoCs also provide similar
functionality and it would be nice if they can just reuse the name and
command line arguments in future.
[1]: NXP AN12853 "i.MX ROMs Log Events" Rev. 0 - May 2020
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221101180643.244270-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add -p option to control promisc mode of the ethernet device.
Example:
ethlog -p eth0 - will enable promisc mode and logging on the eth0
device
ethlog -rp eth0 - will disable promisc mode and logging on the eth0
device
All the same commands without "-p" option will not touch promisc
configuration.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.barebox.org/20221108061009.4168735-3-o.rempel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Normally timer overrun is not that much of a problem, because there
where it matters, we usually have an is_timeout() in the loop that reads
the timer often enough. This doesn't necessarily hold for the new uptime
command and basically anything can happen between subsequent calls and
if get_time_ns() is not called often enough during that time, we end up
with an inaccurate uptime. Mention this in the extended help text.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221102085017.1941580-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have a time command to record the delta of get_time_ns() to time
command execution, but have no command to just print get_time_ns().
Such a command can be useful to debug clocksources or to verify that a
system is still running and hasn't been reset by a yet unhandled
watchdog in-between.
Make development a bit easier by providing a new uptime command.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221101063757.3225283-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have a couple of commands to help with debugging the VFS:
ll, devinfo, devlookup, but we lack a command that can just dump all
information we have in a struct stat or struct cdev. Add stat as such a
command. For most uses, it's not needed, but it can come in handy for
development. The stat_print and cdev_print functions underlying it are
exported, so they can called for debugging purposes.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221026063819.2355568-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently support reboot mode communication with BootROMs of the
i.MX6Q/DL, i.MX8MM and STM32MP15x. For each of these, the user must
take care to use the correct reset as the highest priority reset often
clears the non-volatile register mapped by the syscon holding the reboot
mode. As we only have one BootROM, we can improve usability by adding a
global flag that describes whether a restart handler is suitable for
use after a bootrom reboot mode write. Add a flag bit describing this
and allow populating it from the device tree as well as from drivers.
Existing i.MX/STM32 drivers will be moved onto this in follow-up
commits.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221017071000.1458292-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Both errno_str() and printf("%m" end up calling strerror(). %m is
more convenient to use, so switch over all instances to it.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
04443dc5fc breaks the calculation of arguments needed which effectively
makes the -d option mandatory. Fix this.
Fixes: 04443dc5fc ("commands: gpio: add -d argument to set/get commands")
Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Link: https://lore.barebox.org/20220830073816.2694734-4-enrico.scholz@sigma-chemnitz.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For debugging during self-test run, it can be useful to enable select
logging only when the selftest is running. Provide a selftest_is_running()
function that can be used to determine whether a test is running.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220905070125.537483-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Error check was before pread was called and because ret was initialized,
compiler didn't warn about it. Fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220902100458.2597350-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Like the regulator command, this new pm_domain command gives an easy
way for listing registered power domains and whether barebox had them
activated.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220905070448.539531-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For debugging, it can be useful to reference GPIOs relative to a
controller, e.g.:
gpio_direction_output -d gpio4 20 1
instead of calculating the global gpio number. Extend the GPIO
functions to support that. The argument to -d may be either a device
name, a full path to a device tree node or an alias as in the example
above.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220905103546.1476277-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We don't need to duplicate argv[i], because it persists for the lifetime
of print_tutorial_step. We can thus drop the strdup and while at it,
just drop the redundant step variable altogether.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220905095557.596891-14-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Static analyzer correctly identifies led as being set, but always
overwritten later on. As the later assignments all have their own
argument count check, so we can just drop the first assignment.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220905095557.596891-13-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Now that we define IORESOURCE_BUSY as meaning that a region possibly
contains secure firmware, it's useful to have this information in the
iomem output as well, so add it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220817114244.1810531-11-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When multiple bootloader spec files are available, the first match in
lexical order will be the one to autoboot. Users can customize which one
to use interactively via boot -m, but no means to select a different by
default exists. Allow for this by having the boot command not only
accept a directory to search for bootloader spec entries in, but also
the path of a single bootloader spec file. This aligns it with what we
have for bootscripts, where both directories containing boot scripts
and the path to a specific boot script is understood.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220724184807.2123459-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
boot -m -t 3 already opens a boot menu with a countdown of 3 seconds
before selecting the first element. So far, only way to influence
preselection was shifting around boot entries, so they are iterated over
differently. Add a new -M option that works analogously to -m, but
takes an integer index of the boot menu entry to preselect. This allows
simple customizable interactive boots:
#!/bin/sh
boot -M "$nv.bootmenu_default" -t 3 mmc0.0
With mmc0.0 containing multiple bootloader spec files that would be iterated
over in lexical order. The index is 1-based like the index displayed in
the boot menu.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20220726054136.267069-1-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
FIT images can have properties with very long values. Make it possible
to use of_dump to inspect them by adding a -P option that restricts
how much of the value is printed.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220808065639.453483-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For OF-enabled platforms with aliases, device file naming is pretty much
solved: If there is mmc2 = &something, then we have a mmc2 device and
a /dev/mmc2 device file. For other platforms like x86, EFI-provided
devices are harder to get ahold of. Add a command to make this
straight-forward to do in scripts. The main use of this is probably to
access parameters like nt_signature or guid:
devlookup /dev/disk0 guid
This would print to console, but we have no output capture yet, so add
an optional -v VARIABLE parameter as well to allow easy use from
scripts.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220630124035.4019644-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit 863a2251393e ("state: make first boot less verbose"),
state_load returns -ENOMEDIUM instead of -ENOENT if we detect
a first load because all buckets are zero.
This case is expected and shouldn't warrant an error message, so
adjust callers appropriately.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220620071936.1460295-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We now have pr_setenv() which is a setenv() variant that takes a
format string. Use it where appropriate.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Link: https://lore.barebox.org/20220609072629.15723-1-eagle.alexander923@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix warning fwterated by checkincludes.pl:
./net/nfs.c: libgen.h is included more than once.
./net/ifup.c: globalvar.h is included more than once.
./crypto/rsa.c: asm/types.h is included more than once.
./lib/decompress_unlz4.c: linux/decompress/mm.h is included more than once.
./scripts/stb_image.h: stdio.h is included more than once.
./scripts/kwbimage.c: unistd.h is included more than once.
./scripts/common.c: sys/types.h is included more than once.
./scripts/bareboximd.c: sys/types.h is included more than once.
./scripts/bareboximd.c: sys/mman.h is included more than once.
./fs/pstore/ram_core.c: linux/rslib.h is included more than once.
./fs/pstore/fs.c: fs.h is included more than once.
./fs/pstore/fs.c: linux/pstore.h is included more than once.
./fs/nfs.c: fs.h is included more than once.
./fs/uimagefs.c: fs.h is included more than once.
./fs/fs.c: command.h is included more than once.
./arch/sandbox/board/hostfile.c: linux/err.h is included more than once.
./arch/sandbox/board/devices.c: mach/linux.h is included more than once.
./arch/sandbox/os/common.c: signal.h is included more than once.
./arch/arm/boards/zii-imx51-rdu1/board.c: envfs.h is included more than once.
./arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c: generated/mach-types.h is
./arch/arm/mach-stm32mp/ddrctrl.c: mach/stm32.h is included more than once.
./arch/arm/mach-imx/cpu_init.c: common.h is included more than once.
./arch/arm/mach-imx/imx8m.c: mach/imx8m-ccm-regs.h is included more than once.
./common/efi/payload/init.c: efi.h is included more than once.
./common/state/backend_format_raw.c: common.h is included more than once.
./common/state/backend_format_raw.c: crc.h is included more than once.
./common/hush.c: libbb.h is included more than once.
./drivers/spi/atmel-quadspi.c: linux/clk.h is included more than once.
./drivers/spi/atmel-quadspi.c: linux/err.h is included more than once.
./drivers/net/virtio.c: net.h is included more than once.
./drivers/net/phy/phy.c: linux/phy.h is included more than once.
./drivers/net/cpsw.c: net.h is included more than once.
./drivers/virtio/virtio_pci_common.h: linux/list.h is included more than once.
./drivers/usb/host/ohci-hcd.c: dma.h is included more than once.
./drivers/usb/gadget/fsl_udc.c: dma.h is included more than once.
./drivers/nvmem/eeprom_93xx46.c: spi/spi.h is included more than once.
./drivers/nvmem/eeprom_93xx46.c: of.h is included more than once.
./drivers/video/imx-ipu-v3/imx-ldb.c: linux/clk.h is included more than once.
./drivers/video/imx-ipu-v3/imx-hdmi.c: linux/clk.h is included more than once.
./drivers/video/omap.c: common.h is included more than once.
./drivers/mtd/nand/nand_s3c24xx.c: asm/sections.h is included more than once.
./drivers/clk/imx/clk-imx6sx.c: linux/clk.h is included more than once.
./drivers/clk/imx/clk-imx6sl.c: linux/clk.h is included more than once.
./commands/bootm.c: of.h is included more than once.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Link: https://lore.barebox.org/20220607051957.2497-1-eagle.alexander923@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In barebox, block devices are a special case of character devices.
Nevertheless, differentiation can be useful to allow scripts iterating
over all block devices without accounting for naming, e.g.
for dev in /dev/*; do
test -b $dev && echo $dev: blockdevice
done
Add the necessary support. This will break scripts that assume
test -c blockdevice to be true, but that's a quite improbable check.
Tested-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20220602195916.9061-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
S_ISDIR(mode) is implemented as (mode & S_IFMT) == S_IFDIR, which
accounts for file modes setting multiple bits. So far, this was not the
case, but upcoming S_IFBLK equals (S_IFCHR | S_IFDIR), which would fail
the existing checks, so prepare for that by fixing them.
No functional change. There are no other instances of this elsewhere in
the code base.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220602195916.9061-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
| |
This fixes the following error (without CONSOLE support):
arm-linux-ld: commands/edit.o: in function "do_edit":
/home/ARM/barebox/commands/edit.c:684: undefined reference to "console_list"
make: *** [Makefile:872: .tmp_barebox1] Error 1
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Link: https://lore.barebox.org/20220610054051.4911-9-eagle.alexander923@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Signed-off-by: Denis Orlov <denorl2009@gmail.com>
Link: https://lore.barebox.org/20220520065519.28173-1-denorl2009@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
It is kind of tcpdump or tshark for barebox. Instead of starting
application it will let barebox dump everything to the console by still
allowing to use other application.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.barebox.org/20220413082205.429509-15-o.rempel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
of_find_node_by_name() has the same name as the corresponding kernel
function but a different semantics. A node name is comprised of the
nodes name and a unit address, separated with '@'. Linux
of_find_node_by_name() matches only the name before the '@' whereas the
barebox function compares the full name.
As several callers depend on the barebox semantics we can't just change
the semantics, so rename the barebox function to
of_find_node_by_name_address().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current text can be quite confusing for the prev alias:
prev - print next tip for barebox tutorial
Instead, change it to:
prev - navigate the barebox tutorial
Which is correct for both next and prev.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220224135231.257713-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Import the Linux v5.15 state of the driver to allow easy porting of
MIPI-DBI displays like the Ilitek 9431 added in a follow-up commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220202223023.341817-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Tests may want to leverage of_diff to verify that fixups proceeded as
expected. of_diff lends itself nicely to that by being silent in case of
success and just reporting diff on error. Add a return code to make it
usable in follow-up tests.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220207082801.1052894-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When booting after nv.autoboot=abort, barebox will drop to shell and
try to inhibit all watchdogs: If they can be disabled, they will be and
otherwise if autopoll support is compiled in, they will be periodically
fed. This is useful for development. For this to work though, barebox
needs an environment. Make watchdog_inhibit_all more accessible by
making it directly invocable with wd -x.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220119140816.610764-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
CMD_GRP_MISC is assumed in absence of an explicit group. Let's be
explicit instead to silence the warnings during documentation build.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220124151827.3313412-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|