Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3348597pxb; Mon, 4 Apr 2022 14:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE5ncz64fMV+bPA0cu8CRpSXyCzUvMPbeDiEZqRvudsvY/p2WZ840rLKFfCgbW+J2Dj35l X-Received: by 2002:a17:90b:17c3:b0:1c6:b0ff:abf with SMTP id me3-20020a17090b17c300b001c6b0ff0abfmr184716pjb.24.1649106995909; Mon, 04 Apr 2022 14:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649106995; cv=none; d=google.com; s=arc-20160816; b=k0cKk+VZm3tu+D1AdkTVeCTz/gR6Q/al6XcRDpuCdeDmDhCV0PYKwzFwXQlNm5n+S/ 0+9H23dMpHj6MDu124q8DVkadg4DaiHatTbPEpXMKegk2mJPmmpMWAXA0Vz4fARvwdqM 4J3c9ZyAINUkXoy1x1Sha4Sz2PJ8XUS1XgU7pyVA4jlKsiCfTd1z733HUruJkNePp8Re igQiK4GJYL4zyMeQGNuwHg8wrgyTqtmrHPF+eo2f/eWr4TtQxaK6IMwjGihtW58PUx3X yvG4O6vff5jRpTzgiR2LSuQZbPte/Bgf0A4CPgclmOyXtxHZaLOYkpi7gJHAn59A5qUU GBcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Jxz5zWvm2g9eSY2ODGL8ove3tyAWCdoJG2idJFSxyD8=; b=JjI5PU1MNui2rctA5qROFNr3HH1lNbB2hXEDVJglnI85T5o1zJbwTyz4HrrQ73BCA+ fv0u+j6folZ/5qvkjk/Nynm2dbD3c/v3IFLBuYcKhlor/9F0STDKjHPCqWtuGW1OAzqy pHUuWbxwhDRmEsW3hhAIO+PxI4DKiwT9557TNPCZpRdZxyV5s/FyII0YOA3+38UtjS1W V6/ehja1qx07UNUZYHlC+sgdz47ri3RpxRamPy0Ua7mcsv0h6gPkfSJ3NaY5w7Ej5MHt iEoEh0tUObnDTvP13lF9HmwJJ0LNN1XowlUk9R8ULk9yMltLn40/2sZgrtNO7+b9mqdt zjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XRJ6YJ9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f132-20020a636a8a000000b0038211111ec0si10570461pgc.197.2022.04.04.14.16.20; Mon, 04 Apr 2022 14:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XRJ6YJ9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357307AbiDCNOi (ORCPT + 99 others); Sun, 3 Apr 2022 09:14:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239016AbiDCNOh (ORCPT ); Sun, 3 Apr 2022 09:14:37 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 111A0E45; Sun, 3 Apr 2022 06:12:44 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id bx5so6309810pjb.3; Sun, 03 Apr 2022 06:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jxz5zWvm2g9eSY2ODGL8ove3tyAWCdoJG2idJFSxyD8=; b=XRJ6YJ9vdPpPa6TXlJFJxQGQeLPpk74MPpPWZ5pMZSuZfi2E0jGyTJ4wtvpnslPTi1 77FmR0bZ/iGqrzcoszYTMBg7Pn/hbh7hqU7ZaR0lU5E7Tmb0KUivvCzotlGf31cSINEN zh2J89pAtJEMbCiYHSkSaIzv/Dtftx29GUl4hFhk++bjUVRlLJLH7xwbEBd6P8uh698g zSsNZxN3NVGMMLV0M70MYuti2rc3fuTzlVsJVDMRbLq+1MxVxVh43MkAd9hzrMGXpl3c BbTT1dosqQGjSjR1uUNatmE43fbNHOf968n3jK3OdSPjUp9vjG1e3zhcKVICGGso+395 +Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jxz5zWvm2g9eSY2ODGL8ove3tyAWCdoJG2idJFSxyD8=; b=aKCiTb2rSEP0Vjz7Rxu4azA9U6jeWZyW6UQLWo+TubmUvsCgXZCXNL83XMXpSfg/xx JZPTBdlUSdsxd/J2DbpFR1qIcnL+ajLNEoaaLSuUoA8bnr8oMO8cF/g/NMw5/MvFqIr4 8jckJis6COaby5AcC9EvJwhL01PQ9fbGoSkgrtfWvvkRUuGVly+pDYC21GYo+fuT4D9i XCaK9QKiB98+UsLbVZIfvXJP7qCIDgVE7Pxujp3ZSgC3xOG56La9V4cQeDCisxsMzTNc DOcCoUyEUXYXJ237NmvYNQS74v6xfi78Gal97GHJr5WS5QRP2f9gvCPx1r81Sy88wlUk zBlQ== X-Gm-Message-State: AOAM5316770U8zzbuj9WJ5oIulUlpMuT0v3/+23Ur95ML2lM2Gq8voS1 5/z9H4FUxh9bj6BvNF7Ua2I= X-Received: by 2002:a17:90b:3b91:b0:1ca:5f81:da1e with SMTP id pc17-20020a17090b3b9100b001ca5f81da1emr6897040pjb.182.1648991563494; Sun, 03 Apr 2022 06:12:43 -0700 (PDT) Received: from guoguo-omen.lan ([222.201.153.219]) by smtp.gmail.com with ESMTPSA id x123-20020a623181000000b004fdf99d25f6sm1554857pfx.80.2022.04.03.06.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 06:12:42 -0700 (PDT) From: Chuanhong Guo To: linux-spi@lists.infradead.org Cc: Chuanhong Guo , Mark Brown , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Roger Quadros , Thomas Bogendoerfer , Cai Huoqing , Florian Fainelli , Colin Ian King , Wolfram Sang , Paul Cercueil , Pratyush Yadav , Yu Kuai , linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-kernel@vger.kernel.org (open list), linux-mtd@lists.infradead.org (open list:NAND FLASH SUBSYSTEM) Subject: [PATCH 0/4] spi: add support for Mediatek SPI-NAND controller Date: Sun, 3 Apr 2022 21:11:50 +0800 Message-Id: <20220403131154.1267887-1-gch981213@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mediatek has an extended version of their NAND Flash Interface which has a SPI-NAND mode. In this mode, the controller can perform 1-bit spi-mem ops for up-to 0xa0 bytes and typical SPI-NAND single, dual and quad IO page cache ops with 2-byte address. Additionally, the page cache ops can be performed with ECC and auto data formatting using the ECC engine of the controller. This patchset implements support of this mode as a separated SPI-MEM driver with piplined ECC engine. Chuanhong Guo (4): mtd: nand: make mtk_ecc.c a separated module spi: add driver for MTK SPI NAND Flash Interface dt-bindings: spi: add binding doc for spi-mtk-snfi arm64: dts: mediatek: add dt node for MTK SNFI .../bindings/spi/mediatek,spi-mtk-snfi.yaml | 87 ++ arch/arm64/boot/dts/mediatek/mt7622.dtsi | 12 + drivers/mtd/nand/Kconfig | 7 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} | 3 +- drivers/mtd/nand/raw/Kconfig | 1 + drivers/mtd/nand/raw/Makefile | 2 +- drivers/mtd/nand/raw/mtk_nand.c | 2 +- drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-mtk-snfi.c | 1356 +++++++++++++++++ .../linux/mtd/nand-ecc-mtk.h | 0 12 files changed, 1478 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (99%) create mode 100644 drivers/spi/spi-mtk-snfi.c rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%) -- 2.35.1