Commit Graph

21977 Commits

Author SHA1 Message Date
Dan Murphy e71e70bf45 common: spl: add USB mass storage as a boot device
Add the ability to load a u-boot off a USB mass storage device
from the SPL

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-12-10 12:33:31 -05:00
Pekon Gupta 8e636ad2a2 dra7xx_evm: remove unused MTD partitions
removed u-boot.backup1 and u-boot-spl-os.backup1 partitions

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-10 12:15:26 -05:00
Pekon Gupta 670d917a05 am43xx_evm: remove unused MTD partitions
removed u-boot.backup1 and u-boot-spl-os.backup1 partitions

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-10 12:15:26 -05:00
Pekon Gupta a4b006efe3 am335x_evm: remove unused MTD partitions
removed u-boot.backup1 and u-boot-os-spl.backup1 partitions

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-10 12:15:26 -05:00
Sourav Poddar 532a80c9a9 spi: ti_qspi: Add delay for successful bulk erase.
Bulk erase is not happening properly on dra7 due to erase timing constraints,
add a delay so that erase timing constraints are properly met.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Yebio Mesfin <ymesfin@ti.com>
2013-12-10 10:09:56 -05:00
Tom Rini 530106aac1 am335x_evm: Fix NOR booting
All parts of the pinmux information must be in the first 4 KiB.  In
order to avoid some rather ugly linker script changes to ensure a
specific data segment was early enough, go back to asm for these pinmux
changes.

Signed-off-by: Tom Rini <trini@ti.com>
2013-12-10 10:08:28 -05:00
Tom Rini b42972acef am335x/omap3_beagle/omap4/omap5: Re-enable fdt_high relocation
The fdt_high variable controls how high into memory the FDT can be moved
as part of booting the kernel.  We had been disabling this feature as by
default we move to the very top of memory which can often be part of
highmem and so not visible to the kernel yet.  However, in other cases
the kernel BSS can overwrite the FDT at the location we use, and we
wouldn't detect this case.  The answer is to re-enable relocation, but
ensure it will be in kernel-visible memory still.

Signed-off-by: Tom Rini <trini@ti.com>
2013-12-10 08:54:47 -05:00
Tom Rini fb5de2bc3d am33xx: Add support for modifying INT_CONFIG/PBBPR in EMIF
In EMIF4 blocks of AM335x/TI81XX there is a register at 0x54 called
INT_CONFIG/PBBPR that has a field called PR_OLD_CONFIG that can be
changed depending on workloads of the system to ensure that accesses to
some areas don't cause accesses to other areas to be "stalled".  This
can be seen for example as screen jitter when playing videos.

Signed-off-by: Tom Rini <trini@ti.com>
2013-12-10 08:54:43 -05:00
Dan Murphy d7bfccba57 arm: am437: Fix offset for USB registers
Fix the offset for the USB clock registers

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-12-06 15:17:15 -05:00
Pekon Gupta 47f7187754 mtd: nand: omap: fix ecc-layout for HAM1 ecc-scheme
As per OMAP3530 TRM referenced below [1]

For large-page NAND, ROM code expects following ecc-layout for HAM1 ecc-scheme
 - OOB[1] (offset of 1 *byte* from start of OOB) for x8 NAND device
 - OOB[2] (offset of 1 *word* from start of OOB) for x16 NAND device

Thus ecc-layout expected by ROM code for HAM1 ecc-scheme is:
 *for x8 NAND Device*
 +--------+---------+---------+---------+---------+---------+---------+
 | xxxx   | ECC[A0] | ECC[A1] | ECC[A2] | ECC[B0] | ECC[B1] | ECC[B2] | ...
 +--------+---------+---------+---------+---------+---------+---------+

 *for x16 NAND Device*
 +--------+--------+---------+---------+---------+---------+---------+---------+
 | xxxxx  | xxxxx  | ECC[A0] | ECC[A1] | ECC[A2] | ECC[B0] | ECC[B1] | ECC[B2] |
 +--------+--------+---------+---------+---------+---------+---------+---------+

