9
0
Fork 0
Commit Graph

841 Commits

Author SHA1 Message Date
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 54385ace4b login: add globalvar timeout support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 09:24:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2830faf5e5 command: ubiattach: add option to pass VID offset
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>
2013-09-18 09:17:13 +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 e147a7e2bb Merge branch 'for-next/misc' 2013-09-05 10:38:31 +02:00
Sascha Hauer 10169a04ca Merge branch 'for-next/of' 2013-09-05 10:37:54 +02:00
Jean-Christophe PLAGNIOL-VILLARD f61bc0962b bootm: add global bootm.{image/initrd}.loadaddr support
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>
2013-09-02 11:08:08 +02:00
Christian Hemp 2c974b50d3 commands: Fix memtest return value
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-02 10:50:16 +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 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
Sascha Hauer 7f5c04321d oftree command: Allow to specify node by alias
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:05:37 +02:00
Sascha Hauer 6d06c4e318 of_property command: allow to set phandles
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>
2013-08-14 10:05:37 +02:00
Sascha Hauer 7a15e03fca of_property command: allow to specify a node by alias
With this not only a full path can be used to specify a node, but also
an alias.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:03:28 +02:00
Alexander Shiyan 4db3f91326 Cleanup Kconfig files
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>
2013-08-12 08:05:37 +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 feefc3ef3b Merge branch 'for-next/mtd' 2013-08-05 12:49:58 +02:00
Sascha Hauer 9ebb0554cd Merge branch 'for-next/misc' 2013-08-05 12:49:58 +02:00
Sascha Hauer 07afe7d0e0 Merge branch 'for-next/marvell'
Conflicts:
	arch/arm/boards/Makefile
	arch/arm/dts/Makefile
2013-08-05 12:49:55 +02:00
Sascha Hauer 50f75a1a0e UBI: reimport UBI from Linux v3.10
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>
2013-07-25 10:24:16 +02:00
Sascha Hauer 56ac905457 ubiattach command: Properly check return values
- 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>
2013-07-23 16:32:23 +02:00
Sascha Hauer 675ef4770f UBI: Add ubidetach command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:32:18 +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
Alexander Shiyan 3f0642d383 commands: spi: Fix spi read procedure
Buffer for RX is set incorrectly.

barebox@Phytec phyCORE-i.MX27:/  spi -r 128 -v
device config
    bus_num       = 0
    max_speed_hz  = 1000000
    chip_select   = 0
    mode          = 0x0
    bits_per_word = 8

