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 3D1DFC433EF for ; Tue, 15 Feb 2022 07:51:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53CFC80882; Tue, 15 Feb 2022 08:51:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="I4uLtNLk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90DA880A4F; Tue, 15 Feb 2022 08:51:52 +0100 (CET) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (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 9ADE880378 for ; Tue, 15 Feb 2022 08:51:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zajec5@gmail.com Received: by mail-lf1-x135.google.com with SMTP id b11so10544432lfb.12 for ; Mon, 14 Feb 2022 23:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:to:references:from :in-reply-to:content-transfer-encoding; bh=UYAxue/U+RnB6aBXFT3/s5Zx7w1K/m/Rp+sJZb3082A=; b=I4uLtNLkQoGbbdh01bX7wf8GM2BnX0Cii9knIqCmPl8W38clgTja/w1O6o94WgKoa/ xk92+ebHht9jIotG3+3ptPf8+e27+guBsbaljzbQVB68Xjr997AD9sOzXGU6UF9pDA97 KC8n81FxQUj+UlE6zWS/FHObVS/TJgoEj8bqZCjB+/0Rc/e/8UKVuJRpm/PXbOWrO2Uu LWA4YChGe1AQb3cCAKqmRa7hS3DbOZSmdcO4bj6weV8XKcFh+0uqQPuQFsv0PkV4K6LI W1exnZmQ5mgemsSfYRjkvWX4nQ+Ji1LDTq//LfzYEHU5g2tBbMpTwTd+pEeQ9DHIZ581 0kFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :to:references:from:in-reply-to:content-transfer-encoding; bh=UYAxue/U+RnB6aBXFT3/s5Zx7w1K/m/Rp+sJZb3082A=; b=IAEaLJw57Lc/wKB3KeU222g546cO42aNVR5t7BHhTw1TrNjPYYIVsJoJ2eKoE7xpaI FO7ZMe2k7pewfI6ktDZ3tdA4zlEKEJ7iD0MxZzNT+Y3xlhd49MxvYj1DiBrxG0c4ik4z kkgEgyWZnCqUeiSj+jj6mW/VtdoHTfrCSVUpYm8cjSBvSrWEm7vEglCZJ+muEYiXgsSo 7qd8sjO6zi4mxSwF+QVJjXXxNSt9ZIVlHjZH60t2KDzP7prSktb50kojvAmrLX+nEJpi YdF0iL5L7ZDygcc1Q22qOVpfcP1cXjGefvimFI+1GNT5hEL5GVed2JNotdfJaXX6MZ16 bAmw== X-Gm-Message-State: AOAM5329cMHg+d/ztto7eu1WHgRfjoaPSzHc8naRvVU0gHUVWXkbChct bhs/bVBUHWpqGSZZYWQc6dc= X-Google-Smtp-Source: ABdhPJxwPMxtdmcRWkkjWvjtDsVHgsrqnSDZb+yoo/gSlp1euADeEw5EVBwm284LVf63gDeC34bHZA== X-Received: by 2002:a05:6512:1313:: with SMTP id x19mr2196104lfu.525.1644911507871; Mon, 14 Feb 2022 23:51:47 -0800 (PST) Received: from [192.168.26.149] (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.googlemail.com with ESMTPSA id k14sm4318868ljh.82.2022.02.14.23.51.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 23:51:47 -0800 (PST) Message-ID: <0bd92ecc-ce5f-da29-1636-d8e18aec6e81@gmail.com> Date: Tue, 15 Feb 2022 08:51:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Thunderbird/96.0 Subject: Re: Unable to select a different ENV location due env_get_location on zynqmp To: Michal Simek , Ricardo Salveti , u-boot@lists.denx.de, Jorge Ramirez , Igor Opaniuk , Oleksandr Suvorov References: From: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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 Hi, On 15.02.2022 08:41, Michal Simek wrote: > On 2/14/22 21:10, Ricardo Salveti wrote: >> This is a bit similar to the issue raised on iMX8-based targets a few >> days ago, which is forcing the environment location based on the boot >> mode and not allowing the user to use a different option via other >> CONFIG options. >> >> Should we really force the env location based on boot mode? Currently >> there is no way to boot out of QSPI and save the environment on >> emmc/fat/ext4, and removing CONFIG_ENV_IS_IN_SPI_FLASH causes the env >> location to be set as ENVL_NOWHERE, which is not ideal, especially >> when other env target locations are available at build time. >> >> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c >> index f0be9c022a7..08afb49570a 100644 >> --- a/board/xilinx/zynqmp/zynqmp.c >> +++ b/board/xilinx/zynqmp/zynqmp.c >> @@ -969,6 +969,10 @@ enum env_location env_get_location(enum >> env_operation op, int prio) >>          case QSPI_MODE_32BIT: >>                  if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) >>                          return ENVL_SPI_FLASH; >> +               if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT)) >> +                       return ENVL_FAT; >> +               if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4)) >> +                       return ENVL_EXT4; >>                  return ENVL_NOWHERE; >>          case JTAG_MODE: >>          default: >> >> A change like this one would allow other locations to be set, and just >> use the boot mode to assign the priority instead. >> >> Since I couldn't really find out what is the expected behavior on >> functions defined at soc/board level (env.c sets based on priority, >> depending on what is enabled at build time), I was wondering if we >> shouldn't just drop this function entirely. >> >> While I agree the board should have a set of defaults, not allowing >> the user to change something like env location via CONFIGs seems wrong >> to me. >> >> Let me know what you think. > > Default location is setup based on how Xilinx sees where that variables should be saved for the most cases that's why that function was done like this. > That's why I think that it is very reasonable default setup. > And as is hopefully known we are using pretty generic u-boot which should work on all configurations it means default defconfig have all options enabled. > > Does it make sense to have an option to change it to any configuration? > Definitely. > > How to do it? > DT is for us source of truth that's why I prefer to have DT description which is providing all information. It means say where variables should be stored, where redundant variables should be stored. IIRC as of today I think they have to be on the same device which can be also more flexible. You can specify different start/end in qspis, etc. > > What has to happen? > Someone has to take a lead and come up with generic universal DT binding to be able describe it. Some days ago linaro had similar issue with DT in connection to A/B update via GPT partition. And description for it should be pretty much the same as is for variables. I'm not very familiar with U-Boot & iMX but I actually started working on DT binding for U-Boot env. Please check: [PATCH V2 2/3] dt-bindings: nvmem: add U-Boot environment variables binding https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211230090449.11808-2-zajec5@gmail.com/ I received feedback from Rob on January and I'm working on next version of my patch this very moment. I'll cc U-Boot this time obviously.