X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fconsole.c;h=cc55068c7cd823c138c4f90d1657a899621da0bf;hb=0ec3e0464e923142c845b23b1fc34dc9310540db;hp=270170b3ddff6e3f57ef8903d657cbce39dc0ed9;hpb=849d5d9cda0e7c94797874d842e9b132ec45a565;p=karo-tx-uboot.git diff --git a/common/console.c b/common/console.c index 270170b3dd..cc55068c7c 100644 --- a/common/console.c +++ b/common/console.c @@ -2,23 +2,7 @@ * (C) Copyright 2000 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -73,6 +57,29 @@ static int on_console(const char *name, const char *value, enum env_op op, } U_BOOT_ENV_CALLBACK(console, on_console); +#ifdef CONFIG_SILENT_CONSOLE +static int on_silent(const char *name, const char *value, enum env_op op, + int flags) +{ +#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_SET + if (flags & H_INTERACTIVE) + return 0; +#endif +#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC + if ((flags & H_INTERACTIVE) == 0) + return 0; +#endif + + if (value != NULL) + gd->flags |= GD_FLG_SILENT; + else + gd->flags &= ~GD_FLG_SILENT; + + return 0; +} +U_BOOT_ENV_CALLBACK(silent, on_silent); +#endif + #ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV /* * if overwrite_console returns 1, the stdin, stderr and stdout