summaryrefslogtreecommitdiffstats
path: root/common/console_simple.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>