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 770A3C433F5 for ; Thu, 13 Jan 2022 17:20:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E66D98343B; Thu, 13 Jan 2022 18:20:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc 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; secure) header.d=walle.cc header.i=@walle.cc header.b="aE0WDXBi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45B3B83394; Thu, 13 Jan 2022 18:20:43 +0100 (CET) Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 68E8483373 for ; Thu, 13 Jan 2022 18:20:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id BCFAD223F0; Thu, 13 Jan 2022 18:20:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1642094438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7yLIbY9bDknEFnohX8UsosVCQQP+0D+b1VjAVezJR68=; b=aE0WDXBiEo2F3zMCsY1s7l9Jb0OlthhDgh4v+92GQdv9kWCpmvjuHTx/nhnRG3gUi7PKjh 71qrZ/ZB5Jpj8aiC4JECl/r4CuQ8UyMf2qSsM527qNPUcgt0VcOu/q+B4qyDCYifD8HEzS 26asqsGi27NDrb27CGaFqPaAhnty2gk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 13 Jan 2022 18:20:38 +0100 From: Michael Walle To: Heiko Thiery Cc: u-boot@lists.denx.de Subject: Re: [PATCH] spl: add support for custom boot method names In-Reply-To: <20220113152239.1534294-1-heiko.thiery@gmail.com> References: <20220113152239.1534294-1-heiko.thiery@gmail.com> User-Agent: Roundcube Webmail/1.4.12 Message-ID: <1f682cb4921aa2e36373fbfa0aa640ef@walle.cc> X-Sender: michael@walle.cc 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.2 at phobos.denx.de X-Virus-Status: Clean Am 2022-01-13 16:22, schrieb Heiko Thiery: > Currently the names MMC1, MMC2 and MMC2_2 are output in the SPL. To > achieve more userbility here the name of the boot source can be > returned. > E.g. for "MMC1" -> "eMMC" or "MMC2" -> "SD card". > > Signed-off-by: Heiko Thiery Very nice! If my board would have already support for multiple boot sources, this would be a very good improvement for the user. Our downstream bootloader has that support and it always puzzled me whats MMC1, MMC2 and so on. In fact, theres two SPI boot sources there, which cannot be distinguished at all at the moment; they have different offsets for the same SPI flash. Except for one nit below: Reviewed-by: Michael Walle > --- > common/spl/spl.c | 5 +++++ > include/spl.h | 5 ++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/common/spl/spl.c b/common/spl/spl.c > index 4c101ec5d3..b7b53f352e 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -174,6 +174,11 @@ __weak void spl_board_prepare_for_optee(void *fdt) > { > } > > +__weak const char *spl_board_loader_name(u32 boot_device) > +{ > + return NULL; > +} > + > #if CONFIG_IS_ENABLED(OPTEE_IMAGE) > __weak void __noreturn jump_to_image_optee(struct spl_image_info > *spl_image) > { > diff --git a/include/spl.h b/include/spl.h > index 0af0ee3003..a7f17a3837 100644 > --- a/include/spl.h > +++ b/include/spl.h > @@ -458,6 +458,7 @@ void spl_board_prepare_for_optee(void *fdt); > void spl_board_prepare_for_boot(void); > int spl_board_ubi_load_image(u32 boot_device); > int spl_board_boot_device(u32 boot_device); > +const char *spl_board_loader_name(u32 boot_device); function documentation maybe? > /** > * jump_to_image_linux() - Jump to a Linux kernel from SPL > @@ -541,7 +542,9 @@ struct spl_image_loader { > static inline const char *spl_loader_name(const struct > spl_image_loader *loader) > { > #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT > - return loader->name; > + const char *name; > + name = spl_board_loader_name(loader->boot_device); > + return name ?: loader->name; > #else > return NULL; > #endif -michael