summaryrefslogtreecommitdiffstats
path: root/common/console_simple.c
Commit message (Collapse)AuthorAgeFilesLines
* console: move ARCH_HAS_CTRLC into KconfigAhmad Fatoum2023-11-211-1/+1
| | | | | | | | | | We should do away altogether with <asm/common.h>, so prepare for doing that in the future by moing the only content it has on sandbox into Kconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231109124326.1499612-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for files without explicit licenseAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: fixup add new CONFIG_CONSOLE_DISABLE_INPUT optionAhmad Fatoum2021-10-111-1/+1
| | | | | | | | Fix typo in CONFIG_CONSOLE_DISABLE_INPUT case for simple console. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211002174417.27020-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: add new CONFIG_CONSOLE_DISABLE_INPUT optionRouven Czerwinski2021-10-051-1/+4
| | | | | | | | | | | Add CONFIG_CONSOLE_DISABLE_INPUT to initialize the consoles without input support, making default bootup effectively non-interactive. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Christian Melki <christian.melki@t2data.com> Link: https://lore.barebox.org/20210915123644.1292607-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: provide stubs for ctrlc_* functionsLucas Stach2019-12-021-11/+0
| | | | | | | | Currently the stubs are only provided for CONFIG_CONSOLE_SIMPLE, but they are also needed for CONSOLE_NONE. Move them to the header. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: fix linking error when ARCH_HAS_CTRLC enabledDU HUANPENG2019-10-181-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | this error happens in sandbox with simple console, sandbox has ARCH_HAS_CTRLC enabled by default $ make sandbox_defconfig $ make menuconfig (select CONFIG_SHELL_SIMPLE) $ make LD barebox common/built-in.o: In function `__pr_memory_display': /home/du/source/barebox/common/memory_display.c:117: undefined reference to `ctrlc' common/built-in.o: In function `run_init': /home/du/source/barebox/common/startup.c:317: undefined reference to `console_ctrlc_allow' common/built-in.o: In function `parse_stream_outer': /home/du/source/barebox/common/hush.c:1742: undefined reference to `ctrlc' common/built-in.o: In function `run_list_real': /home/du/source/barebox/common/hush.c:895: undefined reference to `ctrlc' common/built-in.o: In function `run_shell': /home/du/source/barebox/common/hush.c:1940: undefined reference to `ctrlc_handled' Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix compile error when set CONFIG_CONSOLE_SIMPLE=yDU HUANPENG2019-10-141-0/+12
| | | | | Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: add newline conversion for putc_ll caseSascha Hauer2018-06-191-0/+2
| | | | | | | When console_putc uses putc_ll for early printing then it must do a newline conversion as putc_ll doesn't do it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: Fix newline conversionSascha Hauer2018-06-191-1/+2
| | | | | | Newline should be "\r\n" rather than "\n\r" Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: Remove duplicated newline conversionSascha Hauer2018-06-191-2/+0
| | | | | | | console_puts uses console_putc for printing which already does newline conversion, so do not do it again in console_puts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stdio: rename getc to getcharSascha Hauer2016-04-151-3/+3
| | | | | | | The function we have implemented as getc has the semantics of the standard function getchar, so rename it accorgingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* login: rework login mechanismSascha Hauer2015-08-281-6/+0
| | | | | | | | | | | | | | We used to have the login functionality in the /env/bin/init script. This is hard to review and it's too easy to break the login functionality with changes to this script. Move the places to ask for a password to C code where we have only a few places where we have to ask for a password. Mainly these are run_shell() and the menutree command. This patch introduces a login() function which will only return if the correct password has been entered. Following calls will return immediately without asking for a password again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/login'Sascha Hauer2013-10-071-0/+7
|\ | | | | | | | | Conflicts: include/console.h
| * login: disable input console if password wrongJean-Christophe PLAGNIOL-VILLARD2013-09-191-0/+7
| | | | | | | | | | | | | | so we guarantee that barebox is secured again user interaction Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console_simple: fix: set f_activeJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+2
| | | | | | | | | | | | | | | | | | so generic code can check if the console is enabled and now we can use loadb & loadxy Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console_simple: set baudrate at registerJean-Christophe PLAGNIOL-VILLARD2013-09-221-0/+5
|/ | | | | | | as the console is always enable Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework debug_llSascha Hauer2013-09-051-1/+1
| | | | | | | | | | Convert to static inline functions and use lower case letters for function names. Also, include mach/debug_ll.h when an architecture provides support for debug_ll, not only when it's actually enabled. This allows architecures to put some UART initialization code into mach/debug_ll.h which is compiled out when debug_ll is disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: consolidate common console codeSascha Hauer2013-02-131-83/+0
| | | | | | | The different console implementations share a good amount of code, share this in console_common.c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: use debug_ll before the console is availableJean-Christophe PLAGNIOL-VILLARD2012-10-301-1/+4
| | | | | | | This will allow to have the same feature as earlyprintk in the kernel Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console simple: return with a proper error valueSascha Hauer2012-04-131-6/+8
| | | | | | | There can be only one console for console_simple, so return with -EBUSY when the second gets registered. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: fix compiler warningSascha Hauer2011-12-071-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-12-071-0/+4
|\
| * console: add console unregisteringRobert Jarzmik2011-12-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | Some console are transient, like the USB connected serial console which should be removed when the USB connection is severed. Enable console removal for such devices. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console_simple: Fix compilationSascha Hauer2011-12-071-2/+9
|/ | | | | | | | | | | | | | | Since fprintf and console_puts now return the number of character written the prototypes have changes. We forgot to fix console_simple which now fails to compile with: common/console_simple.c:48:6: error: conflicting types for 'fprintf' include/stdio.h:57:5: note: previous declaration of 'fprintf' was here common/console_simple.c:67:6: error: conflicting types for 'console_puts' include/stdio.h:20:5: note: previous declaration of 'console_puts' was here Fix this by returning the proper numbers of characters written. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move version_string to seperate fileSascha Hauer2011-04-111-0/+2
| | | | | | | | | In a noninteractive environment barebox will be compiled without command support. So move version_string to a seperate file which is compiled unconditionally. Also, display the banner when the simple console support is used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console_simple: add fprintf / console_list for commands/loadb.cPeter Korsgaard2010-12-121-1/+25
| | | | | | | | | | commands/loadb.c doesn't build with CONFIG_CONSOLE_SIMPLE, because it uses fprintf / for_each_console (which uses console_list). Fix it by adding trivial implementations of both in console_simple. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* simple console: implement console_flushSascha Hauer2009-05-181-0/+16
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: add a simple console for saving spaceSascha Hauer2008-08-011-0/+117
Add a simple console layer which is not able to handle multiple consoles for those who don't need it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>