From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4FE4C433EF for ; Wed, 23 Mar 2022 16:21:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E491983BDB; Wed, 23 Mar 2022 17:21:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="hykIjSqi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D042083972; Wed, 23 Mar 2022 17:21:34 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1990283BDB for ; Wed, 23 Mar 2022 17:21:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 48C26B81F84; Wed, 23 Mar 2022 16:21:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2631C340E8; Wed, 23 Mar 2022 16:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648052488; bh=K2DvMeLES20Izz7lQ8hksRPljrsp6G64IEABD0zEHQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hykIjSqiZSJ1GDOAFzP12LpoNDL/KDiDIBzgMjkYtQmJpwHww5l6Bj5rVk8wOo0M3 HSJP7s+MixeyCR6TA9LXRcQ6sOvu6eFQ2QwVyJgQGvk69E4eyBl39/MgjAKLDQRjK7 sRuPrxRCvM7AQFIBiM42M/nfOGRGC/kKg9261RkXEDlXERlBlTidEFlxAkgiAHaf3d 8G0dLLWlReQ2BOpkm3SAumgy3w3BIIeLdBkbvtVF/gYoBkpX44OZlp3zg3lLUSk4nI uTxjMGUy4Y+N9T88naAhwbUh8S2nbxu6jktDs9u2vi/xz5Ka5TRZw7TNliYqxR4vdm VWizlNYzgOW4w== Received: by pali.im (Postfix) id 0575172A; Wed, 23 Mar 2022 17:21:25 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell v2] arm: a37xx: espressobin: Fix non-working SPI Date: Wed, 23 Mar 2022 17:19:42 +0100 Message-Id: <20220323161942.7308-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220323131857.29273-1-pali@kernel.org> References: <20220323131857.29273-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Commit 0934dddc6436 ("arm: a37xx: Update DTS files to version from upstream Linux kernel") ported Linux's device-tree files for Armada 3720 SOCs. This broke SPI support on some Espressobin boards and results in following U-Boot error: Loading Environment from SPIFlash... jedec_spi_nor flash@0: unrecognized JEDEC id bytes: f7, 30, 0b *** Warning - spi_flash_probe_bus_cs() failed, using default environment Before that commit DT node for SPI was called 'spi-flash@0' and after that commit it is called 'flash@0'. Before that commit 'spi-max-frequency' was set to 50000000 and after it is 104000000. Rename DT node 'spi-flash@0 in armada-3720-espressobin-u-boot.dtsi to 'flash@0' and set custom U-Boot 'spi-max-frequency' back to 50000000. With this change SPI is working on Espressobin again and it is detected with JEDEC ids ef, 60, 16 on our tested unit. Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB OK Note that it is unknown why spi-max-frequency with value 104000000 does not work in U-Boot as it works fine with Linux kernel. Also note that in defconfig file configs/mvebu_espressobin-88f3720_defconfig is set option CONFIG_SF_DEFAULT_SPEED=40000000 which is different value than in DT. Fixes: 0934dddc6436 ("arm: a37xx: Update DTS files to version from upstream Linux kernel") Signed-off-by: Pali Rohár --- Changes in v2: * Fix #endif for partitions { } node --- arch/arm/dts/armada-3720-espressobin-u-boot.dtsi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/dts/armada-3720-espressobin-u-boot.dtsi b/arch/arm/dts/armada-3720-espressobin-u-boot.dtsi index 3e01c64a4bdb..07293ab72d1f 100644 --- a/arch/arm/dts/armada-3720-espressobin-u-boot.dtsi +++ b/arch/arm/dts/armada-3720-espressobin-u-boot.dtsi @@ -1,8 +1,15 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH &spi0 { - spi-flash@0 { + flash@0 { + /* + * For some unknown reason U-Boot SPI driver cannot access + * SPI-NOR with higher frequency. Linux kernel SPI driver + * does not have this problem. + */ + spi-max-frequency = <50000000>; + +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -18,9 +25,9 @@ label = "u-boot-env"; }; }; +#endif }; }; -#endif /* * U-Boot requires to have this eMMC node by default in "okay" status. U-Boot -- 2.20.1