Under option -munaligned-access, gcc can perform local char
or 16-bit array initializations using misaligned native
accesses which will throw a data abort exception. Fix files
where these array initializations were unneeded, and for
files known to contain such initializations, enforce gcc
option -mno-unaligned-access.
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
[trini: Switch to usign call cc-option for -mno-unaligned-access as
Albert had done previously as that's really correct]
Signed-off-by: Tom Rini <trini@ti.com>
This patch adds support for networking in SPL. Some devices are
capable of loading SPL via network so it makes sense to load the
main U-Boot binary via network too. This patch tries to use
existing network code as much as possible. Unfortunately, it depends
on environment which in turn depends on other code so SPL size
is increased significantly. No effort was done to decouple network
code and environment so far.
Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Tom Rini <trini@ti.com>
This is needed for the SPEAr SPL support, as SPEAr uses the mkimage
header to wrap and validate the images (SPL & U-Boot).
Signed-off-by: Stefan Roese <sr@denx.de>
Replace rand() with the functions from lib/. The link-local network code
stores its own seed, derived from the MAC address. Thus making it
independent from calls to srand() in other modules.
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Add support for AES using an implementation from Karl Malbrain.
This offers small code size (around 5KB on ARM) and supports 128-bit
AES only.
Signed-off-by: Yen Lin <yelin@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
The fdtdec_find_aliases_for_id() function is complicated enough that
it really should have some tests. This does not necessarily need to be
committed to U-Boot, but it might be useful.
(note there are a few minor inconsistencies with this patch which will be
cleaned up when the USB series is applied)
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Adds support for loading U-Boot from UART using YMODEM protocol.
If YMODEM support is enabled in SPL and the romcode indicates
that SPL loaded via UART then SPL will wait for start of a
YMODEM transfer via the console port.
Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]
This patch merges the BCH ECC algorithm from the 3.0 Linux kernel.
This enables U-Boot to support modern NAND flash chips that
require more than 1-bit of ECC in software.
Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
This library provides useful functions to drivers which want to use
the fdt to control their operation. Functions are provided to:
- look up and enumerate a device type (for example assigning i2c bus 0,
i2c bus 1, etc.)
- decode basic types from the fdt, like addresses and integers
While this library is not strictly necessary, it helps to minimise the
changes to a driver, in order to make it work under fdt control. Less
code is required, and so the barrier to switch drivers over is lower.
Additional functions to read arrays and GPIOs could be made available
here also.
Signed-off-by: Simon Glass <sjg@chromium.org>
While looking to upgrade to zlib-1.2.5, the current mondo merge of
multiple files into a single was making things way more difficult
than it should have been. Hard to pick out what has been changed
to port it to U-Boot, been removed as useless, and bug fixes added
after the fact.
So split the single file up into the original file names, and merge
non-essential changes back from the original tree (for some reason,
style in code in a bunch of places was changed to U-Boot style even
though this isn't "U-Boot" code).
The original build style is retained -- we have a single zlib.c that
includes all the other files, and that is the only file we compile.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Crc7 is used to compute mmc spi command packet checksum.
Copy from linux-2.6 lib/crc7.c include/linux/crc7.h
commit ad241528c4919505afccb022acbab3eeb0db4d80
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Before this commit, weak symbols were not overridden by non-weak symbols
found in archive libraries when linking with recent versions of
binutils. As stated in the System V ABI, "the link editor does not
extract archive members to resolve undefined weak symbols".
This commit changes all Makefiles to use partial linking (ld -r) instead
of creating library archives, which forces all symbols to participate in
linking, allowing non-weak symbols to override weak symbols as intended.
This approach is also used by Linux, from which the gmake function
cmd_link_o_target (defined in config.mk and used in all Makefiles) is
inspired.
The name of each former library archive is preserved except for
extensions which change from ".a" to ".o". This commit updates
references accordingly where needed, in particular in some linker
scripts.
This commit reveals board configurations that exclude some features but
include source files that depend these disabled features in the build,
resulting in undefined symbols. Known such cases include:
- disabling CMD_NET but not CMD_NFS;
- enabling CONFIG_OF_LIBFDT but not CONFIG_QE.
Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
This implementation is based on code from uClibc-0.9.30.3 but was
modified and extended for use within U-Boot.
Major modifications and extensions:
* hsearch() [modified / extended]:
- While the standard version does not make any assumptions about
the type of the stored data objects at all, this implementation
works with NUL terminated strings only.
- Instead of storing just pointers to the original objects, we
create local copies so the caller does not need to care about the
data any more.
- The standard implementation does not provide a way to update an
existing entry. This version will create a new entry or update an
existing one when both "action == ENTER" and "item.data != NULL".
- hsearch_r(): Instead of returning 1 on success, we return the
index into the internal hash table, which is also guaranteed to be
positive. This allows us direct access to the found hash table
slot for example for functions like hdelete().
* hdelete() [added]:
- The standard implementation of hsearch(3) does not provide any way
to delete any entries from the hash table. We extend the code to
do that.
* hexport() [added]:
- Export the data stored in the hash table in linearized form:
Entries are exported as "name=value" strings, separated by an
arbitrary (non-NUL, of course) separator character. This allows to
use this function both when formatting the U-Boot environment for
external storage (using '\0' as separator), but also when using it
for the "printenv" command to print all variables, simply by using
as '\n" as separator. This can also be used for new features like
exporting the environment data as text file, including the option
for later re-import.
- The entries in the result list will be sorted by ascending key
values.
* himport() [added]:
- Import linearized data into hash table. This is the inverse
function to hexport(): it takes a linear list of "name=value"
pairs and creates hash table entries from it.
- Entries without "value", i. e. consisting of only "name" or
"name=", will cause this entry to be deleted from the hash table.
- The "flag" argument can be used to control the behaviour: when
the H_NOCLEAR bit is set, then an existing hash table will kept,
i. e. new data will be added to an existing hash table;
otherwise, old data will be discarded and a new hash table will
be created.
- The separator character for the "name=value" pairs can be
selected, so we both support importing from externally stored
environment data (separated by NUL characters) and from plain text
files (entries separated by newline characters).
- To allow for nicely formatted text input, leading white space
(sequences of SPACE and TAB chars) is ignored, and entries
starting (after removal of any leading white space) with a '#'
character are considered comments and ignored.
- NOTE: this means that a variable name cannot start with a '#'
character.
- When using a non-NUL separator character, backslash is used as
escape character in the value part, allowing for example fo
multi-line values.
- In theory, arbitrary separator characters can be used, but only
'\0' and '\n' have really been tested.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
If you really want to slim down U-Boot and you would rather use a higher
compression scheme (like LZMA), it'd be nice to disable gzip/zlib since
these code bases take up a significant amount of space.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The sha1 code is currently compiled for everyone, but in reality, it's
only used by the FIT code. So make it optional just like MD5.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
There are boards out there that do not have network support in
U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This
makes it desirable to be able to port network configuration (like
the IP address) to the Linux kernel.
We should not make the passing of the IP configuration to Linux
dependent on U-Boot features / settings.
For this, make getenv_IPaddr() global. This fixes build error
u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr'
on various architectures.
Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
Acked-by: Ben Warren <biggerbadderben@gmail.com>
According to the PPC reference implementation the udelay() function is
responsible for resetting the watchdog timer as frequently as needed.
Most other architectures do not meet that requirement, so long-running
operations might result in a watchdog reset.
This patch adds a generic udelay() function which takes care of
resetting the watchdog before calling an architecture-specific
__udelay().
Signed-off-by: Ingo van Lil <inguin@gmx.de>
circbuf could be used as a generic library and is only currently
needed when CONFIG_USB_TTY is defined.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Add a library that helps in translating between virtual and physical
addresses. This library can be useful as a simple means to implement
map_physmem() and virt_to_phys() for platforms that need functionality
beyond the simple 1:1 mapping.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Now it's used at UBI module. Of course other modules can use it.
If you want to use it, please define CONFIG_RBTREE
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
ARM, i386, m68k and ppc all have identical implementations of strmhz().
Other architectures don't provide this function at all.
This patch moves strmhz() into lib_generic, reducing code duplication
and providing a more unified API across architectures.
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
This commit gets rid of a huge amount of silly white-space issues.
Especially, all sequences of SPACEs followed by TAB characters get
removed (unless they appear in print statements).
Also remove all embedded "vim:" and "vi:" statements which hide
indentation problems.
Signed-off-by: Wolfgang Denk <wd@denx.de>
MD5 supoprt is turned on by defining CONFIG_MD5, the digest can be then
calculated using the md5() function -- see include/md5.h for details.
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
Introduce the LMB lib used on PPC in the kernel as a clean way to manage
the memory spaces used by various boot images and structures. This code
will allow us to simplify the code in bootm and its support functions.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This change is in preparation for condtitionial compile support in the
build system. By spliting them all into seperate lines now, subsequent
patches that change 'COBJS-y += ' into 'COBJS-$(CONFIG_<blah>) += ' will
be less invasive and easier to review
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Move the 64bit division from lib_avr32 to lib_generic. With this, all
boards can do_div/__div64_32 if needed, not only avr one. Code is put
to lib_generic, so no larger memory footprint if not used. No code
modifications. Thanks for proposal by Håvard Skinnemoen.
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
- Show on the Status LEDs, some States of the board.
- Get the MAC addresses from the EEProm
- use PREBOOT
- use the CF on the board.
- check the U-Boot image in the Flash with a SHA1
checksum.
- use dynamic TLB entries generation for the SDRAM
Signed-off-by: Heiko Schocher <hs@denx.de>
Modifications are based on the linux kernel approach and
support two use cases:
1) Add O= to the make command line
'make O=/tmp/build all'
2) Set environement variable BUILD_DIR to point to the desired location
'export BUILD_DIR=/tmp/build'
'make'
The second approach can also be used with a MAKEALL script
'export BUILD_DIR=/tmp/build'
'./MAKEALL'
Command line 'O=' setting overrides BUILD_DIR environent variable.
When none of the above methods is used the local build is performed and
the object files are placed in the source directory.