wrote 0 bytes
00000000:
read 128 bytes
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
unable to handle paging request at address 0x4dffd3d0
pc : [<a7f05ec4>]    lr : [<a7f05ebc>]
sp : a7fff890  ip : a7fff860  fp : a7f68820
r10: a6ffe9bc  r9 : 00000000  r8 : 00000001
r7 : a6ffe9ec  r6 : a6f00000  r5 : a6ffe9ec  r4 : a6ffe9e4
r3 : a6ffe9e4  r2 : a6ffe9e5  r1 : a6ffe9e4  r0 : 4dffd3cc
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
...

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:05:24 +02:00
Alexander Shiyan b90bceb6a9 commands: nandtest: Fix incorrect size for memset in do_nandtest
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 08:41:31 +02:00
Sebastian Hesselbarth cf31688b6a OF: base: rename of_free to of_delete_node
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>
2013-07-05 08:26:57 +02:00
Sascha Hauer 8afe2cb4d4 Merge branch 'for-next-manual/oftree-linux-sync' 2013-07-02 07:08:46 +02:00
Sascha Hauer 12657cb99e Merge branch 'for-next/usb' 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 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
Jan Weitzel fc01f5db56 ubiformat: check file size
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>
2013-06-24 21:43:05 +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 ab058b10eb detect command: Add -a option to detect all devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 07:42:36 +02:00
Sascha Hauer 31879ed96f usb: move scanned status into core
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>
2013-06-21 07:41:32 +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
Sebastian Hesselbarth 905f3ee7fb OF: base: sync of_find_property with linux OF API
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>
2013-06-20 17:18:01 +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
Alexander Aring 842308e297 commands: add new memtest command
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>
2013-06-08 15:00:55 +02:00
Alexander Aring 47f9da4380 memtest: remove memtest command
Remove memtest command.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-05 22:54:34 +02:00
Masaki Muranaka 56bd91c9a1 Remove a redundant line.
Signed-off-by: Masaki Muranaka <monaka@monami-ya.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-03 09:26:26 +02:00
Sascha Hauer 5f56c35060 Merge branch 'for-next/of' 2013-06-02 16:28:34 +02:00
Sascha Hauer 5d308ce640 bootm: Print internal devicetree information without verbose
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>
2013-05-31 16:33:39 +02:00
Sascha Hauer 95e7982f99 devices: add detect mechanism
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>
2013-05-31 12:32:05 +02:00
Sascha Hauer 08026afdeb bootm: make sure to print fixed oftree
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>
2013-05-31 08:32:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD ce86baace1 commands/mem.c: drop non used DEVMEM
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-08 07:16:40 +02:00
Sascha Hauer c8af035b41 Merge branch 'for-next/misc' 2013-05-06 09:30:28 +02:00
Sascha Hauer 3cdd18632e Merge branch 'for-next/memory-commands' 2013-05-06 09:30:28 +02:00
Sascha Hauer 88a012b9e1 Don't honor initrd load address
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>
2013-05-04 11:06:30 +02:00
Uwe Kleine-König ce9163ae34 bootm: Simplify initrd address handling
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>
2013-05-04 11:06:30 +02:00
Steffen Trumtrar bbe01fedf5 of: property: fix error message
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>
2013-04-26 07:27:37 +02:00
Alexander Shiyan 43f9a96a74 ubimkvol: Typo fix
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-22 09:15:07 +02:00
Sascha Hauer 67c6eeda9e Add memory modify command (mm)
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>
2013-04-17 13:37:14 +02:00
Sascha Hauer e10c1845b2 memory commands: separate into one file per command
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>
2013-04-17 13:36:31 +02:00
Sascha Hauer 81c118aa9e memory commands: make rw_buf global
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>
2013-04-17 13:36:31 +02:00
Sascha Hauer c065be27a1 memory commands: cleanup initialization
- return -ENOMEM instead of -1
- return the result of platform_driver_register

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +02:00
Sascha Hauer 4e3ce28973 Use a common define for RW_BUF_SIZE
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +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 d91b7772c4 memory commands: export common functions
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>
2013-04-17 12:56:44 +02:00
Jan Luebbe b6404068f1 commands: the crc command is actually called crc32
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-16 15:19:26 +02:00
Jan Luebbe 062a2fc2ea commands: i2c: change 0X to 0x
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-09 09:01:28 +02:00
Sascha Hauer c4da77611c Merge branch 'for-next/oftree' 2013-04-04 14:20:32 +02:00
Sascha Hauer 70867916a7 Merge branch 'for-next/mtd' 2013-04-04 14:20:32 +02:00
Sascha Hauer 8f2c6a3d2b Merge branch 'for-next/misc' 2013-04-04 14:20:32 +02:00
Hubert Feurstein 50a9cadb0c commands/tftp: use debug() for debug output
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:22:11 +02:00
Jan Weitzel 01cc0084d9 ubiformat: get buffer from malloc
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>
2013-04-03 17:22:11 +02:00
Jean-Christophe PLAGNIOL-VILLARD a38b236759 splash: fix background color support
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>
2013-03-14 07:16:20 +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 6d6edfcf53 bootm: Pass unflattened devicetree to handlers
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>
2013-03-06 11:41:29 +01:00
Sascha Hauer 5d6c8ac4b4 of_property command: Fix crash with empty property value
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>
2013-03-06 11:41:29 +01:00
Sascha Hauer c932896af9 of_* commands: print usage when insufficient arguments are given
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 025b5394bd bootm: Use of_print_nodes instead of fdt_print
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>
2013-03-06 11:41:28 +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 04a26f678d oftree command: retire CMD_OFTREE_PROBE Kconfig option
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>
2013-03-06 11:41:28 +01:00
Sascha Hauer b6a2800537 of: make OFDEVICE a user selectable option
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>
2013-03-06 11:41:28 +01:00
Sascha Hauer 983686fc1f oftree command: Use of_print_nodes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer b26b7ef0f0 of: Add root node argument to of_find_node_by_path
This makes of_find_node_by_path usable with multiple trees.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 8a185a4ff2 of: let of_unflatten_dtb return the unflattened tree
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>
2013-03-06 11:41:27 +01:00
Sascha Hauer dbaf66d8f7 of_node command: use of_create_node
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:27 +01:00
Sascha Hauer 68bd6e9309 nand command: check for <dev> directly after option parsing
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>
2013-03-04 11:00:33 +01:00
Sascha Hauer 938f748103 nand command: use enumeration for command instead of bitmask
A command can only be one of NAND_*, so use an enumeration instead
of a bitmask.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 29c589c8dc nand command: use loff_t for block offset
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 62ee96bd3b Merge branch 'for-next/mtd'
Conflicts:
	arch/arm/configs/eukrea_cpuimx27_defconfig
	drivers/mtd/core.c
