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 0BCD8C433EF for ; Thu, 27 Jan 2022 22:39:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9817834D2; Thu, 27 Jan 2022 23:39:27 +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="UUMDPQF7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F043583563; Thu, 27 Jan 2022 23:39:26 +0100 (CET) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 3667482BA6 for ; Thu, 27 Jan 2022 23:39:24 +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-x532.google.com with SMTP id w14so5839101edd.10 for ; Thu, 27 Jan 2022 14:39:24 -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=KDK+wSH8iMEN2WT8P0HPTxztKBcstb+9UnnNzalMICI=; b=UUMDPQF7f+Cwt9FDoC+GoNgIfzSHJYLCxSUjYqoQXJZA7pwU7gDWGzeeboN+/iESE1 E540J29XkVNXdpb58wCOVvxdBc5D/Tp4bx+frj+6i/+1VJGLeeqyJmFsvW5lDYjbC8qB axg7Yi+26342WW8ICqtXW1r7a2KG0LMOwLruN9X5kvDxGj4M8rloje9lz8g9jCh9iVIy joMa3u6iIlMFxwoR1UQ4+JRRcjoDnUBu0YoIArY90ESwetAiTg+5CJN8hCqINCdy1vFQ +/C4zIUxcrl1RIfQROQbWTJhFTDwLDJWKUFoRJfRFEbSyMn9ZftT3uEIXmIK56/BLDfP 4Wog== 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=KDK+wSH8iMEN2WT8P0HPTxztKBcstb+9UnnNzalMICI=; b=ZuitlKFoXTQvW14gE9FHTzEOE47fYx+JPxWy38oKRVEOX6lpk11wNtrDruywLlE923 pl8H7NkZpYsymJmIIEe/op1Xjsn7dwhVZuphU7AZW7bmzYNE2EOaO6wi0zTkmVW9NivN akqDUyPj5VNHgFZ03xiIZhYxAwV3ybf2HakzAzsc7K53ZRv+YO7YROeo7N0SyMRst72K wzRN7kAX218kf+Ljx1XkbVbtMvVq/lmd17WsKqiFQLBw9RW05DFJpGJ1OZpEl9w/QrGX UvASf+HUOEQCf1CuCGYxawQGU+J8bUCysmibVSiTGW7hoZCxrI0pBRCz72O2SmHPwdDg Prrg== X-Gm-Message-State: AOAM530JdKqF3sRoIDUZso+LI93rY869LwBhZElTw3JB53n/jkqB7jC/ DUjEoumC4o0pr2VWCXA3ByZLUDr3IKs= X-Google-Smtp-Source: ABdhPJwmm5UacETT6hcqPhTwKsqgx/NtCyJ8KNKX92m/yqotDLXLIcBCalBW7KJfFIMQtoehcIexlg== X-Received: by 2002:a05:6402:26cd:: with SMTP id x13mr5466223edd.354.1643323163689; Thu, 27 Jan 2022 14:39:23 -0800 (PST) Received: from tom-desktop (host-87-19-2-173.retail.telecomitalia.it. [87.19.2.173]) by smtp.gmail.com with ESMTPSA id h16sm9203568ejj.56.2022.01.27.14.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 14:39:22 -0800 (PST) Date: Thu, 27 Jan 2022 23:39:20 +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: <20220127223920.GA5017@tom-desktop> References: <20211225202554.47853-1-tomm.merciai@gmail.com> <20211225202554.47853-5-tomm.merciai@gmail.com> <20220126205849.GA3539@tom-desktop> 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 Thu, Jan 27, 2022 at 10:59:51AM -0600, Adam Ford wrote: > On Wed, Jan 26, 2022 at 2:58 PM Tommaso Merciai wrote: > > > > 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. > > > Hi Adam, > After trying some different options, I wonder if we can just delete > env_get_location() completely from arch/arm/mach-imx/imx8m/soc.c. > > For my board, it does exactly what I want when I delete that function > since the default from env.c is sufficient. I think it's probably > safest to use your original approach to move them to individual board > files with the idea that some people may not need it at all. When > placed into their board files, they can choose what they want for > themselves. Ack. > > I would suggest sending a patch without the RFC and place the function > into the various imx8mn and imx8mp boards, but know that you can skip > the beacon board. I would also suggest that you add a note that > people should test this to see if it's really what they want or if > they can live without the code and fall back on the default. Ok, I'll send v4 of the series (without RFC label) in these days. Thanks, Tommaso > > adam > > > 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 > > > >