9
0
Fork 0
Commit Graph

1508 Commits

Author SHA1 Message Date
Uwe Kleine-König 6fecd2aaca partitions: dos: parse extended partition
DOS MBRs might contain an extended partition that holds several logical
partitions. Add these to the partitions of the block device.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:38:27 +01:00
Uwe Kleine-König 8ddf910d2f partitions: dos: don't open code get_unaligned_le32
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:28:27 +01:00
Uwe Kleine-König 7399925b38 blspec: fix documention of blspec_scan_directory's return code
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:27:58 +01:00
Uwe Kleine-König e55160fe10 partitions: dos: improve guess of disk size
The code used to ineffectively take the end of the last partition as guess
for the disk size. Better use the end of the partition that has its end
rearmost.

Also return an unsigned type instead of int as the result is always
non-negative.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:27:17 +01:00
Sascha Hauer ded25480d8 Merge branch 'for-next/rpi' 2013-11-07 08:31:47 +01:00
Sascha Hauer 73ef216f0d Merge branch 'for-next/bootspec' 2013-11-07 08:31:47 +01:00
Alexander Aring 29ab38ef1c dlmalloc: fix compiler warning
This patch fix a compiler warning while building sandbox barebox with
gcc version 4.8.2.

common/dlmalloc.c: In function ‘barebox_calloc’:
common/dlmalloc.c:1756:2: warning: ISO C90 forbids mixed declarations
and code [-Wdeclaration-after-statement]
  void *mem = malloc(sz);
  ^

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-07 08:10:44 +01:00
Sascha Hauer d7c1612d65 of: Add a context pointer to fixup functions
If drivers want to fixup their specific instance they need some context
to know which instance they have to fixup.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 10:24:46 +01:00
Sascha Hauer 9e26e30af4 blspec: Make error message more clear
"Nothing found on" is a bit unspecific. Make clear that no
bootspec entry is found.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:55 +01:00
Sascha Hauer 21af7e0005 blspec: make cdev optional
the cdev for a given directory can be determined by get_cdev_by_mountpath().
Use this function and remove the cdev argument from blspec_scan_directory().
Also, export the function to make code possible which boots the bootloader
spec entries found in directories.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:55 +01:00
Sascha Hauer d85c580eeb blspec: Let scan functions return the number of entries found
So that callers can detect whether entries are found or not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:54 +01:00
Sascha Hauer 6b12fb727e blspec: Allow to boot partitions
Instead of only allowing complete devices we now also allow single
partitions to look for bootloader spec entries.

Normally the bootloader spec defines a way to find a partition containing /boot
on a device.  On embedded systems it's often useful instead to have only a
single partition image which contains both the kernel and the root filesystems.
This partition image may be written to the device multiple times. With this
patch they can be booted with 'boot emmc0.<partno>'

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:54 +01:00
Sascha Hauer a58d8ba424 blspec: rename _hwdevice functions to _devicename
Since it's not necessarily the hardware device this seems to
be a more appropriate name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:54 +01:00
Sascha Hauer 2f5d04241c blspec: Push device_detect into blspec_scan_device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-05 08:37:54 +01:00
Alexander Shiyan 5643fdce0f calloc: Fix possible memory leak
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 08:51:44 +02:00
Sascha Hauer 6b8b04c0ab blspec: Fix once/default booting
The default/once files contain the full path to the entries, not
only the filename. This fixes booting the once and default entries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-21 09:15:45 +02:00
Jan Luebbe 0a45810d29 common: fix possible build problem without password support
In the case where CONFIG_PASSWORD is off, CONFIG_PASSWORD_DEFAULT is
undefined. As undefined is not "", this causes make to call find -type f.
If there is a filename containing a :, make will complain about having
"multiple target patterns"

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-15 08:36:53 +02:00
Sascha Hauer 61cf2b51bc add kernel-install tool for bootloader Spec
This adds a tool for installing kernels according to the bootloader
spec. systemd already has a similar tool, but it is limited to installing
kernels on the currently running system. The barebox kernel-install
tool instead can also be used to install kernels on removable media on a
development host for cross development. It is compiled in two variants,
as 'kernel-install' for the host and as 'kernel-install-target' using
$CROSS_COMPILE.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-14 15:28:06 +02:00
Sascha Hauer ef5dac9c2b Implement bootloader spec support for barebox
The Bootloader Specification describes a way how kernels can
be installed on devices and how they can be started by the bootloader.

