ipu common: reset ipuv3 correctly

This patch checks self-clear sw_ipu_rst bit in
SCR register of SRC controller to be cleared
after setting it to high to reset IPUv3. This
makes sure that IPUv3 finishes sofware reset.
A timeout mechanism is added to stop polling
on the bit status in case the bit could not be
cleared by the hardware automatically within
10 millisecond.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
video: Provide an API to access video parameters

Create a basic API to provide access to video parameters such as screen
size, and to position the cursor on the screen. Also add a prototype
for video_display_bitmap() which was missing.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
video: Implement additional video API functions in cfb_console

Implement the new video API functions to provide access to screen size,
etc.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
lcd: Provide an API to access LCD parameters

Create a basic API to provide access to lcd parameters such as screen
size, and to position the cursor on the screen.

This matches up with the video API for the same purpose. Unfortunately
they are not yet combined.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
lcd: Fix BMP decode bug that skips the wrong padded row

This change fixed 2 things:
 - Rename padded_line to padded_width since it is (width + padded_row) not line.
 - When finished a line, should skip the padded_row that is
   (padded_width - width) instead of (width - padded_width).

Reference: http://en.wikipedia.org/wiki/BMP_file_format
Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
lcd: Implement RLE8 bitmap decoding

Add support for drawing compressed RLE8 bitmaps.

Reference: http://www.digicamsoft.com/bmp/bmp.html

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Che-Liang Chiou <clchiou@chromium.org>
[agust: fix some minor style issues and build warnings]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
video: Skip bitmaps which do not fit into the screen in cfb_console

The cfb console driver is trying to prevent bitmaps to spill over the
screen, but the calculations assume that at least part of the bitmap
fits into the screen area. In reality there could be bitmap elements
which are completely out of the screen area, they just need to be
discarded.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
MAKEALL: Add spear platform target to compile all SPEAr boards

Signed-off-by: Stefan Roese <sr@denx.de>
nios2: use builtin functions for control registers access

The commit 51926d5ee0be029fb45f10f42756df97279f8ad3
  COMMON: Use __stringify() instead of rest of implementations
forgot to update the wrctl funtion, and causes compilation error.

But there are builtin functions for control registers access in
nios2 comipiler. It is convenient to use them instead.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Cc: Marek Vasut <marex@denx.de>
nios2: remove asm/status_led.h

The file has a wrong inline keyword of __led_toggle(), which causes
compilation error. And its content is defined in common status_led.h.
So define CONFIG_BOARD_SPECIFIC_LED in board config files and remove
this header file.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
video: atmel: implement lcd_setcolreg function

implement the common api lcd_setcolreg in include/lcd.h

Signed-off-by: Bo Shen <voice.shen@atmel.com>
[agust: fixed commit log and gcc 4.6 -Wparentheses warnings]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
fdt: Add function to get config int from device tree

Add a function to look up a configuration item such as machine id
and return its value.

Note: The code has been taken as is from the Chromium u-boot development
tree and needs Simon Glass' sign-off.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add function to get a config string from device tree

Add a function to look up a configuration string such as board name
and returns its value. We look in the "/config" node for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add fdtdec_decode_region() to decode memory region

A memory region has a start and a size and is often specified in
a node by a 'reg' property. Add a function to decode this information
from the fdt.

Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add function for decoding multiple gpios globally available

Samsung's SDHCI bindings require multiple gpios to be parsed and
configured at a time. Export the already available fdtdec_decode_gpios
for this purpose.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Export fdtdec_lookup() and fix the name

The name of this function is not consistent, so fix it, and export
the function for external use.

Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add function to read boolean property

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add fdtdec_get_uint64 to decode a 64-bit value from a property

It decodes a 64-bit value from a property that is at least 8 bytes long.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Add polarity-aware gpio functions to fdtdec

Add get and set gpio functions to fdtdec that take into account the
polarity field in fdtdec_gpio_state.flags.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
fdt: Load boot command from device tree

Load boot command from /config/bootcmd of device tree if present.

Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>