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>
ARM am33xx: the hsmmc is a omap4 type mmc controller

The am33xx hsmmc controller is actually a omap4 type controller which
means that it has a 0x100 offset in the registers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers: net: add driver for TI CPSW

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
of: Fix invalid path for of_find_node_by_path

When of_find_node_by_path is called with a non existing path we
return just some node. return NULL instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM android image: remove double of_fix_tree

With bootm of_fix_tree() will already be called from the generic bootm
code, so do not do this again in the Android image handler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
of: of_free fixes

- Add missing prototype for of_free()
- When root node is freed set root_node to NULL
- (re)scan aliases after freeing a node. This is necessary because
  the freed node may be an alias or point to an alias

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of of_free: remove old node from allnodes list

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of: return root node when looking for a node with path /

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
w1: gpio: use int for gpio

so we can use negative value for invalid gpio

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
ARM am33xx: Add cpws convenience functions

This adds a function to register the cpws device and another one
to register the MAC addresses provided by the am33xx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM beaglebone: Add network support

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM beaglebone: update defconfig for networking

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
meminfo: fix missing include

Fix include for linkerscript variables like _etext.
Otherwise build with #define DEBUG will fail.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
memory: fix size address calculation

Fix size address calculation.

Global variables from <asm/sections.h> which are defined
in linker script *.lds files for end addresses has already
a +1 calculation.

For example:
stext = 0x100 with a size about 0x50 will result a etext = 0x150.
In this case a correct size calculation is (etext - stext) = 0x50.

In function 'request_sdram_region' the end address will be
calculated with (start + size - 1) which result a correct
end address of 0x149 in this example.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
meminfo: fix display of allocated addresses

Fix display to stdout of allocated addresses.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arm-mmu: remove semicolon in arm mmu.c

Remove semicolon in PAGE_ALIGN macro.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
led: test for led->set callback before calling it

Registering a LED can fail. If someone calls led_set for such
a LED no set function will be there. Fail gracefully in this
case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM panda: do not set gpio direction of heartbeat LED

We now have gpio_request. When we call gpio_direction_output before
registering a led_gpio the gpio will be implicitely requested by the
gpio core. gpio_request in the led core will then fail resulting in
an unregistered LED.
Fix this by removing the call to gpio_direction_output. The LED core
will do this anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>