This optionally enabled the MMU in the PBL or during early startup for
the non PBL case. The regular MMU init code will pickup the already enabled
MMU later. This might complicate debugging early code, so this has been
made optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so it more easy to add new entry and to maintain
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will allow to have no console support
Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and
3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple
As on bootstrap we have often very limited size.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so we can add easly the console_none support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
environment.h is for environment variables, not for the environment
storage (envfs), so move the prototypes to envfs.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently Kconfig dependencies are used to allow non-interactive builds.
This leads to problems in Kconfig getting the dependencies right.
This patch adds a barebox_main function pointer which is called at the
end of the startup process. This defaults to run_shell when a shell is
enabled.
With this the HAVE_NOSHELL Kconfig variable can be removed. Non interactive
builds can now be enabled for every board allowing to compile a binary
without further Kconfig dependencies. This also allows for more flexibility,
for example boards may decide to try non-interactive startup first and
call run_shell if that fails.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This has several improvements for the oftree command:
- loading a devicetree (-l) and actually probing (-p) it now is separated
- the command now can dump the internal devicetree or a dtb given on the
command line.
- The -f option now actually frees the internal devicetree
With this the usage pattern for this command is:
oftree -l /env/oftree
oftree -d -n /sound
oftree -d /env/oftree
oftree -f
oftree -p
oftree -l -p /env/oftree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
barebox_fdt should once become the pointer to the barebox internal
devicetree. Since barebox has its own internal devicetree format
this was never used. remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add barebox-data section in arm branch to get complete
barebox regions in sdram regions tree.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fix display to stdout of allocated addresses.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fix size address calculation.
Global variables from <asm/sections.h> which are defined
in linker script *.lds files for end addresses has already
a +1 calculation.
For example:
stext = 0x100 with a size about 0x50 will result a etext = 0x150.
In this case a correct size calculation is (etext - stext) = 0x50.
In function 'request_sdram_region' the end address will be
calculated with (start + size - 1) which result a correct
end address of 0x149 in this example.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fix include for linkerscript variables like _etext.
Otherwise build with #define DEBUG will fail.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently the bootm code uses of_fix_tree to apply the fixups
to the devicetree given on the command line. This function assumes
that there is enough space for the fixups available. Also on ARM
we have to make sure the tree does not cross 1Mib boundaries.
This patch moves the space allocation and alignment ensurance
to of_get_fixed_tree and uses it in bootm. This is the first
step for making of_get_fixed_tree the single point of devicetree
handling in barebox.
of_get_fixed_tree now takes an argument of the input fdt. If it is
given, this one is used, otherwise an internal oftree is used which
will be created in subsequent patches.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
dev_add_child is a very unsafe function. If called multiple times
it allows setting the same device to different parents thus corrupting
the siblings list. This happens regularly since:
| commit c2e568d19c
| Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| Date: Sat Nov 3 16:11:05 2012 +0100
|
| bus: add bus device
|
| automatically add it as parent of any bus device if none already specified
|
| we have now a nice output per bus
If for example a FATfs is mounted this nice output per bus often ends with:
> `---- fat0
> `---- 0
> `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL>
> `---- sram00
> `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
> `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
> unable to handle NULL pointer dereference at address 0x0000000c
> pc : [<87f08a20>] lr : [<87f08a04>]
> sp : 86eff8c0 ip : 87f3fbde fp : ffffffff
> r10: ffffffff r9 : 00000000 r8 : 00000003
> r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544
> r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005
> Flags: Nzcv IRQs off FIQs off Mode SVC_32
> [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130)
>
> [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c)
> [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14)
> [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38)
> [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60)
This patch fixes this by adding a device to its parents children list in
register_device so that dev_add_child is no longer needed. This function
is removed from the tree. Now callers of register_device have to clearly
set the parent *before* registering a device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Jan Lübbe <jlu@pengutronix.de>
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
due to missing/misplaced boundary check, deleting characters could
underflow the password buffer.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Pass the buffer size to the file detection code. This makes sure we do not
read past the buffer. This is especially useful for ext filesystem detection
as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE
define which is set to the minimum bufsize the detection code needs to detect
all known filetypes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It was not possible to register another handler when already
a default handler is registered. Fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This implements two new options for the loadenv command:
-s: removes (scrubs) old directory contents to be able to
create a fresh environment from for example /dev/defaultenv
-n: no overwrite. Do not overwrite existing files. This allows
to keep parts of the old environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The option of reading the file at once was discarded because
the option of increasing the buffer size provided almost the
same benefit.
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>