2013-03-04 09:21:49 +01:00
Sascha Hauer 13408877f4 Merge branch 'for-next/misc' 2013-03-04 09:21:37 +01:00
Sascha Hauer 06bf4ad55b ubiformat: open flash image readonly
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>
2013-02-21 08:58:59 +01:00
Alexander Aring 6b005a6098 nandtest: fix length calculation
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-20 08:23:30 +01:00
Alexander Aring 9d8a20592f fs: add pread and pwrite functions
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>
2013-02-20 08:22:42 +01:00
Alexander Shiyan aa377106d1 commands: automount: Added help string about "-d" option
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-18 09:19:05 +01:00
Sascha Hauer 3930f38028 libmtd: rename functions from mtd_* to libmtd_*
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>
2013-02-14 10:16:17 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6e9eb68de5 oftree: fix probe support
in commit e118761c5f
oftree command: refactor

the Kconfig CMD_OFTREE_PROBE was remove

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 21:11:25 +01:00
Sascha Hauer 0b12784089 Merge branch 'for-next/oftree'
Conflicts:
	drivers/of/base.c
2013-02-04 15:49:04 +01:00
Sascha Hauer da5fe0ba47 Merge branch 'for-next/misc' 2013-02-04 15:49:00 +01:00
Sascha Hauer db63bd8e10 Merge branch 'for-next/commands' 2013-02-04 15:48:45 +01:00
Antony Pavlov 263e454f7f commands: reset: add shutdown_barebox() before reset_cpu()
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>
2013-01-30 16:03:51 +01:00
Jean-Christophe PLAGNIOL-VILLARD b1da925c8a introduce console none support
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>
2013-01-23 20:34:16 +01:00
Sascha Hauer 0c97dd0061 move prototypes for envfs_* to envfs.h
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>
2013-01-20 16:31:51 +01:00
Sascha Hauer 9a554f8ff2 oftree command: Add -s option to save internal oftree to file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Sascha Hauer db474fe0bb commands: Add of_node command
This command allows to create/delete device nodes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Sascha Hauer 8943b86aa8 commands: Add of_property command
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>
2013-01-19 11:48:17 +01:00
Sascha Hauer e118761c5f oftree command: refactor
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>
2013-01-19 11:48:17 +01:00
Sascha Hauer 4979d8e9d5 of: remove unused barebox_fdt
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>
2013-01-19 11:48:17 +01:00
Sascha Hauer 525d82f33e bootm: move printing of file locations outside verbose mode
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>
2013-01-18 11:56:53 +01:00
Sascha Hauer 86e787e845 of: rename of_parse_dtb to of_unflatten_dtb
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>
2013-01-11 14:10:02 +01:00
Sascha Hauer f30b191e36 of: make of_get_fixed_tree more universally usable
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>
2013-01-11 14:08:30 +01:00
Sascha Hauer dbdd533232 fixup! commands: add ubiformat
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>
2013-01-09 18:22:35 +01:00
Jan Luebbe 964893b34b commands: add let command which supports proper arithmetic
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>
2013-01-09 10:32:54 +01:00
Wolfram Sang 5a29d4aea7 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>
2012-12-19 10:31:36 +01:00
Wolfram Sang 52e60618d6 ubi: consolidate ubi-media.h
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>
2012-12-19 10:30:56 +01:00
Wolfram Sang b6accb5e56 commands: flash: add missing newlines to error messages
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:43:44 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
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>
2012-12-08 12:22:12 +01:00
Sascha Hauer 116c24e99e Merge branch 'for-next/mem-commands' 2012-12-07 16:43:15 +01:00
Sascha Hauer c3a84a3f76 Merge branch 'for-next/ext4' 2012-12-07 16:42:04 +01:00
Sascha Hauer 5e74263762 filetype: Pass bufsize
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>
2012-12-03 11:23:25 +01:00
Sascha Hauer 3207dc4608 ls command: call stat() only when necessary
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>
2012-12-03 11:23:25 +01:00
Sascha Hauer 1533521bff loadenv: allow more fine grained environment loading
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>
2012-11-29 20:23:04 +01:00
Sascha Hauer 5a9d53c47e rm: implement -r
To recursively remove files and directories.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-29 20:21:29 +01:00
Antony Pavlov 019d2474e8 commands: mw: add the '-x' option (swap bytes)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Antony Pavlov 6552d2991f commands: md: add the '-x' option (swap bytes)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Antony Pavlov f23198905c mem: add the swab (swap bytes) option to memory_display()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Jean-Christophe PLAGNIOL-VILLARD d179981b2d splash: init struct allocated the stack to 0
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-21 11:53:37 +01:00
Sascha Hauer b474168b90 Merge branch 'for-next/ymodem' 2012-11-16 14:02:49 +01:00
Sascha Hauer 0bf6b41cfa Merge branch 'for-next/spi' 2012-11-16 14:02:49 +01:00
Sascha Hauer 8134a15b0d Merge branch 'for-next/nand-test' 2012-11-16 14:02:36 +01:00
Sascha Hauer 856f60dbd1 Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-16 14:01:34 +01:00
Sascha Hauer bf38ac7b89 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/boards/guf-neso/lowlevel.c
	arch/arm/boards/pcm038/lowlevel.c
	commands/Makefile
