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>