From patchwork Fri Apr 29 16:17:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 66960 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp879157qge; Fri, 29 Apr 2016 09:18:13 -0700 (PDT) X-Received: by 10.66.47.196 with SMTP id f4mr29692055pan.126.1461946692497; Fri, 29 Apr 2016 09:18:12 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kf10si18768869pad.51.2016.04.29.09.18.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Apr 2016 09:18:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1awB77-0002Jt-AI; Fri, 29 Apr 2016 16:17:57 +0000 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1awB70-0002Ac-Si for linux-mtd@lists.infradead.org; Fri, 29 Apr 2016 16:17:51 +0000 Received: by mail-qg0-x235.google.com with SMTP id d90so44559642qgd.3 for ; Fri, 29 Apr 2016 09:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QQSL9qBE7lnyZi7MBukzHLDzhmP92/udcFBSFDipDx8=; b=NiCKnb8udoJdK0tMONAxu0iI+koWPUft3TwoFpYNh6HK13blhJ/UM6xehsWxKhBJr/ ZJ9KWc5nEW2INH5IQwWK+qsOxNK0j1CieG2iZhnvq/+KEwwBLuNGWcwlD199jl1MlK8W hoOqyH7QYWH3w5Rd4sEuPpwjF4sw1Iqzfsw2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QQSL9qBE7lnyZi7MBukzHLDzhmP92/udcFBSFDipDx8=; b=UOvNmmSCGpcXTJScUa2YbwegElt7CUiImdAvq4O/QfksRqnjQ9J5QeHG51/YK6eUnB IRPl5kVFkwTAUkCv2JXtXO3M0b+4rC+pBB3Ucy6LwgL9rC/2ZqbqR8p0emAqidp1Wbof 2RsXuXQ43Q9K2hWZ997j2kk1KkPyWzacuz16HWK+WjrREqL+fd5xpK+C02WePg3gliBQ vvtGUaBw4Y3qzVqWYCsia+YHRxKF/btrmHYyAUR68POiN6BojT06NkG28kFDQpcuo8He LhLMKWErj8bZLnPcO8VTyozTsD+LaN27DQT/IEE8Rafy84syzfiKZ5XdbwNl8mfvGlo/ 6ylw== X-Gm-Message-State: AOPr4FUyhCuVvZEKehk8UVLNBqnHAEbgMGdNNWGsUBMcTmpx9bhim3yPSAYBy8NGTkeJIcN2 X-Received: by 10.140.20.45 with SMTP id 42mr19698318qgi.15.1461946649541; Fri, 29 Apr 2016 09:17:29 -0700 (PDT) Received: from localhost.localdomain (cpe-67-253-128-196.rochester.res.rr.com. [67.253.128.196]) by smtp.gmail.com with ESMTPSA id s184sm4621421qhc.28.2016.04.29.09.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Apr 2016 09:17:28 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, boris.brezillon@free-electrons.com, computersforpeace@gmail.com Subject: [PATCH v4 1/2] mtd: mediatek: device tree docs for MTK Smart Device Gen1 NAND Date: Fri, 29 Apr 2016 12:17:21 -0400 Message-Id: <1461946642-1842-2-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461946642-1842-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1461946642-1842-1-git-send-email-jorge.ramirez-ortiz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160429_091751_075557_8CC0EEE3 X-CRM114-Status: GOOD ( 15.29 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400d:c04:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, daniel.thompson@linaro.org, erin.lo@mediatek.com, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-mtd@lists.infradead.org, xiaolei.li@mediatek.com, dwmw2@infradead.org, blogic@openwrt.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This patch adds documentation support for Smart Device Gen1 type of NAND controllers. Signed-off-by: Jorge Ramirez-Ortiz --- Documentation/devicetree/bindings/mtd/mtk-nand.txt | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/mtk-nand.txt -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt new file mode 100644 index 0000000..175767d --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt @@ -0,0 +1,161 @@ +MTK SoCs NAND FLASH controller (NFC) DT binding + +This file documents the device tree bindings for MTK SoCs NAND controllers. +The functional split of the controller requires two drivers to operate: +the nand controller interface driver and the ECC engine driver. + +The hardware description for both devices must be captured as device +tree nodes. + +1) NFC NAND Controller Interface (NFI): +======================================= + +The first part of NFC is NAND Controller Interface (NFI) HW. +Required NFI properties: +- compatible: Should be "mediatek,mtxxxx-nfc". +- reg: Base physical address and size of NFI. +- interrupts: Interrupts of NFI. +- clocks: NFI required clocks. +- clock-names: NFI clocks internal name. +- status: Disabled default. Then set "okay" by platform. +- ecc-engine: Required ECC Engine node. +- #address-cells: NAND chip index, should be 1. +- #size-cells: Should be 0. + +Example: + + nandc: nfi@1100d000 { + compatible = "mediatek,mt2701-nfc"; + reg = <0 0x1100d000 0 0x1000>; + interrupts = ; + clocks = <&pericfg CLK_PERI_NFI>, + <&pericfg CLK_PERI_NFI_PAD>; + clock-names = "nfi_clk", "pad_clk"; + status = "disabled"; + ecc-engine = <&bch>; + #address-cells = <1>; + #size-cells = <0>; + }; + +Platform related properties, should be set in {platform_name}.dts: +- children nodes: NAND chips. + +Children nodes properties: +- reg: Chip Select Signal, default 0. + Set as reg = <0>, <1> when need 2 CS. +Optional: +- nand-on-flash-bbt: Store BBT on NAND Flash. +- nand-ecc-mode: the NAND ecc mode (check driver for supported modes) +- nand-ecc-step-size: Number of data bytes covered by a single ECC step. + The controller only supports 512 and 1024. + For large page NANDs ther recommended value is 1024. +- nand-ecc-strength: Number of bits to correct per ECC step. + The valid values that the controller supports are: 4, 6, + 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44, + 48, 52, 56, 60. + The strength should be calculated as follows: + E = (S - F) * 8 / 14 + S = O / (P / Q) + E :nand-ecc-strength; + S :spare size per sector; + F : FDM size, should be in the range [1,8]. + It is used to store free oob data. + O : oob size; + P : page size; + Q :nand-ecc-step-size + If the result does not match any one of the listed + choices above, please select the smaller valid value from + the list. + (otherwise the driver will do the clamping at runtime). +- vmch-supply: NAND power supply. +- pinctrl-names: Default NAND pin GPIO setting name. +- pinctrl-0: GPIO setting node. + +Example: + &pio { + nand_pins_default: nanddefault { + pins_dat { + pinmux = , + , + , + , + , + , + , + , + ; + input-enable; + drive-strength = ; + bias-pull-up; + }; + + pins_we { + pinmux = ; + drive-strength = ; + bias-pull-up = ; + }; + + pins_ale { + pinmux = ; + drive-strength = ; + bias-pull-down = ; + }; + }; + }; + + &nandc { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&nand_pins_default>; + nand@0 { + reg = <0>; + nand-on-flash-bbt; + nand-ecc-mode = "hw"; + nand-ecc-strength = <24>; + nand-ecc-step-size = <1024>; + }; + }; + +NAND chip optional subnodes: +- Partitions, see Documentation/devicetree/bindings/mtd/partition.txt + +Example: + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + preloader@0 { + label = "pl"; + read-only; + reg = <0x00000000 0x00400000>; + }; + android@0x00400000 { + label = "android"; + reg = <0x00400000 0x12c00000>; + }; + }; + }; + +2) ECC Engine: +============== + +Required BCH properties: +- compatible: Should be "mediatek,mtxxxx-ecc". +- reg: Base physical address and size of ECC. +- interrupts: Interrupts of ECC. +- clocks: ECC required clocks. +- clock-names: ECC clocks internal name. +- status: Disabled default. Then set "okay" by platform. + +Example: + + bch: ecc@1100e000 { + compatible = "mediatek,mt2701-ecc"; + reg = <0 0x1100e000 0 0x1000>; + interrupts = ; + clocks = <&pericfg CLK_PERI_NFI_ECC>; + clock-names = "nfiecc_clk"; + status = "disabled"; + };