From patchwork Mon Feb 14 20:10:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 1592769 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=IbuK4wCT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JyFj64gqnz9ryY for ; Tue, 15 Feb 2022 07:11:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8D4083B55; Mon, 14 Feb 2022 21:10:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io 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=foundries.io header.i=@foundries.io header.b="IbuK4wCT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A05183B9F; Mon, 14 Feb 2022 21:10:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 451C483A75 for ; Mon, 14 Feb 2022 21:10:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ricardo@foundries.io Received: by mail-lf1-x130.google.com with SMTP id u6so32864774lfc.3 for ; Mon, 14 Feb 2022 12:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=mime-version:from:date:message-id:subject:to; bh=pHuIqJqCtKX/I+T3LqNKySB7P1pPf6IHHeulx053R8k=; b=IbuK4wCT031+2S4/2lP7PQ4OQHrmNd/wFOkF3BD0lMYCmjwEzwQlnb91bz5F+r1rso 9Qm4WtQssw6IYUmVBXdah0ymofSZN5OeLEmGjZ5MpP6V4w1pxz8+3SwYl8FITFKM6FwP Q8khC7oWu0QxkRqM30upvqRxHsiba4ftYX/z23emG0QxlpVXsP9rNQpMoBwaTxAYgtnB sknx8NyX54emQzL7nukYQMnXAwA2NOoJHjjRpOLFJLpO0NGBtBEpHm5NwQsXJaMl4zWG 3otGKirnSX9wPSRnt40+J7jqGoXFlxgcwObHBjDrL6Blteyl7V/ZF3bIKmzozUDWehTs zb6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pHuIqJqCtKX/I+T3LqNKySB7P1pPf6IHHeulx053R8k=; b=UH9BZCm/SqeoeDdniLnnBlBJzwKXOWK5ErD88egRaS3hR0B6+N+WiNABPUOC2uoCyO ZJHvMYE79yTU/xRp8zVEqVATyJs5M8azKxxo2I/Ejei12/XtvI1SpueATkbQxTr1fKAd uHn97OgHGeqi6GcMP8NMT0LyyGUV5HN4Fb72K10HnVjqj++OvKe4ICqxKHPXUT3Tcv8n zmXfWhqv64GCcusrtm29rfjF/YTg5PTS8lyXVj+cdfdh/7n6Kc6aYzfR1wErQfKPdnY9 NO3P4IAJVgvwwFSFK+c1ovm2t4GQqIhU37Gx1gMZi8Ry/1tkqcEax+aMyHZA8KICGJ+f vVOw== X-Gm-Message-State: AOAM533Ff69bZXOm6sU9uRZjEtET+y35H5g4uajKb4aH1XIQiUFPfElR yllOX0arY0WvhoC73qzHMXFZTIN8oeDu+sUJlZRk X-Google-Smtp-Source: ABdhPJwqyY3IyivU5flOIEn0Lde9fpAddnIjbXyT1Uwb78Mj2CkrJghiD+E/6yxnqRBB6PhfkUh9G36QBC+gKbuwdAg= X-Received: by 2002:ac2:5e6f:: with SMTP id a15mr506478lfr.213.1644869450338; Mon, 14 Feb 2022 12:10:50 -0800 (PST) MIME-Version: 1.0 From: Ricardo Salveti Date: Mon, 14 Feb 2022 17:10:14 -0300 Message-ID: Subject: Unable to select a different ENV location due env_get_location on zynqmp To: Michal Simek , u-boot@lists.denx.de, Jorge Ramirez , Igor Opaniuk , Oleksandr Suvorov 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 Michal, 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. 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. Thanks, 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: