From patchwork Tue Mar 28 10:15:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190868 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 530B2C77B60 for ; Tue, 28 Mar 2023 10:16:32 +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=RyW9Zu51aPOEU+G9JHGGVnkYM4lpQlEIOyJAucwQm8Y=; b=jChzAQ9vRJj/Md +hE0+EWDGZThUiqAz5auk+qVW1NFOqP4kwm3/oPeYKO0Ltz58JYzKS2K8JAyVrD7bX0kD9dcn6xUH l+eRVPzSh7mo8YDQdA2M3l8dtWZHXgQrvFDgzANjshPDlIjvtCA04a+QiMePk13Vh5kIPKPXF+jEa qkoWWsL5IlVDCzijypPg+FDF0/Uicp/jqdBgcNIW2YObuA6ZOOl0btYvJ/0WSLOY86HwIHPi/Hqzj ctHAvDAFocLmdjGSs+SIkN8acRDtqc2/uNee5RZwikiOQIYyWh1uDH5qVRlqkHXoZeSjgBjcjUP/7 V/MWjwDIw+Mjta5Nx/Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Mh-00Dtfb-0B; Tue, 28 Mar 2023 10:15:43 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6MR-00DtXf-0g for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:15:28 +0000 Received: by mail-lf1-x12b.google.com with SMTP id br6so15059461lfb.11 for ; Tue, 28 Mar 2023 03:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998521; 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=X88qJMuybuDG/DdfVsPonRD1rXJpjEmcdOesR2x9t6U=; b=AB9I7MC3E6mjUudJSg6hpMMurrZH02ci4PI4lN6vJxwsKh5y0zjuwyFOOLLGhLXWTS 84yPQ0fQX9XB/yp57zsxYhrDMwFOfubjwtwqSlm3nLDPiZ5FUx6r50LqpwQgrFEWRrQr kib7QI1r/+rdGF/m/sxCf7c0TTzUc80Sj3CWwrVr3oIyFTmz7t2qIc16ChsFY36XsQfC x4hZUkTJN8X9MHMpCs4RrlzPWwufFL7GQWSybYyyCejiYguQroPGvYHCeBVweKWgq3zW O6JQ5YIMhNP6KHro1vsALFLjFg9SV4NnCbsAS9WM7hjmkfzb+zQ9vbesGDEEbqEqCHfI BwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998521; 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=X88qJMuybuDG/DdfVsPonRD1rXJpjEmcdOesR2x9t6U=; b=oDCNRWttoTMBiayhrgUfiRwP02AoEWiw4TvwSry9pr3i/GeSckeVhPdtJv6mwEHSfx 1RR4BCdF3AsqXxQT9TZe29DVsrkdbX5zpoSmZ0diuMh50b5I7Z6psU/gBmZci5ol+i/u dXqOifBjlJA65nNr4rWT87EPBRmL1+/76wZF33Kv8EQg7f1K2jJUYU5pDfUh6mK8dbLs Z3MsJhxjx5FaXku/Jrad6h8BoAzk1htRmi0zVou0AxKllJvk96QJ4BlgF1PIG4s/ueb4 v+YuQs0CVJngnp0dixlNCZSKmRnOuSLxwsMP9wEkmWcEXDl9jabWaXX064CEpWJ37ZIA eeQw== X-Gm-Message-State: AAQBX9dbworgOAWmd1kCg5bOBje/Bns7gb+j3vHUIUgGnDvKt4dCYNcy wZ7nLcctZtRTvsPEiXlc2W4zEA== X-Google-Smtp-Source: AKy350aT0sNUpbJxDY33ty2a86va5X5lR74uqhOp1UWtl1kecGv+30GwCQ+ZPJ0mxl++EaduDVyf4w== X-Received: by 2002:ac2:4f8c:0:b0:4dd:ad4b:efd with SMTP id z12-20020ac24f8c000000b004ddad4b0efdmr4975999lfs.52.1679998521030; Tue, 28 Mar 2023 03:15:21 -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 o25-20020ac24959000000b004e84d64ab51sm5061405lfi.58.2023.03.28.03.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:15:20 -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@linaro.org, Tudor Ambarus Subject: [PATCH v3 1/4] ARM: dts: at91-sama5d27_wlsom1: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:15:14 +0000 Message-Id: <20230328101517.1595738-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328101517.1595738-1-tudor.ambarus@linaro.org> References: <20230328101517.1595738-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_031527_263239_BC6E3428 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 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:15:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190865 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 9FFD0C76195 for ; Tue, 28 Mar 2023 10:16:19 +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=qbpoAbB6pauVHb6NUcYyMWcV7/FYN9uBoCzbqzQQYBo=; b=R3oAUhJQfvYl8U q8J3AUs4I+pgFnBh3PPPSD5ZUsovypcCkGwArQRcTaDyLNy91EdK27xrGP/1ltMSF7+FleJfBE5S/ iBMcCo5ObO7/m2+rzaggEHe7etPtO6hB0d6QgtDN0sx8N3dUVTJbD6RXBqM70xCcQjPqHplfjqGmv GcGLYzLClNZtsPum2lw9d5nM/Sl1aYi9uMw6DHzIVIfo18GiSeNWOcVfLDmLCeQO/Ad30CwYLt/3f Q7NQCu/Fc2rmhzEhV8NZPMUxbzg4Cg0nKlrBvAHIHYMJh/UCpfV8GPiroG4VMk8W7ZedbXnohYLyi 8RtivP09F5Gzlmi2ak6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6MR-00DtZw-2m; Tue, 28 Mar 2023 10:15:27 +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 1ph6MN-00DtXr-18 for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:15:24 +0000 Received: by mail-lf1-x131.google.com with SMTP id c29so15110841lfv.3 for ; Tue, 28 Mar 2023 03:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998521; 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=Mg5frztIjRO8xPyyjAsQX1BZNMpBQv5h5VL7qvtYjg4=; b=lm5A7AK2Y+pysxDKtabuoncNSLYvl5ECwtcbuz4TIkydtDNPASeam7ZKONUi/scwvc ytKM3N4EGv4pO5HSK/htEkU12yk1qH9lcTVKcENTTw/671ZYjTtYbHgswP6Rud0Ku2qC xNi2SfCnV+jJP+TNfO/P4lOByJvQwKZ0E7CD7mnbv+MKnEuqKZzitDFQ8eDph7cNrbrB 9LuQ//3mX1ehdknmbHaI3IFjnUYPjnlNJ4gqiOC6MftsGq6ykA2MYFhGHopNpewR1E3o xy4qI7USNQO3C7gn2ZkE2fIr4qtvc7HAJmc0zzRwadpw0ZnHtKCYOJh2lV75qSIudsBE va4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998521; 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=Mg5frztIjRO8xPyyjAsQX1BZNMpBQv5h5VL7qvtYjg4=; b=JfPqDVM+VuqfgbEWhLIi7C5iXyu19LWBn/REIfVgprvHiKgu4Dp5PQA+Zx0TQJ549C EJnBzIKL0Dkug9tzlN0mxyYQtklEv3e0JLHfOIbqzw/vQmVEDXL8q/kh9YQkeJmXG73I Pz/07jboQjeofhK3kcwKoq1oE8yENmj5EpeLj/CVmOzF48qUj6fRns5SCgy1zfL+68dI 44ZPnS0zdASYoCmXPjzBQn2jv7QTPr5tRZ57xkBrvxjhbc27HE3HvmOiG2shq/4Gj/rG n3dUdt9iZGHPaVYROBxwXRkur++ESk6o9qjV4FO3Y6VGzm9D4P3k1NnHHge5MLY1M+/L gYGQ== X-Gm-Message-State: AAQBX9fOfPppqyFndVG17RcH5C986VXzQ2iI83fHcMVxdayh7ttPVUZ4 Qu+8dvDMVsaJlQ6I/RFRnBQVyg== X-Google-Smtp-Source: AKy350b/KQGsVvcnnL1FGPlSVECFF8UzHQ2+2AMIm95qvEQVJmIBQxAVUk4oaRBvI+XrGAXwADS/hA== X-Received: by 2002:a05:6512:4dc:b0:4ea:fa87:7a8a with SMTP id w28-20020a05651204dc00b004eafa877a8amr4397954lfq.37.1679998521674; Tue, 28 Mar 2023 03:15:21 -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 o25-20020ac24959000000b004e84d64ab51sm5061405lfi.58.2023.03.28.03.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:15:21 -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@linaro.org, Tudor Ambarus Subject: [PATCH v3 2/4] ARM: dts: at91-sama5d27_som1: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:15:15 +0000 Message-Id: <20230328101517.1595738-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328101517.1595738-1-tudor.ambarus@linaro.org> References: <20230328101517.1595738-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_031523_407512_CE2A7FF7 X-CRM114-Status: GOOD ( 13.30 ) 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:15:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190869 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 31250C76195 for ; Tue, 28 Mar 2023 10:16:38 +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=dy6fzHim5g/K/Mr6WsnQ4F+vcTGo3x4ZpopAm9smbeo=; b=aOm+9sRvo1cOzJ qwVCE7/7Ot1KirxwxKO/7QL9zVyPuKESsuypA/34E5QFfstKGNJxxhM15QS7eVz5STL83d9Bu+uby l99Tmahb7JW/1az0dVvwOKKpIFrho71zbiBbrtHyG41pb5DuG9AGMi7gvhMIUT5erc2YxIGNBLQmb IUAei/oRF9hE+BdhgIma5n+RFESiZQ7pS0AEAXvWPDipK4dwmmgR83FMNjGKhq1oYyTpQYwX2baxZ 5oY7+eTNLNYHMp0nKJ+fiiC4P2vQFyU4T1ZODRQ8j3mAxnre4f+3EqfkaR/EpuhAJfoJ1cyFxP2e2 qwCU3x6bUC546qGeI9hA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Mj-00Dth1-19; Tue, 28 Mar 2023 10:15:45 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Ma-00DtYB-1c for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:15:37 +0000 Received: by mail-lf1-x12e.google.com with SMTP id c9so4666738lfb.1 for ; Tue, 28 Mar 2023 03:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998522; 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=QqCZBLOWDafOBoOlTrMP8B0zdSc1FZSNMJAlIExG3UM=; b=t9OnNpqky/FwhydCPEZZDj9cC8WhyFJ6DX6Eqp2eRmN28088SkZ0dzeSpRiFki4J+K 3B7tktQFTrLAH6ALURVDAqxyd4qZ4UVwY+ciAxwz+qreejacdo8NLxZ4yDTQjBZPiDnP 6h7PScc545ATkD12+MndfEXweXLu0WOpQ+6DJX8GraM4CGV/E/3pQlILhjyzFJzR5XRB Ui9oj3wNlNYlLGdDIjNJh64ICbu+gR0yJzVidaXa7edVLMWlAaSg9G9AE6FAjriGR1Wy +5zCANGciWvwxpNFhijGxzMkXWRQSk3Bz7t7iG+Ra/0EeuN5oTXpr0SKOxLMcIk4qune RvsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998522; 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=QqCZBLOWDafOBoOlTrMP8B0zdSc1FZSNMJAlIExG3UM=; b=RluOk5EmwttepXnlKSumTjWWj+UODqeYKcRZNYsXU/EtyxWc50oTDAM7yUceS87KeW Cq6Yb4Yr3nmj9OtXd5Uv6U0pC2/Wc2/p9jRNyOGRz8SueFZ+8N/NJh/Sh/rCXcSVLZ6h sBTIpJmKpag6WdoW6biZt9BsoMSXEzgSF3u6/RI7z+jPRkQdbGUd4bSU9SzPvKotjh3C mEMBuWQctiJTmEpX87UBRNtdy8YgZy7JXJOaqHhoQfEej+T4AnQ9fJ+9y7Fh+GSnZjfP c69WmtNyiE/bGqgQ6NmGtdW2rrRiVXWCMk1Y6lk+yELP12mYDFmQurThFiu4BtyEF0Vh x47Q== X-Gm-Message-State: AAQBX9cf7SX+65ycwdHTzyptGuQ5HamLWqs9SHo8lCABbBnnRGo/ZayX r+xM/2mDGfES76aSVDJtor0BVA== X-Google-Smtp-Source: AKy350bgWfxXLD8Q847RJ7ey62vlxVTfAXfCJchvhg8x3HltPj3VenFzVWOk+MsTJ6NlHiarPrqBxw== X-Received: by 2002:a19:700e:0:b0:4de:3774:2d97 with SMTP id h14-20020a19700e000000b004de37742d97mr3487289lfc.13.1679998522305; Tue, 28 Mar 2023 03:15:22 -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 o25-20020ac24959000000b004e84d64ab51sm5061405lfi.58.2023.03.28.03.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:15:21 -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@linaro.org, Tudor Ambarus Subject: [PATCH v3 3/4] ARM: dts: at91: sama5d2_icp: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:15:16 +0000 Message-Id: <20230328101517.1595738-4-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328101517.1595738-1-tudor.ambarus@linaro.org> References: <20230328101517.1595738-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_031536_532858_053700DC 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 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 Tested-by: Nicolas Ferre # on sama5d2 ICP --- 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:15:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13190867 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 0ADC3C761A6 for ; Tue, 28 Mar 2023 10:16:31 +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=/rDbai1jv7eO2pwV0D+Nb8vurU0vllaIaiOVc9LIWLs=; b=M2WuU0FgB/cPOv LqpqjqAymwN5ZqsKFow6l8DlydFVNq4p1mBIeHIuuNvhmbXoYRCHKBmPr3Iip1F74F67J0Jp3s4Iy IldVlwRgpbcmAq6tZzmut6yZnLW1wteiqpsjBLc6VBIEY63Eq7Z66ZKhwjwkrxpuP/oqu0Rb81Gpu +BKs6rHIqUoLWiHIZKwHxhBZjM4N0hgM+gce6KThB7EFro8J4VF0UqvUKsUgiYj6E3bZcTnZgOa4g cSNEpZVXXxm+HsChETLx30lSeanOcqy9kC31jRlZ5c5rH5FxpqiWc3FmKyKNJh/z5jOtjRJeY3npk ut1w6yvnui6Ah2faVEKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ph6Mi-00DtgQ-0X; Tue, 28 Mar 2023 10:15:44 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ph6MY-00DtYV-2J for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 10:15:35 +0000 Received: by mail-lf1-x130.google.com with SMTP id j11so15056121lfg.13 for ; Tue, 28 Mar 2023 03:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679998523; 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=ukK4h27NxoigC7dSjFLoWuySuRs80nENr66pmBmOuMs=; b=SIWBJdYx0NsDp3HLVTSD2orttoOvTI+JMUKiRHbVMoPvP/fkf8dD95XDm51CtZ+OOo kgnz7f/HpqYgeq1C3viPhmbollrT91JCSA8Wstwy21QduknsnlZooS/DFUiOqqxy951i fa5d3HQWjTPb2PjSZewdjExQOE3f1J5afX4jl4Ok0DIU2Oj1qIaal25zxE8BTMsfnamA i1fhGP5pRtZV0JgSgFe0KmOmY27YMoVVdY+2mJiz8sx1gRfneUrbvaIkFhLyEvX8IU2j GNYnME+73KjwIe7emky/aX8/tfXBsaxAuOzykXQsVc43ggc5+0rU9eTALBG4ucDbFMvx OC/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679998523; 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=ukK4h27NxoigC7dSjFLoWuySuRs80nENr66pmBmOuMs=; b=qrw4Uw5crPD6KExWzPg8NQDh2XoL3DjMEZASu0VBdWD2J5yjRgMpqvdjPQVtIFLk6W SIAxaQEM4gDfMvZce8UKX0EJfjEqIk7pwOdwtLfvhS0DHkoHzMVlXdZZM4ZpTjoOlW0u zjYjpOejkpuDPM6fOWEt3tgjbt7E6kVGvDhonOntWkhR/Cm5kbV4prj9GX1utZ/ttm8i gVXD12Pdo84DfOL/u3LeN7VN+D/ecLeDWYIKaRQs8Lao3sgvQPWJDvcg6vfeLFOgI+gc bS4Jd9XpHiRnvxNqAUW+JHF0N5G+jA3oBcE5FBq5yQuOMKCsIa2yuivZpSMyzoasNqEz j3rQ== X-Gm-Message-State: AAQBX9eXpbI5r6ZSVhZG4AlxVYUb+5KjmfhWQOPWPo//01p6H5VdGCJE jrXEuJ53EJ23L3QXt4O9x7Hjsg== X-Google-Smtp-Source: AKy350aae0f2FYHIpDZhSd7ktpKXsqTfGK8Y8AMhjonOemsJggYQiRFmsDVMKoCcXA5YT6VMPczprg== X-Received: by 2002:ac2:50c3:0:b0:4e8:5854:11ce with SMTP id h3-20020ac250c3000000b004e8585411cemr4748667lfm.41.1679998522917; Tue, 28 Mar 2023 03:15:22 -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 o25-20020ac24959000000b004e84d64ab51sm5061405lfi.58.2023.03.28.03.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 03:15:22 -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@linaro.org, Tudor Ambarus Subject: [PATCH v3 4/4] ARM: dts: at91: sam9x60ek: Set sst26vf064b SPI NOR flash at its maximum frequency Date: Tue, 28 Mar 2023 10:15:17 +0000 Message-Id: <20230328101517.1595738-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230328101517.1595738-1-tudor.ambarus@linaro.org> References: <20230328101517.1595738-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_031534_760838_96177F53 X-CRM114-Status: GOOD ( 13.30 ) 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;