The bootloader spec is currently supported by (x86) gummiboot and
by systemd which provides a kernel-install script. With the bootloader
spec it's possible for the Operating system to install a new kernel
without knowing about the bootloader and for the bootloader it's possible
to discover and start Operating Systems on a media without being
configured.

For more details about the spec see:

http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/

This patch adds barebox support for the spec. It enhances the 'boot'
command so that not only boot script names can be given, but also
devices containing bootloader spec entries. With this it's possible
to call the 'boot' command like: 'boot sd emmc net'. It would then
first look for bootloader spec entries on the (removable) sd card,
then, is nothing is found, on the internal emmc and if still
unsuccessful would call the 'net' bootscript.

The bootloader Spec currently doesn't specify which entry should be
default if multiple entries are found on a single device. Therefore
barebox currently has two extensions of the spec. The $BOOT diretory
can contain a file named 'default'. If present, the content of the
file is treated as a filename under $BOOT/loader/entries/ which is
used as default. Similarly if a file named 'once' is present, the
entry is started once and the file is removed afterwards. This is
useful for testing if a newly installed kernel works before making
it the default.

As on ARM and other Architectures a devicetree has to be specified
for the kernel, the 'devicetree' property is used to specify a
devicetree. Like 'kernel' and 'initrd' this also contains a pth
relative to $BOOT.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-14 14:04:20 +02:00
Sascha Hauer 1369bfd44f cdev: store dos partition type in struct cdev
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-14 14:04:20 +02:00
Sascha Hauer ebf9022f2e Merge branch 'for-next/rs485'
Conflicts:
	common/console_common.c
2013-10-07 08:02:14 +02:00
Sascha Hauer d9870d782a Merge branch 'for-next/mount' 2013-10-07 08:00:28 +02:00
Sascha Hauer 33c56e21eb Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile
2013-10-07 08:00:25 +02:00
Sascha Hauer 9aa6dd0270 Merge branch 'for-next/login'
Conflicts:
	include/console.h
2013-10-07 08:00:13 +02:00
Sascha Hauer 574947ef76 Merge branch 'for-next/console' 2013-10-07 07:59:18 +02:00
Sascha Hauer fb0c2ee1ae Merge branch 'for-next/bpkfs' 2013-10-07 07:59:18 +02:00
Sascha Hauer 0546e669a2 bootm: Replace getenv_loadaddr with getenv_ul
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-07 07:57:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 32d88d9a86 filetype: add Binary PacKage BPK type
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:26:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6a5121f748 console: factorise function to get the first enabled console
rename it to console_get_first_active

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:19:46 +02:00
Sascha Hauer 5ee4ad2229 environment variables: introduce new helpers
This introduces some new environment variable helpers and updates
the existing ones. Newly introduced are:

getenv_bool: read a bool variable
getenv_ul: read an unsigned long variable
getenev_uint: read an unsigned int variable
getenv_nonempty: like normal getenv, but does return NULL instead of an
                 empty string

All new helpers take a pointer to the value. This value is only modified
when the variable exists. This allows the following programming scheme:

	unsigned int myvalue = sanedefault;

	getenv_uint("myvalue", &myvalue);

So without checking the return value myvalue contains the best possible
value.

getenv_ull is updated to this scheme.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 10:28:52 +02:00
Sascha Hauer 4dda27ce49 block: Collect block devices on list
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 10:18:39 +02:00
Sascha Hauer 28141f9e5a defenv-2: replace boot script with command
This replaces the 'boot' script in the defaultenv-2 with a command
with the same behaviour. A command gives more flexibility for future
externsions

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 07:45:04 +02:00
Sascha Hauer 5a968fc81c bootm needs uImage support. Select it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 07:45:04 +02:00
Sascha Hauer 666f12e0c1 introduce runtime loglevel
With this the verbosity of barebox can be controlled during runtime
using the 'loglevel' globalvar.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-29 12:15:40 +02:00
Sascha Hauer 4973077872 globalvar: Do not modify already existing variables
When globalvar_add_simple was called on previously existing variables
then the value was overwritten, even when value was passed as NULL.
Do not overwrite the value in this case which allows us to do a 'global'
on the same variable multiple times without loosing the values.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:14:45 +02:00
Jean-Christophe PLAGNIOL-VILLARD 651a23a69e console_simple: fix: set f_active
so generic code can check if the console is enabled

