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 10E2EC433EF for ; Wed, 26 Jan 2022 20:58:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D6B782F8E; Wed, 26 Jan 2022 21:58:57 +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="DP00JD+s"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63DFC82FA5; Wed, 26 Jan 2022 21:58:55 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 B25D282133 for ; Wed, 26 Jan 2022 21:58:52 +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=tomm.merciai@gmail.com Received: by mail-ed1-x52d.google.com with SMTP id c24so890056edy.4 for ; Wed, 26 Jan 2022 12:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=McdrWpe4a74OETUux7UG4lvrmXFznP0q7eGGbN8P0u8=; b=DP00JD+sitLvlcJnqUk1t4HQWU878FS9n0vjO3+wmL0cc/Zy92gU91B3O8cl0jD5SM vjiF8XbSX2aWmg4QXcJPlMTr9bDV5WZ+DMEe82ezdThiJG/Sp/gppWlVvWxtYamYVcGz egI+9aRA100WY4zm0U3Fh6fLANIwtWdg0lbxkuf9TqDhuW9jzWMcFeP4rfIoHRA9HErt S3JrgHHba0Hauh0x1TqM6XMIuoeGQhnxNpUe9Gmf+fMmB1ajZNMlZIgXPReDMj5PpjrD PpA9wr39I7oNgzZqECoruJtR6FwZy8QyGiA0ZqmXImKpWk4FnG+0x6q/zbKpwfBscjW/ d8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=McdrWpe4a74OETUux7UG4lvrmXFznP0q7eGGbN8P0u8=; b=KBNX25nY3m1TN56MmbsDF3nDF/mlSaUjrzdMPmGk5zGUN6fR6WXO7blaLEmAZF4Lk5 OUMecDMd0rB4KcU1RAIIMOmfuIpSa/x+paRqskkccju8cYqrl7xPuwYaoMFn7fpuzAU2 7r6mG4sI0BeBwzMQKweSZ8JI3BYaIA1eoeZKwDELJ7R6KpV2FE4BCoLubsVcLX1AmNXn fQI1/5XpP5aIE0SH7u3KBsiD3m9cRypAKl165pLBq1QWQdSLRc9kG+5HdJYab2L3TTSJ omYNonfGlo573ShqnNC1HGMt3kYkKpUTeHRcgDQeNBoJdn5iwOv78Hfj1Z2MDdFidBY4 zHWQ== X-Gm-Message-State: AOAM532pLuFcq+9yhVGMlMWKB1cFqESSiTNN/S6Se8dolzitz/aCFocC 7nML0gyatKN16rYFEmPa86Q= X-Google-Smtp-Source: ABdhPJz6cK6TIWzddwab73erq5c4MXdx1NQSNH0LwDNxNUcjzRzR6zxbMAPAN0Jfmou3ExD/zWSlpg== X-Received: by 2002:a05:6402:787:: with SMTP id d7mr777893edy.390.1643230732197; Wed, 26 Jan 2022 12:58:52 -0800 (PST) Received: from tom-desktop (net-188-217-49-141.cust.vodafonedsl.it. [188.217.49.141]) by smtp.gmail.com with ESMTPSA id i12sm7493268ejy.43.2022.01.26.12.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 12:58:51 -0800 (PST) Date: Wed, 26 Jan 2022 21:58:49 +0100 From: Tommaso Merciai To: Adam Ford Cc: Michael Trimarchi , Teresa Remmet , U-Boot Mailing List Subject: Re: [RFC PATCH v3 4/5] beacon: imx8mn: override env_get_location in imx8mn_beacon.c Message-ID: <20220126205849.GA3539@tom-desktop> References: <20211225202554.47853-1-tomm.merciai@gmail.com> <20211225202554.47853-5-tomm.merciai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Wed, Jan 26, 2022 at 12:05:22PM -0600, Adam Ford wrote: > On Sat, Dec 25, 2021 at 2:26 PM Tommaso Merciai wrote: > > > > Override env_get_location function at board level, previously dropped > > down from arch/arm/mach-imx/imx8m/soc.c > > > > References: > > - commit 37d3e3bb95d7532e2503f115dd6c6762fd3b0262 > > > > Signed-off-by: Tommaso Merciai > Hi Adam, > I am going to re-do the patch for the beacon board, because I talked > it over with my colleagues, and we'd like to force the environment to > one location or another and not base it on whether or not it was the > boot device. > > I guess my questions is what's the status of the remaining patch > series, and how do I integrate my desired changes into it? I can send > you what I want for my board if you're going to resubmit the series. It's ok for me. Send me your changes. Thanks. > I wonder if a sub-function could be called where the existing > env_get_location() is renamed to something else, but declared as weak > can called from env_get_location. Anyone who wants a their own > function can write their own so we don't have two functions with the > same name declared as weak. > > What are your thoughts on that? Right. In this way every boards that use imx8mp/imx8mn can override this function according to their own needs. Tommaso > > adam > > --- > > board/beacon/imx8mn/imx8mn_beacon.c | 35 ++++++++++++++++++++++++++++- > > 1 file changed, 34 insertions(+), 1 deletion(-) > > > > diff --git a/board/beacon/imx8mn/imx8mn_beacon.c b/board/beacon/imx8mn/imx8mn_beacon.c > > index 7fe252b262..05ab5613ee 100644 > > --- a/board/beacon/imx8mn/imx8mn_beacon.c > > +++ b/board/beacon/imx8mn/imx8mn_beacon.c > > @@ -6,14 +6,47 @@ > > #include > > #include > > #include > > - > > +#include > > #include > > #include > > +#include > > #include > > #include > > > > DECLARE_GLOBAL_DATA_PTR; > > > > +enum env_location env_get_location(enum env_operation op, int prio) > > +{ > > + enum boot_device dev = get_boot_device(); > > + enum env_location env_loc = ENVL_UNKNOWN; > > + > > + if (prio) > > + return env_loc; > > + > > + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH) && dev == QSPI_BOOT) { > > + env_loc = ENVL_SPI_FLASH; > > + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND) && dev == NAND_BOOT) { > > + env_loc = ENVL_NAND; > > + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC)) { > > + switch (dev) { > > + case SD1_BOOT: > > + case SD2_BOOT: > > + case SD3_BOOT: > > + case MMC1_BOOT: > > + case MMC2_BOOT: > > + case MMC3_BOOT: > > + env_loc = ENVL_MMC; > > + break; > > + default: > > + break; > > + } > > + } else if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) { > > + env_loc = ENVL_MMC; > > + } > > + > > + return env_loc; > > +} > > + > > #if IS_ENABLED(CONFIG_FEC_MXC) > > static int setup_fec(void) > > { > > -- > > 2.25.1 > >