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 BC7C5C433F5 for ; Thu, 13 Jan 2022 15:22:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BE3882DB7; Thu, 13 Jan 2022 16:22:50 +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="pHa8ZA2K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2945A83042; Thu, 13 Jan 2022 16:22:49 +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 A5A7C80384 for ; Thu, 13 Jan 2022 16:22:46 +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=heiko.thiery@gmail.com Received: by mail-ed1-x52d.google.com with SMTP id a18so24363712edj.7 for ; Thu, 13 Jan 2022 07:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ebg+mX4i4OW1ci+Zr/HWOgQYXLn1Fqbo4rkyA4FraLk=; b=pHa8ZA2Kwfqge0Qjz52G0TVtrMCPeJISgcJcNGG6UMDrxYJfpHWWM5KFZJpzh57zqV 8MoP+ntoyVvJ7wt8UWvufypDF0xPwx4foVWFCu7+zUa39gr2ZttmkBF5RedevvvmMJB4 0WKdhmlK2a8A6y51NmUTRA0bAidd7LfAngifnxulLwOOoOZIBVQjxoEf9WPlZ+ol+WCf I4+hP9otWImkkqG7Qr67wrwNOwrEEPUAWs4Se3GfDHci/F1Sk11GsPH/7liOm8JfyfuT ctst6aGyJNPGSAkwlyMu4CQCNHLo2KPJGSRc7Q3qMjG6WHAM1HgFqQ2s+abur/bcJ2ZQ 26pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ebg+mX4i4OW1ci+Zr/HWOgQYXLn1Fqbo4rkyA4FraLk=; b=jWM5mTTqgFaXx22p1AqFrvwxP3mjAH3u78Ul1BLlqlLXSvRkLeXQB9BshkGUfh0wO8 Iuq16c+zq+OTy5Umuj8s4A4AOzXIoJ9CX7tjvvT2Rm6C0HYdr/XypNQc6LMdnQNjXjP1 0Sv8XeCU2tisW04/YE5PPJ4WFe/z8TUPcxWRCpeZyzlsHYqUefurYhnfPvXw5FLd4G2R QEiDKNBJQoOszUZvnO/ECrMogMInOKHh0VnB2S9hBGJBQjZf1EPgUey1zTnhsMnbMoTe cAsDJ+nbqdg+QjVUnU8SwBCo8wtnEZJGVkkQTjP3stuJhHa3Eg2kZYGOXbGcjKsg4/38 Kq7w== X-Gm-Message-State: AOAM530Z0D6z5kQFOApYHYYUuXLsrfWZ5ExdIywtALxCz3Vte9MZKuCd Cnc1YiUkwNBiOBcoXB2+OfCX8PU/EMP5Rg== X-Google-Smtp-Source: ABdhPJwWBfVo5x3uFQ2CxAiYFhKZxBWgdMr67HqOShKxSG5wO9AV/qGi5+6PhVGv5+hYUXSZrl4WEw== X-Received: by 2002:a05:6402:158:: with SMTP id s24mr4845330edu.144.1642087366036; Thu, 13 Jan 2022 07:22:46 -0800 (PST) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id qk10sm971150ejc.116.2022.01.13.07.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 07:22:45 -0800 (PST) From: Heiko Thiery To: u-boot@lists.denx.de Cc: Michael Walle , Heiko Thiery Subject: [PATCH] spl: add support for custom boot method names Date: Thu, 13 Jan 2022 16:22:40 +0100 Message-Id: <20220113152239.1534294-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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.2 at phobos.denx.de X-Virus-Status: Clean 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 --- 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); /** * 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 -- 2.30.2