Some ops do not handle read with count = 0 correctly. They do
not have to if this is catched in the upper layer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The OMAP4 romcode expects some unusual ecc layout which we could
write but not read. This patch adds a function which uses the
manual mode to read a page written with this ecc layout.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We can't use the ECC_RESULTx_0 register set for manual mode which
we'll need in the next patch. So factor out an internal function
which makes the register set to use configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
- add missing '\n' at line ends
- fix wrong argument type warnings
- remove too noisy debug in omap_hwcontrol
- add function names to debug printfs
- add 0x prefixes to hex values
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The driver used to print an error when bch decoing failed, but
did not actually throw an error. Fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Move omap_calculate_ecc outside omap_correct_bch. When implementing
the romcode bch read page we have to call omap_calculate_ecc with
different arguments than in the standard case.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We need the bch correct algorithm in the next patches, so
factor out a seperate function for this and also safe an
indention level.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
let the linker to provide the basic linker script
just insert the commands and initcalls before the .rodata section
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
today we have the same linker script in board and lib
and only the board linker script is used
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This fixes a bug introduced with:
commit 74c36329c3
Author: Antony Pavlov <antonynpavlov@gmail.com>
Date: Tue Oct 18 13:48:44 2011 +0400
fs: fix path_check_prereq()
This patch makes impossible the situations than path_check_prereq() can make
'return 0' without changing errno.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
path_check_prereq is supposed to return 0 when a file does
not exist and S_UB_DOES_NOT_EXIST is given. stat() changes
errno, so we have to set errno back to 0 before returning.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks to a common memory handling barebox knows the sdram banks
and sizes, so we can add a common fixup functions for the nodes
in the devicetree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
If the user has parsed a tree, we start Linux using the
device tree, otherwise we use the traditional ATAG
mechanism.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds basic device tree command support. So far we can
parse a flat device tree (-p), which also stores the tree
in memory, dump it (-d) and free (-f) the internally stored tree.
The chosen node can be updated with barebox bootargs, no other
device tree manipulation is implemented yet.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
vanilla libfdt 1.3.0 from the dtc git:
git://git.jdl.com/software/dtc.git
Only small adjustments to compile with barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch makes impossible the situations than path_check_prereq() can make
'return 0' without changing errno.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When building sandbox, barebox is built with -Dprintf=barebox_printf as
to not collide with the printf provided by libc. This would also match
the format(printf) function __attribute__.
Since gcc documents that __printf__ can be used instead of printf as a
format attribute, use this instead and avoid a lot of noisy warnings.
NB: this relates to 6b082cfe9f which was
an earlier attempt at solving this, which got reverted due to other
regressions.
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When building sandbox with ccache, one would hit warnings such as:
warning: 'struct mmsghdr' declared inside parameter list
on random files; a way to reproduce this issue is to build a simple
file doing just:
#include <sys/socket.h>
int main(void) {
return 0;
}
gcc -Wall -P -c -o foo foo.c
But actually the -P flag is only useful when generating non-C files,
such as linker scripts in the case of barebox. Removing the -P flag
from all the gcc invocations, except when generating .lds files makes
the warning go away. It turns out that this is what
linux/scripts/Makefile.build also does nowadays.
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Running the 'bootz' command always fails with
could not read <some file>
due to wrong usage of pointers and structures. This is the second try to fix
the 'bootz' command. At least on my target it is now be able again to load a
kernel without any error.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Running the 'bootz' command always fails with
could not read <some file>
due to it loads only a size of a pointer, instead of the size of the expected
header structure.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch remove those warnings in nios2 drivers:
include/io.h:7:5: warning: "__BYTE_ORDER" is not defined
include/io.h:7:21: warning: "__BIG_ENDIAN" is not defined
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Contrary to other Atmel boards, the AT91SAM9M10G45EK board file only
describes the case where NAND is used as the storage for Barebox and
its environment. Therefore, it makes sense to enable the Atmel NAND
driver in the default configuration for this board.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The environment partition was overlapping the Barebox partition in
those three Atmel boards. Saving the environment resulted in the
Barebox being overwritten.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We switched to resources recently and the nand controller
of the i.MX53 needs two of them, so fix the helper in the
same way as the i.MX51
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds lowlevel (AIPS, PLL, L2) initialization for i.MX53 boards.
This is a direct transcription of Freescales U-Boot assembler code
with the exception that we initialize PLL1 with 1000MHz and assume
that all necessary voltages are already adjusted when we arrive here.
It must be explicitely called from the boards so a board is free to
do it's own initialization. However, boards should use this code
and make it more configurable if necessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>