mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes

chip->ecc.hwctl() is used for preparing the H/W controller before read/write
NAND accesses (like assigning data-buf, enabling ECC scheme configs, etc.)

Though all ECC schemes in OMAP NAND driver use GPMC controller for generating
ECC syndrome (for both Read/Write accesses). But but in current code
HAM1_ECC and BCHx_ECC schemes implement individual function to achieve this.
This patch
(1) removes omap_hwecc_init() and omap_hwecc_init_bch()
as chip->ecc.hwctl will re-initializeGPMC before every read/write call.
omap_hwecc_init_bch() -> omap_enable_ecc_bch()

(2) merges the GPMC configuration code for all ECC schemes into
single omap_enable_hwecc(), thus adding scalability for future ECC schemes.
omap_enable_hwecc() + omap_enable_ecc_bch() -> omap_enable_hwecc()

Signed-off-by: Pekon Gupta <pekon@ti.com>
mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes

chip->ecc.calculate() is used for calculating and fetching of ECC syndrome by
processing the data passed during Read/Write accesses.

All H/W based ECC schemes use GPMC controller to calculate ECC syndrome.
But each BCHx_ECC scheme has its own implemetation of post-processing and
fetching ECC syndrome from GPMC controller.

This patch updates OMAP_ECC_BCH8_CODE_HW ECC scheme in following way:
- merges multiple chip->calculate API for different ECC schemes
  omap_calculate_ecc() + omap_calculate_ecc_bch() + omap_calculate_ecc_bch_sw()
				==> omap_calculate_ecc()
- removes omap_ecc_disable() and instead uses it as inline.

Signed-off-by: Pekon Gupta <pekon@ti.com>
mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes

chip->ecc.correct() is used for detecting and correcting bit-flips during read
operations. In omap-nand driver it implemented as:
(a) omap_correct_data(): for h/w based ECC_HAM1 scheme
(b) omap_correct_data_bch() + CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
	for ECC_BCH8 scheme using GPMC and software lib/bch.c
(c) omap_correct_data_bch() + CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW
	for ECC_BCH8 scheme using GPMC and ELM

This patch updates (c)
- checks for calc_ecc[]==0x00 so that error_correction is not required for
  known good pages.
- adds scalability for other ECC_BCHx scheme by merging following
  omap_rotate_ecc_bch() + omap_fix_errors_bch() => omap_correct_data_bch()
- fixing logic for bit-flip correction based on error_loc[count]

Signed-off-by: Pekon Gupta <pekon@ti.com>
board/ti/am335x/README: update for NAND boot

NAND boot mode on AM335x EVM has been verified, and steps
to use it has been documented and update in this README

Signed-off-by: Pekon Gupta <pekon@ti.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Tom Rini <trini@ti.com>
net: emaclite: Fix OF initialization

- Add xilinx_emaclite_of_init to netdev.h
- Remove global data pointer from the driver
- Add better handling for error state.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Do not use SPL OF initialization

Disable CONFIG_OF_CONTROL for SPL compilation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: gem: Add OF initialization support

Gem can be directly initialized from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mmc: zynq: Add OF initialization support

Enable initialize sdhci from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Add OF ram initialization support

Read ram size directly from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
serial: zynq: Add OF initialization support

Add console selection from DTB which is enough to have
OF driven solution.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
kbuild: post: fix dependency tracking correctly

$(call if_changed,...) must take FORCE as a prerequite.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
config.mk: Delete unused variable BCURDIR

This variable was abolished by Kbuild series.
I forgot to delete it.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Makefile: delete unused variable LDSCRIPT_MAKEFILE_DIR

LDSCRIPT_MAKEFILE_DIR is not referenced from anywhere. Remove.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
nand_spl: simpc8313: move config.mk used only for nand_spl

board/sheldon/simpc8313/config.mk is used only for nand_spl.
So it should go into nand_spl/board/sheldon/simpc8313/.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
x86: Delete redundant compiler flags

-Wstrict-prototypes, -ffreestanding, -fno-stack-protector
are defined at the top Makefile for all architectures.

Do not define them twice for x86.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
sh: Do not define -ffreestanding twice

-ffreestanding is defined at the top Makefile for all architectures.
Do not define it twice for SH2A.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
sh: merge compiler flag -ffixed-r13

-ffixed-r13 is defined commonly for sh2, sh3, sh4.
Move it to arch/sh/config.mk

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
m68k: merge compile flags -ffixed-d7 -sep-data

All arch/m68k/cpu/*/config.mk define the same flags
  PLAGFORM_REFLFLAGS += -ffixed-d7 -msep-data
Move it to arch/m68k/config.mk

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jason Jin <Jason.jin@freescale.com>
nand_spl: display warning message to inform the end of nand_spl

Now we have two different frameworks for doing the same thing.
I'd like to propose to drop nand_spl framework.
How about deleting it before v2014.07 release?

In the interim, this commit will display a warning message
when compiling nand_spl board.

Now we have 19 nand_spl boards:

  MPC8315ERDB_NAND
  SIMPC8313_LP
  SIMPC8313_SP
  MPC8536DS_NAND
  MPC8569MDS_NAND
  MPC8572DS_NAND
  P1023RDS_NAND
  P1011RDB_NAND
  P1020RDB_NAND
  P2010RDB_NAND
  P2020RDB_NAND
  acadia_nand
  bamboo_nand
  canyonlands_nand
  glacier_nand
  haleakala_nand
  kilauea_nand
  rainier_nand
  sequoia_nand

They must be ported to SPL before the deadline,
otherwise they will be removed.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Dave Liu <daveliu@freescale.com>
Cc: Ron Madrid <info@sheldoninst.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
drivers: net: cpsw: add support to have phy address from cpsw platform data

Some platforms like AM437x have different EVMs with different phy addresses,
so this patch adds support for passing phy address via cpsw plaform data.
Also renamed phy_id to phy_addr so better understanding of the code.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
[trini: Update BuR am335x_igep0033 pcm051_rev3 pcm051_rev1 cm_t335
pengwyn boards]
Signed-off-by: Tom Rini <trini@ti.com>