and now we can use loadb & loadxy

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:22:50 +02:00
Jean-Christophe PLAGNIOL-VILLARD 050f0d5978 console: introduce console_get_by_dev
so we can get console by it's device

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:21:40 +02:00
Jean-Christophe PLAGNIOL-VILLARD 14e8e0a421 shutdown: add board call back
so if we need to do something switch in the board we can fill this function
pointer (as example on Animeo IP shutdown some rs232 & rs485)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:21:40 +02:00
Sascha Hauer 45212cdd72 command: Let builtin command take precedence
In theory we can overwrite a builtin command with a script. However,
I don't know a single case where this has been done. Scripts are
often more unflexible than commands so it's unlikely that a script
can extend the functionality of a builtin command. Moreover, the
internal command is no longer accessible once it's overwritten by
a script.

Invert this logic so that a builtin command can overwrite an existing
script. This will help when the 'boot' script is converted to a
builting command. Then with old environments the builtin command will
be used instead of the script.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 68e6eceae9 bootm: Add dryrun support
This adds support for checking the bootm command without actually booting.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer b15c5eeecf bootm: separate bootm input data and internal data
We used to use struct image_data as the central data structure for bootm and
also as the input data structure. This makes it unclear which of the fields
are actually input data. This patch creates a struct bootm_data which is
exclusively used for input data to make usage clearer.

Also it moves the dispatching of multifile uImage pathnames to the core bootm
code so that the core code gets more flexible and the command code simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 172fc40f61 bootm: move globalvars from command to common
The globalvars should be available even if the bootm command
is not directly present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer fc5923d975 bootm: move getenv_loadaddr from command to common
getenv_loadaddr may be used by other code, so move it
from command/ to common/

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 81e0f84dca bootm: check for os image file
Check if an os image file has been given.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer a0dd2f162a bootm: fix memory leak
data->of_root_node may be allocated from of of_unflatten_dtb.
Free it in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 3c2df61f63 bootm: fix possible memory leak
fdt is allocated, free it in error case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:17 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3b2263c865 console_simple: set baudrate at register
as the console is always enable

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-22 16:46:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD e62d425517 console: drop f_caps and check the function pointer getc/putc instead
None of the driver make the difference between STDOUT and STDERR.
So we just need to check if putc or getc are filled in the console_device

save 32 bytes on versatilepb

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-21 09:59:16 +02:00
Jean-Christophe PLAGNIOL-VILLARD 892c005849 login/passwd: add default password support
even if the env is broken you will have a password

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-19 08:49:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD bb89ea62a0 login: disable input console if password wrong
so we guarantee that barebox is secured again user interaction

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-19 08:49:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 50355554dc globalvar: add globalvar_add_simple_int/bool/enum/ip support
so we can types var

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 09:24:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD 56ee5d3aac process_escape_sequence: add support to \$?
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 09:17:13 +02:00
Sascha Hauer 7f6b6d25d8 Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/pcm051/env/config
2013-09-05 10:40:04 +02:00
Sascha Hauer 1729b1798e Merge branch 'for-next/boardinfo'
Conflicts:
	arch/mips/boards/qemu-malta/init.c
	commands/bootm.c
	drivers/of/base.c
2013-09-05 10:39:22 +02:00
Sascha Hauer 4960dc9db0 rework debug_ll
Convert to static inline functions and use lower case letters for function
names. Also, include mach/debug_ll.h when an architecture provides support
for debug_ll, not only when it's actually enabled. This allows architecures
to put some UART initialization code into mach/debug_ll.h which is compiled
out when debug_ll is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 10:15:48 +02:00
Sascha Hauer 88e132b2a8 Merge branch 'for-next/ubifs' 2013-09-05 10:11:54 +02:00
Jan Luebbe a26d126ee1 console: fix console without CONFIG_PARAMETER
If CONFIG_PARAMETER is not set, dev_set_param() does not call the setter
function. Call it directly instead in this case.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
2013-08-26 10:01:28 +02:00
Sascha Hauer 338b6e7edc export model as globalvar
The model string is valuable information. Make it available to scripts
with a globalvar.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:56 +02:00
Sascha Hauer 068bed22a6 Set model and hostname at boardlevel
With multiboard support the compiletime generated BOARDINFO string
gets more and more meaningless. This removes it from Kconfig and
replaces it with a variable that can be set at boardlevel.

Also many boards have a standard setting for the hostname in the
environment. This patch also moves the standard to C code by calling
barebox_set_hostname().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:55 +02:00
Sascha Hauer 774580c2bd Make hostname available to C Code
The boards often have a sane default for the hostname. Provide a C
function for setting/getting it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:37 +02:00
Sascha Hauer 775ba3c093 introduce barebox_set_model
Instead of calling of_get_model() in barebox_get_model() add a
barebox_set_model() and use it to set the boardinfo once it's
available from the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:37 +02:00
Sascha Hauer b986f4f1ee remove remaining references of CONFIG_BOARDINFO
With this all code uses barebox_get_model() and no longer
a compile time generated string.

Also this renames barebox_boardinfo() to barebox_get_model()
since we are going to add the corresponding _set_ function
and 'model' corresponds to the devicetree notion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:37 +02:00
Sascha Hauer 8326bff00f globalvar: move globalvar init to pure_initcall
globalvar has no dependencies. Move it to pure_initcall to
make it available earlier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:37 +02:00
Sascha Hauer ec871f9b60 Add a global.version variable
So far we only had the version command which is able to print
the barebox version. To make the barebox version available for
scripts add a globalvar for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:36 +02:00
Sascha Hauer 016082f85e globalvar: Allow to set initial value
Calling globalvar_add_simple() and setting a value is more than common.
Add a parameter for the initial value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:33 +02:00
Jean-Christophe PLAGNIOL-VILLARD 52286bb492 uimage: fix: fill size when no compression is used
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-12 22:04:31 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7320851ed1 uimage: fix: always support multi image support
drop ifdef CONFIG_UIMAGE_MULTI as the Kconfig option is not present anyway

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-12 22:04:31 +02:00
Sascha Hauer d9abbe8d01 filetype: Add ubifs detection
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:44:48 +02:00
Sascha Hauer fbf082b565 Merge branch 'for-next/of'
Conflicts:
	arch/arm/boards/freescale-mx53-loco/board.c
	drivers/of/Makefile
2013-08-05 12:50:06 +02:00
Sascha Hauer 9ebb0554cd Merge branch 'for-next/misc' 2013-08-05 12:49:58 +02:00
Sascha Hauer b1aae799f9 Merge branch 'for-next/lz4' 2013-08-05 12:49:46 +02:00
Sascha Hauer b8c60d554f Merge branch 'for-next/imagesize' 2013-08-05 12:49:31 +02:00
Antony Pavlov e3399d713f resurrect CONFIG_PANIC_HANG option
The CONFIG_PANIC_HANG a part of the U-Boot heritage.
It is used in the barebox code, but there is no mention
of this option in Kconfig files.

Sometimes this option is very helpful, so
let's resurrect it.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-05 12:14:03 +02:00
Sascha Hauer 85fce508e7 of: Use correct devicetree in of_print_cmdline
of_print_cmdline() is passed a devicetree, so use this one instead
of the internal devicetree. This fixes the cmdline printout when
bootm on ARM is used with an external devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-27 07:38:13 +02:00
Sascha Hauer e49d260ba7 memory_display: Change address pointer to type const void *
No need to force a width of the pointer, so use void *. Also it's
not modified in memory_display, so also add a const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 12:16:26 +02:00
Sascha Hauer c7848ffee2 block: shortcut writebuffer_flush if writing is disabled
Saves a few bytes of binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 11:49:01 +02:00
Kyungsik Lee cdc837f4d9 lib: Add support for LZ4-compressed kernel
This patch adds support for extracting LZ4-compressed kernel images,
as well as LZ4-compressed ramdisk images in the kernel boot process.

