MX28: extend print_cpuinfo() to use chip information

The information now is gathered from HW_DIGCTL_CHIPID register and
includes the chip modem and revision on the output.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX28: use a clear name for DDR2 initialization

The mx28 prefix has been added to the initialization data and function
so it is clear by which SoC it is used as i.MX233 will have a specific
one. While on that, we also change it to static.

Series-to: u-boot
Series-version: 3

Series-changes: 3
- change short-description prefix

Series-changes: 2
- use static for the allocation of memory initialization matrix

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX28: Check if we are using a valid VBUS for power initialization

Series-to: u-boot
Series-version: 2

Series-changes: 3
- change short-description prefix

Series-changes: 2
- fix when we have vbus OR vdd5v
- improve patch short description
- add comments

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: reorganize source directory for easy sharing of code in i.MXS SoCs

Most code can be shared between i.MX23 and i.MX28 as both are from
i.MXS family; this source directory structure makes easy to share code
among them.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: prefix register acessor macros with 'mxs' prefix

As the register accessing mode is the same for all i.MXS SoCs we ought
to use 'mxs' prefix intead of 'mx28'.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: prefix register structs with 'mxs' prefix

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: Reowork SPL to use 'mxs' prefix for methods

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: rename mx28.c to mxs.c as it is common to i.MX233 and i.MX28 SoCs

Series-to: u-boot
Series-prefix: RFC

Cover-letter:
Rework for mxs SoC family support
This patchset is the basis for inclusion of i.MX233 support on U-Boot.
To accomplish it, this patchset moves code around to create the mxs
SoC family support.

The idea of posting it on the mailing list is to receive comments on
ways to improve the patchset and also try to merge it during the merge
window.
END

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX28: rename regs-clkctrl.h to regs-clkctrl-mx28.h

The CLKCTRL registers are SoC specific so we ought to have it clear on
filename.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX233: Add MX233 register base addresses

The address space layout is a bit different on MX233.

Signed-off-by: Marek Vasut <marex@denx.de>
MX233: add regs-clkctrl-mx23.h

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
GPIO: Extend the cmd_gpio API by gpio_{from,to}_string()

The gpio_from_string() call shall parse the incoming GPIO name taken
from the command line and return the GPIO number used within U-Boot or
return -1 on error.

The gpio_to_string() on the other hand allows nicer reporting of GPIO
name in the output of cmd_gpio.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Stefano Babic <sbabic@denx.de>
GPIO: Implement gpio_{from,to}_string on M28EVK

Implement the above two functions. The format of input parameters is
"x_y", where x is the bank number and y is the pin number in that bank.

Example:
  => gpio i 3_13
  gpio: pin 3_13 (gpio 107) value is 0

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Stefano Babic <sbabic@denx.de>
Fix misuse of calloc() in linux/compat.h header

Quote from the manpage:

[...]
       void *calloc(size_t nmemb, size_t size);
[...]
DESCRIPTION
[...]

       The  calloc() function allocates memory for an array of nmemb elements
       of size bytes each and returns a pointer to the allocated memory.  The
       memory is set to zero.  If nmemb or size is 0, then calloc() returns
       either NULL, or a unique pointer value that can later be successfully
       passed to free().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
MX28: Add u-boot.mx28.sd and u-boot.mx28.nand make targets

These targets allow for easy invocation of mxstool, for generating
the u-boot images bootable in mx28 CPU.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
MX28: Cleanup mxsboot within make mrproper

Delete the "mxsboot" binary if make mrproper is called.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
EXT2: Squash GCC 4.7.1 warning

ext2fs.c: In function 'ext2fs_read_file':
ext2fs.c:458:19: warning: 'blocknxt' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Jason Cooper <u-boot@lakedaemon.net>
COMMON: Add __stringify() function

This function converts static number to string in preprocessor.
This is useful as it allows higher usage of puts() in favour of printf()

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
CACHE: Add cache_aligned() macro

This macro returns 1 if the argument (address) is aligned, returns
zero otherwise. This will be used to test user-supplied address to
various commands to prevent user from loading data to/from unaligned
address when using caches.

This is made as a macro, because macros are expanded where they are
used. Therefore it can be easily instrumented to report position of
the fault.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
CACHE: net: asix: Fix asix driver to work with data cache on

The asix driver did not align buffers, therefore it didn't work
with data cache enabled. Fix this.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>