Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7346323rwb; Tue, 6 Dec 2022 04:44:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf700cerrNLkhbkGdNEX1UHQ9EIqp3IrQnhUO4gcLgHq5TS//+qH5p4By2FLw6yBDUs6eF3V X-Received: by 2002:a17:906:4c98:b0:7ad:b9f3:a66a with SMTP id q24-20020a1709064c9800b007adb9f3a66amr59136066eju.282.1670330681223; Tue, 06 Dec 2022 04:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670330681; cv=none; d=google.com; s=arc-20160816; b=C04Jq0EjG5AErH3I3DFHBP2whCooXMHLjAKGNTE2mhpRpNh16GuWXFZIV3lz71aP60 EpzAplOmy37H7sTlV6h1ng6t6fR9X7BxkVMzPAO0P+4ghsQOPWlzRBxA607/Eo8vARCk N4B9vndNkvWUaNcG5FMxoHs1l9pLIOdl2hadHI/6xijua+9bSqSmJUnJHxyavnmsYrCG ZU/sgBD+75tM7lMdwEBtPa7AUQqGtC75taawz11FWrgaiBD7ouMiZPXFnz3hDsocqL8f S/5R3KTAwgDzb6nxcS8Blk9u6jlLi2sLOdYBSqX4p6wKdrfbwIZv6Y06POYtN56ARwPK oTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eCv6zQoq8PKoLW1js9zLzmuf7KmwF9Ll7GspeJwUf94=; b=Uyd80f0lY+ezUjZ84qPWogfIwGdYyJfMEnbhtHMELOj6Vu52G11aZ0/XFLWnu/xFfU AGgbFeQ0g1WNpYP57Y5r76JD9JNUU0QH32oWufDfNWTgYJFCZBwxdzjp8hP3aGtR20M6 Cb0DNV1jWk9KsZL5Uoif0HBYmcGFqFhGuy2D63v2D8mA+RJ12wC4iJ3KTa32gcQEkufM huqmdgsq1IV+r0z8vm1n8RZrdN+DvLydlOoIgI08pvgdhN5shhis6S7oMfZR1YGRbdj/ smKi1k5/q7CpKArs9eG8LvuaJa8jm9JhTfvPa02tzAqzuvaALupbRSECSNXA3SLGWCYy tlPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JMsgBLF1; 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=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a056402151100b0046b76553f5esi1728504edw.329.2022.12.06.04.44.20; Tue, 06 Dec 2022 04:44:41 -0800 (PST) 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=@collabora.com header.s=mail header.b=JMsgBLF1; 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=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233206AbiLFMWU (ORCPT + 79 others); Tue, 6 Dec 2022 07:22:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbiLFMWS (ORCPT ); Tue, 6 Dec 2022 07:22:18 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8682B2934B; Tue, 6 Dec 2022 04:22:15 -0800 (PST) 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 AE439660035D; Tue, 6 Dec 2022 12:22:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1670329327; bh=HFhsBPJUZ/W3qeEbtqj0mNmnYKJB/11JNCtWMdGTv88=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JMsgBLF19vGkI7bjFVq2yyNHu0QRemrayTu3nigu593WI7AyVTqCauD9mDxXD/hsT mbaMKCn1Fk40bs0z68zMZPCQimF5KjiR6da/ZD8qHC2BvOnS75PQwmj5pv+uQOKX+p IZbZtZkBzkqGU5pU1Qb17m0uH9snhHja5hA3vx2qKxXl98YmycaA8W/do9/AHOn17p /cCy46ruAiCy/THacT1AIQOuE9+JulTQF5rWLLxSCFmgBjViBTU4bASICxzpV8xtYE ko0tQ8tX/suIToA2tf1/OcuYZ3UCihVhGwVu6BCG9kAqLd+K+Ll+iN86jTsBIJ4+1j fpRs2UUzSJhXg== Message-ID: Date: Tue, 6 Dec 2022 13:22:04 +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: =?UTF-8?B?WGlhbmdzaGVuZyBIb3UgKOS+r+elpeiDnCk=?= , "miquel.raynal@bootlin.com" , "robh+dt@kernel.org" , "broonie@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "matthias.bgg@gmail.com" , "gch981213@gmail.com" , "vigneshr@ti.com" , "richard@nod.at" Cc: "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" , =?UTF-8?B?QmVubGlhbmcgWmhhbyAo6LW15pys5LquKQ==?= , "linux-spi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , =?UTF-8?B?QmluIFpoYW5nICjnq6Dmlowp?= References: <20221205065756.26875-1-xiangsheng.hou@mediatek.com> <20221205065756.26875-5-xiangsheng.hou@mediatek.com> <50ede482-7f03-ff55-5ad0-aa6249027cbe@collabora.com> <149100d0dc205a317ed352cdfb391f2147a2afab.camel@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <149100d0dc205a317ed352cdfb391f2147a2afab.camel@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS 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 Il 06/12/22 10:04, Xiangsheng Hou (侯祥胜) ha scritto: > Hi Angelo, > > On Mon, 2022-12-05 at 15:21 +0100, AngeloGioacchino Del Regno wrote: >> 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 > > Yes, you are right. > I will change like > #define ECC_ERRMASK(x) GENMASK(x, 0), > since other IC driver data will use 0x3f and 0x7f err_mask. > I would prefer, instead, something like #define MT7986_ERRNUM GENMASK(....) #define MT7622_ERRNUM GENMASK(....) #define MT.... (etc) instead of a macro calling another macro. Regards, Angelo