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 8D6AEC433F5 for ; Thu, 2 Dec 2021 05:47:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D712E830BB; Thu, 2 Dec 2021 06:47:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.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=amarulasolutions.com header.i=@amarulasolutions.com header.b="gMPlCarV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34047830BB; Thu, 2 Dec 2021 06:47:52 +0100 (CET) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 057CF82F5F for ; Thu, 2 Dec 2021 06:47:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-ed1-x52c.google.com with SMTP id g14so111353339edb.8 for ; Wed, 01 Dec 2021 21:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zfalR1Fuc8qnrCs70e8oDOHFxOmEOf4rcA9GICNXl7U=; b=gMPlCarVGDDghjS37YuTKCrhrLwkxB1GEoeB23azg48rpzpvk8e2x2NN1axSi4lRH8 PgHyD1QV1hThSsLmL+etyfwAi87AAwLT8lYSki4Ntz9SmeXEPBoMCG/f796TqCzrkfs3 T2ELL4uLgh/OwykqDIm9MtodgDzf/rjpjjU9c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zfalR1Fuc8qnrCs70e8oDOHFxOmEOf4rcA9GICNXl7U=; b=qHb+NRPwfrDi+08NajhWicwCqRoD3x+wnOEMEGosFkBFRz6bcLcjw7bmZGVA/Opdwd Lqa8FKVKjYMZUure9rwA/kWqBoqcVV7wW3sVYdlOzBJaPx060O7QMGxxBq8p4ODbit9W k8B8EXPzreOunkr7BI9szLkdp1JHU4xZUz/xqTwK00noxmIDDSXEUWK2hbLL3JkoYNGk O2ZD7AqF74/Awr97OFeuk+GaCSdDvrloaZePAOcmy9zQRV09GEgu1cip9X6A1pb5BfJi N+utIiK+uu30YDBFu2RkpyVkHiWcSJw0j+OABDV5xk3VHQm+FqHGpx8KiWY51ZSWvG68 seWQ== X-Gm-Message-State: AOAM533tIxfOMrDyPqI7MvcdUD3ahCiSPtP6H17VOREReyQy/3F81hVo 25Jz2TZcGbpR5m3Cw9O/8i4M057712d/f6UBsmiynGlrlrE= X-Google-Smtp-Source: ABdhPJxP2sL06HUrAJVss7VP/giFNqYb7kGS/v3IEegfvwQqlYsFFreC0veMnSEsru+eNOAsZxJEC1KmCT0B2MaT/JQ= X-Received: by 2002:a17:907:250f:: with SMTP id y15mr12681833ejl.0.1638424065595; Wed, 01 Dec 2021 21:47:45 -0800 (PST) MIME-Version: 1.0 References: <20210914032849.273625-1-marex@denx.de> In-Reply-To: <20210914032849.273625-1-marex@denx.de> From: Jagan Teki Date: Thu, 2 Dec 2021 11:17:32 +0530 Message-ID: Subject: Re: [PATCH] mtd: sf: Set SF parameters as env variables To: Marek Vasut , Tom Rini Cc: u-boot@lists.denx.de, Vignesh R Content-Type: text/plain; charset="UTF-8" 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 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? Jagan.