This patch fixes ecc-layout *only* for HAM1, as required by ROM-code
For other ecc-schemes like (BCH8) ecc-layout is same for x8 or x16 devices.

[1] OMAP3530: http://www.ti.com/product/omap3530
    TRM: http://www.ti.com/litv/pdf/spruf98x
		Chapter-25: Initialization Sub-topic: Memory Booting
		Section: 25.4.7.4 NAND
		Figure 25-19. ECC Locations in NAND Spare Areas

Reported-by: Stefan Roese <sr@denx.de>
Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-06 15:17:15 -05:00
Pekon Gupta 49fb9da3ca mtd: nand: omap: fix data-abort while correcting bit-flips using BCH16 ecc-scheme
This patch fixes 'data-abort' while correcting bit-flips in BCH16 ecc-scheme,
when number of bit-flip counts was greater than 8.

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-06 15:17:15 -05:00
Pekon Gupta 9e6155b923 mtd: nand: omap: add CONFIG_SPL_NAND_DEVICE_WIDTH to determine NAND device bus-width
This patch adds CONFIG_SPL_NAND_DEVICE_WIDTH to specify bus-width of NAND device
  CONFIG_SPL_NAND_DEVICE_WIDTH == 16: NAND device with x16 bus-width
  CONFIG_SPL_NAND_DEVICE_WIDTH == 8:  NAND device with x8 bus-width

Need for a separate CONFIG_xx arise from following situations.
(1) SPL NAND drivers does not have framework to parse ONFI parameter page.

(2) if !defined(CONFIG_SYS_NAND_SELF_INIT)
         |- board_nand_init()
         |- nand_scan()
               |- nand_scan_ident()
               |- nand_scan_tail()
   This means board_nand_init() is called before nand_scan_ident(). So NAND
   controller is initialized before the actual probing of NAND device.
   However some controller (like GPMC) need to be specifically configured for
   bus-width of NAND device.
   In such cases, bus-width of the NAND device should be known in advance
   of actual device probing. Hence, CONFIG_SPL_NAND_DEVICE_WIDTH is useful.

(3) Non-ONFI compliant devices need some mechanism to specify device bus-width
   to driver.

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-06 15:17:15 -05:00
Vladimir Koutny a67b4401d7 am335x: cpsw: optimize cpsw_recv to increase network performance
In 48ec5291, only TX path was optimized; this does the same also for RX
path. This results in huge increase of TFTP throughput on custom am3352
board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer
timeouts.

Signed-off-by: Vladimir Koutny <vladimir.koutny@streamunlimited.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Tom Rini <trini@ti.com>
2013-12-04 09:40:43 -05:00
Pekon Gupta 1a59ceb159 dra7xx_evm: add support for parallel NAND
This patch
 - Adds pin-mux for x16 parallel NAND device (MT29F2G16AAD) present on DRA7xx_EVM
 - Populate MTD partition table which needs same as kernel DTS for DRA7xx_EVM.
 - Populate other CONFIG_xx parameters required for NAND Boot on DRA7xx

Important: NAND device on DRA7xx_EVM board (MT29F2G16AAD) is a x16 device.
  To support NAND device with bus-width=16 bits, GPMC driver needs additional
  hack as following

diff --git a/arch/arm/cpu/armv7/omap-common/mem-common.c b/arch/arm/cpu/armv7/omap-common/mem-common.c
index 8e7352b..9b14927 100644
--- a/arch/arm/cpu/armv7/omap-common/mem-common.c
+++ b/arch/arm/cpu/armv7/omap-common/mem-common.c
@@ -91,7 +91,7 @@ void gpmc_init(void)
        u32 base = CONFIG_SYS_FLASH_BASE;
 #elif defined(CONFIG_NAND)
 /* configure GPMC for NAND */
