Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp583711rwb; Wed, 7 Dec 2022 02:23:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf4JjgGV0R+UKD2d6g5YeZbk0PtWjYnto/0F17zreJN3d1dTa2bOHW39ReoSdZB7KJAK9XdM X-Received: by 2002:a17:902:8f8b:b0:189:b994:1be with SMTP id z11-20020a1709028f8b00b00189b99401bemr25750839plo.133.1670408634285; Wed, 07 Dec 2022 02:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670408634; cv=none; d=google.com; s=arc-20160816; b=vhfUGLEMxPh8yCFl+5B1b0b7Imgkf09l25dAR0YjiaeEKl1upMUy0CQJ+fH9W/SDuE 6bL5xn8bKLm4/Ah28lJn5/C0Vxtv2eqObAFHS6r7SqzusrlfUEIqN+NMuGFWMdKSo56O 6Y2SPA4llq2pGw40+kLVuga0zayX9kIncqKnwW+R3XLgBjc9dBRzgTBmTVrEItja9d8N 42TFkXviKfdgE3BniP+ZctaBlNM6H5CdNuek3+Y7MlqWVAzgjQgOI7gtfazPbrRa2NBj 80v0XEnpmhOEvXYwSYYwI4eCrG6+rerc56Jli06hOGE3K3LqZIPgNz8RFA98I2+ubgyw CZ1A== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=zo+YV+F0mXIRLunGJD055SnguaY1mRhUgomTE1GBJV0=; b=cP4rlVpRWPhnGJwepdsN1g/30nkwGTy+gYaglwJ6dK7J4IRHo3WMRGqllwnnPilq+i RkGpoXPHIGUARKrXDDY19cahImSunONIwdrL9Cm4Vtih2RL6mZBdA6yy5Fs61dSonUpQ 89LV0/YLHO7EAeieie6pJ6WjaKIypJzyvhqkMUDZxM/uGfm0JLZNs3HDUJOKZEFLt17P rHdUpTqtYlzQ9RYIaU5OOpAhRQy2ffmz0KQo+CXCxy5T+CdxlTmxA8PKHkbw+Qo+hFpI ubN6u37H+NQjrwVd1d9u0D+w3UBnppgzxrzMvU5Fdb6U1VCRU8M9HTbCcBlMeM3o0Rn0 MzAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=gYO5sj0N; 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 j13-20020a056a00174d00b00572789f89b6si22029669pfc.156.2022.12.07.02.23.43; Wed, 07 Dec 2022 02:23:54 -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=gYO5sj0N; 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 S230201AbiLGJs6 (ORCPT + 76 others); Wed, 7 Dec 2022 04:48:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbiLGJs4 (ORCPT ); Wed, 7 Dec 2022 04:48:56 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F4F63137D; Wed, 7 Dec 2022 01:48:50 -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) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7F4686602BC8; Wed, 7 Dec 2022 09:48:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1670406528; bh=qNEpnM8ClbrtXrZA6HU6eUiqyAOy4w4SGFwvj+Zg7ZU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gYO5sj0NeKHGQdOIykdzKDXaUMR4eTpN/Gf5vQW9433/FCKI5EhWReF8ANjQZz+9T W0yfMuhK2NpiNeriKtbQdjar477D0D4bftjuQv1UBwHpISOf+a2P8QSaLSV2CTAPpX PVWvv2MgZF2bo4rBeATogcd6pXZX+O9TJeFqHAVOHIsz7DLGPcq0peRCGaCNeCCozj ycUDIRukQFQmbdZRm495QMNSBFSreFa60eyKqlABw8OS+8W6i2+OZX1ZwEZ5cO+mGD SyagMVmgnx4+tBSYfZkiyNLcqotoE5Qfh3RJxuktLwks9Chjnni+BLLfg4ECF7LEHz U779io82HGe+w== Message-ID: Date: Wed, 7 Dec 2022 10:48:44 +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 7/9] dt-bindings: spi: mtk-snfi: Add read latch latency property 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-8-xiangsheng.hou@mediatek.com> <9992c9a5-059a-9396-32ce-7ed63cd12a96@collabora.com> Content-Language: en-US From: AngeloGioacchino Del Regno In-Reply-To: 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 07/12/22 03:00, Xiangsheng Hou (侯祥胜) ha scritto: > Hi Angelo, > > On Tue, 2022-12-06 at 13:19 +0100, AngeloGioacchino Del Regno wrote: >>>>> diff --git >>>>> a/Documentation/devicetree/bindings/spi/mediatek,spi- >>>>> mtk-snfi.yaml >>>>> b/Documentation/devicetree/bindings/spi/mediatek,spi- >>>>> mtk-snfi.yaml >>>>> index bab23f1b11fd..6e6ff8d73fcd 100644 >>>>> --- a/Documentation/devicetree/bindings/spi/mediatek,spi-mtk- >>>>> snfi.yaml >>>>> +++ b/Documentation/devicetree/bindings/spi/mediatek,spi-mtk- >>>>> snfi.yaml >>>>> @@ -45,6 +45,13 @@ properties: >>>>> description: device-tree node of the accompanying ECC >>>>> engine. >>>>> $ref: /schemas/types.yaml#/definitions/phandle >>>>> >>>>> + mediatek,rx-latch-latency: >>>>> + description: Rx delay to sample data with this value, the >>>>> value >>>>> + unit is clock cycle. >>>> >>>> Can't we use nanoseconds or microseconds as a unit here, instead >>>> of >>>> clock cycles? >>> >>> The clock cycle will be various with MediaTek SPI NAND controller >>> which >>> clock frequency can support 26/52/68/81/104MHz... >>> It`s may be easy to configure and understand with clock cycle in >>> unit. >>> >> >> Yes, but whatever clock frequency we use, the target is to always >> wait for >> X nanoseconds, right? >> >> Waiting for 5 clock cycles at 104MHz is obviously not the same as >> waiting >> for the same 5 clock cycles at 26MHz: in that case, expressing the >> value >> in nanoseconds or microseconds would make that independent from the >> controller's clock frequency as the calculation from `time` to >> `cycles` >> would be performed inside of the driver. > > There have two rx related timing properties in spi-peripheral-props. > The rx-sample-delay-ns have been used in Mediatek snfi driver to adjust > controller sample delay. > However another spi-rx-delay-us is in microseconds. Take 52MHz for > example, the clock cycle will be 19.23ns which lower than 1us. This may > not easy to by one clock cycle. > I agree, but nothing prevents you from adding your own property for that. I propose "mediatek,rx-latch-latency-ns" or "mediatek,rx-latency-ns", so that we can specify the delay in nanoseconds: in that case, when we specify 19ns, the driver will safely round that resulting in 52MHz == 19.23ns => 19ns valid. Regards, Angelo