From patchwork Tue Mar 28 10:07:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190825 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 74C94C76196 for ; Tue, 28 Mar 2023 10:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nXmhE0VzDsuOkoSYB940z0/G2euTcj1b6eufyqgnrhs=; b=u+Ep+MBLnFxzMx YKY5/gBk1MurE5BbwT2Sy+vuQv3lSiOdihx0z5EQ9fkV7VmHyCYh9gmaGGFzegoMJwIo/3UFWhTGf xYbu8sUqyA2pNnf1bT/S53QIrn6/6JcgAYP2E0T3HkAmDfQGib17/x3/YvByy6eYXEIZsecLCW7KY a2kcOCPitC6FffII43um9KPGZWgzSubs1d+HC4na/xZ9m+50XwhZsLL0DpH2Pdj69RmBMwqaH67Jk 29iwixJidymVUWkRcspxHy/kN9kR8qbz7+R54nvR7hpQCHuxt3BtpdLZaBi/7aqZmn+AwuuiFYSKb FFYsUYmtGwR2nem+rxYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Ex-00DqiV-13; Tue, 28 Mar 2023 10:07:43 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Ek-00Dqai-2f for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:07:33 +0000 Received: by mail-lf1-x12f.google.com with SMTP id br6so15035205lfb.11 for ; Tue, 28 Mar 2023 03:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OQaFD4osD3DHxIZa/buALI2kTZuKgrQvblLMK2wYDmo=; b=Zy7aNvp+kqqyuw2iDArozGHYDREgAE5yRQVhgOogYSiEm6Zn0Ko4N4ZAHFbpiQMkV6 c3SXzZStijEFJyddV1boMdGPxF5p40F3EW+nuMcCJlVtscNJ+BHSfUQ7rpTJTw0aaN6G pWJTJIEyX31yc3WhDrGT+60nz+qL3NSkz9t7jGLa46lx+qMwuA7s8ELo2XgL19oq6zM+ TDnut5eqzKfbRmC4T1Pdk0IQAo7txXaE50z57AMV5ywBV7s6SauA0iWWHTD7nOZiWDlG E0J6lXA8h4B5/pe2Ovhguk9Ymci+DuR5fdKWR1Mcsq9JoiDah7gEfFwQ4WloajTzA8KD oxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OQaFD4osD3DHxIZa/buALI2kTZuKgrQvblLMK2wYDmo=; b=B9WgEqe5s1x9kP9shLiWlP+O524IidQXgBT252PBYSWHTVDWwlw0iPQx+cbSM5jlKu Fsgy0w3CsaYxe4SUJL2vl1HJAdZ4n22ZWEA1uKLL1z2Iv7DoxiugXzJnTHZyP6eP3Pae pnV5OGcu04Lsg8WY1xj64JPE/xX3LVPHp08P1sLoDuc4mh9YGvvboB2F13zv+NzvMVEL 65qp7Ek2IOwQljRtdqPXGfNuY3SBBPSRw9y1g9hxkbezPljt89DNLkICVtootFReZANv WTkGn5iGT+lPfZytG+1Uu1dUFw5FBtUAqKlEWdDaOIuSAPLw4WyZ2mnTUTZu4geM9UCz B3zg== X-Gm-Message-State: AAQBX9dVjJmx6r5yHK/pFoRDv2AM/WiM1NehwXnYWut9jAwHFVyV6jjd hkmeESD12fB71MCo7hJAm+D7Tw== X-Google-Smtp-Source: AKy350aW1f4TTMZKwNfQpTfuRkMYUA25SWc5xDJeJyeTqHxQA7xhI0DQB4Zmzndeb1ph+N1atefO7Q== X-Received: by 2002:ac2:5519:0:b0:4de:e802:b7e3 with SMTP id j25-20020ac25519000000b004dee802b7e3mr4371321lfk.19.1679998048436; Tue, 28 Mar 2023 03:07:28 -0700 (PDT) Received: from ta1.c.googlers.com.com (61.215.228.35.bc.googleusercontent.com. [35.228.215.61]) by smtp.gmail.com with ESMTPSA id w9-20020a05651203c900b004db2ac3a522sm5039572lfp.62.2023.03.28.03.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:07:27 -0700 (PDT) From: Tudor Ambarus To: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com Cc: alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tudor Ambarus Subject: [PATCH v2 1/4] ARM: dts: at91-sama5d27_wlsom1: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:07:20 +0000 Message-Id: <20230328100723.1593864-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328100723.1593864-1-tudor.ambarus@linaro.org> References: <20230328100723.1593864-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_030730_864269_9311702F X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tudor Ambarus sama5d27-wlsom1 populates an sst26vf064b SPI NOR flash. Its maximum operating frequency for 2.7-3.6V is 104 MHz. As the flash is operated at 3.3V, increase its maximum supported frequency to 104MHz. The increasing of the spi-max-frequency value requires the setting of the "CE# Not Active Hold Time", thus set the spi-cs-setup-ns to a value of 7. The sst26vf064b datasheet specifies just a minimum value for the "CE# Not Active Hold Time" and it advertises it to 5 ns. There's no maximum time specified. I determined experimentally that 5 ns for the spi-cs-setup-ns is not enough when the flash is operated close to its maximum frequency and tests showed that 7 ns is just fine, so set the spi-cs-setup-ns dt property to 7. With the increase of frequency the reads are now faster with ~37%. Signed-off-by: Tudor Ambarus --- arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi index 83bcf9fe0152..4617805c7748 100644 --- a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi +++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi @@ -220,7 +220,8 @@ qspi1_flash: flash@0 { #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <104000000>; + spi-cs-setup-ns = <7>; spi-rx-bus-width = <4>; spi-tx-bus-width = <4>; m25p,fast-read; From patchwork Tue Mar 28 10:07:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190826 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 42F89C761A6 for ; Tue, 28 Mar 2023 10:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qki1R0+WV4DxhD5hzLQ8PUc8tOCm4y2CetSBEcYARHs=; b=q3wSe7mxg1nNed Xtog9g+IGIdkSbSzfT2d135ytcrj/d2473NjgYXroELFgplOQrfILzJFKy2kCmY/3razpEtyCGrKS ZmUNUs++Ao77MTtblDZrKZ9GtXmPV01cxdEU8/lAP6uM03MpKC3WKpaXbgnpsfJcKpuHh48tNTxXk Bp/ZEBNoZrlj1F+nX9RUGPXFidNqoUdCi1w+X8ZovcNCwuY7qBTI6TLoyLNq3fLueo1J1eMac73FL Zoy5RaoVxXSTyc03JWj2QnecRBZ39ErlEyRq42+6V6pbVcvis/n7AXA8V7yOgYmX3saDT2IgnDYM3 yDsW64wN83B0+KfKgKyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Ey-00DqjE-2I; Tue, 28 Mar 2023 10:07:44 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6En-00Dqb5-0J for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:07:34 +0000 Received: by mail-lf1-x12a.google.com with SMTP id g17so15075314lfv.4 for ; Tue, 28 Mar 2023 03:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QrY1OuDR/+qlCoUvp7xD7ZWzVOeNYJFtAbaI7JDwTWM=; b=hAAal796U+HxnwWZF/jbseBG2s/J6J6okTwD6RMngnFNxbPF0DsSb8oeNgsAerlpW3 JtINISEkpC+k003xcvTYpBjP1OMQ3+P+RQI90SUJBJmDOfd6dGCMZIEbRIHh4QoKa8rL p7/1MZ0o5jRVz0unDAXst3BPondXBd7VIRLVHXz4UYdIZLkCey1xsZtZjVH39vb0AS7N vfPrd5FhdOKv8Ig4Dy3lfBEOYVQUYvhQOEomu4GiX3WVT+cugSf7ZEuPK9+16xwLUZOw IZdrRSIxpkNCnMd72yU4lgZanRw+9oubgeA+Gaw68eTPDNtxD9STdWKh1tQ6sEuYKawV SA6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QrY1OuDR/+qlCoUvp7xD7ZWzVOeNYJFtAbaI7JDwTWM=; b=UxffJiy8QtvMlQP67EFYp7ZEd/npymBJxXXCpIxPRDCuzB9BRCr4DzQ4J443hZmTwy fSMPmrtoWMq/rzaB8UDo/yQR6qVliWewNHAymEMV2ymcrj22qArpdRvIZ0FV48UCnxvQ YLDsZz+hGwwKm5BKAVBHHDrzGUZ0OVm2cIHDfOUHVDYFIrpFCokV9IeoHbJXRBTA/CVK wjE30y8ovCHKzzhzHaJ7iXC3wehkIQQ7tAVZZI5MaUDjb6hLFC4NlASHHROoxKLvnNHs 6NceEIc1nb+4OKVxtn546i9iSgkI9AE6Qw2skkCmtxOLhfsaZku0hsTE4KT0gKVKmd5v U/pg== X-Gm-Message-State: AAQBX9eLebqYLzrJOgfvQnT36AUDlw3WxXIn5P+0HFOiE2y5/Wfa1oIT x61jkmKB1yRqZyRElUNoT9D2OA== X-Google-Smtp-Source: AKy350ZsZw5YeU9rZZh2ZArIM673HB9SUzeWWISkt7rVHV+uwIedYI2WgTUkMLtoUghFlPgLUBKaeQ== X-Received: by 2002:ac2:52af:0:b0:4dd:b766:37ae with SMTP id r15-20020ac252af000000b004ddb76637aemr4088978lfm.13.1679998049213; Tue, 28 Mar 2023 03:07:29 -0700 (PDT) Received: from ta1.c.googlers.com.com (61.215.228.35.bc.googleusercontent.com. [35.228.215.61]) by smtp.gmail.com with ESMTPSA id w9-20020a05651203c900b004db2ac3a522sm5039572lfp.62.2023.03.28.03.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:07:28 -0700 (PDT) From: Tudor Ambarus To: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com Cc: alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tudor Ambarus Subject: [PATCH v2 2/4] ARM: dts: at91-sama5d27_som1: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:07:21 +0000 Message-Id: <20230328100723.1593864-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328100723.1593864-1-tudor.ambarus@linaro.org> References: <20230328100723.1593864-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_030733_146965_28C03E4C X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tudor Ambarus sama5d27-som1 populates an sst26vf064b SPI NOR flash. Its maximum operating frequency for 2.7-3.6V is 104 MHz. As the flash is operated at 3.3V, increase its maximum supported frequency to 104MHz. The increasing of the spi-max-frequency value requires the setting of the "CE# Not Active Hold Time", thus set the spi-cs-setup-ns to a value of 7. The sst26vf064b datasheet specifies just a minimum value for the "CE# Not Active Hold Time" and it advertises it to 5 ns. There's no maximum time specified. I determined experimentally that 5 ns for the spi-cs-setup-ns is not enough when the flash is operated close to its maximum frequency and tests showed that 7 ns is just fine, so set the spi-cs-setup-ns dt property to 7. With the increase of frequency the reads are now faster with ~37%. Signed-off-by: Tudor Ambarus --- arch/arm/boot/dts/at91-sama5d27_som1.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi index 8aa9e8dea337..95ecb7d040a8 100644 --- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi +++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi @@ -43,7 +43,8 @@ flash@0 { #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <104000000>; + spi-cs-setup-ns = <7>; spi-tx-bus-width = <4>; spi-rx-bus-width = <4>; m25p,fast-read; From patchwork Tue Mar 28 10:07:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190828 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 09E8AC76195 for ; Tue, 28 Mar 2023 10:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=niaFSRyOMsdSA9niJr7DriV5Er6op0oVA2UCUTuhR3M=; b=afjOwNVEOVvpeY Re5EL6Cksy+USZKSBU00Nt1NNY95Mms46HkgFMJOcwFYedv3ojRSBQJ09AKRnsU3uWMmwwU71nHnN RyEvggTkEa/iV1zEk+6UqLrhv1L45L+PcK/4QRT7I45cZL/1fQib1uM+Q9TXPHkJPqVtyr+ShW/Lm mIhnbHrZss6r8OHq5y/905DEc1qtBTUUboLFyrL0R331Oy3Y8sbg7XUfT4mmldZvtSNZw+sTI5Se8 XGnWxSpor7Y+nZhFHdbxYBofg80uiuuNOv+Frb7noRqa7HXj/0F/hF8LoNeJg2SKSPicmANRGKSn2 Au/GxAXHSJ4JAJy9xhJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6F0-00DqkC-0C; Tue, 28 Mar 2023 10:07:46 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6En-00Dqbc-2x for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:07:35 +0000 Received: by mail-lf1-x129.google.com with SMTP id x17so15081624lfu.5 for ; Tue, 28 Mar 2023 03:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HWHba6Uu0Ek+kYjlRBQm3S5zfLvA96w4h84b04kVQ3w=; b=gmEA9eVDLVEuSqY30iZ244dRPsGlbiyB2DELO2i4s5GtSoDMUM9hV+PSHoPzWy5SxJ g0RX4lC/YKWIHmAdN8RM3L0vVy5D+vLeinmSa2x24NM9NJ212Ta8hkX9GMvCyYuoyM1d DMivUm02j3CSGcX+2HDicI7kbDXNi39vCbYdSvY+DiDRyRjO9xqBmDXklc5N+qmLQVyk oG6icfSSoW2HuxANWejAi+MAj77T8TZBKRaqfvRVbgUhkfhP/+rUoxVomddaez/EsA0r VAL+fGHgaGPAVA92cIcy06G5vIqXzSsTmw8fxXk533Bttky56f6uL+bRsNS3TQ3uq/3/ +/kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HWHba6Uu0Ek+kYjlRBQm3S5zfLvA96w4h84b04kVQ3w=; b=qVeE5kiliGAcBNI/oTqt8LF1YEBvIf7/2ARLFPo7JprKuX2mwdnOFJGDueMzWCxajj 2/pOhpPm4c3CJy1MGpbCXcxi14tiuZkG7w8NCRvNUmr77CbyzJXFUsPSRNPdh1JtJiD5 8WyZDrMVQnSwC3rrf9DFoceg38bF4GxgwGpiQSesX75JDksVFkD6r5bXe65lKhx3fU/6 kwHMkmxYYv+JBbjETkYS/8ysUm2kTv+NDi+4+Cv7c3P2H8g4WJgygQHgiCWGBdqGD9kk lYEdc72Lr+YKheT7Teaiz2C+aw0mq3ybo5MRqxq2regvRAmyd58fYQxDR84hKWIH9R0o aw8A== X-Gm-Message-State: AAQBX9f9AVfD6RL9CzhQYDKb9DV5AgTB4Xg2/9uVbHEWaODGdeUzYfxC FDMw991bTE9I/sfHd4qFmF4Wtw== X-Google-Smtp-Source: AKy350ZtrujPPVXU4pT+yrqtYxfFvHNujl2xHI00jKUIXRYA9J1Z/6lIUWJ6l23l4tHUvBkykVs6YA== X-Received: by 2002:ac2:4434:0:b0:4eb:dd2:f3d2 with SMTP id w20-20020ac24434000000b004eb0dd2f3d2mr2271129lfl.43.1679998050106; Tue, 28 Mar 2023 03:07:30 -0700 (PDT) Received: from ta1.c.googlers.com.com (61.215.228.35.bc.googleusercontent.com. [35.228.215.61]) by smtp.gmail.com with ESMTPSA id w9-20020a05651203c900b004db2ac3a522sm5039572lfp.62.2023.03.28.03.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:07:29 -0700 (PDT) From: Tudor Ambarus To: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com Cc: alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tudor Ambarus Subject: [PATCH v2 3/4] ARM: dts: at91: sama5d2_icp: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:07:22 +0000 Message-Id: <20230328100723.1593864-4-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328100723.1593864-1-tudor.ambarus@linaro.org> References: <20230328100723.1593864-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_030733_963851_DBB80F65 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tudor Ambarus sama5d2_icp populates an sst26vf064b SPI NOR flash. Its maximum operating frequency for 2.7-3.6V is 104 MHz. As the flash is operated at 3.3V, increase its maximum supported frequency to 104MHz. The increasing of the spi-max-frequency value requires the setting of the "CE# Not Active Hold Time", thus set the spi-cs-setup-ns to a value of 7. The sst26vf064b datasheet specifies just a minimum value for the "CE# Not Active Hold Time" and it advertises it to 5 ns. There's no maximum time specified. I determined experimentally that 5 ns for the spi-cs-setup-ns is not enough when the flash is operated close to its maximum frequency and tests showed that 7 ns is just fine, so set the spi-cs-setup-ns dt property to 7. With the increase of frequency the reads are now faster with ~37%. Signed-off-by: Tudor Ambarus --- arch/arm/boot/dts/at91-sama5d2_icp.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts index 1346b8f2b259..999adeca6f33 100644 --- a/arch/arm/boot/dts/at91-sama5d2_icp.dts +++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts @@ -669,7 +669,8 @@ flash@0 { #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <104000000>; + spi-cs-setup-ns = <7>; spi-tx-bus-width = <4>; spi-rx-bus-width = <4>; m25p,fast-read; From patchwork Tue Mar 28 10:07:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190827 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 A0403C76196 for ; Tue, 28 Mar 2023 10:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DClsEe8K7RD1sCBvosE44hdtf+pgRVCpIrHnolI4/ME=; b=bTYseu8o6E26z4 RT2Eg1dX3YAG4dNFxwmZqo87kDi7VpSUWWwWJ2lYaxqq/Ar8dK0bjWaC3lAJkwcR9+tHT0HXMxpm6 RsZ5G3jNVF2yBHCEafJS+gJjcdpyMP2iCB3+zuqc2zuKNWwPNW/0NUoZarPhQnpAhaqMpAYKCw0ua uPE4wEdwAWHRvdTL1q6bKngykbqs+NkJ6iroYG6Thqr8+7XObWgfEsaD+KwhCMZ0252IoQGhKWCi3 XtXQtvvByEnHycJeahVzZJyjfYp8Cqx3XXLM6AVjxttLVPGYfL/S89IfR6rg2P+kH6OXsyPSMAMnc a3i9bPspSY9Ro7suxmeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6F1-00Dqky-1V; Tue, 28 Mar 2023 10:07:47 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Eo-00Dqc5-2P for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:07:36 +0000 Received: by mail-lf1-x131.google.com with SMTP id bi9so15043419lfb.12 for ; Tue, 28 Mar 2023 03:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=48VlVOVaivhhP/O4cu0azvwlKJKtgxluZIhbOwUMy6s=; b=JPdpXlXQ65UESbAhf2kFM78+q5EwWYaFXefaBujqWctws3m6e4Bcy/S+TM+hNR64uj 9RrTtU9UGVrsiPuU+TkJpSYcE+XGzqZkgV0RiOlpt0UncBYLhrGCyoKsfxrDiRaJnibW pIGWYfaXDag6JUXHJnC5PJfC8jK3fQ0rAMGoDKzWvbx2oRTVnpy6Ggcly+t2oKnsKVOp M1quA9cL0tnH3ZaHN+l9uWmUXmFheoCqPAMzFpfdV9ZDO+WuZy1mqF7uVwOOD+OuK+YK DyhBVCEltGYIK+39fMXycKycJ4gM0J9j41/YZGXfPCKV30tPC8QW1HmdO2LSHR/MD6Ua aJCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=48VlVOVaivhhP/O4cu0azvwlKJKtgxluZIhbOwUMy6s=; b=cL+U6RS5YN4KaRSkRAQxUFEgH2ddo3BcG8T661lkntr1xRqHEIZacjF2eWdBsCaI+h f7FDobo6olX9Vc/2VB7isYVf2mK1iLJVBpGnz8Z/rGf71ESMG1qXSh3y+bZRNFw69Zi8 eDcBLKWt4HmpdRonbJ4uEpBFoKWdj3p5qT4tyEP/pHph9GupkcCJlJzet6sV8F9Xqvmo rTH5iLk7EgCognAefIUEFHgqvZ/jqJ4FQSDVZpBdVepE8S1T/bvmwokX5QO093rA6RLP FVkPpJyQLz+WrCbjne6yqcd4UnCSvxjYg7Dk6AGzQvjlFHARP3Y4AbqFeX4YcECPwbE1 Te4g== X-Gm-Message-State: AAQBX9d/+mZcmRzGUU+fRYNOi3XohU6hSlbGG7kqU8eJM3ui9Fa/1HLp N/tOQJNhkbz4g3J6NlYMfQElRQ== X-Google-Smtp-Source: AKy350ZNS5+M+UE9YcPOcjSTmGrxxrgHBsEWONdoLd+/o0kWKjyeb5j4mgTgkFcz/nuiGW/QUJL8Aw== X-Received: by 2002:a19:ee18:0:b0:4a4:68b8:f4f1 with SMTP id g24-20020a19ee18000000b004a468b8f4f1mr4606382lfb.55.1679998050986; Tue, 28 Mar 2023 03:07:30 -0700 (PDT) Received: from ta1.c.googlers.com.com (61.215.228.35.bc.googleusercontent.com. [35.228.215.61]) by smtp.gmail.com with ESMTPSA id w9-20020a05651203c900b004db2ac3a522sm5039572lfp.62.2023.03.28.03.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:07:30 -0700 (PDT) From: Tudor Ambarus To: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com Cc: alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tudor Ambarus Subject: [PATCH v2 4/4] ARM: dts: at91: sam9x60ek: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:07:23 +0000 Message-Id: <20230328100723.1593864-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328100723.1593864-1-tudor.ambarus@linaro.org> References: <20230328100723.1593864-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_030734_804962_3DEACF62 X-CRM114-Status: GOOD ( 13.41 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tudor Ambarus sam9x60ek populates an sst26vf064b SPI NOR flash. Its maximum operating frequency for 2.7-3.6V is 104 MHz. As the flash is operated at 3.3V, increase its maximum supported frequency to 104MHz. The increasing of the spi-max-frequency value requires the setting of the "CE# Not Active Hold Time", thus set the spi-cs-setup-ns to a value of 7. The sst26vf064b datasheet specifies just a minimum value for the "CE# Not Active Hold Time" and it advertises it to 5 ns. There's no maximum time specified. I determined experimentally that 5 ns for the spi-cs-setup-ns is not enough when the flash is operated close to its maximum frequency and tests showed that 7 ns is just fine, so set the spi-cs-setup-ns dt property to 7. With the increase of frequency the reads are now faster with ~33%. Signed-off-by: Tudor Ambarus --- arch/arm/boot/dts/at91-sam9x60ek.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-sam9x60ek.dts index 180e4b1aa2f6..5cd593028aff 100644 --- a/arch/arm/boot/dts/at91-sam9x60ek.dts +++ b/arch/arm/boot/dts/at91-sam9x60ek.dts @@ -578,7 +578,8 @@ flash@0 { #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <80000000>; + spi-max-frequency = <104000000>; + spi-cs-setup-ns = <7>; spi-tx-bus-width = <4>; spi-rx-bus-width = <4>; m25p,fast-read;