Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp970177ybl; Fri, 24 Jan 2020 12:56:46 -0800 (PST) X-Google-Smtp-Source: APXvYqy3rDqptgzvUp5bxtjURUB4+XUAo45ZusfPJPTfqudsvAryaDoJ6hzXv+0OEQVjowbfIcBA X-Received: by 2002:aca:d6c8:: with SMTP id n191mr531342oig.103.1579899406034; Fri, 24 Jan 2020 12:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899406; cv=none; d=google.com; s=arc-20160816; b=T6sw72UX16XjONgwJXNC9S3KpeIYj/BHD/Dk0oDSJ7zcparWZO9X5OZSSAopx1xLsv j+hzTKOoClN8cf8KbN071TyN5Cd7h7VxywPtLtGchNYogvtHDK0p/szcDFRDi0I7/TLj voR/jB3JdWwC1JSWlLUGfzJ7E62p9ZoRJSdddExAKc63uUH+FTUR36rd2aM4vXdUze+H iHy4fIDV/rHduRYschGZwqpgpcZVB3ahAx0A2NeGkRau+gYcHwaZ5P/qOi5h2YSmBvlU cBm2GIZoD+e8j/jVoU1Wn/EDxJ1XE5mC6PDvHXSkWscWrM79/cK8Yaj7neOBraXYDe3Y sJFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=EGh3OiKQogE5iT7XPWpVeqcoJRu9YANRktnC4s4FDMY=; b=rHV7zC0HkXbfHixY7nVS7wks1n3Bc9URSuzt4MgttSEnI8eqaRkPSVWGO8rn9z1fCW ppD02jlHeyvp6pc45pu44/V+rt77Mx97Oi4XP9CF39wlgdmTY3YJuWl5aIJwYOt4LxkJ r7xdqcrIizov7rJRkLSrCAnb/Q1nh6+Bchi7vSWY+NT4fmnFRCkXeD6Ap2ot8OgldHr9 btlR+6lPpwuNlLMLuDUE8LWoAWgPmsWvyZAI62TpA2suvFCN0A6NWiaYIEnutgaYTqPf yh9gV3UQxmsffoli+ehL/csqpPRPw+FO9pFW1y4l58kc7XhtzcqKM+G7MuEAKeEsI5oJ o2Og== ARC-Authentication-Results: i=1; mx.google.com; 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 f22si3469137otp.145.2020.01.24.12.56.33; Fri, 24 Jan 2020 12:56:46 -0800 (PST) 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; 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 S1731688AbgAXRR5 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 24 Jan 2020 12:17:57 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:55193 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730514AbgAXRR5 (ORCPT ); Fri, 24 Jan 2020 12:17:57 -0500 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 04F64E0003; Fri, 24 Jan 2020 17:17:52 +0000 (UTC) Date: Fri, 24 Jan 2020 18:17:51 +0100 From: Miquel Raynal To: Johan Jonker Cc: richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, yifeng.zhao@rock-chips.com Subject: Re: [RFC PATCH v2 00/10] Enable RK3066 NANDC for MK808 Message-ID: <20200124181751.721aa428@xps13> In-Reply-To: <20200124163001.28910-1-jbx6244@gmail.com> References: <20200124163001.28910-1-jbx6244@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Johan, Johan Jonker wrote on Fri, 24 Jan 2020 17:29:51 +0100: > DISCLAIMER: Use at your own risk. > Status: For testing only! > > Version: V2 > > Title: Enable RK3066 NANDC for MK808. > > The majority of Rockchip devices use a closed source FTL driver > to reduce wear leveling. This patch serie proposes > an experimental raw NAND controller driver for basic tasks > in order to get the bindings and the nodes accepted for in the dts files. > > What does it do: > > On module load this driver will reserve its resources. > After initialization the MTD framework will then try to detect > the type and number of NAND chips. When all conditions are met, > it registers it self as MTD device. > This driver is then ready to receive user commands > such as to read and write NAND pages. > > Test examples: > > # dd if=/dev/mtd0 of=dd.bin bs=8192 count=4 > > # nanddump -a -l 32768 -f nanddump.bin /dev/mtd0 > > Not tested: > > NANDC version 9. > NAND raw write. nandbiterrs -i /dev/mtd to validate it works! > RK3066 still has no support for Uboot. > Any write command would interfere with data structures made by the boot loader. > > Etc. > > Problems: > > No bad block support. Most devices use a FTL bad block map with tags > that must be located on specific page locations which is outside > the scope of the raw MTD framework. I don't understand this story of bad block map. Are you comparing with a vendor kernel? If vendors invent new ways to handle MTD blocks it's sad but they will never be compatible with mainline. It's a fact. However for an upstream version, I don't get if there is any real issue? The location of the BBM is not related to your controller driver but depends on the NAND chip and as you say below we know provide three possible positions in a block. What you refer as the FTL is the equivalent of UBI in Linux, which indeed offers to the user a linear logical view of all the valid blocks while physically the data is spread across all the available eraseblocks. > > hynix_nand_init() add extra option NAND_BBM_LASTPAGE for H27UCG8T2ATR-BC. > > No partition support. A FTL driver will store at random locations and > a linear user specific layout does not fit within > the generic character of this basic driver. > > Driver assumes that IO pins are correctly set by the boot loader. Which pins are you talking about? Are you missing a pinctrl driver? > > Fixed timing setting. > > RK3228A/RK3228B compatibility version 701 unknown > RV1108 nand version unknown > > Etc. > > Todo: > > MLC ? This is not related to your NAND controller driver neither. Cheers, Miquèl