From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59119C4321E for ; Mon, 5 Dec 2022 14:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uRspRtAG2sQ4XlGGxDYUHABBmIKc21h1mXb/tM/LMLg=; b=ja/tk/gl2Esj19u03+rBG1TbmQ ujqgJACJC1Qh6kyNCVQO5uyZnkNCQeG3orLy8g9GQtU+pms05nVCbRl6MFwTw1AB3C6bzUWXKa3jz Qd49bKWpyUxo/pTwrBYJU5+QBgySgRwcRZz48XGeZy9P1dFhhqWIaat7Hq4Rp7vct8hRd7nu9NFlb T4rtfzvsxwPxwgPbEqp2xBM/GOYVhibxzHbMWMVlKRn/L2SaegVXg+PuIr0i74xTT4zDhfVJZeDNE HAEVp6QiqO6iYxYnw0DzzyBc1haIXuunths5sqNDz95b6nr1c0XkA2zDQJ+AMPqMMKbA7pXJ2ABMv r7igYLNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2CLq-0040Ip-Gi; Mon, 05 Dec 2022 14:21:46 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2CLa-0040Bk-Qj; Mon, 05 Dec 2022 14:21:32 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id EA7BC6601E6A; Mon, 5 Dec 2022 14:21:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1670250084; bh=NPMSgIxm/IXldzeGyabGZE0MeVSJ1WmroFFQ+QCluy8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=M6aiSYUzpfsDT2/aoI8gLuXBouJWy4KNgMDRTXxHrGEEZ7r81AnVgl1fYYRHwyY+n ZwnArRIo9iXOdslt1Hrp+Pk5SuvMwH4pF67UF+orzFqNPVTStLOLEXBjttmSpQz4at /y0YNqA/sUkZirp+UiFeOjc10QyLLgALk+9gDMaY6BD3TjvfCBJUckAh2KBCAeUwjT 4+cu/NgmaIjOLj3/cBsUc6oa1iWe2S+trfLy2OXPWXIY6vuZ4zfhBt8cnPhYhnPCQK 5gs6sVOEdWSyD1c+DETIGLp9hVcNj2JsTSnzAQcUoZDhAafl/PPRtRysS5fwAN2ZIA vuQhevsJo8lgw== Message-ID: <50ede482-7f03-ff55-5ad0-aa6249027cbe@collabora.com> Date: Mon, 5 Dec 2022 15:21:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2 4/9] mtd: nand: ecc-mtk: Add ECC support fot MT7986 IC Content-Language: en-US To: Xiangsheng Hou , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Mark Brown , Chuanhong Guo Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, benliang.zhao@mediatek.com, bin.zhang@mediatek.com References: <20221205065756.26875-1-xiangsheng.hou@mediatek.com> <20221205065756.26875-5-xiangsheng.hou@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20221205065756.26875-5-xiangsheng.hou@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221205_062131_038573_55EEC53A X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 05/12/22 07:57, Xiangsheng Hou ha scritto: > Add ECC support fot MT7986 IC. > > Signed-off-by: Xiangsheng Hou > --- > drivers/mtd/nand/ecc-mtk.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/mtd/nand/ecc-mtk.c b/drivers/mtd/nand/ecc-mtk.c > index 9f9b201fe706..c2f6cfa76a04 100644 > --- a/drivers/mtd/nand/ecc-mtk.c > +++ b/drivers/mtd/nand/ecc-mtk.c > @@ -79,6 +79,10 @@ static const u8 ecc_strength_mt7622[] = { > 4, 6, 8, 10, 12 > }; > > +static const u8 ecc_strength_mt7986[] = { > + 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24 > +}; > + > enum mtk_ecc_regs { > ECC_ENCPAR00, > ECC_ENCIRQ_EN, > @@ -483,6 +487,17 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = { > .pg_irq_sel = 0, > }; > > +static const struct mtk_ecc_caps mtk_ecc_caps_mt7986 = { > + .err_mask = 0x1f, Can't we use GENMASK() to define err_mask instead? #define MT7986_ERRNUM GENMASK(4, 0) P.S.: Did I get that right? Is that referred to the ERRNUM(x) bits? Regards, Angelo