This depends on the patch below
decompressor: Add LZ4 decompressor module

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-16 08:24:30 +02:00
Sascha Hauer 121c3d6e9c devfs: let devfs_add_partition return the new partition
Useful for unregistering later or for adding addional flags.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:47 +02:00
Sascha Hauer 10920b6fe2 ARM: i.MX: Fix i.MX27 debug uart Kconfig entries
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:05:59 +02:00
Alexey Galakhov 3d85dae2be Force set console baudrate at enable time
Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-10 23:25:22 +02:00
Alexander Shiyan 4ccf45db0a common: console: Fix possible null pointer dereference
doing a 'cs0.active=' on the command line crashed barebox. Fix this by
not dereferencing val when it's NULL.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 08:45:42 +02:00
Sascha Hauer 8afe2cb4d4 Merge branch 'for-next-manual/oftree-linux-sync' 2013-07-02 07:08:46 +02:00
Sascha Hauer 55e87e07c1 Merge branch 'for-next/ppc' 2013-07-01 10:14:40 +02:00
Sascha Hauer 85b427ffed Merge branch 'for-next/misc' 2013-07-01 09:37:37 +02:00
Sascha Hauer 87ed8c0456 Merge branch 'for-next/menu' 2013-07-01 09:37:37 +02:00
Sascha Hauer 44ebe21a33 Merge branch 'for-next/memtest' 2013-07-01 09:37:37 +02:00
Sascha Hauer 1e382ad1c4 Merge branch 'for-next/debug' 2013-07-01 09:32:05 +02:00
Sascha Hauer d2fcbe0690 Merge branch 'for-next/bootm' 2013-07-01 09:32:04 +02:00
Renaud Barbier e06aa06965 common: DDR2 SPD checksum.
The code calculates the DDR2 SPD checksum as per JEDEC standard
No 21-C Appendix X (revision 1.2)

The code is based on the equivalent files from U-Boot version
git-a71d45d.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-27 08:38:04 +02:00
Sascha Hauer 4674fd7b6c startup: Add initcall tracing debug option
Being able to trace initcall is very useful when trying to
find out where startup hangs. This adds a kconfig option for
it to make it easier to access.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:36 +02:00
Sascha Hauer 549ccf4d0c ARM: i.MX: Make debug UART selectable from Kconfig
To make early debugging on i.MX a bit simpler. This uses a similar
magic than the kernel does.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:36 +02:00
Sascha Hauer 0686fe0edf add function to get boardinfo string
When using devicetrees the boardinfo (or model) can be obtained
from the devicetree. Add a function to get the boardinfo so that
we have a chance to add information from the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-24 21:39:07 +02:00
Sascha Hauer 2e6bbb4065 remove unused debug Kconfig options
ENABLE_DEVICE_NOISE is used only in two network drivers and is
otherwise unused. ENABLE_FLASH_NOISE is completely unused.
ENABLE_PARTITION_NOISE enables DEBUG in the partition command,
but this code has no debug messages at all.

Remove all this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-23 21:37:12 +02:00
Sascha Hauer a485953521 module: remove duplicate ALIGN and __ALIGN_MASK definition
This is already defined in include/common.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 08:08:37 +02:00
Sebastian Hesselbarth 0b79c3bb64 OF: base: sync of_find_node_by_path with linux OF API
Barebox of_find_node_by_path requires a node to be passed as start node
to start searching. Linux OF API does not pass this node and no current
user of it in barebox is passing anything else than the root node.
Therefore, we rename current function to of_find_node_by_path_from and
introduce a Linux OF API compatible of_find_node_by_path that always
passes the current root_node. Also, all current users of that function
are updated to reflect the API change.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 21:20:50 +02:00
Sascha Hauer 7c3603a199 partitions: dos: fix memory leak in nt disk signature
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-19 22:59:55 +02:00
Sascha Hauer 7d58f3f346 bootm: factor out code to make it usable from C
Much of the bootm code is implemented in the command itself. Move
it to a common place to be able to call it from C aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-19 22:57:39 +02:00
Sascha Hauer 22350e4e68 menu: Make action callback optional
Someone calling menu_show might only be interested in the entry the user
selected without having something in the action callback. Make it optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-19 22:47:48 +02:00
Sascha Hauer f890ea69be Fix gotoXY argument order
gotoXY has the argument order (y, x). Change this so that usage of this
function feels more natural.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-19 22:45:14 +02:00
Sascha Hauer 1679063e40 menu: Align entries
More than 9 menu entries in are single menu are not aligned anymore, like
this:

8 entry8
9 entry9
10 entry10

Use %2d in the printf format specifier to align more than 9 entries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-19 22:42:34 +02:00
Alexander Aring 3275c7ea43 common: add memtest.c with mem_test routine
Add mem_test routine. Useful to detect timing problems if someone
porting a new device to barebox. This test includes a data bus test,
address bus test and integrity check of memory.