-       const u32  gpmc_regs[GPMC_MAX_REG] = {  M_NAND_GPMC_CONFIG1,
+       const u32  gpmc_regs[GPMC_MAX_REG] = {  M_NAND_GPMC_CONFIG1 | 0x1000,
                                                M_NAND_GPMC_CONFIG2,
                                                M_NAND_GPMC_CONFIG3,
                                                M_NAND_GPMC_CONFIG4,

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 23:01:56 +05:30
Pekon Gupta cab134bad2 dra7xx: updated macro used in pin-mux configuration
This patch introduces simple user-friendly macro for configuring pin-mux
- PIN_INPUT_PULLDOWN, PIN_INPUT_PULLUP, PIN_INPUT_NOPULL
- PIN_OUTPUT_PULLDOWN, PIN_OUTPUT_PULLUP, PIN_OUTPUT_NOPULL
- PIN_MUX_MODE(x): x is mode number

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 16:38:10 +05:30
Pekon Gupta 7304e05470 am43xx_evm: add support for parallel NAND
This patch
 - Adds pin-mux for x8 parallel NAND device (MT29F4G08AB) present on AM43xx_EVM

 - As above NAND device has blocksize=256k, pagesize=4k, oobsize=224, so by
   design ROM code expects SPL to be flashed using BCH16 ECC scheme. Hence
   CONFIG_NAND_OMAP_ECCSCHEME = OMAP_ECC_BCH16_CODE_HW is enabled.

 - Specifies MTD partition table which needs same as kernel DTS for AM43xx_EVM.

 - Populates other CONFIG_xx parameters required for NAND Boot on AM43xx

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 16:37:50 +05:30
Pekon Gupta 3ecf32a72c am335x_evm: update NAND related CONFIG_xx and MTD partitions
This patch
 - Groups all CONFIG_xx required for enabling parallel NAND on AM335x_EVM
   into single file include/configs/am335x_evm.h
 - Updates MTD partition table to include backup partitions for
   u-boot, environment and u-boot-spl-os.
 - Aligns MTD partitions (except for SPL partitions) such that partition offsets
   and sizes remain constant for all NAND devices with blocksize=128k or 256k.
   (because MTD partitions need to be aligned with blocksize boundary)

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 15:47:01 +05:30
Pekon Gupta f9519b4a1b ARM: omap: merge GPMC initialization code for all platform
Most of TI's SoC platform have in-buit GPMC (General Purpose Memory Controller)
which can be used to interface different types of external memories like:
 - parallel NOR flash
 - parallel NAND flash
 - OneNand flash
 - SDR RAM

This patch:
 - As the GPMC hardware engine is common across all OMAPx and AMxxxx platforms,
   so GPMC initialization code from all platforms is merged into single file:
     arch/arm/cpu/armv7/omap-common/mem-common.c

 - But as different platforms support different operating clock frequencies,
   So, same memory device can have different GPMC configuration values on
   different platforms (like memory signal timing values of same device may
   differ on different platforms). Hence actual GPMC configuration parameters
   are still kept separately in following platform specific header files:
     AM33xx: [unchanged] arch/arm/include/asm/arch-am33xx/mem.h
     OMAP3:  [modified]  arch/arm/include/asm/arch-omap3/mem.h
     OMAP4:  [new] arch/arm/include/asm/arch-omap4/mem.h
     OMAP5:  [new] arch/arm/include/asm/arch-omap5/mem.h

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:45 +05:30
Pekon Gupta 35a50ea51c ARM: omap5: add hardware info for GPMC and ELM controllers
This patch adds OMAP5 platform specific information to enable GPMC controller,
which can interface different types of external memories like:
 - parallel NOR flash
 - parallel NAND flash
 - OneNand flash
 - SDR RAM

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:45 +05:30
Pekon Gupta 1c8e9c5f5d ARM: omap4: add hardware info for GPMC and ELM controllers
This patch adds OMAP4 platform specific information to enable in-built GPMC and
ELM controller, which can interface following types of external memories:
 - parallel NOR flash
 - parallel NAND flash
 - OneNand flash
 - SDR RAM

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:44 +05:30
Pekon Gupta a64b8e9456 mtd: nand: omap: README: how to select NAND ecc-schemes on OMAP devices
Adds explanation on how to select ECC scheme.

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:44 +05:30
Pekon Gupta 7a0845728b mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
With increase in NAND flash densities occurence of bit-flips has increased.
Thus stronger ECC schemes are required for detecting and correcting multiple
simultaneous bit-flips in same NAND page. But stronger ECC schemes have large
ECC syndrome which require more space in OOB/Spare.
This patch add support for BCH16_ECC:
(a) BCH16_ECC can correct 16 bit-flips per 512Bytes of data.
(b) BCH16_ECC generates 26-bytes of ECC syndrome / 512B.

Due to (b) this scheme can only be used with NAND devices which have enough
OOB to satisfy following equation:
OOBsize per page >= 26 * (page-size / 512)

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:43 +05:30
Pekon Gupta a72c2ee835 mtd: nand: omap: add support for BCH16_ECC in ELM driver
With increase in NAND flash densities occurence of bit-flips has increased.
Thus stronger ECC schemes are required for detecting and correcting multiple
simultaneous bit-flips in same NAND page. But stronger ECC schemes have large
ECC syndrome which require more space in OOB/Spare.
This patch add support for BCH16_ECC:
(a) BCH16_ECC can correct 16 bit-flips per 512Bytes of data.
(b) BCH16_ECC generates 26-bytes of ECC syndrome / 512B.

Due to (b) this scheme can only be used with NAND devices which have enough
OOB to satisfy following equation:
OOBsize per page >= 26 * (page-size / 512)

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-12-03 14:30:42 +05:30
Mugunthan V N 726c782423 ARM: AM43xx: Add Ethernet boot support to SPL
Add Ethernet Boot support to SPL

Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2013-12-02 12:02:18 -05:00
Mugunthan V N 5e7ae95a3d ARM: AM43xx: increase ro segment size
Increase read only segment size so that more peheripheral support can be
added to SPL like Ethernet or USB. The OCMC ram size is 256K, so allocating
~220K for read only segment.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2013-12-02 12:02:18 -05:00
Lokesh Vutla 6f45e53060 ARM: DRA7xx: Change clk divider setting
Commit "armv7: hw_data: change clock divider setting"
updates the setting for m6 divider for 20MHz sys_clk frequency.
But missed to update for other sys_clk frequencies. Doing the same.

Reported-by: Rajendran, Vinothkumar <vinothr@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2013-12-02 12:02:17 -05:00
Lokesh Vutla 56d8c207de ARM: AM4372: Update EMIF registers for DDR3
Updating EMIF_PHY_CTRL and adding EMIF_READ_WRITE_EXECUTION_THRESHOLD
registers.
In EMIF_PHY_CTRL:
Updating [4:0]READ_LATENCY to 8, because at higher frequencies like 400MHz the
read latency expected will be CL+3 as per tests from HW folks.
Clearing [19]PHY_DIS_CALIB_RST bit as this is used onl for debug
purpose. With out this resume is not working(Still waiting for PHY team to
come back for better explanation).

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2013-12-02 12:02:16 -05:00
Lokesh Vutla 3e4115e182 ARM: OMAP4: Fix build break
Commit "ARM: DRA7/OMAP5: EMIF: Add workaround for bug 0039"
introduces the following build error.

arch/arm/cpu/armv7/omap-common/libomap-common.o: In function `do_bug0039_workaround':
/home/lokesh/exp/mainline/u-boot/arch/arm/cpu/armv7/omap-common/emif-common.c:1284: undefined reference to `get_bug_regs'

This is because of missing function call in OMAP4. Adding a weak function
for this.

Reported-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2013-12-02 12:02:16 -05:00
Lokesh Vutla 1e64752dae ARM: OMAP4/5: Fix build warning
Commit "ARM: OMAP5: DRA7xx: Add workaround for ARM errata 798870"
introduces the follwoing build warning for OMAP5 and build break for OMAP4.

hwinit-common.c: In function 's_init':
hwinit-common.c:132:2: warning: implicit declaration of function 'arm_errata_798870' [-Wimplicit-function-declaration]

As this function is called for both OMAP5 and OMAP4 and defined only for OMAP5
causing a build error for OMAP4
Fixing by moving this function common to OMAP4/5.
This will not break any functionality on OMAP4 as it checks for A15.

Reported-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2013-12-02 12:02:16 -05:00
pekon gupta cad434fe2e mtd: nand: omap: move omap_elm.h from arch/arm/include/asm to drivers/mtd/nand
omap_elm.h is a generic header used by OMAP ELM driver for all TI platfoms.
Hence this file should be present in generic folder instead of architecture
specific include folder.
Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:55 -05:00
pekon gupta e05f81d3eb mtd: nand: omap: move omap_gpmc.h from arch/arm/include/asm to drivers/mtd/nand
omap_gpmc.h is a generic header used by OMAP NAND driver for all TI platfoms.
Hence this file should be present in generic folder instead of architecture
specific include folder.
Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:55 -05:00
pekon gupta 4fe753f862 mtd: nand: omap: merge duplicate GPMC data from different arch-xx headers into common omap_gpmc.h
Each SoC platform (AM33xx, OMAP3, OMAP4, OMAP5) has its own copy of GPMC related
defines and declarations scattered in SoC platform specific header files
like include/asm/arch-xx/cpu.h
However, GPMC hardware remains same across all platforms thus this patch merges
GPMC data scattered across different arch-xx specific header files into single
header file include/asm/arch/omap_gpmc.h

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:54 -05:00
pekon gupta 65c69b22ed mtd: nand: omap: remove unused #defines from common omap_gpmc.h
OMAP NAND driver can detect Page-size and OOB-size of NAND device from ONFI
params or nand_id[] table. And based on that it defines ECC layout.
This patch
1) removes following board configs used for defining NAND ECC layout
	- GPMC_NAND_ECC_LP_x16_LAYOUT (for large page x16 NAND)
	- GPMC_NAND_ECC_LP_x8_LAYOUT  (for large page x8 NAND)
	- GPMC_NAND_ECC_SP_x16_LAYOUT (for small page x16 NAND)
	- GPMC_NAND_ECC_SP_x8_LAYOUT  (for small page x8 NAND)

2) removes unused #defines in common omap_gpmc.h depending on above configs

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:54 -05:00
pekon gupta 9db4169403 mtd: nand: omap: remove redundant platform specific header: arch-xx/omap_gpmc.h
Currently there are two sets of omap_gpmc.h header files
(a) arch/arm/include/asm/omap_gpmc.h
 common header file for all platforms, containing defines and declarations used
 by GPMC NAND driver.

(b) arch/arm/include/asm/arch-xx/omap_gpmc.h
 SoC platform specific header file containing defines like ECC layout.

This patch removes platform specific arch-xx/omap_gpmc.c because:
 - GPMC hardware engine is common for all SoC platforms hence only (a) is enough
 - ECC layout is now defined in omap_nand.c driver itself based on ecc-scheme
   selected. Hence all ECC layout declarations in (b) are redundant.

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:54 -05:00
pekon gupta 05473da64f 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>
2013-11-26 09:09:46 -05:00
pekon gupta 706ee385ac 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>
2013-11-26 09:09:46 -05:00
pekon gupta 2147d300bc 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>
2013-11-26 09:09:46 -05:00
pekon gupta fd050d3479 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>
2013-11-26 09:09:46 -05:00
pekon gupta 6f2d6d7144 am335x: fix GPMC config for NAND and NOR SPL boot
GPMC controller is common IP to interface with both NAND and NOR flash devices.
Also, it supports max 8 chip-selects, which can be independently connected to
any of the devices.
But ROM code expects the boot-device to be connected to only chip-select[0].
Thus to resolve conflict between NOR and NAND boot. This patch:
- combines NOR and NAND configs spread in board files to common gpmc_init()
- configures GPMC based on boot-mode selected for SPL boot.

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:18 -05:00
pekon gupta 8e2517339b mtd: nand: omap: add CONFIG_NAND_OMAP_ECCSCHEME for selection of ecc-scheme
This patch adds new CONFIG_NAND_OMAP_ECCSCHEME, replacing other distributed
CONFIG_xx used for selecting NAND ecc-schemes.
This patch aims at solving following issues.

