summaryrefslogtreecommitdiffstats
path: root/include/console.h
Commit message (Collapse)AuthorAgeFilesLines
* console: forbid ctrlc during startupSascha Hauer2019-04-241-0/+3
| | | | | | | | | | | | | | | When global.autoboot_abort_key is set to ctrl-c then the user is expected to press ctrl-c to get to the prompt. The user might press ctrl-c before the init script runs the "timeout" command. In this case the init script is aborted at arbitrary places which leads to inconsistent results depending on the place it is aborted. This patch introduces the global.console.ctrlc_allowed variable. When this variable is set to false ctrl-c is ignored entirely. The variable is set to false by default and changed to true in the init script. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Add simplified 'serdev' framework from Linux kernelAndrey Smirnov2018-04-171-0/+27
| | | | | | | | | Port 'serdev' UART-slave deivce framework found in recent Linux kernels (post 4.13) in order to be able to port 'serdev' slave drivers from Linux. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Introduce console_drain()Andrey Smirnov2018-04-171-0/+84
| | | | | | | | | | | | | | Generalize high baud rate UART polling code found in lib/xmodem.c and expose it as a generic function in console API. The usecase for this -- besides X/Y-mode data transfers where the code originated -- is command/reply type of serial exchages at high baud rates (~1Mbaud) with payloads exceeding inernal UART FIFOs in size. Such interactions are not uncommon in serdev device and this patch is done in preparation for serdev support code that will follow. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename file_operations -> cdev_operationsSascha Hauer2018-04-061-1/+1
| | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: move global.allow_color handling to C codeSascha Hauer2018-02-221-0/+2
| | | | | | | | | We have global.allow_color, but this is limited to the environment only. Move creation and handling of this variable to C code so that we can add support for colored output to commands/console controlled by the same variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Use dev_add_param_stringSascha Hauer2017-04-111-1/+1
| | | | | | | dev_add_param_string allows to pass a priv * so that the device_d * argument is not needed and can be removed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: expose consoles in devfsBastian Stender2017-02-281-0/+3
| | | | | | | | | This enables displaying text on e.g. a framebuffer console by issueing echo -o /dev/fbconsole0 abc123 Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: replace set_active by open/closeBastian Stender2017-02-281-1/+6
| | | | | | | | | Opening and closing consoles should be independent from setting them active. This way it is possible to open e.g. a framebuffer console and display text on it without showing stdout/stderr. Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* login: rework login mechanismSascha Hauer2015-08-281-3/+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>
* PBL: console: Make independent of DEBUG_LLSascha Hauer2015-07-311-0/+6
| | | | | | | | | | With more stuff being done in PBL regular console support gets more and more useful. This makes the PBL console independent of DEBUG_LL which is only meant for early debugging but not regular output. To use the regular PBL console a board must call pbl_set_putc() which stores a pointer to the putc function to be used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Add console_get_by_nameSascha Hauer2015-06-091-0/+1
| | | | | | | Commands like loadx/loady wish to find a console device by its name. Add a function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Add functions to get/set baudrateSascha Hauer2015-06-091-0/+3
| | | | | | So C code can call a function rather than fiddling with device parameters. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Add functions to get/set active state of consoleSascha Hauer2015-06-091-0/+4
| | | | | | | | Currently code needs to fiddle with the active parameter of a console device directly to enable/disable consoles. Add console_set_active() to set the status and console_get_active() to get the current status. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: allow to specify the device idJean-Christophe PLAGNIOL-VILLARD2015-01-131-0/+1
| | | | | | | so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Add set_active callbackSascha Hauer2014-12-171-0/+1
| | | | | | | | The netconsole needs to be able to deny activation when the network has not been enabled. Add an optional callback to the console for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2014-08-071-0/+1
|\ | | | | | | | | | | | | Conflicts: .gitignore Makefile drivers/serial/Makefile
| * console: Add puts callback to console devicesSascha Hauer2014-07-111-0/+1
| | | | | | | | | | | | | | | | Some devices may have a much more efficient way to output strings rather than single characters. Let console devices implement a callback for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console: Allow persistent device namesSascha Hauer2014-07-111-0/+2
|/ | | | | | | | Add a devname field to struct console_device so that the device name can be set by the driver. This makes it possible to have persistent device names. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Set Linux console parameter automaticallySascha Hauer2014-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | Linux specifies the linux,stdout-path property in the /chosen node in the devicetree. Unfortunately this is ignored in most cases. For cases in which barebox uses this property for its own use we translate this into a Linux boot arg with: - the console name provided by the serial driver - the the instance from the 'serial' alias - the baudrate from the actual baudrate. So with this it's for devicetee enabled boards no longer necessary to manually assign a console= parameter. Should a user not want to use the automatically assigned parameter it should do: global.linux.bootargs.console= in the environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rs485'Sascha Hauer2013-10-071-0/+8
|\ | | | | | | | | Conflicts: common/console_common.c
| * console: introduce new callback set_modeJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+6
| | | | | | | | | | | | | | so we can set the port in rs485 mode Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * console: introduce console_get_by_devJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+2
| | | | | | | | | | | | | | so we can get console by it's device Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/login'Sascha Hauer2013-10-071-0/+5
|\ \ | | | | | | | | | | | | Conflicts: include/console.h
| * | introduce runtime loglevelSascha Hauer2013-09-291-0/+2
| | | | | | | | | | | | | | | | | | | | | With this the verbosity of barebox can be controlled during runtime using the 'loglevel' globalvar. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | login: disable input console if password wrongJean-Christophe PLAGNIOL-VILLARD2013-09-191-0/+3
| |/ | | | | | | | | | | | | 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: factorise function to get the first enabled consoleJean-Christophe PLAGNIOL-VILLARD2013-10-061-0/+2
| | | | | | | | | | | | | | rename it to console_get_first_active Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console: drop f_caps and check the function pointer getc/putc insteadJean-Christophe PLAGNIOL-VILLARD2013-09-211-1/+0
|/ | | | | | | | | | None of the driver make the difference between STDOUT and STDERR. So we just need to check if putc or getc are filled in the console_device save 32 bytes on versatilepb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: Use dev_add_param_int for baudrate parameterSascha Hauer2013-04-111-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: remove unused function prototypesSascha Hauer2012-01-261-13/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: add console unregisteringRobert Jarzmik2011-12-051-0/+1
| | | | | | | | | | | 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>
* rework device parametersSascha Hauer2010-06-171-6/+0
| | | | | | | | Change device parameters so that the memory management is in generic code. This also removes the need of storing statically initialized parameters as they are stored in a struct list_head for each device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* list: remove duplicated list.hSascha Hauer2009-11-031-1/+1
| | | | | | | | We accidently have two list implementations in the tree: include/list.h and include/linux/list.h. This patch moves the latter (newer one) to include/linux/list.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* get rid of device idsSascha Hauer2009-07-211-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Flush consoles before exitingSascha Hauer2009-03-191-0/+1
| | | | | | | We use FIFOs on some devices, so flush them before exiting so we do not get funny characters in the output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use Linux Kernel list implementation for console devices insteadSascha Hauer2007-10-111-1/+5
| | | | of homegrown list.
* add early console for mpc5200Sascha Hauer2007-07-121-0/+12
|
* svn_rev_686Sascha Hauer2007-07-051-0/+5
| | | | implement console baudrate switching
* svn_rev_528Sascha Hauer2007-07-051-0/+2
|
* svn_rev_502Sascha Hauer2007-07-051-1/+9
| | | | complete multiple console support
* svn_rev_380Sascha Hauer2007-07-051-8/+13
| | | | add support for multipple consoles
* Initial revisionwdenk2000-11-121-0/+38