All handlers used to just relocate the image without any checks, so
we are doomed if we write outside of SDRAM or will overwrite ourselves.
Move the relocation up to the generic part where we have a chance
of catching these issues.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We never had interrupt support in barebox and we have no plans to
add interrupt support. Even if we do I doubt the current fragments
of irq support are helpful, so remove them.
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>
/dev/self0 and /dev/env0 are in the last MB of nor flash. The
offset depends on the size of the flash, so detect this at
runtime.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We introduced several new functions to ease our life
on ppc, use themn on the pcm030:
- setup iomux and bus clocks in board code
- add sdram memory according to detected size
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The old startup process consisted of several CFG_LOWBOOT,
CFG_RAMBOOT ifdeffery which I do not understand. So remove
all this and replace it with:
- put the entry point for second stage loaders to offset 0x0
so that we can do a go /dev/ram0 to start a second barebox
- When we come from the reset vector assume MBAR is at 0x80000000
- When we come from the second stage entry assume that
SPR 311 is in sync with the current MBAR address.
- Switch MBAR to 0xf0000000 and we are done.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This has never been used in barebox and likely is incomplete
and bitrotted over time, so remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add a helper function for boards to register their memory
devices. This makes the board code smaller and also helps
getting rid of map_base and struct memory_platform_data.
And switch all of the memory to it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
we keep struct memory_platform_data for now on we will switch off the memories
resources to struct resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
this will avoid __bswapsi2 issue see with gcc 4.5.1
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
include/common.h declares this as "unsigned long addr", so we unify it.
This also silences a doxygen warning.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The function names do not make it clear what return value
is expected and do not save a single line of code. Put
the code inline and unbreak the wrong checks introduced
with a3c1e5d888.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Eric Bénard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
before if you specify id = 0 the next available id will be taken
otherwise fail if already registered now as in linux we use -1
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will reduce and simplify defconfigs maintainance
it will also save some disk space
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
this rework is done in order to add a phylib and allow to have phy driver support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will allow each arch to handle the boards more simply and depending on
there need
the env var BOARD will refer to the current board dirent
for sandbox as we have only one board the board dirent is arch/sandbox/board
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Based on a suggestion from S. Hauer, we don't currently need any IDE
support, but we can always add it back later if we choose. There
don't appear to be any other IDE-related source files in the tree.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The correct config variable is CONFIG_MODULES, so tweak any references
to the incorrect CONFIG_MODULE.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Our version of ppc bitops produces the following compiler warnings:
/ptx/work/octopus/WORK_1/sha/u-boot/barebox/arch/ppc/include/asm/bitops.h:
In function 'ext2_find_next_zero_bit':
/ptx/work/octopus/WORK_1/sha/u-boot/barebox/arch/ppc/include/asm/bitops.h:294:
warning: '__swab32p' is static but used in inline function 'ext2_find_next_zero_bit' which is not static
Looking at the kernel ext2_find_next_zero_bit is defined as
generic_find_next_zero_le_bit which is in generic kernel code.
We currently do not need this, so do the very same define to silence the
compiler. If somebody ever needs this function, the resulting error
should give him a hint what to do.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Move platform independent header files to arch/ppc/include/asm, leaving
those in asm/arch*.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Memory layout can now be specified via kconfig options. Two
possibilities exist: default layout means the layout is stack
/ malloc heap / U-Boot. The user can also specify fixed addresses
for each TEXT_BASE / stack / malloc heap.
This patch removes the "-isystem $(gccincdir)" from the
arch/*/Makefile because gccindir is empty.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
a generic linker script to arch/arm/lib/u-boot.lds.S.
If a board wants to overwrite a linker script it can do
so using CONFIG_BOARD_LINKER_SCRIPT.
There is no generic linker script for ppc and blackfin
yet, so still use the board specific one.
This patch makes TEXT_BASE a consistent per-arch config switch.
Additionally, it converts all TEXT_BASE occurences from string to hex.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
restructure ppc startup process. Instead of doing the whole
initialization sequence in flash, we now initialize sdram very
early in the start sequence and relocate u-boot into RAM.
Also U-Boot is now linked to address 0x0 and is also executed
from there. This gives the advantage that we see the correct
offsets in the objdump and we do not need to hassle with
relocation anymore.
The code is still position independent and compiled with -fPIC,
but this could be removed.