Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 206F4C12002 for ; Mon, 19 Jul 2021 07:03:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EB18961186 for ; Mon, 19 Jul 2021 07:03:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB18961186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 903D682956; Mon, 19 Jul 2021 09:03:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1626678190; bh=eLrkfj/lGUaJeTGWCeuizMK2YPtVXFoxWajXXgX0HT4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WsaXMUY2T+O3thyQm9bDQVUGyiwBR4JZ8iVYOdwhCIG6Oqx5Tj4f4x5MY4kICm/Uc ga3zsxAKN12S9MMVK9ZmiHEtaGFZcFXYpnqTlCKlIqLmfPQpmJPl7uwBU/ItN/rMoR luFP1bqCNCzRJfKSHZqP9ggumCfN5H7ep6jUyWTxcMcjWNpNtM5BQVXQFSbzj6JhTZ wUeJXuu2JOdak7xeAdmK/I4MRLRmJWsg1GQCgj31Y30RzrDE31PHht1kMmjpnc4j4a pJp98N2uHyIAO0A4qWp4TLWBRue0BCoBvCyfHUsux8LMgc9shbPGGGDiI9hv9yCS7V l+H/VX4EZiu5w== Received: by phobos.denx.de (Postfix, from userid 109) id 99A268296F; Mon, 19 Jul 2021 09:03:08 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E706D80082 for ; Mon, 19 Jul 2021 09:03:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4GSt8n5kmRzQjhV; Mon, 19 Jul 2021 09:03:05 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id aBlvyJcFCD0L; Mon, 19 Jul 2021 09:03:02 +0200 (CEST) Subject: Re: [PATCH] arm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Andre Heider , =?UTF-8?Q?G=c3=a9rald_Kerma?= , Konstantin Porotchkin Cc: u-boot@lists.denx.de References: <20210716103442.21842-1-pali@kernel.org> From: Stefan Roese Message-ID: <78b336bf-e098-ed18-1802-acddc6578afd@denx.de> Date: Mon, 19 Jul 2021 09:03:01 +0200 MIME-Version: 1.0 In-Reply-To: <20210716103442.21842-1-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C32B81848 X-Rspamd-UID: 008bb0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 16.07.21 12:34, Pali Rohár wrote: > U-Boot now supports parsing SPI NOR partitions from Device Tree. So enable > 'mtd' command support for Espressobin board and define partition layout in > U-Boot Espressobin DTS file. Access to SPI NOR via 'sf' command is old > method and 'mtd' command is now preferred variant. > > From include file remove '#define CONFIG_MTD_PARTITIONS' as this option is > now defined and enabled in defconfig file. This change is required to fix > compile error: > > CC arch/arm/lib/asm-offsets.s > In file included from include/config.h:4, > from include/common.h:16, > from lib/asm-offsets.c:14: > include/configs/mvebu_armada-37xx.h:63: warning: "CONFIG_MTD_PARTITIONS" redefined > #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ > > In file included from ././include/linux/kconfig.h:4, > from : > include/generated/autoconf.h:44: note: this is the location of the previous definition > #define CONFIG_MTD_PARTITIONS 1 > > After enabling support for mtd command, output from 'mtd list' on > Espressobin board is: > > => mtd list > List of MTD devices: > * w25q32dw > - device: spi-flash@0 > - parent: spi@10600 > - driver: jedec_spi_nor > - path: /soc/internal-regs/spi@10600/spi-flash@0 > - type: NOR flash > - block size: 0x1000 bytes > - min I/O: 0x1 bytes > - 0x000000000000-0x000000400000 : "w25q32dw" > - 0x000000000000-0x0000003f0000 : "firmware" > - 0x0000003f0000-0x000000400000 : "u-boot-env" > => > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > arch/arm/dts/armada-3720-espressobin.dts | 18 ++++++++++++++++++ > configs/mvebu_espressobin-88f3720_defconfig | 3 +++ > include/configs/mvebu_armada-37xx.h | 5 ----- > 3 files changed, 21 insertions(+), 5 deletions(-) > > diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts > index d86d8f0b63cf..cba6139be690 100644 > --- a/arch/arm/dts/armada-3720-espressobin.dts > +++ b/arch/arm/dts/armada-3720-espressobin.dts > @@ -164,6 +164,24 @@ > reg = <0>; /* Chip select 0 */ > spi-max-frequency = <50000000>; > m25p,fast-read; > + > +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@firmware { > + reg = <0 CONFIG_ENV_OFFSET>; > + label = "firmware"; > + }; > + > + partition@u-boot-env { > + reg = ; > + label = "u-boot-env"; > + }; > + }; > +#endif > }; > }; > > diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig > index dc199cfe503b..78796115cd38 100644 > --- a/configs/mvebu_espressobin-88f3720_defconfig > +++ b/configs/mvebu_espressobin-88f3720_defconfig > @@ -28,6 +28,7 @@ CONFIG_BOARD_LATE_INIT=y > CONFIG_CMD_GPIO=y > CONFIG_CMD_I2C=y > CONFIG_CMD_MMC=y > +CONFIG_CMD_MTD=y > CONFIG_CMD_PCI=y > CONFIG_CMD_SPI=y > CONFIG_CMD_USB=y > @@ -54,6 +55,7 @@ CONFIG_MMC_SDHCI=y > CONFIG_MMC_SDHCI_SDMA=y > CONFIG_MMC_SDHCI_XENON=y > CONFIG_MTD=y > +CONFIG_DM_MTD=y > CONFIG_SF_DEFAULT_MODE=0 > CONFIG_SF_DEFAULT_SPEED=40000000 > CONFIG_SPI_FLASH_GIGADEVICE=y > @@ -62,6 +64,7 @@ CONFIG_SPI_FLASH_MACRONIX=y > CONFIG_SPI_FLASH_SPANSION=y > CONFIG_SPI_FLASH_STMICRO=y > CONFIG_SPI_FLASH_WINBOND=y > +CONFIG_SPI_FLASH_MTD=y > CONFIG_PHY_MARVELL=y > CONFIG_PHY_GIGE=y > CONFIG_E1000=y > diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h > index a2bea2947dd1..c8c34d7d92dd 100644 > --- a/include/configs/mvebu_armada-37xx.h > +++ b/include/configs/mvebu_armada-37xx.h > @@ -57,11 +57,6 @@ > #define CONFIG_I2C_MV > #define CONFIG_SYS_I2C_SLAVE 0x0 > > -/* > - * SPI Flash configuration > - */ > -#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ > - > /* > * Environment > */ > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de