1) Currently ecc-scheme is tied to SoC platform, which prevents user to select
   other ecc-schemes also supported in hardware. like;
 - most of OMAP3 SoC platforms use only 1-bit Hamming ecc-scheme, inspite
   the fact that they can use higher ecc-schemes like 8-bit ecc-schemes with
   software based error detection (OMAP_ECC_BCH4_CODE_HW_DETECTION_SW).
 - most of AM33xx SoC plaforms use 8-bit BCH ecc-scheme for now, but hardware
   supports BCH16 ecc-scheme also.

2) Different platforms use different CONFIG_xx to select ecc-schemes, which
   adds confusion for user while migrating platforms.
 - *CONFIG_NAND_OMAP_ELM* which enables ELM hardware engine, selects only
    8-bit BCH ecc-scheme with h/w based error-correction (OMAP_ECC_BCH8_CODE_HW)
    whereas ELM hardware engine supports other ecc-schemes also like; BCH4,
    and BCH16 (in future).
 - *CONFIG_NAND_OMAP_BCH8* selects 8-bit BCH ecc-scheme with s/w based error
    correction (OMAP_ECC_BCH8_CODE_HW_DETECTION_SW).
 - *CONFIG_SPL_NAND_SOFTECC* selects 1-bit Hamming ecc-scheme using s/w library

