FogBugz #168357: Enhance to auto calculate SDRAM size

Enhance Preloader and U-Boot to auto calculate the SDRAM size. This
will save user from the hassle of modifying the PHYS_SDRAM_1 macro
when the SDRAM change. The SDRAM size calculation will based on SDRAM
controller settings such as address row, columns, banks and others.

Signed-off-by: Chin Liang See <clsee@altera.com>
---
Changes for v2
- using macro for SDRAM width with ECC enabled
- fixed the SDRAM size calculation algorithm
FogBugz #171615: Ensure local variable in QSPI driver initialized

Ensure the local variable used in QSPI driver is properly
initialized. This is to avoid the variable being assigned with
garbage value which will affect the program flow.

Signed-off-by: Chin Liang See <clsee@altera.com>