convert to at91bootstrap-3.5.x

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Add blank space to the version print message.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Add blank space to the PMECC correctuin failed print message

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Makefile: change the version to "v3.5.2"

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Boot media: save boot media to the backup register

Give the boot media information provided by the romcode through R4 to next
level bootloader.

This information is stored in the second GPBR for sama5d3 family.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
5series: remove EMBEST from condition of revA cpu module

NAND flash was configured differently on revA modules. It was true for every
vendor and not just for Embest: we remove this condition from tests.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
RSTC_KEY_UNLOCK: use defined magic value

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
at91sam9x5ek: AT91C_DDRC2_EBISHARE bit cleared in DDR configuration

Comment about the use of AT91C_DDRC2_EBISHARE bit in DDR controller
configuration and the reason why it is cleared when considering the
AT91SAM9x5-EK board case.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
MMC: BUG: fix the operand of CMD1 command of MMC

The operand of CMD1 command should be the required VDD voltage window
as Table 41 - OCR register definitions of JESD84-A441

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested by: Ke Allen <Allen.Ke@atmel.com>
NAND Flash: add two hynix chip information to the nand_ids table

HY27UF082G2A: 0xadda
HY27UF162G2A: 0xadca

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
OneWire: Fix the OneWire Mapping of difference between at91sam9x5ek and sama5d3xek

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
OneWire: align the board revision print message to SAM-BA's

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
libgcc: remove the dependence to the toolchain's libgcc

For some toolchains, there are some compatibility issue with the toolchain's libgcc,

Because after importing this lib, for some toolchains such as the toolchain
comes with ubuntu 12.04(arm-linux-gnueabi-gcc),it builds OK without
warning and error, but for ek with "926ej-s" core, it fails to run on the board.

for some toolchains such as from Sourcery CodeBench Lite 2012.03-57,
it run on sama5d3xek, no print message output from DBGU. and so on.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
Add the div() and mod() division function.

Add the div() and mod() division function, to eliminate the below
compilation error which arose after removing the dependence to libgcc:

	undefined reference to `__aeabi_uidiv'
	undefined reference to `__aeabi_uidivmod'

For the division in udelay() function, since our own division function
which spends much run time, causes the delay time inaccuracy. So,
using shifting, change to implement the division.
In spite of changing "1000" to "1024" which causes some inaccuacy,
but it is acceptable for our application.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
Change some "switch-case" with "if-else"

To eliminate the below compilation error which arisen after removing
the dependence to the toolchain's libgcc.

	undefined reference to `__gnu_thumb1_case_uqi'

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
Rewrite the swap_uint32() function

To eliminate the below compilation error which arisen after removing
the dependence to the toolchain's libgcc.

	undefined reference to `__bswapsi2'

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
udelay: make sure the udelay() maximum delay time and correct the error invocation.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
defconfig/at91sam9260eknf: enable "CONFIG_NANDFLASH_RECOVERY"

Since removing the dependence to the toolchain's libgcc,
the binary size decrease, so enable the recovery function
for the at91sam9260ek nandflash default configuration.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
Fix BUG: Remove gcc options "-mthumb-interwork" for AT91SAMA5D3XEK with cortex-a5

Verified by "gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-57)"

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Josh Wu <Josh.wu@atmel.com>
OneWire: make display module compatible between sama5d3xek and sam9x5ek

By checking the specification field "Mapping Revision info" to figure out
the layout of OneWire of sama5d3xek and sam9x5ek.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>