This mem_test routine has as parameter start and end address of testing
space. The last parameter can skip the integrity check.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-05 22:54:35 +02:00
Sascha Hauer 5f56c35060 Merge branch 'for-next/of' 2013-06-02 16:28:34 +02:00
Sascha Hauer 5e7f855847 Merge branch 'for-next/block' 2013-06-02 12:35:47 +02:00
Sascha Hauer b27af5cdf3 partition: DOS: Add parameter for the NT disk Signature
The NT disk Signature is a unique 32-bit value in the MBR allowing
to identify a MSDOS partitioned disk. The signature can be used to
specify the Linux rootfs.
This patch adds support for the NT disk Signature in the form of a
device parameter which can both be read and written.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-02 12:35:13 +02:00
Sascha Hauer 5014bf0cc5 partitions: Add missing depends on BLOCK
The disk partitions use blockdevice functions, so add the corresponding
depends on BLOCK.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-02 12:35:13 +02:00
Sascha Hauer df1dcc057e Merge branch 'for-next/misc' 2013-06-02 12:24:56 +02:00
Sascha Hauer e82e40523f block: implement block_read/block_write functions
Some drivers use blk->ops->read/write. This bypasses the caching block
layer and was never intended like this. The upper API to the block layer
is the cdev layer. This patch adds block_read and block_write functions
and uses them where appropriate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 09:34:48 +02:00
Sascha Hauer b5c4e238d3 block: rename file operation functions
block_read and block_write collide with a to-be-introduced
global function, so rename the file operation functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 09:23:52 +02:00
Sascha Hauer b5167ee51c bootm: print Kernel commandline in verbose mode
Without devicetree support we print the Kernel commandline in
verbose mode. Do the same with devicetree boot aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:32:37 +02:00
Sascha Hauer a872dc166a of: remove unused define
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:32:27 +02:00
Sascha Hauer 95453258d6 make: Add barebox_default_env.* to targets
Otherwise it gets rebuilt everytime.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-25 15:11:50 +02:00
Sascha Hauer fe85ff4761 treewide: Fix typo seperate -> separate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-21 21:38:21 +02:00
Sascha Hauer c19efab886 Merge branch 'for-next/param'
Conflicts:
	drivers/mci/mci-core.c
2013-05-06 09:30:50 +02:00
Sascha Hauer 3cdd18632e Merge branch 'for-next/memory-commands' 2013-05-06 09:30:28 +02:00
Hubert Feurstein a5e4764679 common/partition: check only for partition table types
The detection of the partition table fails when we have a barebox image
in the MBR. So check only for partition table types.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-29 09:34:13 +02:00
Hubert Feurstein c06956e15f common/filetype: move partition-table detection into own function
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-29 09:32:54 +02:00
Sascha Hauer 255e5b4c42 memory commands: move memory_display to separate file
memory_display is a function which should generally be available.
Currently it depends on memory command support being compiled in,
so move the function to a separate file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:35:17 +02:00
Sascha Hauer ab855df99f console: Use dev_add_param_int for baudrate parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-11 11:48:35 +02:00
Sascha Hauer dd9f6d08a2 Merge branch 'for-next/relocate'
Conflicts:
	arch/arm/lib/barebox.lds.S
2013-04-04 14:20:42 +02:00
Sascha Hauer 2143dfda8b Merge branch 'for-next/pr_print' 2013-04-04 14:20:33 +02:00
Sascha Hauer c4da77611c Merge branch 'for-next/oftree' 2013-04-04 14:20:32 +02:00
Sascha Hauer 45b87922a6 Merge branch 'for-next/misc-arm' 2013-04-04 14:20:32 +02:00
Sascha Hauer 8f2c6a3d2b Merge branch 'for-next/misc' 2013-04-04 14:20:32 +02:00
Marc Kleine-Budde d366ae8382 bootsource: add definition for i2c-eeprom, spi-nor, spi-eeprom and usb
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-04 10:54:27 +02:00
Marc Kleine-Budde 5d8240619c bootsource: add support for bootsource instance information
Add a C interface to set and get the bootsource instance:

    int bootsource_get_instance(void);
    void bootsource_set_instance(int instance);

