Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3481959pxb; Mon, 4 Apr 2022 18:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuCtOZ5EdKVc468a2XYLPi9KWDhSf+eIWq1qaf9XkhtQ44KMsyiSqU2HUKJ+xcDj4i2yRA X-Received: by 2002:a63:1a56:0:b0:381:ede3:979d with SMTP id a22-20020a631a56000000b00381ede3979dmr827282pgm.372.1649121737701; Mon, 04 Apr 2022 18:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649121737; cv=none; d=google.com; s=arc-20160816; b=AC/ANKQYjxX5BnnqyVZmFA33rAbGDPuC7K2FzThmdetwWInV9W0dlIL32A2Gk8It2i qzAt7tIu4vh89ZA0F8hey+JkoqCkuLBAoIFn/+EMAG0uKvC1bWJGBwYSa2a0kOoaGA1U 2tnZWBZs8guUB4KJI8lpAym5Skbb3TF/Ka9cLRHZVxpWwshfuqSagpFnfdoYGWFKvSjx fD3IFU2E2HU27H1v9niHEIG4SEoUTWn5bRWgYshlLyVYYbNn57kAXYdmdkuj39Wqn4n/ RMSSlrNDkqfEwv26ckht/a0lykrh1CTfNHoSoIcUKgs4q5dPxoOb/JvEKgj2R4fshEdS I0xA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vyrqHELlKNXA/M2+zx7CFD/1nfCk80dDQzAqwlfKPhM=; b=vPEnsHOEKkv6ySFEgeKUCFytnLedZYSDwQHzmOKDB1nsg/WNKLNk0qQQWtiQ09PsMc ajsJX+7mXYRoDGcJYJJwo4+NfrmLJ1AAF4MhnqEankpmoPTvvZBBmlH3AOpcjy3EjPs/ 2QwQTj3scAmLn1dcL9PI6REjfECvksdbU96wADFg6J9LgXuHwhQK8xGUqO8V6/Sf+bv1 cd/m2pIt0zCHBSh8wgdcZO2IA0fFAn/JsKk1oCebYu102tah7kflsBLPk+EHiZdm57lv C78IFkPnDSBLoUIlCas81XZ3b0AaJwNPCJY01RVAi37gE1GjNRi3mESP5gzCg2fmIltl d78Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=meVSmIhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h38-20020a631226000000b003816043eea5si11126264pgl.154.2022.04.04.18.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=meVSmIhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1019C38D8B; Mon, 4 Apr 2022 17:13:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356006AbiDCNRe (ORCPT + 99 others); Sun, 3 Apr 2022 09:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233134AbiDCNRc (ORCPT ); Sun, 3 Apr 2022 09:17:32 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2476E54; Sun, 3 Apr 2022 06:15:38 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id ku13-20020a17090b218d00b001ca8fcd3adeso666395pjb.2; Sun, 03 Apr 2022 06:15:38 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=vyrqHELlKNXA/M2+zx7CFD/1nfCk80dDQzAqwlfKPhM=; b=meVSmIhgkmL3kR+0lSFosnFWA4K9lMzIPYRxEOroAKVFpg7gTf1S0jwsIGWtA6tpD8 6QQ90oyK6MpIKlh62OUJgRTFc68Z6RIASV0ZPdXvT6nT66e1VOQkKlBe2LIDCcaHgGd1 DVt+nQbSRGg3Gdj2OkZ0SVXTJOaTPMoxefFhBL3Y79brbQDtq6g7WGJjo7HFdUBpKjN0 FVWANijtmrrmFYrX8UT1sQ6fb8VKLlQO9Rq+t1ZRaf5wDBILM50tsdiGYsi/R3m9l6SS wRJGNe5DWOFcgsImmrMclDNNOFRB2utv4Cp/4mY6IlRTeoi9zxpeY8MFTNoROTnFfMba Ssww== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=vyrqHELlKNXA/M2+zx7CFD/1nfCk80dDQzAqwlfKPhM=; b=p/5StPASfK5h9jB6hjZ5elro7G15DVKA65fb0eCWDHIkuHC9H6E4YFYeBh67kD/U0F fcBlGn+ZYlfezrRnJRgNllm9d0iuoNAUspxEkVWYrFVj0rJibP7NBjARGQTssbYmhC6X izwcW3WrEoeQ5gcP8xobyawD/HjIebuPiyAPAalTG807t/DjkrU9dXLdgw0iBAa/daDY 5A2G+++qDt/O5l5qmwvLULCPoUT+PrcZ2V+ykxdDylRZLjRxgJNoPKLxJbsBb0us+Wdh BsTXtEF4C63hXTsDGEurdfxNk9yAiP9bn5HH7IBOvdvcH4KkLUSmeiYbYvZtwPGT+1fW V11w== X-Gm-Message-State: AOAM533U5wD5T2ay0Q1XKi57DFo5ubElbh39W147qP4baf4zYL0Aryil QYvjeOgv+X/7PIDjiVWeUiUhdWKWOh1eu+OTncc= X-Received: by 2002:a17:902:f686:b0:156:1102:ffda with SMTP id l6-20020a170902f68600b001561102ffdamr34668031plg.16.1648991738321; Sun, 03 Apr 2022 06:15:38 -0700 (PDT) Received: from guoguo-omen.lan ([2001:250:3000:7000:7978:d40d:86ff:591d]) by smtp.gmail.com with ESMTPSA id w19-20020a056a0014d300b004fae5e3970csm9272416pfu.35.2022.04.03.06.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 06:15:38 -0700 (PDT) From: Chuanhong Guo To: linux-spi@vger.kernel.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 , 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 resend 1/4] mtd: nand: make mtk_ecc.c a separated module Date: Sun, 3 Apr 2022 21:14:50 +0800 Message-Id: <20220403131453.1269229-2-gch981213@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220403131453.1269229-1-gch981213@gmail.com> References: <20220403131453.1269229-1-gch981213@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 this code will be used in mediatek snfi spi-mem controller with pipelined ECC engine. Signed-off-by: Chuanhong Guo --- 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 +- .../nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h | 0 7 files changed, 12 insertions(+), 4 deletions(-) rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (99%) rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%) diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 9b249826ef93..39df4621ac25 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -53,6 +53,13 @@ config MTD_NAND_ECC_MXIC help This enables support for the hardware ECC engine from Macronix. +config MTD_NAND_ECC_MEDIATEK + bool "Mediatek hardware ECC engine" + depends on HAS_IOMEM + select MTD_NAND_ECC + help + This enables support for the hardware ECC engine from Mediatek. + endmenu endmenu diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index a4e6b7ae0614..e5f40ed9300f 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -11,3 +11,4 @@ nandcore-$(CONFIG_MTD_NAND_ECC) += ecc.o nandcore-$(CONFIG_MTD_NAND_ECC_SW_HAMMING) += ecc-sw-hamming.o nandcore-$(CONFIG_MTD_NAND_ECC_SW_BCH) += ecc-sw-bch.o nandcore-$(CONFIG_MTD_NAND_ECC_MXIC) += ecc-mxic.o +nandcore-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/ecc-mtk.c similarity index 99% rename from drivers/mtd/nand/raw/mtk_ecc.c rename to drivers/mtd/nand/ecc-mtk.c index 49ab3448b9b1..74ddaa46ba7c 100644 --- a/drivers/mtd/nand/raw/mtk_ecc.c +++ b/drivers/mtd/nand/ecc-mtk.c @@ -15,8 +15,7 @@ #include #include #include - -#include "mtk_ecc.h" +#include #define ECC_IDLE_MASK BIT(0) #define ECC_IRQ_EN BIT(0) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 9b078e78f3fa..8b6d7a515445 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -374,6 +374,7 @@ config MTD_NAND_QCOM config MTD_NAND_MTK tristate "MTK NAND controller" + depends on MTD_NAND_ECC_MEDIATEK depends on ARCH_MEDIATEK || COMPILE_TEST depends on HAS_IOMEM help diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile index 88a566513c56..fa1d00120310 100644 --- a/drivers/mtd/nand/raw/Makefile +++ b/drivers/mtd/nand/raw/Makefile @@ -48,7 +48,7 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/ obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o -obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o +obj-$(CONFIG_MTD_NAND_MTK) += mtk_nand.o obj-$(CONFIG_MTD_NAND_MXIC) += mxic_nand.o obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm32_fmc2_nand.o diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c index 66f04c693c87..d540454cbbdf 100644 --- a/drivers/mtd/nand/raw/mtk_nand.c +++ b/drivers/mtd/nand/raw/mtk_nand.c @@ -17,7 +17,7 @@ #include #include #include -#include "mtk_ecc.h" +#include /* NAND controller register definition */ #define NFI_CNFG (0x00) diff --git a/drivers/mtd/nand/raw/mtk_ecc.h b/include/linux/mtd/nand-ecc-mtk.h similarity index 100% rename from drivers/mtd/nand/raw/mtk_ecc.h rename to include/linux/mtd/nand-ecc-mtk.h -- 2.35.1