Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3204185imm; Sun, 17 Jun 2018 13:48:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIANWmZkdjr+1Oxx5l53UFhhJvJIdOTkBGMDH7dHoNUgBDcGJ8Hesrw8eIbsvyr8R5AsreK X-Received: by 2002:a62:ca4a:: with SMTP id n71-v6mr10781571pfg.14.1529268526962; Sun, 17 Jun 2018 13:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529268526; cv=none; d=google.com; s=arc-20160816; b=w4q6jDumJadIY6ZxV98NgtbwSoypBuReDmK8r5pA4GaYWzBzqfORRDyYDza80DMsUc SyzuIEmp29z/uCYKtWZhLj4Ru4Vdnmk2zYO2zp9yVBQxwMkOPKGOcs8TCFR7Fq8m2WFE 9WarkBjtB+ZnS5QpOH2HVIy0E33CUp34mNelIZKMgIvefOWGwEtDnW94I3ISutN2FvEq 0oZEgqLb/GKpqU5BhHHqdJ/S5lJlT7qZgr9qEh6LABdvNVsSh5LMLzvfAc0mcYHJdc0K NrL+40U8k+NhjvAaywUC+lR0c2LLO1qjHl7eGUX4OkHCN/vrJNUDLxknwcUXPR8Sgn85 2qBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9yi2PXsGhMBHDAUoqwjg0Y9ukovC4qRpqc1C/iifuVU=; b=zIkpYM869avsub8VzwZ3hTjgR0HxZEc0BcWUC34nHGalvXwfcRYow5ALWj62rWaGig t7qWtIdpHc24+/4K6hOvszKNIJ5awfeiAIeKBV79Szl1TLgaGLx76ZlZpVXlQdD77s1p sRufGKxfzsZqhydLyvVAKeeWKKSCySa4uFC1yTnEWP/kcAxucQQa+rXSLvDLZ4SxYYXO S5wt2pp4Vhwcxkzok/KVKVYvbR+JZy+lOG+GToN5rarHeorbvRL0zpxdidf4psRWRLrQ ZRn4Rvu4IMwwC9pS1NteY58QTiQzFx4YSJ5MP3rTKSxcOJ1lJiT7Xv0FNhRSRXM67KtZ R3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=BGsr3l0K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15-v6si11341128pgf.45.2018.06.17.13.48.32; Sun, 17 Jun 2018 13:48:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=BGsr3l0K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934463AbeFQUqR (ORCPT + 99 others); Sun, 17 Jun 2018 16:46:17 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:50306 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754081AbeFQUqI (ORCPT ); Sun, 17 Jun 2018 16:46:08 -0400 Received: from trochilidae.lan (unknown [37.17.239.3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 67B535C0E8F; Sun, 17 Jun 2018 22:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529268366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=9yi2PXsGhMBHDAUoqwjg0Y9ukovC4qRpqc1C/iifuVU=; b=BGsr3l0KlNIfxWcgMcYnkqmcXRsyES/KMCSVN49cP+e7/IuAVoSgJl4QRgAEFtPkrkcFJL LzZhIrXi6CvIFc3ENzzBaRxeSyolbU0fwLeGco83bNmdTkJBCKvgyho9uVDmFtnwvVvtrR UbzbXBDwANOwIWeVVU34zq99YMD9/pc= From: Stefan Agner To: boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, thierry.reding@gmail.com Cc: dev@lynxeye.de, miquel.raynal@bootlin.com, richard@nod.at, marcel@ziswiler.com, krzk@kernel.org, digetx@gmail.com, benjamin.lindqvist@endian.se, jonathanh@nvidia.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com, mirza.krak@gmail.com, gaireg@gaireg.de, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH v5 0/6] mtd: rawnand: add NVIDIA Tegra NAND flash support Date: Sun, 17 Jun 2018 22:45:59 +0200 Message-Id: <20180617204605.4648-1-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 X-Spamd-Result: default: False [-2.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_TWELVE(0.00)[24]; BAYES_HAM(-3.00)[100.00%]; TAGGED_RCPT(0.00)[dt]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MID_CONTAINS_FROM(1.00)[]; ASN(0.00)[asn:13030, ipnet:37.17.238.0/23, country:CH]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes definitly calm down, most noteably probably the changes around checking whether a page is empty if the stack reports ECC errors.. I verified the code using raw nandwrites with OOB to simulate an empty page which has some bits flipped in the OOB area, everthing seems to work as I would expect it. For now I do not check extra OOB bytes since those are at variable locations depending on algorithm. -- Stefan Changes since v1: - Split controller and NAND chip structure - Add BCH support - Allow to select algorithm and strength using device tree - Improve HW ECC error reporting and use DEC_STATUS_BUF only - Use SPDX license identifier - Use per algorithm mtd_ooblayout_ops - Use setup_data_interface callback for NAND timing configuration Changes since v2: - Set clock rate using assigned-clocks - Use BIT() macro - Fix and improve timing calculation - Improve ECC error handling - Store OOB layout for tag area in Tegra chip structure - Update/fix bindings - Use more specific variable names (replace "value") - Introduce nand-is-boot-medium - Choose sensible ECC strenght automatically - Use wait_for_completion_timeout - Print register dump on completion timeout - Unify tegra_nand_(read|write)_page in tegra_nand_page_xfer Changes since v3: - Implement tegra_nand_(read|write)_raw using DMA - Implement tegra_nand_(read|write)_oob using DMA - Name registers according to Tegra 2 Technical Reference Manual (v02p) - Use wait_for_completion_io_timeout to account for IO - Get chip select id from device tree reg property - Clear interrupts and reinit wait queues in case command/DMA times out - Set default MTD name after nand_set_flash_node - Move MODULE_DEVICE_TABLE after declaration of tegra_nand_of_match - Make (rs|bch)_strength static Changes since v4: - Pass OOB area to nand_check_erased_ecc_chunk - Pass algorithm specific bits_per_step to tegra_nand_get_strength - Store ECC layout in chip structure - Fix pointer assignment (use NULL) - Removed obsolete header delay.h - Fixed newlines - Use non-_io variant of wait_for_completion_timeout Lucas Stach (1): ARM: dts: tegra: add Tegra20 NAND flash controller node Stefan Agner (5): mtd: rawnand: add Reed-Solomon error correction algorithm mtd: rawnand: add an option to specify NAND chip as a boot device mtd: rawnand: tegra: add devicetree binding mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver ARM: dts: tegra: enable NAND flash on Colibri T20 .../devicetree/bindings/mtd/nand.txt | 6 +- .../bindings/mtd/nvidia-tegra20-nand.txt | 64 + MAINTAINERS | 7 + arch/arm/boot/dts/tegra20-colibri-512.dtsi | 16 + arch/arm/boot/dts/tegra20.dtsi | 15 + drivers/mtd/nand/raw/Kconfig | 6 + drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/nand_base.c | 4 + drivers/mtd/nand/raw/tegra_nand.c | 1268 +++++++++++++++++ include/linux/mtd/rawnand.h | 7 + 10 files changed, 1393 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mtd/nvidia-tegra20-nand.txt create mode 100644 drivers/mtd/nand/raw/tegra_nand.c -- 2.17.1