Thus adding new *CONFIG_NAND_OMAP_ECCSCHEME* de-couples ecc-scheme dependency
on SoC platform and NAND driver. And user can select ecc-scheme independently
foreach board.
However, selection some hardware based ecc-schemes (OMAP_ECC_BCHx_CODE_HW) still
depends on presence of ELM hardware engine on SoC. (Refer doc/README.nand)

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:17 -05:00
pekon gupta 3e05e9d0ff mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
BCH8_ECC scheme implemented in omap_gpmc.c driver has following favours
+-----------------------------------+-----------------+-----------------+
|ECC Scheme                         | ECC Calculation | Error Detection |
+-----------------------------------+-----------------+-----------------+
|OMAP_ECC_BCH8_CODE_HW              |GPMC             |ELM H/W engine   |
|OMAP_ECC_BCH8_CODE_HW_DETECTION_SW |GPMC             |S/W BCH library  |
+-----------------------------------+-----------------+-----------------+

Current implementation limits the BCH8_CODE_HW only for AM33xx device family.
(using CONFIG_AM33XX). However, other SoC families (like TI81xx) also have
ELM hardware module, and can support ECC error detection using ELM.

This patch
- removes CONFIG_AM33xx
	Thus this driver can be reused by all devices having ELM h/w engine.
- adds omap_select_ecc_scheme()
	A common function to handle ecc-scheme related configurations. This
	can be used both during device-probe and via user-space u-boot commads
	to change ecc-scheme. During device probe ecc-scheme is selected based
	on CONFIG_NAND_OMAP_ELM or CONFIG_NAND_OMAP_BCH8
- enables CONFIG_BCH
	S/W library (lib/bch.c) required by OMAP_ECC_BCHx_CODE_HW_DETECTION_SW
  	is enabled by CONFIG_BCH.
