FogBugz #159721: Fix QSPI baudrate divisor algorithm

To fix the algorithm to ensure the generated serial clock (SCLK)
by QSPI controller doesn't exceed the targeted serial clock
specified by user.

Signed-off-by: Chin Liang See <clsee@altera.com>
---
Changes for v2
- Updated the comments
FogBugz #159721: Enhance Arria V MPU clock to 1050MHz

Enhance the Arria V MPU clock from 800MHz to 1050MHz. This is
to align with the new Arria V dev kit which is using I3 speed
grade parts.

Signed-off-by: Chin Liang See <clsee@altera.com>
FogBugz #158674: Enhance Preloader to display clock info

Preloader will display the clock info such as MPU clock, DDR clock
and others during run time. It will help user to know the current
clock configuration being used without reading the handoff file.

Signed-off-by: Chin Liang See <clsee@altera.com>
FogBugz #158674: Enhance drivers to use derived clock value

Enhance the drivers for flash controllers (SDMMC and QSPI)
and UART to determine the incoming clock frequency (from PLL)
based on derived values instead of macros.

The derived values are based on Clock Manager registers and incoming
clock source frequencies (from handoff file pll_config.h). This
enhancement will avoid user manually update the clock frequencies
for drivers when any changes made to Clock Manager configuration.

Signed-off-by: Chin Liang See <clsee@altera.com>
---
Changes for v2
- Used uint32_t instead unsigned long for Clock Manager register struct
mmc/dwmmc: Using calloc instead malloc

To enhance the SDMMC DesignWare driver to use calloc instead of
malloc. This will avoid the incident that uninitialized members
of mmc structure are later used for NULL comparison.

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Andy Fleming <afleming@freescale.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
FogBugz #178339: Clearing PLL loss bits after clock configuration

Clear all the PLL lost of lock bits in Clock Manager's interrupt
status register. The false PLL lost of lock happen during the PLL
reconfiguration in Preloader stage.

Signed-off-by: Chin Liang See <clsee@altera.com>
FogBugz #158674: Enabling I2C support for U-Boot

Enable the DesignWare I2C controller support within U-Boot.
Only I2C0 is enabled per Cyclone V and Arria V dev kit. At
same time, rename socfpga_base_addrs.h to hardware.h. This is
to align with the file name used by DesignWare I2C driver.

Signed-off-by: Chin Liang See <clsee@altera.com>
---
Changes for v4
- Update the license header for hardware.h
Changes for v3
- Renamed socfpga_base_addrs.h to hardware.h
Changes for v2
- Updated hardware.h which mainly used for I2C driver
FogBugz #158674: Enhance DesignWare I2C driver address support

Enhance the DesignWare I2C driver to support address length more
than 1 byte. This enhancement is required as some I2C slave
device such as EEPROM chip might have 16 bit address byte.

Signed-off-by: Chin Liang See <clsee@altera.com>
Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
cc: Armando Visconti <armando.visconti@st.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Heiko Schocher <hs@denx.de>
Cc: Vipin KUMAR <vipin.kumar@st.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
---
Changes for v2
- Removed the function check_params()
FogBugz #158674: Enable option to get EMAC address from EEPROM

Provide additional option for user to get the EMAC address from
EEPROM chip 24LC32A which is available on Altera dev kit.
Currently, user can get the EMAC address through the U-Boot
environment that stored within flash devices.

Signed-off-by: Chin Liang See <clsee@altera.com>
---
Changes for v5
- Update documentation to reflect changes for v4
Changes for v4
- Auto assign ethaddr environment from EEPROM if its empty
Changes for v3
- check for MAC address validity before assign to ethaddr environment
Changes for v2
- Swapped the MAC address to match the board team implementation