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=-18.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 44AE1C4332F for ; Thu, 23 Sep 2021 18:53:34 +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 0F2CC61038 for ; Thu, 23 Sep 2021 18:53:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F2CC61038 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C982E833DE; Thu, 23 Sep 2021 20:53:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="mbz+mzqs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D80083301; Thu, 23 Sep 2021 20:53:28 +0200 (CEST) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 4943B833E4 for ; Thu, 23 Sep 2021 20:53:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=p.yadav@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 18NIrKXR006384; Thu, 23 Sep 2021 13:53:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1632423200; bh=6M5YHo8YjkWP2NiwvFr4rVVJ5hQ9k657XBV9z9iJz1Y=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=mbz+mzqsK+7okN5XmJRDMs/XC4UO9+OtH9wu727KEy8np1I+XoE6lpdCVuKx1vzc3 cp6QIrpnFITiRE4lU9cx3lyHyQhWZCoZKWTnvmLCXng1LRBUZDvyubcv4CbBBr1X2T xoiH12Yq3f5v/ASOXMGfcQqKy1Opp155FfZYknCM= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 18NIrKqQ064873 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Sep 2021 13:53:20 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 13:53:20 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 13:53:20 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 18NIrJKs030301; Thu, 23 Sep 2021 13:53:19 -0500 Date: Fri, 24 Sep 2021 00:23:18 +0530 From: Pratyush Yadav To: Marek Vasut CC: , Jagan Teki , Vignesh R Subject: Re: [PATCH] mtd: sf: Set SF parameters as env variables Message-ID: <20210923185316.se55powofpm37mg3@ti.com> References: <20210914032849.273625-1-marex@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210914032849.273625-1-marex@denx.de> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 14/09/21 05:28AM, 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. I don't quite follow the rationale for making these environment variables. Wouldn't you be better off finding this info out via mtd or sf command? > > 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"); > #endif > > -- > 2.33.0 > -- Regards, Pratyush Yadav Texas Instruments Inc.