This adds a command to flip bits in a Nand flash. This is useful for
testing purposes to check if flipped bits are corrected and if the
driver returns the correct number of bitflips.
The command writes a configurable number of bitflips to a single Nand
page. If the -r option is not given the results are reproducible, so
calling the same command twice will revert the bitflips.
The command uses the raw read/write Nand operations which are probably
less tested than the regular read/write operations, so the command may
produce surprising results.
As of writing the command has been tested with the GPMI Nand driver and
the imx-nand driver with fixes posted.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The only user of libmtd was ubiformat which now uses the mtd-peb API,
so remove the now unused libmtd.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This changes ubiformat from the libmtd API to the mtd-peb API. This
makes the libmtd API unnecessary and it can be removed in the next
step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of_fixup_status enables or disables the status property of a
given node with a device tree fixup.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Check if the given offset is valid for the mtd device. Print an error
message if not to inform the user in the command 'nand'.
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit changes the behaviour of the 'miitool'. Now in order to show
PHY's link information 'miitool' should be invoked as such:
miitool -s [PHY]
Also, implment code to allow to register a dummy PHY device in order to
be able to perform raw MDIO bus access.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Do not include ID of the parent to mii_bus if that ID is negative since
it produces a rather confusing string (e.g. "mdio.11-1", which is very
likely to be interpreted as "mdio.11<dash>1").
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead of displaying the status of PHY "PHY" the tool will print status
of all PHYs it encounters while searching for the one that was
requested. This commit fixes the logic such that only requested
information is printed.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This implementation is inspired by U-Boot's FIT support. Instead of
using libfdt (which does not exist in barebox), configuration signatures
are verified by using a simplified DT parser based on barebox's own
code.
Currently, only signed configurations with hashed images are supported,
as the other variants are less useful for verified boot. Compatible FIT
images can be created using U-Boot's mkimage tool.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
So long struct bootm_data.verify is a bool which enables CRC checking
(hashing). Extend this to a enum and add support for signature checking
in the same option. This also adds the corresponding globalvar and a
-s option to bootm.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Both the bootm and the boot code initialize the struct bootm_data
with defaults from the bootm global variables. Create a common
function for doing this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We can make the dryrun option more useful by calling into the handlers.
With this we can detect more cases that can go wrong during boot.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
printf now supports printing resource_size_t directly, convert
all users of the previously used PRINTF_CONVERSION_RESOURCE over
to %pa.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It is possible for rtc_read_time() to fill struct rtc_time it returns
with invalid values, so we have to check for its return value before
using returned time.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Print three-letter abbreviations of the days and months.
With a fixup by Andrey Smirnov:
| common/date.c: Fix off-by-one error
|
| As per http://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html
| 'tm_wday' is zero indexed with zero representing Sunday, this is also
| corroborated by the code in rtc_time_to_tm() which used 4 to represent
| Thursday.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds some missing arguments in help string of memtest.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From mtd-utils commit:
| commit 15685fe39f1665d53d8b316c8f837f20f8700d4b
| Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| Date: Mon Sep 8 15:05:54 2014 +0300
|
| ubiformat: fix the subpage size hint on the error path
|
| David Binderman <dcb314@hotmail.com> reports that the following piece of looks
| wrong:
|
| if (!args.subpage_size != mtd->min_io_size)
| normsg("may be sub-page size is incorrect?");
|
| I totally agree with him and I believe that we actually meant to have no
| negation in fron to f 'args.subpage_size', so instead, the code should look
| like this:
|
| if (args.subpage_size != mtd->min_io_size)
| normsg("may be sub-page size is incorrect?");
|
| Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In commit 104a6a7ccf support was added
for Thumb2. It added do_execute() as a way to provide arch dependent
calling veneers for use in "go" and thumb2_execute() as the thumb2 to
arm veneer.
But thumb2_execute() isn't necessary as gcc generates a proper calling
sequence from a standard function pointer call. Thumb2 barebox is
compiled with the AAPCS ABI which requires this.
It also had a bug and didn't pass the arguments properly, but code
execute via "go" rarely uses arguments so this wasn't very noticeable.
Since thumb2 was always the only user of do_execute(), go ahead and
delete that too.
Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Explicitly loading environment is not required as it will be loaded if
available during device probing
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead of insisting on multiple parameters just use sane defaults.
This allows us to scan all addresses on all busses which is normally
what one wants to get an overview over devices on i2c busses.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
'putchar' is a standard function to output a character. Use this one
instead of the lower level console_putc.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The port we want to have the console on may not necessarily be the port
we want to transfer files on. Make the port configurable with a
commandline option.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Remove the console device we are about using for loadb from the
console layer by deactivating it. This makes sure that no printf output
disturbs the current file transfer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We already retrieve a console_device using console_get_first_active().
Use this one also to send/receive characters instead of the combined
input/output of all console devices with putc/getc.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When writing a file failed (e.g. due to a read-only file system), no
error was reported by the 'edit' tool. To be valid (and to not confuse
the poor user) at least '1' should be returned to indicate an error.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
save_file() did ignore possible errors of its write() calls.
Now the error code is used as return code for save_file().
write_full() is used instead of write() as it does not perform partial
writes which would require to check for returned size, too.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add options to explicitly test cached/uncached tests. Without these
options still both cached and uncached is tested if remapping is
supported.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Often enough the biggest free region spans most free RAM, so
it doesn't add much value to test the remaining free regions. This
patch changes the default behaviour to only test the biggest free
region and adds the -t option to test all regions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>