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 C0174C32772 for ; Tue, 23 Aug 2022 09:31:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D706847EF; Tue, 23 Aug 2022 11:30:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine 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 (2048-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="HEua4UKD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C5AF847E8; Tue, 23 Aug 2022 11:30:28 +0200 (CEST) Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (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 F3BCF8461A for ; Tue, 23 Aug 2022 11:30:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 7DF4A9A84; Tue, 23 Aug 2022 11:30:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1661247024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HOMcnE4S8ox7WaZr2lPPQt6T1bTJsu/gEwSw2T5f2K8=; b=HEua4UKDY42PGCsG4+VxMkuaC34C8joGukyVq0xJd15d5N/oW9FD2jZQHfykLull2l0a40 ZR+qeJKrqbra2tMmDSdJRqn3rkjbSujDSAD3FELJlITYcZtlP4I36B+h8uuwQbcwYEXcyQ +7GS+ZQmMv0IP6LaCr6TnZbDxFosQ+KdEiZdAXjHn0sEJ2aH6+vS1suKyXaMzpn4UEFJi2 OLxwCFM4DHoUe47VdxEo6JrixqXvWczAmfCGWBTdTJ3ER0T4LQbpA/aztn0K6eNLZGh1i6 toNuv9QbI2skfG29oHnWhXSbfitDSNtxJjjt3nfQaQQhF22qbxaF485QFbu1bQ== From: Michael Walle To: peng.fan@oss.nxp.com Cc: u-boot@lists.denx.de, Michael Walle Subject: [PATCH v3 4/5] board: sl28: support dynamic prompts Date: Tue, 23 Aug 2022 11:30:17 +0200 Message-Id: <20220823093018.3157715-5-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220823093018.3157715-1-michael@walle.cc> References: <20220823093018.3157715-1-michael@walle.cc> 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.6 at phobos.denx.de X-Virus-Status: Clean Depending on the boot source, set different CLI prompts. This will help the user to figure out in which mode the bootloader was started. There are two special modes: failsafe and SDHC boot. Signed-off-by: Michael Walle --- board/kontron/sl28/sl28.c | 20 ++++++++++++++++++++ configs/kontron_sl28_defconfig | 1 + 2 files changed, 21 insertions(+) diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c index 54719cc01c..0576b3eae4 100644 --- a/board/kontron/sl28/sl28.c +++ b/board/kontron/sl28/sl28.c @@ -126,8 +126,28 @@ static void stop_recovery_watchdog(void) wdt_stop(dev); } +static void sl28_set_prompt(void) +{ + enum boot_source src = sl28_boot_source(); + + switch (src) { + case BOOT_SOURCE_SPI: + env_set("PS1", "[FAILSAFE] => "); + break; + case BOOT_SOURCE_SDHC: + env_set("PS1", "[SDHC] => "); + break; + default: + env_set("PS1", NULL); + break; + } +} + int fsl_board_late_init(void) { + if (IS_ENABLED(CONFIG_CMDLINE_PS_SUPPORT)) + sl28_set_prompt(); + /* * Usually, the after a board reset, the watchdog is enabled by * default. This is to supervise the bootloader boot-up. Therefore, diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index 4d50c681f9..fc1c607927 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -55,6 +55,7 @@ CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_CBSIZE=256 CONFIG_SYS_PBSIZE=276 CONFIG_SYS_BOOTM_LEN=0x800000 +CONFIG_CMDLINE_PS_SUPPORT=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y CONFIG_CMD_NVEDIT_EFI=y -- 2.30.2