Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1129810rdh; Fri, 27 Oct 2023 05:47:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE67OPZ8AXnG5W4zyGglaAx9TPe3HuSyFIAxq/i3t7dlaZLmV/wU3JltjNlBBR6hIQ3V9rc X-Received: by 2002:a5b:88a:0:b0:da0:622b:553f with SMTP id e10-20020a5b088a000000b00da0622b553fmr2669843ybq.55.1698410833744; Fri, 27 Oct 2023 05:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698410833; cv=none; d=google.com; s=arc-20160816; b=gq/dKN32gmLZNAUqNfFSk9uUavNv5Y33sw5xNf4vA1E0sBOA2ii9QI0q7oKVICiClx 7NOpHq1PaiV7eRz3B//YHCbMhElH0jE9f5vhuSt5QfHiHpRUPtY5P0ytTz2eOxRFiD7u 2oD2La0nHuxNSssXBUgSI/z+A+8S7ef0MDked7NaP2Sqz0Onvc5L2zQpfUP/+93GtYsx HDUaS4MGFY8NGE3LGma+1zsBUzflJkiapl/9V5Pir7t8kxj4saDRC1yhTvaT/26MsDFX eRx7lSPx0M0EJoGKshQfcjsiolv4qka0T8tJJag6gQtaFtf+SH57/wFg+QlCATtmfZHA e3ng== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=3i63HftU+feakpu2BbYrMpadCqw476CUSoNNflnjczs=; fh=TUd5CUQvSLgIMpW8T69tcpizDaYVZA33/Cau1SFbA7E=; b=FcEktcdNT9b/UojOw9lv+Ai1oocSaxd0k0bNkCIEeyNzftGrAIb7YtQZN3+9NVLLri ZBp7Tl/GAUPGBUIZYoCRPqNJoWqV5mw0J6WzXoTbv9Mw4A23rJm/tD9m2a1OT0+UW/Eb EhRKQskwJ6w57fRX3mCtPm7geFiyzaKEVLizZ0wr/KCIxCWRNCMtu5wbUgXUkYVDODR8 WmUfMN+tGlrZAw6Ajlw0AO2wUnt4MHRzFyTlqLMEnPOStQbkz6wyGFA5FyCc3PhuBof4 Gb1Kybe/GtJCiSSupKsQxJ707xXxdHhhmfaWA466Iaw6ScuRYWMQBYK0V5/uRIjRIqOn KkPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Crp+0TgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t24-20020a252d18000000b00d71bf89f0fasi2850164ybt.491.2023.10.27.05.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Crp+0TgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E150B82F0995; Fri, 27 Oct 2023 05:47:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345970AbjJ0Mq7 (ORCPT + 99 others); Fri, 27 Oct 2023 08:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345953AbjJ0Mq4 (ORCPT ); Fri, 27 Oct 2023 08:46:56 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D85BF; Fri, 27 Oct 2023 05:46:51 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id DFAB9FF817; Fri, 27 Oct 2023 12:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698410810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3i63HftU+feakpu2BbYrMpadCqw476CUSoNNflnjczs=; b=Crp+0TgT9AZ1xSSTbR1i6qOed1on2FZ3Sp6FJ3KKPOnvR5j9tmpc1LInwvo08UTB+Unajn fuFi3vMO33TwsFIotyIcIuqwgxhdGMU0oNXOfzrcR19sexSB8juvp6UHgvieEiOrgpihqT r+h1VaU/IJhnKThVkmmzw/v4VKc3lC1P6YWEppZ6r6PMBOoyizuX35nN/HvYrGkJZ99aqO ovHzrUKE3Slodp+l06IC2YKTodHd4iyKe5DOch8hRGhc4h0J0McWB0Pznlil8EVEQfr18e iQn4XlaYCmOm6eG4g08Z27EJQudn/mbuOQHx8XXzQADnK89EzuA0ztK/3J6JFA== Date: Fri, 27 Oct 2023 14:46:46 +0200 From: Miquel Raynal To: "Stoll, Eberhard" Cc: Andy Shevchenko , Eberhard Stoll , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , Mark Brown , "Schrempf, Frieder" , Amit Kumar Mahapatra , Christophe JAILLET , Geert Uytterhoeven , Krishna Yarlagadda , Leonard =?UTF-8?B?R8O2aHJz?= , Yang Yingliang Subject: Re: [PATCH 1/4] spi: Add parameter for clock to rx delay Message-ID: <20231027144646.577210ff@xps-13> In-Reply-To: References: <20231026152316.2729575-1-estl@gmx.net> <20231026152316.2729575-2-estl@gmx.net> <20231027005643.4b95f17e@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 05:47:11 -0700 (PDT) Hi Eberhard, eberhard.stoll@kontron.de wrote on Fri, 27 Oct 2023 12:41:23 +0000: > Hello, >=20 > > > > Can you be more specific? I am wondering how big the need is. =20 > > > > > > In our case it's a QSPI NAND chip (Winbond W25N02KV). This device > > > can operate at 104MHz SPI clock. But it also has a tCLQV value of 7ns. > > > The tCLQV value limits the SPI clock speed for this device to 2x7ns > > > (if it is not adjustable in the SPI controller) which is approximately > > > 70MHz. > > > > > > Without the ability to set the tCLQV value, the SPI clock has to be > > > limited to 70MHz in device tree for this bus. > > > > > > In our case the Winbond W25N02KV chip is a replacement of an > > > older chip. The older chip can operate at 104MHz and does not > > > have the tCLQV restrictions as this new one. > > > The new chip is mostly is better than the data sheet and meet the > > > timing requirements for 104MHz. But on higher temperatures > > > devices fail. > > > > > > In device tree QSPI NAND chips are configured by a compatible > > > property of 'spi-nand'. The mtd layer detects the real device > > > and fetches the properties of this device from the appropriate > > > driver. > > > > > > So for our case (boards containing the old and new chip) we well > > > have to reduce the SPI clock for the entire QSPI bus to 70MHz, even > > > for the elder chips which can operate well also with 104MHz. =20 > >=20 > > So, to me sounds like device tree source issue. I.e. you need to provide > > different DT(b)s depending on the platform (and how it should be). > > The cleanest solution (as I see not the first time people I trying quir= ks like > > this to be part of the subsystems / drivers) is to make DT core (OF) to= have > > conditionals or boot-time modifications allowed. =20 >=20 > We don't talk about device tree modifications on boot time! >=20 > Currently the SPI NAND chips are not fully configured in the device > tree data. Today a QSPI NAND is represented by an abstract 'compatible' e= ntry > of 'spi-nand' in device tree. Which can be seen as something like a 'spi-= nand' > bus with autodetection of the connected chips. >=20 > Therefore there is no way to reference a QSPI NAND chip directly, it's > auto-detected by the framework. There is also currently no possibility to > set the tCLQV parameter for a single SPI CS line. >=20 > Some parameters for the SPI NAND chips are already provided only by > the fitting chip driver (e.g. flash layout, banks, variants of the command > set of the device, ...). With this patchset it's now possible to provide = also > the tCLQV data for this chip. >=20 > IMHO a autodetect system does not make much sense if you have to provide > parts of the chip configuration also in device tree. The framework should > detect the chip and fetch the operation parameters either from the chip > itself or from a chip driver which provides the required configuration se= ttings. Yes, if the information is discoverable, we should propagate it to the spi layer so that the relevant action is taken, from the most desirable to the less desirable: - adapting the sampling point - lowering the bus frequency - refusing the probe if none of these solutions are possible Can you update your patchset with this in mind? Thanks, Miqu=C3=A8l