2012-11-16 14:01:09 +01:00
Sascha Hauer ea30283ba0 Merge branch 'for-next/filetype-command' 2012-11-16 14:00:45 +01:00
Robert Jarzmik 818b981bfc commands: remove old Y-Modem implementation
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>
2012-11-12 09:35:53 +01:00
Robert Jarzmik 2a38aa83f7 commands: change Y-Modem implementation
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>
2012-11-12 09:35:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD 055b31e92e introduce spi command
usefull to debug spi

The command allow to read/write on a spi device

Usage: spi [OPTION] [data to write 0xXX]
write/read spi device.
  -b <bus_num>  spi bus number (default = 0)
  -r <count>    to read
  -c <cs>       chip select (default = 0)
  -m <mode>     spi mode (default = 0)
  -f <hz>       max_speed_hz (default = 1MHz)
  -w <bit>      bits_per_word (default = 8)
  -v            verbose

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:32:16 +01:00
Sascha Hauer d74bef2b04 mount: add compatibility to old mount command
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>
2012-11-02 21:26:29 +01:00
Sascha Hauer b8d7c3a95c bootm: Do not cross 1MiB sections for the devicetree
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>
2012-11-01 16:27:21 +01:00
Sascha Hauer da7d19b9d8 bootm: Add a define for the additional devicetree size
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>
2012-11-01 16:27:17 +01:00
Sascha Hauer e8018cf5f0 add filetype command support
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>
2012-10-30 15:42:39 +01:00
Sascha Hauer 87feda4eb1 environment variables: use linux list
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>
2012-10-30 10:24:12 +01:00
Antony Pavlov de053ed91c add 'miitool' command to view media-independent interface status
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>
2012-10-30 10:24:12 +01:00
Antony Pavlov 735775a7c4 commands/Kconfig: move 'ln' to the 'file commands' section
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 10:24:12 +01:00
Sascha Hauer f849039dd2 wd: Provide default value for watchdog timeout
Otherwise barebox can't be built if the user did not specify a value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-26 08:54:44 +02:00
Alexander Aring b63fe60bef nandtest: add another constraints check
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>
2012-10-23 08:27:33 +02:00
Alexander Aring bbc7a434e6 nandtest: use loff_t instead off_t
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>
2012-10-23 08:27:33 +02:00
Alexander Aring be96dc98b3 nandtest: clean up code
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>
2012-10-23 08:27:33 +02:00
Alexander Aring c4f2e01df3 nandtest: use get_random_bytes instead of for loop
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>
2012-10-23 08:27:33 +02:00
Alexander Aring bada8f57a6 nandtest: change flash length variable type
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>
2012-10-23 08:27:33 +02:00
Alexander Aring f221939b5d nandtest: rename command argument p to i
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>
2012-10-23 08:27:33 +02:00
Alexander Aring 1c3d312b51 nandtest: add progressbar instead of offset print
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>
2012-10-23 08:27:33 +02:00
Alexander Aring f3781cb7b3 nandtest: stat ecc per page not per eraseblock
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>
2012-10-23 08:27:33 +02:00
Sascha Hauer bed8fb6de1 Add in-system barebox update infrastructure
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>
2012-10-17 20:23:41 +02:00
Carlo Caione 7423f13ff7 cosmetic: extra new line in automount usage command
Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-13 20:20:17 +02:00
Carlo Caione 27b77dc415 cosmetic: improve command list display
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>
2012-10-12 10:52:53 +02:00
Vicente 8083e2e024 bootm: close open files
Signed-off-by: Vicente <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:29:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5eb89cea2a gui: blit the surface on demand
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9a048064e4 graphic_utils: introduce common fb_open/close
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3fa8d74abe gui: introduce screen and surface to factorize and simplify code
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD da0d61770a gui: move gui file to include/gui and lib/gui
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Sascha Hauer 47d237e58a Merge branch 'for-next/fixes' 2012-10-04 15:25:12 +02:00
Sascha Hauer 94de405d8f Merge branch 'for-next/imx-clk' 2012-10-04 15:24:57 +02:00
Jan Luebbe 468fababe0 commands/mount: fix typo and wording in help message
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:21:04 +02:00
Sascha Hauer c797f3c168 commands: Add clk commands
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>
2012-10-04 15:19:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer edf068e9cf Merge branch 'for-next/tftp' 2012-10-03 21:17:39 +02:00
Sascha Hauer 2385424e30 Merge branch 'for-next/testing-menu' 2012-10-03 21:13:11 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer cd323c0224 Merge branch 'for-next/png'
Conflicts:
	common/filetype.c
	include/filetype.h
