pia335x: e2: revert ethernet init for MII2

- we are connected to MII2 interface which is _slave_ 2 not host
  port 2.
- init both slave ports, as there seems to be no obvious way to
  setup slave 2 only

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
omap24xx_i2c: Handle OMAP5 like OMAP2,3,4

OMAP5 has 8b i2c data register field, like OMAP2, 3 and 4. Handle in the same
way. This fixes the following error on OMAP5:

  OMAP5430 EVM # mmc rescan
  timed out in wait_for_bb: I2C_STAT=1410
  twl6035: could not turn on LDO9.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
omap24xx_i2c: Handle wait_for_bb error

We add a return code to wait_for_bb() to be able to report errors to the
callers properly. We in turn handle this new error code in i2c_read, i2c_write
and i2c_probe.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
ARM: OMAP: I2C: New read, write and probe functions

New i2c_read, i2c_write and i2c_probe functions, tested on OMAP4
(4430/60/70), OMAP5 (5430) and AM335X (3359); should work on older
OMAPs and derivatives as well. The only anticipated exception would
be the OMAP2420, which shall require driver modification.
- Rewritten i2c_read to operate correctly with all types of chips
  (old function could not read consistent data from some I2C slaves).
- Optimised i2c_write.
- New i2c_probe, performs write access vs read. The old probe could
  hang the system under certain conditions (e.g. unconfigured pads).
- The read/write/probe functions try to identify unconfigured bus.
- Status functions now read irqstatus_raw as per TRM guidelines
  (except for OMAP243X and OMAP34XX).
- Driver now supports up to I2C5 (OMAP5).

Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
Tested-by: Heiko Schocher <hs@denx.de>
pia335x: update I2C settings

- disable 2 byte address for EEPROM
- disable EEPROM ENV

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
ARM: am33xx: run timer_init before using I2C

- I2C routines use udelay which requires timers to be enabled

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: make EEPROM initialization a fixed configuration

- on first start we need to write the ID EEPROM content, this can't be
  detected reliably automatically, so we create a special configuration,
  that creates an u-boot.spl which initializes the eeprom content.
- make sure we are using the correct header struct
- get the board revision from PIA_FIRSTSTART define
- disable generic AM33xx EVM eeprom initialization for piA-AM33xx boards
- use paged write for EEPROM init
- wait a 10ms between writes to avoid timeout warnings

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: update I2C mux function for FIRSTSTART

- When in FIRSTSTART mode we need to initialize the RTC IC as well.
  It is connected to the second I2C bus, so we need to enable support
  for I2C1 in MLO when running FIRSTSTART version
- make sure the currently selected I2C bus is correct before reading the
  EEPROM

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: add delays between access to different I2C devices

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: E2: implement hw changes between revision 0.01 and 0.02

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia3353x: fix compile errors and warnings for normal version

- first start function is not used in normal build
- revision define was missing

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
spl: mmc: fix crash for long image names in debug mode

- when the image name in the u-boot.img header is 32 bytes, there is no
  string termination when printing the name with %s

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: disable init functions only used for tessting mode

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: fix reset detection

- on cold boot we have high level on pb and wd reset pins

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: always display cpuinfo

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: avoid toggling of FF_CLK

- FF_CLK must not be toggled during boot as it would reset the
  flipflops storing the previous RESET state

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: completely remove MMC WD and CD pin configurations

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: make u-boot for MMI and E2 boards not depend on #defines

- It's easier to handle a single u-boot for similar boards.
  Use the EEPROM detection for configuration selection.
- The special first boot initialization version still need to be spearated,
  as there is no easy way to detect the board type with an empty EEPROM.

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia335x: print detected board even if DEBUG is disabled

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>