Also export the shell variable "bootsource_instance".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-04 10:54:27 +02:00
Marc Kleine-Budde 54c3870f54 bootsource: use initcall to export bootsource location to environment
This way the bootsource is exported to the environment, even if unknown.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-04 10:54:27 +02:00
Marc Kleine-Budde 7b66d9cddd bootsource: create arch independent bootsource framework
This patch seperates the imx independent from the arch independent code. The
following functions and enums are renamed:

- imx_bootsource() -> bootsource_get()
- imx_set_bootsource() -> bootsource_set()
- enum imx_bootsource -> enum bootsource

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-04 10:54:22 +02:00
Sascha Hauer 9eefa7445e include asm/sections.h instead of asm-generic/sections.h
To let the architectures override asm-generic/sections.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-10 11:05:46 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1d60b224e5 barebox_banner: switch to pr_info
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:18:08 +01:00
Jean-Christophe PLAGNIOL-VILLARD 42459443b6 startup: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:18:08 +01:00
Jean-Christophe PLAGNIOL-VILLARD a4a8b454e1 meminfo: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:16:17 +01:00
Jean-Christophe PLAGNIOL-VILLARD 50c9df4899 startup: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:16:17 +01:00
Sascha Hauer d34aca4c09 dummy malloc: Add licence header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-08 08:47:51 +01:00
Sascha Hauer a81ec0225f ARM: Add relocatable binary support
For making the same binary executable on different SoCs which have
different DRAM addresses we have to be independent of the compile
time link address.

This patch adds relocatable binary support for the ARM architecture.
With this two new functions are available. relocate_to_current_adr
will fixup the binary to continue executing from the current position.
relocate_to_adr will copy the binary to a given address, fixup the
binary and continue executing from there.

For the PBL and the real image relocatable support can be enabled
independently. This is done to (hopefully) better cope with setups
where the PBL runs from SRAM or ROM and the real binary does not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-07 12:38:01 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6640f5e399 tlsf_malloc: drop duplicate include
config.h is not need and already inclued by Makefile

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-07 08:37:22 +01:00
Sascha Hauer a51d06d679 of: remove unused libfdt
Now that we are completely independent of libfdt remove the unused
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 973e58e3ab ARM bootm: Switch initrd support to unflattened tree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 3d554f9925 of: memory: Use of_write_number
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 9d8e08353c of: fixup unflattened devicetree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 64c199dd29 of: Pass barebox internal format devicetree to of_get_fixed_tree
With this every devicetree is first converted to the barebox internal
format before it's converted back to dtb again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 004cce1347 of: make flatten independent of libfdt
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD 8be08d9cf2 defaultenv-2: add boot sequence
This allows to boot a sequence of boot entries until one succeeds.

boot sources can be passed in $global.boot.default, which is now treated
as a list. Also a list of boot entries can be specified as arguments
to the boot script. The entries can be:

- a plain filename from /env/boot/
- a full path to an arbitrary file
- a directory containing boot entries

With this this command:

boot net nand-ubi /env/boot.d

would first use the /env/boot/net entry, if this fails the /env/boot/nand-ubi
entry and if this also fails the files from /env/boot.d/ (which could also
be links to boot scripts)

To make the above the default, global.boot.default would be specified as:

global.boot.default="net nand-ubi /env/boot.d"

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-05 11:51:35 +01:00
Sascha Hauer ea0f831cd0 Merge branch 'for-next/mxs' 2013-03-04 09:21:54 +01:00
Sascha Hauer 13408877f4 Merge branch 'for-next/misc' 2013-03-04 09:21:37 +01:00
Sascha Hauer 831d83e922 Merge branch 'for-next/highbank' 2013-03-04 09:21:37 +01:00
Sascha Hauer c6813a5fb1 Merge branch 'for-next/gpt' 2013-03-04 09:21:37 +01:00
Sascha Hauer 1eb77960b8 Merge branch 'for-next/dt' 2013-03-04 09:21:37 +01:00
Sascha Hauer 3d9c751312 Merge branch 'for-next/console' 2013-03-04 09:21:36 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6ae2455e80 of: add do_fixup_by_compatible with u32 and string version
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-03 14:08:44 +01:00
Fabio Porcedda 8e418dcc63 menu: fix remove superfluous newline: change puts() -> printf("%s", )
Fix previous commit:
638f91b "fix compiler warnings: use puts() instead of printf()".

Because puts() function add a newline, use instead printf("%s", ).

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-26 15:04:23 +01:00