net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back

Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
fails, fall back to use dev->enetaddr, which could be filled up by
the ethernet device driver:

With the current code, introduced with below commit, eth_write_hwaddr()
will fail immediately if there is no eth<n>addr in the environment variables.

However, e.g. for an overo based product that uses the SMSC911x ethernet
chip (with the MAC address set via EEPROM connected to the SMSC911x chip),
the MAC address is still OK.

On mx28 boards that are depending on the OCOTP bits to set the MAC address
(like the Denx m28 board), the OCOTP bits should be used instead of
failing on the environment variables.

Actually, this was the original behavior, and was later changed by
commit 7616e7850804c7c69e0a22c179dfcba9e8f3f587.

Signed-off-by: Eric Miao <eric.miao@linaro.org>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
CC: Stefan Roese <sr@denx.de>
CC: Eric Miao <eric.miao@linaro.org>
CC: Wolfgang Denk <wd@denx.de>
CC: Philip Balister <philip@balister.org>
CC: Zach Sadecki <zach@itwatchdogs.com>
arm: imx6q: add axi cache and qos setting

Signed-off-by: Jason Chen <b02280@freescale.com>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
arm: imx6q: add anatop regulator init

init core regulator to 1.2V

Signed-off-by: Jason Chen <b02280@freescale.com>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
arm: Add option to disable code relocation

This permits disabling the code relation in U-Boot which is useful when
debugging with an ICE.

To use it define CONFIG_SYS_SKIP_ARM_RELOCATION in your board.

Signed-off-by: Simon Glass <sjg@chromium.org>
mx6q: Skip the relocation for the ARM2 and SabreLite boards

The boot ROM code copies U-Boot already into the RAM at address
CONFIG_SYS_TEXT_BASE.  To improve the boot time, skip the relocation
(i.e. the copy RAM -> RAM).

ATTENTION: Please read

http://lists.denx.de/pipermail/u-boot/2012-February/117140.html

why you normally don't want this!

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
i.MX6: mx6q_sabrelite: add SATA bindings

This patch requires Stefano's driver for MX5/MX6.
	http://lists.denx.de/pipermail/u-boot/2012-February/118530.html

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
i.MX6: mx6qsabrelite: Add keypress support

This patch adds support for the GPIO keyboard used on MX6Q SabreLite.

This is generally used for invoking Android "recovery mode" in
response to a long press of volume key down during boot.

This can be tested by a boot script like so:
    if keypress voldown && sleep 1 && keypress voldown ; then
          echo "do recovery thing" ;
    fi

Key values can be seen by issuing keypress with no arguments:

	MX6QSABRELITE U-Boot > keypress
	keys: !menu	!back	!search	!home	!volup	!voldown
part_dos: align disk buffers on cache line to enable DMA and cache

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
fs/fat: align disk buffers on cache line to enable DMA and cache

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
i.MX: fsl_esdhc: allow use with cache enabled.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
mmc: Fix warning if CONFIG_MMC_TRACE is enabled

Fix the warning

mmc.c: In function 'mmc_send_cmd':
mmc.c:87: warning: assignment from incompatible pointer type

in case CONFIG_MMC_TRACE is enabled.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
CC: Andy Fleming <afleming@freescale.com>
mmc: fsl_esdhc: Poll until card is not busy anymore

This patch imports parts of two patches from the Freescale U-Boot with the following
commit messages:

ENGR00156405 ESDHC: Add workaround for auto-clock gate errata ENGcm03648
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/drivers/mmc/imx_esdhc.c?h=imx_v2009.08_12.01.01&id=e436525a70fe47623d346bc7d9f08f12ff8ad787
The errata, not applicable to USDHC, causes ESDHC to shut off clock to the card
when auto-clock gating is enabled for commands with busy signalling and no data
phase. The card might require the clock to exit the busy state, so the workaround
is to disable the auto-clock gate bits in SYSCTL register for such commands. The
workaround also entails polling on DAT0 bit in the PRSSTAT register to learn when
busy state is complete. Auto-clock gating is re-enabled at the end of busy state.

ENGR00156670-1 ESDHC/USDHC: Remove delay before each cmd and some bug fixes
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/drivers/mmc/imx_esdhc.c?h=imx_v2009.08_12.01.01&id=a77c6fec8596891be96b2cdbc742c9824844b92a
Removed delay of 10 ms before each command. There should not be a need to have this
delay after the ENGR00156405 patch that polls until card is not busy anymore before
proceeding to next cmd.

This patch imports the polling part of both patches. The auto-clock gating code
don't apply for i.MX6 as implemented in these two patches.

SYSCTL_RSTA was defined twice. Remove one definition.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
CC: Andy Fleming <afleming@freescale.com>
CC: Fabio Estevam <fabio.estevam@freescale.com>
CC: Stefano Babic <sbabic@denx.de>
ARM: add u-boot.imx as target for i.MX SOCs

Freescale SOCs require an header to u-boot.bin

The patch adds u-boot.imx to the default targets
if the imx file is set (IMX_CONFIG).

Signed-off-by: Stefano Babic <sbabic@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
CC: Loïc Minier <loic.minier@linaro.org>
CC: Mike Frysinger <vapier@gentoo.org>