From patchwork Mon Nov 18 13:32:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pekon gupta X-Patchwork-Id: 292092 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8BE2F2C00A4 for ; Tue, 19 Nov 2013 00:34:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4DD194B31B; Mon, 18 Nov 2013 14:34:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id braoeU2VQyTF; Mon, 18 Nov 2013 14:34:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 40C9D4B31E; Mon, 18 Nov 2013 14:33:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B6C74B31E for ; Mon, 18 Nov 2013 14:33:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rY2l2NMD2hZz for ; Mon, 18 Nov 2013 14:33:43 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by theia.denx.de (Postfix) with ESMTPS id 65E344B317 for ; Mon, 18 Nov 2013 14:33:37 +0100 (CET) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAIDXA0g013455; Mon, 18 Nov 2013 07:33:10 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAIDXAZ7003632; Mon, 18 Nov 2013 07:33:10 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Mon, 18 Nov 2013 07:33:09 -0600 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAIDX403005143; Mon, 18 Nov 2013 07:33:05 -0600 From: Pekon Gupta To: , Date: Mon, 18 Nov 2013 19:02:58 +0530 Message-ID: <1384781582-31773-1-git-send-email-pekon@ti.com> X-Mailer: git-send-email 1.8.1 MIME-Version: 1.0 Cc: yanok@emcraft.com, weber@corscience.de, balbi@ti.com, u-boot@lists.denx.de, eballetbo@iseebcn.com, ezequiel.garcia@free-electrons.com, computersforpeace@gmail.com Subject: [U-Boot] [PATCH v10 0/4] mtd: nand: omap: optimize and clean-up of OMAP NAND driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de *changes in v10* [PATCH 1/4] re-generated patche using 'git format-patch -M -C' to detect renames [PATCH 2/4] removed #ifdef while including omap_elm.h header in omap_gpmc.c [PATCH 3/4] and [PATCH 4/4] *changes in v9* (Important) As this patch series was becoming bulky and had many un-related patches, so it has been split into two parts. Part-1: Current patch series focuses on cleaning up GPMC and ELM drivers maintaining existing functionality. And update ecc-scheme selection mechanism across all platforms. Part-2: Next patch series will focus on optimizing data-paths of GPMC and ELM drivers for better performance and scalability. This Part-1 series has following patches, maintaining earlier feedbacks. [PATCH 1/4] [NEW] mtd: nand: omap: make am33xx/elm.c as common driver - move ELM driver source to drivers/mtd/nand/ to reuse driver on all platforms [PATCH 2/4] [SPLIT] mtd: nand: omap: enable BCH ECC scheme using ELM for ... v8 version of this patch is split into follwing part maintaining earlier feedbacks. - [PATCH 2/4] handles ecc-scheme selection clean-up - [PATCH 3/4] add CONFIG_NAND_OMAP_ECCSCHEME [PATCH 3/4] [NEW] mtd: nand: omap: add CONFIG_NAND_OMAP_ECCSCHEME ... - split from previous patch to introduce new CONFIG_xx for having common method of ecc-scheme selection across all platforms. - updated include/configs/ for SoC platforms (like OMAP3) which use omap_gpmc.c [PATCH 4/4] [NEW] am335x: fix GPMC config for NAND and NOR SPL boot - clean separation of NOR Boot and NAND Boot configurations - configuration of GPMC registers moved to arch/am33xx from board/ti/am335x/board.c, so that its re-usable for other boards also. This patch is tested on beagle-bone (white) with NAND cape, using following (a) Patch to add beaglebone pin-mux support http://lists.denx.de/pipermail/u-boot/2013-September/163881.html (b) Hack in board-file to configure GPMC for x16 device -------------- -------------- *changes in v8* [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform - incorporated following feedbacks from Scott Wood - using symbolic names (enums) as values of CONFIG_NAND_OMAP_ECCSCHEME - updated omap_select_ecc_scheme(): perform ecc-scheme compatibility checks before updating nand_chip.ecc fields. This avoids corrupting of existing ecc-scheme in case of switching failures. - code clean-up (removed fall-back on omap_select_ecc_scheme() failures) *changes in v7* [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform - omap_gpmc.c: fix: free bytes in OOB (ecclayout->oobfree[0].length) - omap_gpmc.c: cleanup: redundant code added in previous patch versions - am335x_evm.h: cleanup: redundant code added in previous patch versions - tricorder.h: fix: CONFIG_NAND_OMAP_ECCSCHEME *changes in v6* [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform - incorporated feedbacks from Scott Wood - renamed CONFIG_SYS_NAND_ECCSCHEME to CONFIG_NAND_OMAP_ECCSCHEME - updated omap_select_ecc_scheme() to handle error conditions without depending on caller. - renamed OMAP_ECC_HAM1_CODE_HW_ROMCODE to OMAP_ECC_HAM1_CODE_HW to keep it naming compatible to linux kernel - updated doc/README.nand and doc/README.omap3 - moved CONFIG_NAND_OMAP_ECCSCHEME description to README.nand *changes in v5* This version of patch is tested on am335x-evm with x8 NAND device, and boots SPL and u-boot from NAND [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform - re-added omap_read_page_bch(): needed proper sequence of while reading DATA and ECC from NAND page, so that calc_ecc generated from GPMC is understood by ELM. - added check to see if NAND OOB can accomodate ECC for entire page *changes in v4* [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform - removed omap_read_page_bch(): chip->ecc.read_page uses default API nand_read_page_hwecc() in nand_base.c - updated tricorder.h: added new CONFIGS for ECCSCHEME & ONFI_DETECTION - converted printf("ECC-SCHEME") to debug("ECC-SCHEME") *changes in v3* [PATCH] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform (complete re-work) - ecc-scheme is selection is controller by s/w, not CONFIG_NAND_xx - added omap_select_ecc_scheme(), as common function to handle all ecc-scheme related configurations for both board_nand_init() & omap_nand_switch_ecc(). - removed un-used defines from asm/arch-am33xx/omap_gpmc.h - updated doc/REAME.nand - removed un-used defines from asm/omap_gpmc.h *changes in v2* - added documentation for CONFIG_NAND_OMAP_xx in doc/README.nand - added CONFIG_BCH along with CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW_DETECTION_SW to include software library lib/bch.c - fixed board_nand_init() and omap_enable_hwecc() *original v1* This patch series updates BCH8_ECC schemes in mtd/nand/omap_gpmc.c driver - adds scalability for higher ECC schemes in future. - removes CONFIG_AM335x and it makes it generic for all platforms. - optimizes read_data paths Pekon Gupta (4): mtd: nand: omap: make am33xx/elm.c as common driver for all OMAPx and AMxxxx platforms mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform mtd: nand: omap: add CONFIG_NAND_OMAP_ECCSCHEME for selection of ecc-scheme am335x: fix GPMC config for NAND and NOR SPL boot arch/arm/cpu/armv7/am33xx/Makefile | 1 - arch/arm/cpu/armv7/am33xx/mem.c | 52 ++-- arch/arm/include/asm/arch-am33xx/mem.h | 5 - .../include/asm/{arch-am33xx/elm.h => omap_elm.h} | 0 arch/arm/include/asm/omap_gpmc.h | 16 + board/ti/am335x/board.c | 14 +- doc/README.nand | 53 ++++ doc/README.omap3 | 3 +- drivers/mtd/nand/Makefile | 1 + .../am33xx/elm.c => drivers/mtd/nand/omap_elm.c | 6 +- drivers/mtd/nand/omap_gpmc.c | 323 +++++++++++++-------- include/configs/am335x_evm.h | 5 +- include/configs/am335x_igep0033.h | 2 + include/configs/am3517_crane.h | 1 + include/configs/am3517_evm.h | 1 + include/configs/devkit8000.h | 1 + include/configs/mcx.h | 2 +- include/configs/omap3_beagle.h | 1 + include/configs/omap3_evm.h | 1 + include/configs/omap3_evm_quick_nand.h | 1 + include/configs/omap3_igep00x0.h | 1 + include/configs/omap3_overo.h | 1 + include/configs/siemens-am33x-common.h | 2 + include/configs/tam3517-common.h | 2 +- include/configs/tricorder.h | 2 +- 25 files changed, 321 insertions(+), 176 deletions(-) rename arch/arm/include/asm/{arch-am33xx/elm.h => omap_elm.h} (100%) rename arch/arm/cpu/armv7/am33xx/elm.c => drivers/mtd/nand/omap_elm.c (97%) Tested-by: Ezequiel Garcia Reviewed-by: Roger Meier diff --git a/arch/arm/cpu/armv7/am33xx/mem.c b/arch/arm/cpu/armv7/am33xx/mem.c index 56c9e7d..b166a94 100644 --- a/arch/arm/cpu/armv7/am33xx/mem.c +++ b/arch/arm/cpu/armv7/am33xx/mem.c @@ -64,7 +64,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,