2012-10-03 21:12:19 +02:00
Sascha Hauer ed4645cf13 Merge branch 'for-next/boot-sequence-dhcp'
Conflicts:
	drivers/net/miidev.c
2012-10-03 21:10:30 +02:00
Sascha Hauer 4183b9ab58 net: Add tftp command which uses the new tftp code
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>
2012-09-28 16:23:43 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Sascha Hauer f4eb950535 oftree command: Add devicetree probe support
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>
2012-09-14 11:47:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4732c27030 globalvar: add support to set a value to of all globalvars beginning with 'match'
via c global_set_match and global -r

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-14 00:46:00 +08:00
Jean-Christophe PLAGNIOL-VILLARD 39cc6c9cbd echo: always allow to pass -e option
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>
2012-09-14 00:45:35 +08:00
Jean-Christophe PLAGNIOL-VILLARD 1f16f058e4 add PNG support
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>
2012-09-12 17:23:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD a60803de67 splash: add support to set a background color
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>
2012-09-12 17:22:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2dbdd40d57 splash/bmp: switch to image_renderer
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:22:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6ce5bc4624 bmp: Move bmp rendering to lib/bmp.c
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>
2012-09-12 17:21:10 +02:00
Jean-Christophe PLAGNIOL-VILLARD a87361dfc3 bmp: rename it to splash
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>
2012-09-12 17:16:45 +02:00
Alexander Aring 5b10582696 commands: move memtest to testing
Move memtest to testing commands menu.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:46:13 +02:00
Alexander Aring 126f9f0482 commands: move nandtest to testing
Move nandtest in commands menu.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:46:05 +02:00
Alexander Aring 5603b48dfa commands: add testing menu
Add command menu for testing utilities.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:45:58 +02:00
Sascha Hauer d7257236a7 Merge branch 'for-next/misc' 2012-09-05 12:59:29 +02:00
Sascha Hauer e5a927883e Merge branch 'for-next/link' 2012-09-05 12:59:29 +02:00
Sascha Hauer 40126ad7f8 Merge branch 'for-next/fs' 2012-09-05 12:59:29 +02:00
Jean-Christophe PLAGNIOL-VILLARD dccdc2ed88 dirname: add -V option to return only path related to the mountpoint
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 0939b7c549 ls: add symlink support to -l
barebox:/ ls -l /env/init.d/
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
lrwxrwxrwx         11 net -> ../boot/net

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD bf32bc1d9a command: add ln support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 69a4ea15db command: add readlink support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD f26472f2d1 test: add -L support to test if it's a symbolic link
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 94fd74dda7 command/mount: add autodetection support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-04 09:08:39 +02:00
Antony Pavlov 7039368327 commands/digest: don't print checksum for non-existing files
This fixes the case:

  barebox:/ md5sum non-existing-file
  non-existing-file: No such file or directory
  00000000000000000000000000000000  non-existing-file     0x00000000 ... 0xffffffffffffffff
  barebox:/

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-04 09:08:39 +02:00
Steffen Trumtrar f64bd3d932 trivial: bootm: correct grammar in error message
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-31 09:26:39 +02:00
Steffen Trumtrar af23372773 trivial: fix spelling in usb code
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-31 09:26:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9812795873 arm: do not enable the previous bootz command
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>
2012-08-28 09:51:31 +02:00
Antony Pavlov 0d6aa9a82b commands/digest: don't print checksum for non-existing files
This fixes the case:

  barebox:/ md5sum non-existing-file
  non-existing-file: No such file or directory
  00000000000000000000000000000000  non-existing-file     0x00000000 ... 0xffffffffffffffff
  barebox:/

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-28 08:48:46 +02:00
Jean-Christophe PLAGNIOL-VILLARD 73918efe1a bootm: do not load the initrd in the common code
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>
2012-08-13 14:48:13 +08:00
Antony Pavlov 58713d3274 commands: memset: fix help message
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>
2012-08-09 08:44:38 +02:00
Sascha Hauer 88107f6e12 Merge branch 'for-next/randconfig' 2012-08-01 17:49:27 +02:00
Sascha Hauer 9204bf87d6 Merge branch 'for-next/misc' 2012-08-01 17:49:27 +02:00
Sascha Hauer 239fa8cc9b mem md: make md -s /dev/something work again
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>
2012-08-01 08:36:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD d6a50c915f stddev: make it selectable via Kconfig
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>
2012-07-25 10:06:30 +02:00
Sascha Hauer ed71cd5c82 loadb: fix compilation
'ofd' is always needed, even if LOADB is not selected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer f8f570ea88 exec command: Fix compilation
read_file and run_command take an additional argument now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer a6ce65b121 uimage: introduce UIMAGE Kconfig symbol
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>
2012-07-25 09:27:27 +02:00