9
0
Fork 0
Commit Graph

429 Commits

Author SHA1 Message Date
Sascha Hauer b3c1fda092 partition command: optionally do not automatically prepend the device name
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>
2012-03-18 15:03:31 +01:00
Sascha Hauer 7e614c143d usb command: by default scan only once for USB devices
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>
2012-03-18 15:03:31 +01:00
Sascha Hauer b5e5b06d8b Add automount support
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>
2012-03-18 15:03:26 +01:00
Sascha Hauer b55fbf7f5f fs: drop struct mtab_entry
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>
2012-03-17 18:16:03 +01:00
Sascha Hauer beb36c510b Merge branch 'work/thumb2' into next 2012-03-06 09:39:59 +01:00
Sascha Hauer 104a6a7ccf ARM: Allow to compile in thumb-2 mode
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>
2012-03-06 09:37:59 +01:00
Sascha Hauer 33d1cc4bf2 commands: remove struct command pointer from commands
This is unused in all commands and thus can be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:07 +01:00
Sascha Hauer 7a61f5db46 cp: fix memory leak
dst is an allocated string, we have to free it also when
copy_file fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 19:53:52 +01:00
Sascha Hauer 2546c5a514 Merge branch 'pu/device-cleanup' into next 2012-02-17 10:27:31 +01:00
Sascha Hauer 8a81eab846 fs: Store mtab entries in list
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>
2012-02-17 10:27:15 +01:00
Sascha Hauer c20952a621 Merge branch 'master' into next 2012-02-15 12:59:10 +01:00
Jean-Christophe PLAGNIOL-VILLARD 9f5c1f2a99 dfu: add description how to specify the "description" to the long help
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 15:01:52 +01:00
Sascha Hauer 238b7b1d99 uimage: Fix error message
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-13 09:51:20 +01:00
Jean-Christophe PLAGNIOL-VILLARD f4147cd621 CMD_UNCOMPRESS: select UNCOMPRESS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-16 09:36:01 +01:00
Sascha Hauer 8742816771 Merge branch 'pu/jean-codesize' into next 2012-01-13 09:33:36 +01:00
Jean-Christophe PLAGNIOL-VILLARD 507319e13b filetype: add config to disable it
remove 160 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD e7aa252938 uncompress: add config to disable it
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD b7498fdb82 banner: add config to disable it
this will allow to save 144 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Alexander Aring 58ad6c152a nandtest: add missing select.
Add select PARTITION_NEED_MTD in nandtest.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:49:37 +01:00
Alexander Aring 75a646755c nandtest: fix typo
Fix typo nand -> nandtest.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:49:37 +01:00
Alexander Aring 12fa9c5024 nandtest: add nandtest command
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>
2012-01-04 14:25:27 +01:00
Eric Bénard f7aaa22493 serial gadget: enable/disable on request
- 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>
2012-01-04 14:18:46 +01:00
Wolfram Sang 3fada2bced command: flash: remove broken filename check
It makes no sense to check the filename pointer here, because a) we have
already been using it and b) argc has been tested against 1 already, so
argv[1] should not be NULL. So, drop the checks.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:08:09 +01:00
Alexander Aring 84f0a81899 commands/ls: add to use sorted-insert
Added sorted insert to ls command.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 12:38:14 +01:00
Sascha Hauer abeea4d7f3 bootm: Add missing Kconfig dependency
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-17 16:37:14 +01:00
Sascha Hauer 146a7fe4a2 Merge branch 'work/uimage' into next
Conflicts:
	arch/ppc/lib/ppclinux.c
	commands/bootm.c
	include/boot.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-17 16:33:57 +01:00
Sascha Hauer 84fd8a956c Merge branch 'pu/ppc-oftree' into next 2011-12-15 20:12:32 +01:00
Sascha Hauer 609c4a988c ppc: switch to libfdt based oftree implementation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 20:11:47 +01:00
Sascha Hauer 40c9e6b22b Merge branch 'pu/misc' into next 2011-12-15 20:03:17 +01:00
Sascha Hauer 467a675626 Merge branch 'master' into next
Conflicts:
	arch/arm/boards/usb-a926x/init.c
	arch/arm/mach-pxa/include/mach/clock.h
	arch/arm/mach-pxa/speed-pxa27x.c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 19:58:56 +01:00
Sascha Hauer fc72640247 remove unused watchdog header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Sascha Hauer e90f67881e remove now obsolete iminfo command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer 1d1618a11b add uimage command
The uimage command superseeds the iminfo command. Unlike
the iminfo command the uimage command can also be used
to verify the data crc on demand and to extract uImages
to files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer d4e5c6b8a0 bootm: use new uimage code
This switches the bootm code to the new uimage code. Also
bootm can now handle other types of images than uImages.
Currently the only architecture making use of this is
arm which allows to boot zImages, raw images and barebox
images.
I intended to make a more bisectable series from this but
I failed becuase there are many dependencies and no matter
how I tried the patches grew bigger and and bigger. So I
decided to put this all in a single patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:11 +01:00
Sascha Hauer a46098b1d1 ppc: switch to libfdt based oftree implementation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 13:40:17 +01:00
Sascha Hauer ce66d6da75 Add missing code from linux_exec command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-13 09:52:18 +01:00
Sascha Hauer 0e43141403 time command: Fix needed string length
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-08 13:46:36 +01:00
Sascha Hauer 3180d4b3e3 bootm: factor out initrd code from option parser
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 17:47:43 +01:00
Sascha Hauer 0ee6847f7b Merge branch 'next' 2011-12-07 12:03:13 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1e06aef681 sanbox: add linux_execve and linux_exec command
this will allow to execute a program of the host from barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 10:35:01 +01:00
Jan Weitzel 019e55f4f7 crc exit with COMMAND_ERROR_USAGE
If parameter -v without a crc is used, you got a notice but the crc is
calculated and exit status is 0.
With wrong parameters we should quite with COMMAND_ERROR_USAGE.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:53:09 +01:00
Sascha Hauer 32f163f67c add iomem command to show iomem usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-03 10:09:29 +01:00
Sascha Hauer 27169b62f6 bootm: remove dead code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:13:55 +01:00
Sascha Hauer ad4537ba92 bootm: use generic uncompress function
This simplifies the code somewhat. The user visible change here is
that we now ignore the compression specified in the uImage. Instead
we detect the compression type from the data which also means that
we now support lzo compressed uImages.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:13:13 +01:00
Sascha Hauer 1f56f81711 add generic uncompress command
Using the new uncompress function we can now implement a command which
can uncompress all known compression types. This supplements the unlzo
command.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 32daa5509a bootm: do not select uncompression methods
Instead, let the user select them manually so that bootm supports
all compression types compiled in.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 4b09cdc798 add kernel gunzip implementation
The kernel uncompression functions have a unified API so use this
implementation to get it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 5930f100aa use kernel bunzip implementation
The kernel uncompression functions have a unified API. Switch
to the kernel implementation to unify the different uncompression
APIs. As a bonus the kernel implementation is much smaller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:27 +01:00
Sascha Hauer d4950552f5 bootm: use initrd_address and initrd_size
Make these fields in struct image_data the reference for image handlers

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:03:17 +01:00
Sascha Hauer 351058fa51 bootm: push relocate_image up to the generic command
All handlers used to just relocate the image without any checks, so
we are doomed if we write outside of SDRAM or will overwrite ourselves.
Move the relocation up to the generic part where we have a chance
of catching these issues.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:59:56 +01:00