| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Our cyc_crc16() function is the same function as crc_itu_t() in the
Linux kernel. Import and use crc_itu_t() from the Kernel for
consistency.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Same as linux dmesg, barebox dmesg will be able to restrict output level
by using -l option. For example "dmesg -l err,warn"
This functionality can be used for test automation.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add -r option to mimic functionality of linux dmesg.
It will prefix log level and timestamp to each buffer:
<6>[ 460us] barebox 2019.02.0-00266-g6aea757067-dirty #355 Thu Feb 21 11:51:43 CET 2019
<6>[ 6279us] Board: DPTechnics DPT-Module
<6>[ 209281us] mdio_bus: miibus0: probed
<6>[ 210184us] ag71xx-gmac 18070000.mac@19000000.of: network device registered
<6>[ 216051us] m25p80 w25q128@00: w25q128 (16384 Kbytes)
<6>[ 219913us] netconsole: registered as netconsole-1
<6>[ 223312us] malloc space: 0x80c00000 -> 0x80ffffff (size 4 MiB)
<6>[ 228255us] eth0: got preset MAC address: c4:93:00:00:ae:89
<6>[ 246363us] running /env/bin/init...
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
| |
Test will read the device and report the corrected or failed ECC states.
Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This matches the method implemented in i2cdetect(8) when using its -q
option.
With this change an rx8130 RTC is detectable using i2c_probe. This
failed before because this chip acks the first byte (containing its
address and the R/̅W bit) but nacks the following 0 (representing the
target address to write nothing to) which makes i2c_write_reg() return
with an error and so the chip is not listed as available.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adresses below 0x04 and above 0x77 are reserved in the i2c bus
specification, so don't probe these addresses unless requested
explicitly.
Also do more strict boundary checking:
- ensure start address is greater or equal to zero;
- don't decrease stopaddr after checking it being greater or equal to
startaddr.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Maximum file size on 64-bit system is 2^63-1 (9223372036854775807),
which takes more that 14 characters of space. In order to keep things
properly aligned adjust that spacing to 20 on 64-bit platforms.
Before:
ls -l /dev/
d--------- 0 .
d--------- 0 ..
crw------- 16384 dds-eeprom
crw------- 256 e1000-invm0
crw------- 16384 eeprom0
cr-------- 0 full
crw------- 2048 imx-ocotp
crw------- 16384 main-eeprom
crw------- 64 mdio0-phy00
crw------- 9223372036854775807 mem
c-w------- 0 netconsole-1
c-w------- 0 null
crw------- 256060514304 nvme0n1
cr-------- 0 prng
crw------- 4294967296 ram0
c-w------- 0 serial0-1
cr-------- 0 zero
After:
ls -l /dev/
d--------- 0 .
d--------- 0 ..
crw------- 16384 dds-eeprom
crw------- 256 e1000-invm0
crw------- 16384 eeprom0
cr-------- 0 full
crw------- 2048 imx-ocotp
crw------- 16384 main-eeprom
crw------- 64 mdio0-phy00
crw------- 9223372036854775807 mem
c-w------- 0 netconsole-1
c-w------- 0 null
crw------- 256060514304 nvme0n1
cr-------- 0 prng
crw------- 4294967296 ram0
c-w------- 0 serial0-1
cr-------- 0 zero
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Only the following cdevs do not declare an .lseek() operation:
- Console devices in common/console.c
- Firmware framework in common/firmware.c
- JTAG driver in drivers/misc/jtag.c
- UBI in drivers/mtd/ubi/barebox.c
Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and
implement only .write() operation and the last two don't implement
anything but .ioctl(). While there's probably no meaningful way to use
lseek() against any of those devices, there doesn't seem to be any
harm in allowing it either.
Change devfs_lseek() to ignore absense of .lseek() callback and drop
dev_lseek_default() and all references to it in the codebase.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With all other code gone from commands/mem.c, move it into
driver/misc, where it fits better. While at it, expose it directly via
a Kconfig options instead of relying on CONFIG_COMPILE_MEMORY
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There doesn't seem to be any good reason for all of the memory
commands (md, mw, etc.) to rely on a shared pre-allocated buffer
anymore. So, to simplify things, drop the shared buffer and adjust all
of the utilites to allocate needed memory.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As a first step of de-cluttering /dev/mem related code, move
mem_parse_options() out of commands/mem.c into lib/misc.c where it
seem to fit better. With this change we no longer explicitly turn this
code off using CONFIG_COMPILE_MEMORY and instead rely on LTO to get
rid of it when it's not being used.
While at it, also fix return value by replacing COMMAND_ERROR_USAGE
with -EINVAL. All of the callers of mem_parse_options() expect
negative error code as a sign of failure and COMMAND_ERROR_USAGE is
not negative.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Loff_t is a signed type, so ~0 is a negative number. While it works OK
due to clamping/conversion to ulong when passed to
digest_file_window(), it is better not to rely on that fact and use an
appropriate constant.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
When global.net.server is a hostname instead of an IP address we have to
resolv it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
The help text is present but not hooked into the command structure. Fix
this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
We do getopt(), so the next argument is in argv[optind], not in argv[1].
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Andreas Schmidt <andreas.schmidt@wago.com>
|
|/
|
|
|
|
|
|
| |
All of those variables are already initialized in-place in the
variable declaration section above to exactly the same values
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The volume id can be used to refer to a specific volume.
This adds support to choose a corresponding argument when creating
a UBI volume.
Signed-off-by: Leif Middelschulte <leif.middelschulte@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to put the device name without the "/dev/" component into
device_detect_by_name() and cdev_by_name(). Since 8ca7053b3ff we only
put the device name into device_detect_by_name(), but cdev_by_name()
still gets the full path. The result is that a "mount /dev/<devname>" no
longer works. Fix this.
Fixes: 8ca7053b3ff ("commands: mount: Make use of devpath_to_name()")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
|
|
|
|
|
|
|
|
| |
resource_size_t may be 32bit on several architectures, so explicitly do
a 64bit comparison to avoid "warning: comparison of distinct pointer types
lacks a cast".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use global variable dfu_function to autostart DFU. As similar code
is used to start multifunction gadget using command, move common
code to common/usbgadget.c and consolidate it.
It turned out that '-s' option of usbgadget command does nothing,
so remove its help text and make it function as '-a'.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
On 64bit arches the file covering the whole address space is larger than
what can be represented in the loff_t type (s64) used for the file size.
Thus the size of this device is interpreted as negative in a lot of
places. Fix this by truncating the size to fit the file size type.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure that there's a space between device name and it's status
string regardless if if device is using "id" field or not.
Before:
barebox@ZII RDU2 Board:/ miitool
mdio0-phy00: mdio:no link
mdio1-phy15: 2188000.ethernet@2188000:10 Mbit, half duplex, no link
mdio1-phy16: 2188000.ethernet@2188000:10 Mbit, half duplex, no link
mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0:negotiated 100baseTx-FD, link ok
mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio3-phy01: eth1: negotiated 1000baseT-FD flow-control, link ok
After:
barebox@ZII RDU2 Board:/ miitool
mdio0-phy00: mdio: no link
mdio1-phy15: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link
mdio1-phy16: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link
mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio3-phy01: eth1: no link
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use kstrtoint() instead of simple_strtoul() in order to properly
handle invalid arguments. Current code using simple_strtoul() results
in following:
barebox@ZII RDU2 Board:/ gpio_get_value foo
barebox@ZII RDU2 Board:/ echo $?
0
whereas with this patch we get:
barebox@ZII RDU2 Board:/ gpio_get_value foo
gpio_get_value: Invalid argument
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Several places assume that the default environment path cannot be NULL.
Allow NULL here without crashing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make use of %pa specifier to avoid warnings when building against
64-bit CPU (specifically AArch64) as well as adjust a number of
patterns to be 64-bits wide.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Add code to verify that update handler specified with either -t or of
-d exists before commencing the update procedure.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Add "handler" parameter to barebox_update() and remove the code that
was respondible for header lookup before. With this change finding
appropriate handler is caller's responsibility, which makes it
possible to implement custom handler lookup/existence check, chache
it, and then re-use it without calling handler_find_by_* functions for
the second time.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
If no start register is explicitly given, receive data in master
receive mode.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
When no explicit start register is given, the i2c message is emitted
in master send mode.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 40ee300 introduces info option about bad blocks. The open()
function call is therefore moved out from mark good/bad block to use the
filedescriptor in info option too. If someone tries to add/delete a bb device
the optind variable is incremented and the open() call gets a null pointer.
Fix this issue by returning when the bb device is added/deleted.
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 748d1b8 adds the fixup feature to the above command. With this commit an
unwanted free(data) on the freshly set property value is done if someone tries
to set the value of an already present property (not the case for a new
property). Furthermore in fixup mode the pointer fixup->data is freed when the
fixup function is called more than once. This leads to a hanging system after
calling of_dump -F many times.
Fix this issues by copying the data to a new allocated memory area like a new
property is created.
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To create an oftree node /path/node I tried after reading the help text
of of_node:
of_node -c /path node
similar to the syntax of of_property. This didnt result in any output
but still failed to do what I meant.
So clarify the help text to not suggest there are two parameters and
return an usage error if still two (or more) names are passed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
This allows to use the adapted commands on non-existing files which
failed before with
open: No such file or directory
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|