aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-03-18 09:25:01 +0100
committerPatrick Delaunay <patrick.delaunay@st.com>2020-05-14 09:02:12 +0200
commit99d643cb411775037453bf24cac6b8eb0917bfe7 (patch)
treeb1f0563405fa7c5c044b45dc1778b2a9826a1a3d
parent468f0508b58b02943942c47b66645a05244f2bbf (diff)
downloadu-boot-99d643cb411775037453bf24cac6b8eb0917bfe7.zip
u-boot-99d643cb411775037453bf24cac6b8eb0917bfe7.tar.gz
u-boot-99d643cb411775037453bf24cac6b8eb0917bfe7.tar.bz2
stm32mp: stm32prog: enable videoconsole
Enable the videoconsole during the stm32prog command execution to have information without UART. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index 1769ba0..15bbdc2 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -11,6 +11,32 @@
struct stm32prog_data *stm32prog_data;
+static void enable_vidconsole(void)
+{
+#ifdef CONFIG_DM_VIDEO
+ char *stdname;
+ char buf[64];
+
+ stdname = env_get("stdout");
+ if (!stdname || !strstr(stdname, "vidconsole")) {
+ if (!stdname)
+ snprintf(buf, sizeof(buf), "serial,vidconsole");
+ else
+ snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
+ env_set("stdout", buf);
+ }
+
+ stdname = env_get("stderr");
+ if (!stdname || !strstr(stdname, "vidconsole")) {
+ if (!stdname)
+ snprintf(buf, sizeof(buf), "serial,vidconsole");
+ else
+ snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
+ env_set("stderr", buf);
+ }
+#endif
+}
+
static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
@@ -45,6 +71,8 @@ static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
if (argc > 4)
size = simple_strtoul(argv[4], NULL, 16);
+ enable_vidconsole();
+
data = (struct stm32prog_data *)malloc(sizeof(*data));
if (!data) {