- enables CONFIG_SYS_NAND_ONFI_DETECTION
	for auto-detection of ONFI compliant NAND devices
- updates following README doc
	doc/README.nand
	board/ti/am335x/README
	doc/README.omap3

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 09:09:15 -05:00
pekon gupta c413424f74 mtd: nand: omap: make am33xx/elm.c as common driver for all OMAPx and AMxxxx platforms
ELM hardware engine which is used for ECC error detection, is present on all
latest OMAP SoC (like OMAP4xxx, OMAP5xxx, DRA7xxx, AM33xx, AM43xx). Thus ELM
driver should be moved to common drivers/mtd/nand/ folder so that all SoC
having on-chip ELM hardware engine can re-use it.
This patch has following changes:
- mv arch/arm/include/asm/arch-am33xx/elm.h arch/arm/include/asm/omap_elm.h
- mv arch/arm/cpu/armv7/am33xx/elm.c drivers/mtd/nand/omap_elm.c
- update Makefiles
- update #include <asm/elm.h>
- add CONFIG_NAND_OMAP_ELM to compile driver/mtd/nand/omap_elm.c
	and include in all board configs using AM33xx SoC platform.

Signed-off-by: Pekon Gupta <pekon@ti.com>
2013-11-26 08:54:43 -05:00
Praveen Rao a59443f753 ARM: OMAP5: DRA7xx: Add workaround for ARM errata 798870
This patch adds workaround for ARM errata 798870 which says
"If back-to-back speculative cache line fills (fill A and fill B) are
issued from the L1 data cache of a CPU to the L2 cache, the second
request (fill B) is then cancelled, and the second request would have
detected a hazard against a recent write or eviction (write B) to the
same cache line as fill B then the L2 logic might deadlock."

Signed-off-by: Praveen Rao <prao@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2013-11-26 08:34:10 -05:00
Carlos Leija c3a7f32060 omapimage: Add QSPI CH support for DRA7xx
Introduce the usage of QSPI CH for DRA7xx instead of the default and
dummy CHSETTINGS. This CH is only valid for DRA7xx based devices and
is intended to speed up the boot for QSPI_1 device.

Change-Id: I9ab902f0597a758a48732b4dac18adc2e840f7ab
Signed-off-by: Carlos Leija <cileija@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
2013-11-25 12:54:05 -05:00
Carlos Leija e9f6b8958f omapimage: Generalize CH structure
Generalize CH structure to support different CH types based on the fact
that every configuration header entry is composed of a header section
and a data section with the settings intended to configure.

Change-Id: Ib32606dda9f9988cae5b85652f8e8c5bc21919d6
Signed-off-by: Carlos Leija <cileija@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
2013-11-25 12:54:05 -05:00
Tom Rini 996f0c426b am335x_evm: Update nandboot to use partitions and DT
Signed-off-by: Tom Rini <trini@ti.com>
2013-11-18 10:17:03 -05:00
Roger Quadros eef40eae2d ARM: dra7_evm: Add SATA support
The evm has a SATA port. Enable SATA configuration and
inititialize the SATA controller.

Signed-off-by: Roger Quadros <rogerq@ti.com>
2013-11-15 09:08:48 -05:00
Roger Quadros e736621f13 ARM: DRA7xx: Add PRCM and Control information for SATA
Adds the necessary PRCM and Control register information for
SATA on DRA7xx.

Signed-off-by: Roger Quadros <rogerq@ti.com>
2013-11-15 09:08:48 -05:00
Roger Quadros 6ff8bcd82a ARM: omap5_uevm: Add SATA support
The uevm has a SATA port. Inititialize the SATA controller.

Signed-off-by: Roger Quadros <rogerq@ti.com>
2013-11-15 09:08:48 -05:00
Roger Quadros 21368142b6 ARM: OMAP5: Add SATA platform glue
Add platform glue logic for the SATA controller.

Signed-off-by: Roger Quadros <rogerq@ti.com>
2013-11-15 09:08:43 -05:00