Creating menus from the shell using the regular 'menu' command is rather
complicated. This adds a 'menutree' command which creates a menu from
a directory structure. In the directory structure each directory corresponds
to a single menu entry. The directory contains the following files:
title - A file containing the title of the entry as shown in the menu
box - If present, the entry is a 'bool' entry. The file contains a variable
name from which the current state of the bool is taken from and saved
to.
action - if present this file contains a shell script which is executed when
when the entry is selected.
If neither 'box' or 'action' are present this entry is considered a submenu
containing more entries.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The boot command is expected to work on bootsources from the commandline
if given, on global.boot.default otherwise. Fix this behaviour for the
-m and -l options also.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Since MTD is already supports >= 4GB device sizes it is better to
allow ubi valumes also be created of larger sizes.
Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
MTD internal API presently uses 32-bit values to represent device
size. This patch updates them to 64-bits but leaves the external API
unchanged.
In general, changing from 32-bit to 64-bit values cause little
or no changes to the majority of the code with the following
exceptions:
- printk message formats;
- division and modulus of 64-bit values (mtd_div_by_wb,
mtd_div_by_eb may be used in some of such cases).
Was tested on phyFLEX i.MX6.
Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
memtest fails when a reserved sdram region is at the bank start at
address 0. This patch supports the exclusion of memory region at
the bank start.
Tested on P2020RDB and DA923RC, qemuarm versatilepb.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We can compile barebox for multiple boards at once, but currently
they all share a single default environment. This patch adds a
defaultenv_append() which boards can call to customize the default
environment during runtime. Each board now generate default environment
snippets using bbenv-y and add them during runtime with defaultenv_append()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The readf command is useful to read the content of a file into
a shell variable. It should be used for ascii content and thus
stops reading at all nonprintable characters including newline.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We obtained a USB Product ID from Openmoko for barebox running
in DFU mode. Use it as default for the dfu command. Now we can
make the USB VID/PID arguments optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Check the return value of usb_dfu_register and bail out
with an error if it fails. Also return successfully if it succeeds
instead of returning 1 unconditionally.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Similar to mount(8) the barebox command mount now supports passing a string
to the file system driver via -o.
This is used in the next commit to let the user specify port numbers for
nfs mounts.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
default_environment_path only exists when CONFIG_ENV_HANDLING is enabled.
Boards would have to #ifdef this if they wanted to use
default_environment_path. Use accessor functions instead which can
be ifdeffed on a single place.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Don't return after freeing stored devicetree if also loading ist wanted.
Allow "oftree -f -l my.dtb"
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The GbE support based on the patch for generic 'mii-tool', see
http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz
We need to note Jean-Christophe PLAGNIOL-VILLARD for his
initial GbE support patch:
http://lists.infradead.org/pipermail/barebox/2013-February/012634.html
Generic 'mii-tool' GbE support patch has some disadvantages:
1. 1000baseT-HD is prefered to 1000baseT-FD;
2. show GbE-features for 10/100 only phys (e.g. Level One LXT971).
This patch fixes this disadvantages.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
miitool without arguments will try to show status for all phys.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With the -s option all mii buses can be scanned for devices so
that they are available without doing network operations. Also,
now *all* phy devices on a mii bus can be examined, not only
the one attached to an ethernet device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds the crc32 command to be build
as host and optionally as target tool.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
boot -l crashes with CONFIG_MENU disabled because blspec_alloc returns
with blspec->menu being NULL in this case. So guard the usage of
blspec->menu accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
"%d" in format string requires a signed integer.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
A lot of files rely on include/driver.h including include/of.h (and
this including include/errno.h. include the files explicitly so we can
eventually get rid of including of.h from driver.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With this we can do 'boot <name>' where name is one of:
- a filename under /env/boot/
- a full path to a boot script
- a device name
- a partition name under /dev/
- a full path to a directory which
- contains boot scripts, or
- contains a loader/entries/ directory containing bootspec entries
Multiple names can be given, they are tried in order. So any mixture
between bootspec entries and bootscripts can be given. bootspec entries
can now also be given as a path to a directory containing bootspec entries.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The 'boot -m' command executes the /env/boot/* scripts in order to
determine the title of a boot menu entry. This is not complete and
depends on changes in the environment, so remove it for now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
With this a mount <devname> will mount the device to /mnt/<devname>. This
directory is created automatically if it doesn't exist already.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
It's useful to know which filesystems a barebox binary supports.
Add a -v option to the mount command to find it out.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When printing the devices on which a path is mounted the backingstore is
the interesting thing, not dev_name.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
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>
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>
use the same option as linux -O
as example due to a bug in already deployed kernel we must for the VID offset
at 512 even it should be at 256
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To be able to pass the loadaddr of the image and the initrd.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
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>
With this properties with phandles can be created. A phandle
is created when cells are parsed (in '<' '>') and a cell does
not begin with a digit.
The phandles can be specified either by alias or by full path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format.
No functional changes.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This is a fresh UBI import from Linux v3.10
This is done mainly to get fastmap support.
This was tested with the i.MX nand driver, the MXS nand driver and
on CFI NOR flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
- print error when ioctl fails, not a combined message when one of
ioctl or ubi_attach_mtd_dev failed.
- ubi_attach_mtd_dev() returns the ubi number for success, not 0, so
check for ret < 0 to detect errors.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of_free is misleading about the actual purpose of the function. There is
already a of_create_node counterpart, so rename of_free to of_create_node
and update all users accordingly.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
If size of a flash image file is 0 ubiformat silently formats the volume.
Check size and abort if size == 0. This may be the case if an empty or tftp
mounted file is used.
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
A command should not be interested in the internal USB core state, so
move the state handling into the core.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
To start synchronizing OF API of barebox with linux OF API, this adds
a length pointer to of_find_property. Also all current users of that
function are updated to reflect the API change.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
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>
This new memtest can test the whole unused memory. The new memtest
command try to request the whole unused sdram regions on all banks and
run the mem_test routine from common/memtest.c on it.
The memtest command has only two parameters;
-i Amount of iterations, default 1, iteration of 0 is endless.
-b Set this to skip integrity check.(Do only a fast test for bus lines)
If MMU support is enable, memtest try to run memtest twice. The first with
cache enabled, the second with cache disabled.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It's a precious information that barebox will boot the kernel
with the internal devicetree, so print it even in non verbose
mode.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We often encounter the situation where slow devices should not be
probed during startup since probing is slow and maybe unnecessary
for unused devices. With MMC we have the 'probe' device parameter,
for ata we have the same, for USB we have the 'usb' command. Overall
this is not very consistent.
With MMC there is the additional problem that the probe parameter
is attached to the logical device when we often have the information
which physical device we want to probe.
This patch adds a 'detect' callback for devices and adds a command
to detect devices and to list the devices which are actually detecable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
when doing bootm -v -v we dumped the original tree to the console.
Make sure to print the fixed tree instead so that the fixups can
be examined.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
U-Boot doesn't honor the load address specified in an initrd. Barebox
shouldn't be more strict here. This unbreaks booting an uInitrd
generated by Debian's flash-kernel that uses 0 as entry address where
there is nothing on the i.MX53 that was used.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
data.initrd_address = UIMAGE_SOME_ADDRESS;
...
if (-L was given to bootm)
data.initrd_address = address_provided_to_-L;
...
if (initrd is provided as uInitrd && data.initrd_address == UIMAGE_SOME_ADDRESS)
data.initrd_address = load_address_from_uInitrd;
...
if (data.initrd_address == UIMAGE_SOME_ADDRESS)
data.initrd_address = UIMAGE_INVALID_ADDRESS;
can be simplified to:
data.initrd_address = UIMAGE_INVALID_ADDRESS;
...
if (-L was given to bootm)
data.initrd_address = address_provided_to_-L;
...
if (initrd is provided as uInitrd && data.initrd_address == UIMAGE_INVALID_ADDRESS)
data.initrd_address = load_address_from_uInitrd;
...
The only change introduced by this simplification is for cases where the
user passes -L UIMAGE_SOME_ADDRESS or -L UIMAGE_INVALID_ADDRESS to
bootm. (-L UIMAGE_SOME_ADDRESS is now used literally instead of ignored
before. -L UIMAGE_INVALID_ADDRESS used to skip getting the
initrd-address from the uInitrd, now the uInitrd address is honored.)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
At least in standard oxford english one not is enough.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
As of now we have no way to manipulate individual bits of registers on the
command line. This introduces a memory modify command which allows this. It
has the syntax:
mm [OPTIONS] <adr> <val> <mask>
With [OPTIONS] being the usual memory command options (-b, -w, -l, -d <file>).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Normally in commands we have one file per command which is named like
the command itself. The memory commands are an exception to this. This
patch changes this by separating the memory commands. This also has the
effect that the memory commands can now be selected individually. Along
the way we add some Kconfig help text for the commmands.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The rw_buf is used by several memory commands. Make it global since
we want to split the memory commands into separate files. Also rename
it to mem_rw_buf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
The memory commands all use open_and_lseek and mem_parse_options. Export
them to be able to split the memory commands into separate files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
There was a erase block sized (here 131072) char buf array on the stack.
Changed this to get the space from malloc preventing stack overflows.
Also fix a wrong return without clean up.
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
the fb info is stored in struct screen by fb_open
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This makes it possible to modify the tree in the handlers.
This is necessary because the initrd addresses are only
known inside the handlers, but not to the generic bootm
code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
the of_property command crashes when an empty property value
was given. This is because xrealloc is called with a length
argument of 0. Fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Now that we use the unflattened tree in bootm we can use of_print_nodes
instead of printing the flattened tree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
Whether or not the user wishes devicetree probe support can
now be decided indepentently of the oftree command, so retire
the CMD_OFTREE_PROBE option and use OFDEVICE in the code instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
OFDEVICE decides whether or not we compile in support for probing
devices from the devicetree. Let the user decide this explicitly.
This makes the oftree, of_node and of_property commands independent
of devicetree device support since being able to manipulate
devicetrees has nothing to do with probing devices from the devicetree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In order to be able to handle multiple devicetrees, do not assume
the tree to be unflattened is the barebox internal one. Instead,
just return a pointer to it and assign the barebox internal root_node
external to the unflatten function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Allo subcommands need at least one nonopt arg, so check for
it right after parsing the options and drop the check in the
MARKBAD command.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ubiformat only needs readonly access to the image to flash, so
open it readonly. Opening r/w may fail for example on tftp servers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add pread and pwrite functions.
Split read and write functions to save some space.
The functions pread and pwrite saves and sets the file
position to a given offset and restore them afterwards.
This also makes the nandtest command use these function
which is necessary to not break compilation for the nandtest
command.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The kernel nowadays has mtd_read/write and other functions. In
barebox we also have these functions, but with a different prototype,
namely they correspond to the libmtd userspace functions. Rename
these functions to libmtd_* to avoid name clashes with future mtd
updates.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some of controlled by barebox peripheral devices may be
not affected by CPU reset, so we need call shutdown_barebox()
to stop them.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.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>
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>
The of_property command allows to modify/add/delete properties.
Parsing user input is based on U-Boot code with some fixes added
for catching invalid input.
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>
The location of files that are booted is a precious information, so print
it by default and not only in verbose mode.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
The process of unflatten the device tree is known from the kernel,
so rename the function, because that's what it does.
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>
This adds the missing ubiformat.c file missing from:
commit 5a29d4aea7
Author: Wolfram Sang <w.sang@pengutronix.de>
Date: Mon Dec 17 16:48:33 2012 +0100
commands: add ubiformat
Imported from mtd-utils and stripped down to needed functionality.
Based on an older version (1.4.5.) since the newer do use MEMWRITE
interfaces which we don't have in barebox (yet).
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This command works like the corresponding Unix shell command and
is used for adding, multiplying and much more.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Imported from mtd-utils and stripped down to needed functionality.
Based on an older version (1.4.5.) since the newer do use MEMWRITE
interfaces which we don't have in barebox (yet).
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We have two versions in the tree. Use the newer one, and put it into the
mtd directory while we are at it.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@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>
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>
When calling ls in short mode we do not have to call stat()
for additional informations because we do not use them. This
speeds up ls on filesystems on which stat() is expensive
because the barebox filesystem support always has to iterate
over the directory tree.
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>
As a new implementation of Y-Modem protocol is available,
switch from old implementation to the new one :
- remove old xyzModem* files
- remove old command loady2
- rename command loady2 to loady
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The current Y-Modem implementation has some limitations:
- Y-Modem/G protocol is not supported
- Multiple files (aka. batch) transfers are not supported
- Transfer speed over fast lines (USB console) is slow
- Code is not trivial to maintain (personnal opinion)
This implementation tries to address all these points by
introducing loady2 command.
The effects are :
- transfer speed for Y-Modem over USB jumps from 2kBytes/s
to 180kBytes/s
- transfer speed for Y-Modem/G jumps to 200kBytes/s
- multiple file transfers are possible
This command was tested on a USB console and UART 9600bps
serial line :
- NAKs (and retransmissions) were tested for faulty
serial lines
- multiple file transfers were tested
- Y-Modem, Y-Modem/G and X-Modem transfers were tested
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
the mount command used to have the syntax 'mount <dev> <type> <mountpoint>'.
This was changed to the more Linux like behaviour which specifies the
type with the -t <type> option. If a newer barebox is run on a device
with an older environment the mount command no longer works. This patch
adds compatibility to the old behaviour.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM Linux only maps a single 1MiB section for the devicetree. This has
a 1Mib alignment, so we are not allowed to cross such a boundary. Align
the devicetree to the next power of two so that this never happens.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The fixed devicetree may need more space than the original one.
We used to use 0x8000 here. Add a define for it to have the
space defined at a single place.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds support for a filetype detection command. It can be
used to print a filename on the console or to set a variable
with the detection result for use in shell scripts.
The command also has an option to print the known filetypes
so that a user knows what to match for.
Based on an earlier version from Jean-Christophe.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This switches environment variables to use linux list. This is easier
to read. An additional plus is that the environment variables no longer
need an initcall, so malloc is the only requirement for them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This command is based on the 'mii-diag' and 'mii-tool'
Unix utilities, but it lacks routines to manipulate
MII state (e.g. reset MII, restart autonegotiation
or force MII mode).
This version of the 'miitool' command has no GbE support,
but we can upgrade it in the future. The GbE support
patch for generic 'mii-tool' is here
http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz
EXAMPLE:
barebox:/ miitool -vv /dev/phy0
negotiated 100baseTx-FD, link ok
registers for MII PHY:
3100 782d 0013 78e2 01e1 45e1 0007 2001
0000 ffff ffff ffff ffff ffff ffff ffff
0084 4780 0000 0000 0422 0000 0000 0000
0000 0000 0080 0000 ffff 0000 0000 3660
product info: Level One LXT971A rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add check if writesize is a multiple of erasesize.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Use the same offset type like mtd interface.
Replace modulo operation with IS_ALIGNED macro.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Clean up code:
- change 'i+i' to 'i + i'.
- change counter variable to unsigned int.
- use spaces instead of tabs in help text.
- remove __test_ofs variable.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Use already builtin get_random_bytes instead of for loop.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Change flash 'length' variable type to off_t instead of int.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Rename command argument p for 'passes' to 'i' iteration.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add progressbar and remove other outputs of current flash offset.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Collect ecc statistics per page not per eraseblock.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently in-system update means to write an arbitrary file to
an arbitrary device. There is no sanity check if the flashed image
is of the right type or will fit onto the device. Furthermore some
SoCs need a special preparation step for their images before
flashing them.
This adds a barebox in-system update infrastructure. Boards can
register update handlers which know how to make the board bootable.
The available handlers can be listed to be able to select one,
different force levels give the user the chance to know it better.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Following from the Frank Jullien's patch, here is the same cosmetic correction
when the list of commands is printed (the problem was that the commands for
gpio_* were too long for the %10s alignment)
Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Do not blit the surface everytime we write an image
As we want to able to render multiple image this will cause 1 blit per image;
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To open, memmap, get the fb_info and if needed allocate the offscreen buffer
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead of passing hundreds of parameter, just pass the right structure.
struct screen represent the screen with a without double buffering.
struct surface represent the part of the screen we want to render.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds some basic commands to manupulate clocks on the command
line. Right now we have:
- clk_set_parent
- clk_set_rate
- clk_enable
- clk_disable
- clk_dump
The commands work based on the clock name, otherwise they behave like
the Linux Kernel C functions. clk_dump will dump the clocktree to the
console.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Traditionally tftp is a command of its own. Since we can
mount tftp as a filesystem we have duplicated the tftp code, the old
code is used by the tftp command, the new by the filesystem support.
This adds a tftp command based on the filesystem support to preserve
backward compatibility. This allows us to remove the old tftp support
in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With this the -p option is no longer for parse, but for probe instead.
Using this parses a devicetree given on the command line and probes
the devices found in this tree. Devices which already exist are not
probed again, but instead their device_node is attached to the existing
device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This will allow to do not taint if not enabled
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
use LodePNG version 20120729 from http://lodev.org/lodepng/
The original coding style is keeped to simplify update.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This will allow to reset the screen to a default color when using transparent
PNG.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
So we can add other format support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so be can add more format support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
as we now support via bootm
on ixp4xx we still need it so keep it so far.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This need to be handled by the arch bootm as the address can be invalid and
provided at arch level.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
memset has no '-s' option so remove related help string.
Also this patch makes the command's description more clear.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Since
|commit d22b85a203
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date: Wed Jul 4 23:41:13 2012 +0200
|
| mem md: bail out without arguments
|
| Without arguments the 'md' command defaults to show address 0 which
| likely results in a NULL pointer exception, so only three keystrokes
| are necessary to crash barebox. Show usage instead if 'md' is invoked
| without arguments, so that it at least requires an address to be given
| to crash barebox. This increases the stability of barebox by 66%. Hurray!
barebox does not crash any longer when a plain 'md' without additional arguments
is exectuted. However, doing a 'md -s /dev/nor0' was a standard usecase which now
does not work anymore.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
enable is by default for simple and hush
we do not need to NO_SHELL
this allow to save 1KiB
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Both the uimage command and the bootm command need uImage support, so
add a Kconfig symbol for it to be able to select it properly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This fixes
barebox@Very long board name:/ crc32 -f /dev/mem 0x83f00000+0xfff
CRC32 for /dev/mem 0x83fff000 ... 0x83fffffe ==> 0xa080584bbarebox@Very long board name:/
The problem here was that the return value of
lseek(fd, 0x83f00000, SEEK_SET) (which is 0x83f00000) was casted to an
int (which is -2081423360), returned to do_crc and interpreted as
error there without yielding another error message.
This also makes
crc32 -f /dev/mem 0xffffffff+0x1
die on a NULL pointer exception instead of reporting:
lseek: No error
:-)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Since this commit we interpret the argument to the bad block ioctls
as a pointer to a 64bit number:
|commit e71c343668
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date: Fri Oct 14 11:57:55 2011 +0200
|
| mtd: fix arguments to bad block ioctls
|
| In the Kernel the mtd ioctls expect a pointer to the offset, whereas
| barebox interprets the pointer itself as an offset. Since we want
| to add 64bit support for file sizes a pointer may not be sufficient,
| so align with the kernel and convert it to a pointer to the offset.
|
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This missed some places, fix them aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Without arguments the 'md' command defaults to show address 0 which
likely results in a NULL pointer exception, so only three keystrokes
are necessary to crash barebox. Show usage instead if 'md' is invoked
without arguments, so that it at least requires an address to be given
to crash barebox. This increases the stability of barebox by 66%. Hurray!
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The standard devices are currently broken since they have
the size ~0. As now files use loff_t as file size which is a signed
type the read implementation gets confused and now returns -1.
The current implementation also has the (somewhat theorical) problem
that we do not have real streaming devices, so /dev/zero went out
of zeroes after reading 4GB (or now LLONG_MAX).
This patch introduces a new cdev flag DEVFS_IS_CHARACTER_DEV and a new
file size flag FILE_SIZE_STREAM which makes it possible to create
real stream devices instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Command "uncompress" can handle not only with LZO-format, so we just
changed description for command.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add a command to sleep for n milliseconds.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Change function name to command_var_complete in all calls and its declaration.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch allows to present "/dev/zero" always in system and not
depending of mem-command. Standard files allow to test other memory
devices, not only "mem", such as NOR, NAND, MCI-devices e.t.c.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds a simple wd command which can setup, trigger and stop a watchdog
on the platform.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
resource_size_t can be 32bit or 64bit depending on the architecture.
Add a define for it to be able to printf a resource_size_t correctly
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It turns out useful to be able to configure bootm before its usage.
This allows us to overwrite bootm settings on an individual base.
This patch adds global variables to configure the kernel image, the
initrd image and the devicetree image. These values will be used
unless overwritten explicitely with command line switches.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The patch making errno a positive value has another bug:
lseek was switched to return -errno instead of -1. This does not
work since we can lseek we can address the whole 4G address space,
have of which has a negative offset when interpreted as a signed
integer. Let lseek return -1 on failure again instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When invoked from a skript it's useful to know which file is edited. Also
Add information how to exit the editor to the status line.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We currently use the environment variable 'bootargs' to get the
Linux bootargs. This patch allows for a more flexible bootargs
generation using global variables. With it the Linux bootargs
are concatenated from multiple variables. This allows to replace
parts of the bootargs string without having to reconstruct it
completely.
With this bootargs can be constructed like:
global linux.bootargs.base="console=ttyS0,115200"
global linux.bootargs.ip="ip=dhcp"
global linux.mtdparts="physmap-flash.0:512K(nor0.barebox),-(root)"
This will then automatically be combined into a kernel bootargs
string during boot.
If the 'linux.bootargs.' variables are all empty the old standard
'bootargs' way will be used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This implements global shell variable support. This is done by registering
a new device named 'global', so global variables are just plain device
parameters.
Global variables are useful for storing the global state in the environment.
Currently we do this by sourcing scripts instead of executing them which is
quite limiting.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Normally errno contains a positive error value. A certain unnamed developer
mixed this up while implementing U-Boot-v2. Also, normally errno is never
set to zero by any library function.
This patch fixes this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Running i2c_read without the 'count' setting causes an error and reboots.
barebox@Phytec phyCORE-i.MX27:/ i2c_read -b 1 -a 0x4a -r 0x00
ERROR: out of memory
no stack data available
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The following patch serie improve the complete support
by adding a complete framework to aalow commands complete support.
The add also car complete support for eval and setting and executable
file support
This also include an update of the stringlist API to support asprintf
API
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJPnohsAAoJEOrjwV5ZMRf2qeIQAIC7WrIao0mB2pIB+51MqeU+
sof7GLxUl0MWXFFc3OFEHDcY5grC867mBmB9+uDG1mvcxa/bUpw+jMRMrki5j4Kg
mjaHQ2UCvDjMHqQi7ISc/WTyJb09mtduFIceP0EftAmG8Mb5n9XOMaKwL9r/UQHB
ps9MijnI/QeFqbrmBZcuaCp59QsPvipYw8NMJITBu2VvWrpKTIox33qPfNATDuEV
SzMoLwz+uD7W7dEAM/A1uFdo4K5fLyZruDVGQoQ8CRS+zW3E6rr/EakpN5mhr/66
dVZYO1xWppBaefIJQ1RD6bvwlFvesuuvQmMtDxsCsp07fyBolEWfFzblrwdkbueY
NPwWExV5nzbRdAKKSyhU/nHiQ2edOQQZtHDAbnM4zh5e6lK7YLrzVklzT4Dfhzn0
GRdnjCmiQiaZdmAEHe8wte2nr3Lc01fTsj/EFVA+LYP3a9by1iG2Zn3/ChieVcN4
R+o/2lMBdhxsTszcmwMOemdqVPlt/0VmEXrKGtjTIZEViuQyyhY8ZtEaf4C0zeln
Jf60t0ZvkehAJc0Lo4UOygjzvErqcKoHMk7utAjP+bi1KcMgF3Q+HmtCnJJs2FHw
c40FZj1WcLPStEiS1way7miBakxOy2zPumKi1OXx+140L25C1nvQPYu8ilOZHEyU
opNlo+wQ8h5sG/054kYL
=rYfw
-----END PGP SIGNATURE-----
Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next
improve complete support
The following patch serie improve the complete support
by adding a complete framework to allow commands complete support.
The add also car complete support for eval and setting and executable
file support
This also include an update of the stringlist API to support asprintf
API
bootm_initrd tests for data->initrd, but this never becomes true because
the settingof data->initrd is inside a if(bootm_initrd()). Fix this. Also,
do not support the initrd options when initrd is disabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We used to have a quite slow algorithm to detect the screen size
which was unused for long time. This patch changes this to first
set the cursor to x=999, y=999 and the read back the actual cursor
position. Since I am not confident that this works on all terminals
this is only used when edit is called as 'sedit'.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Arm needs 64-Bit alignment of the oftree as mentioned in the documentation
Documentation/arm/Booting.
Other architectures may need a bigger alignment so align to 4K.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The intention of this code was to check the return value of fdt_open_into. Fix
this.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
- print error message when the specified oftree cannot be opened
- move verbose info to top of function so that the information is
printed before something else fails.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The Android Image contains 3 components and params
- kernel
- initrd
- second stage (optional)
- tags addr
- bootargs
In fast boot the initrd is mandatory, in barebox we are less restrictive
use the initrd only if present
add to env params:
aimage_noverwrite_bootargs
Disable overwrite of the bootargs with the one present in aimage
aimage_noverwrite_tags
Disable overwrite of the tags addr with the one present in aimage
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From bd6c5c884337ae2d4ef41d85d59c2d5ec525f8a5 Mon Sep 17 00:00:00 2001
From: Uwe Hermann <uwe@hermann-uwe.de>
Date: Fri, 6 Apr 2012 17:30:01 +0200
The loady command seems to work just fine (tested on an S3C2440 target).
Also, mark it as TRISTATE like loadb and loads.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We used to automatically prepend the device name before the partition
name. So when we added a partition named 'barebox' to a device named
'nor0' the partition was named 'nor0.barebox'.
The Kernel can mount its rootfs based on the mtd name, for example with
root=mtd:root. If for example we have multiple mtd devices (nor and nand)
'root' is a bad name for the partition, it should better be 'nor0.root'
This patch adds an additional commandline switch to addpart to optionally
skip the automatic device name adding. This makes it possible to define
our mtd partitions like this:
nor_parts="512k(nor0.barebox)ro,128k(nor0.bareboxenv),2M(nor0.kernel),-(nor0.root)"
This way the barebox partition names stay the same, but we can now
pass the exact name to the kernel (root=mtd:nor0.root).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We normally do not expect USB devices to be hotplugged. Instead of
rescanning each time the usb command is called, scan only once.
This makes the usb command safe for being called multiple times
without making already registered USB devices reinitialized. To
really scan multiple times a '-f' option is introduced.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds an automount command which makes it possible
to execute a script when a certain directory is first accessed.
It's the commands responsibility to make this directory available
(bringing devices up and mounting it). This results in automount
support which makes sure that from the shell every file can
be accessed without having to care for device bringup. Bringing
up devices may be expensive (USB, dhcp). The automount support
makes it easy for the environment to bringup devices when they
are actually needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
every struct fs_device_d contains a struct mtab_entry, so they
have a 1:1 relationship. Instead of having to use container_of
to get from a struct mtab_entry to a struct fs_device_d we can
better embed the members of struct mtab_entry into struct fs_device_d
directly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This shrinks the resulting binary size by ~25%. Exceptions
are still handled in arm mode, so we have to explicitely
put .arm directives into the exception code. Thumb-2 mode
has been tested on i.MX51 Babbage board.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To make the code a bit easier to read. Also, do not allow
to umount / when something else is mounted.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add nandtest command to test nand devices
and display ecc stats at the end of test.
Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
- add a usbserial command to enable/disable the serial gadget
- allow dfu and usbserial to cohexist in the same barebox
- add a timeout in u_serial so that we don't get locked if the user
enable usbserial from a UART console but doesn't consume the data
on the usbserial port created on the PC
- remove debug or verbose printf
- tested on i.MX25 & i.MX35 & usb-a926x
Signed-off-by: Eric Bénard <eric@eukrea.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>