mx28: Remove SET, CLR, TOG ops from PLLxCTRL1 registers

These registers don't have _SET, _CLR and _TOG at the respective offsets
available, these registers has to be toggled via R-M-W if needed. Thus do
not export these offsets anymore.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
mx28: Rename regs-power.h to regs-power-mx28.h

The i.MX23 has different register layout and bit placement in the
power supply. Thus, in order to be able to add support for MX23,
rename the MX28's regs-power.h to regs-power-mx28.h . Moreover,
add ifdef around inclusion of regs-*-mx28.h in imx-regs.h so the
MX23 boards will include proper set of registers.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
mxs: Silence elftosb

The elftosb tool is now called with -d switch, which produces debug
output to the stdout. The debug output is completely useless for
regular operation, so silence it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: Implement common function to setup VDDx

Implement common function to setup the VDDIO, VDDD and VDDA voltage.
Right now, there are two almost identical functions to setup VDDIO
and VDDD, which is prone to breakage. Pull out the differences into
constant structure and pass them as an argument to the common function.

Moreover, the function has almost identical loops for setting higher
and lower VDDx voltage. Merge these two loops.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
mxs: Properly setup VDDD in power supply setup code

The memory setup code adjusted the VDDD voltage. Remove this adjustment
and configure the VDDD voltage correctly in the power supply setup code.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
mxs: Staticize SPL functions

The MXS SPL didn't mark local functions "static". Fix it. This also makes the
SPL smaller by roughly 300 bytes.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
mx23: Add POWER and CLKCTRL register definitions

Add register definitions for the i.MX23 power control block and
clock control block. These are essential for the basic bootstrap
of the i.MX23. Also, properly include them in imx-regs.h .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
mxs: SPL: Only run i.MX28 specific power code on i.MX28 boards

This adds #ifdef / #endif around i.MX28 specific power code to avoid
those to be run in other boards.

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

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

Series-changes: 4
- rebase against imx/master

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: SPL: Generalize memory initialization

Use a generic 'dram_vals[]' array that has the full initialization
sequence and rename the initialization method so it doesn't has a
frequency on its name.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
mxs: clock: Use 'mxs' prefix for methods

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

This adds the base addresses of i.MX23 and easy the detection of wrong
order in board setup, in case no SoC has been set, an error is raised
during build.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: Add iomux-mx23.h

This has been copied from Linux source at revision 786f02b719f.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: Handle iomux-mx23.h including in sys_proto.h

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: power: Add comment about registers with same offsets

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: Add support on print_cpuinfo()

Add information to identify i.MX23 chips and its known revisions.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: Add boot mode description

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: SPL: Add boot mode support

This adds the boot mode support for i.MX23 processors.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: SPL: Initialize DDR at 133MHz

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
MX23: config: Enable building of u-boot.sb binary

For i.MX23 we need to pass imx23 as elftosb param.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>