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 51F12C433EF for ; Thu, 2 Dec 2021 05:50:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 17859830CA; Thu, 2 Dec 2021 06:50:02 +0100 (CET) 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=1638424203; bh=pQI2ty/tNxM6KSqSzQhwYfbq71YBA8c7+MY/L0IyTYU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IqziCqusnyM9IV3h7X1bqNcTPVt/a3iYXdHJ2sXqhD+ABFLVRzvXXgrJcWLTpD+Cw H2TxrMGA9kT6inpqbPimDUnMx7ogxv7CgZpRHWBznRqcIn8HMw7/2VKW0R8JdpgJpO +OqzygyoQFMubGW78RZTMqWjONyjcU1g5y6NLNhRGe/R1BHfUCWdM65W0zV5bwc1Ub k4dEKEg2VydBRH8WgctuQGOlSB237WH7Zlqvy6/BCjbM08Np2BAexuQIWIncb7vLl/ WAg97GrG/hj+Ok+mG8ZKB3PPt6lK1sFLWfEYPuQWgHuWreFtrlkJ8aCFZ3H/ZVBWEB /zdOQc0+Fh8xw== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2688E830C0; Thu, 2 Dec 2021 06:49:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1638424199; bh=pQI2ty/tNxM6KSqSzQhwYfbq71YBA8c7+MY/L0IyTYU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=zOoRNeCHva2JJP8GteBIvYEbSUpaD1SLBbSSAOKg6lp+2KaQmKftmVAxYwr/TLzFT zF9xCAFH3EED9eu3RtXZsBhV86qBHazRWuS+TRLao4xKxqlgcodjO30erQijlkJJan 7elMSXelLPTj0BXvRdH6hL9WCPJphGM1HPNK3kTKkJ8Bpi6Oyt7SyQUbjiPmSdiXFG PtxooF5EH4oLc99/aqjdKk+wQCQt1bsXZ/q09tDxXwDOOU346CHWg1qBV7qTJtSJzx zc9i9g1yPnPPOkN5Jmzz8YakRIs3oYsZX4RGHMjvs+4FOxuHwMseUXPoAm+6MMC3mH 2XNjFQCjSiy4w== Message-ID: Date: Thu, 2 Dec 2021 06:49:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] mtd: sf: Set SF parameters as env variables Content-Language: en-US To: Jagan Teki , Tom Rini Cc: u-boot@lists.denx.de, Vignesh R References: <20210914032849.273625-1-marex@denx.de> From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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 12/2/21 06:47, Jagan Teki wrote: > On Tue, Sep 14, 2021 at 8:59 AM Marek Vasut wrote: >> >> Set the SF page size, erase block size and total size as an environment >> variable after "sf probe". This lets us discern boards with multiple >> distinct SPI flash options and also e.g. set mtdparts accordingly. >> >> Signed-off-by: Marek Vasut >> Cc: Jagan Teki >> Cc: Vignesh R >> --- >> drivers/mtd/spi/spi-nor-core.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c >> index d5d905fa5a1..448653b9931 100644 >> --- a/drivers/mtd/spi/spi-nor-core.c >> +++ b/drivers/mtd/spi/spi-nor-core.c >> @@ -15,6 +15,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -3829,8 +3830,11 @@ int spi_nor_scan(struct spi_nor *nor) >> #ifndef CONFIG_SPL_BUILD >> printf("SF: Detected %s with page size ", nor->name); >> print_size(nor->page_size, ", erase size "); >> + env_set_hex("sf_pagesize", nor->page_size); >> print_size(nor->erase_size, ", total "); >> + env_set_hex("sf_erasesize", nor->erase_size); >> print_size(nor->size, ""); >> + env_set_hex("sf_size", nor->size); >> puts("\n"); > > I feel this unnecessarily add env variables which are not needed for > those SF enabled boards, isn't it? So, how do you determine current SPI NOR size from U-Boot shell ?