summaryrefslogtreecommitdiffstats
path: root/include/console.h
Commit message (Collapse)AuthorAgeFilesLines
* Move include lock.h to fsp-console.h from console.hStewart Smith2018-06-181-1/+0
| | | | | | It's only used there, let's minimise our needed includes. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* mambo: add mprintf()Oliver O'Halloran2017-01-101-0/+2
| | | | | | | | | | mprintf() is printf(), but it goes straight to the mambo console. This allows it to be independent of Skiboot's actual console infrastructure so it can be used for debugging the console drivers and for debugging code that runs before the console is setup. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: remove force_dummy_console()Oliver O'Halloran2017-01-041-2/+0
| | | | | | | | | | force_dummy_console() was only ever used to ensure the dummy console would be initialised when the platform did not setup it's usual console. The new console init path will uses the dummy console by default so this is now unnecessary. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: remove con_ops->flush()Oliver O'Halloran2017-01-041-1/+0
| | | | | | | | | Flushing the OPAL console is now handled by a driver specific OPAL call handler so this can be removed. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: use opal_con_ops APIOliver O'Halloran2017-01-041-0/+3
| | | | | | | | | | | | | | | | | | Adds a new structure that contains the implementations of the various OPAL console handlers. This is intended to replace the existing ad-hoc mechanism where the OPAL call handlers are overwritten in the OPAL console driver's init function. Currently this just moves the site where the OPAL call handlers are overwritten to inside of console.c, but it is intended to give us a mechanism for implementing features such as pointer validation for the OPAL console calls without having to manually update each driver. This also helps to clarify differences between the internal (skiboot) console and the external (OPAL) console. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: add opal_con_ops structureOliver O'Halloran2017-01-041-0/+27
| | | | | | | | | | Adds a separate structure to house the operations for the OPAL console. This is used to define a new API for dealing with the OPAL console in the next patch. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: move mambo con_ops into the platformOliver O'Halloran2017-01-041-2/+1
| | | | | | | | | There's no need for this to be in the skiboot core console code. Also do a few cleanups while we're shovling code around. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: add helper to create serial console nodesOliver O'Halloran2017-01-041-0/+3
| | | | | | | | | | The creation of /ibm,skiboot/console/serial@<xyz> nodes is pretty much identical across the various OPAL console drivers. This patch moves it into a helper function as a cleanup. Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: unexport con_lockOliver O'Halloran2017-01-041-2/+0
| | | | | | | | | | The skiboot console lock protects the skiboot log buffer. All writes to the log buffer need to be done via console_write() so there is no need to export the lock outside console.c Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: don't use __flush_console() outside console.cOliver O'Halloran2017-01-041-1/+0
| | | | | | | | | | | There is only one use of this function outside of console.c and that usage is broken. As the name suggests this is an internal function that is only safe when the console lock held is held. flush_console() will acquire the lock for the caller so that should be used instead. Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mambo: Convert console read/write from asm to CMichael Neuling2016-11-021-2/+2
| | | | | | | | Also changes the function name: mambo_read/write() -> mambo_console_read/write() Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* uart: Cleanup initialization and remove simulator hackBenjamin Herrenschmidt2016-07-061-1/+0
| | | | | | | | | | Add more generic support for MMIO based UARTs, simplify code, use common initialization, and clean up the device-tree representation as well. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Enable Simics UART consoleRyan Grimm2016-03-071-0/+1
| | | | | | | | | | | | | The UART is a simulated ns16550 with memory mapped registers. A /simics dt node is detected and a SIMICS_QUIRK is added to chip quirks similar to MAMBO_CALLOUTS. It can contain an ns16550 dt node with a property console-bar. The LPC UART code is reused and this will work without an LPC bus in the model. Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add OPAL_CONSOLE_FLUSH to the OPAL APIRussell Currey2016-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | uart consoles only flush output when polled. The Linux kernel calls these pollers frequently, except when in a panic state. As such, panic messages are not fully printed unless the system is configured to reboot after panic. This patch adds a new call to the OPAL API to flush the buffer. If the system has a uart console (i.e. BMC machines), it will incrementally flush the buffer, returning if there is more to be flushed or not. If the system has a different console, the function will have no effect. This will allow the Linux kernel to ensure that panic message have been fully printed out. The existing synchronous flushing mechanism used in OPAL's shutdown and reboot routines has been refactored into a helper that repeatedly calls the new partial flush function. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* console: Completely flush output buffer before power down and rebootRussell Currey2015-11-091-0/+3
| | | | | | | | | | | | | | | | | | | | | Completely flush the output buffer of the console driver before power down and reboot. Implements the flushing function for uart consoles, which includes the astbmc and rhesus platforms. Adds a new function, flush(), to the con_ops struct that allows each console driver to specify how their output buffers are flushed. In the cec_power_down and cec_reboot functions, the flush function of the driver is called if it exists. This fixes an issue where some console output is sometimes lost before power down or reboot in uart consoles. If this issue is also prevalent in other console types then it can be fixed later by adding a .flush to that driver's con_ops. Signed-off-by: Russell Currey <ruscur@russell.cc> [stewart@linux.vnet.ibm.com: reduce diff size, change flush function name] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: MEMCONS_MAGIC is a longCédric Le Goater2015-02-261-1/+1
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add tweaks to work in Mambo simulatorBenjamin Herrenschmidt2014-12-011-0/+5
| | | | | | | | | | | Mambo doesn't implement various things such as PBA SCOMs, LPC, ChipTOD, etc... It also provides a special console hook. This adds detection of Mambo via the /mambo node, and enables us to boot all the way to Linux. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* uart: Give UART it's own OPAL console callbacks instead of dummy consoleBenjamin Herrenschmidt2014-10-151-2/+0
| | | | | | | | | | | This means the Linux output no longer gets into our internal log, which makes dumping of it from Linux a lot nicer. It will also allow us to improve the way we do the bufferring for Linux and to exploit eventually the TX interrupts. It will also allow us to implement some form of timeouts for the OPAL console variant of it so we don't get stuck of the BMC doesn't consume from the virtual UART. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Write log messages with log_level > PR_NOTICE only to in memory logStewart Smith2014-08-081-1/+4
| | | | | | | | | | | We modify write() (adding console_write()) which calls down to a modified __flush_console() which can now decide if it's flushing the added console contents to the console drivers or not. A future patch may add support for changing PR_NOTICE to some other level Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+68
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud