diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2016-12-21 15:52:29 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-01-04 17:15:34 +1100 |
commit | 6f7bd78463e051dad239b349caf5dd641e2a4dd7 (patch) | |
tree | 42cc3630d9309c1f88a3beb411fcce7f4289493b /include/console.h | |
parent | aa586d259b58c676d0d90f9981671438442eadbe (diff) | |
download | blackbird-skiboot-6f7bd78463e051dad239b349caf5dd641e2a4dd7.tar.gz blackbird-skiboot-6f7bd78463e051dad239b349caf5dd641e2a4dd7.zip |
console: add opal_con_ops structure
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>
Diffstat (limited to 'include/console.h')
-rw-r--r-- | include/console.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h index 08d2961e..e821ce70 100644 --- a/include/console.h +++ b/include/console.h @@ -54,6 +54,28 @@ struct con_ops { int64_t (*flush)(void); }; +struct opal_con_ops { + const char *name; + + /* + * OPAL console driver specific init function. + */ + void (*init)(void); + + int64_t (*write)(int64_t term, int64_t *len, const uint8_t *buf); + int64_t (*read)(int64_t term, int64_t *len, uint8_t *buf); + + /* + * returns the amount of space available in the console write buffer + */ + int64_t (*space)(int64_t term_number, int64_t *length); + + /* + * Forces the write buffer to be flushed by the driver + */ + int64_t (*flush)(int64_t term_number); +}; + extern bool dummy_console_enabled(void); extern void force_dummy_console(void); extern bool flush_console(void); @@ -73,4 +95,9 @@ extern void dummy_console_add_nodes(void); struct dt_node *add_opal_console_node(int index, const char *type, uint32_t write_buffer_size); +/* OPAL console drivers */ +extern struct opal_con_ops uart_opal_con; +extern struct opal_con_ops fsp_opal_con; +extern struct opal_con_ops dummy_opal_con; + #endif /* __CONSOLE_H */ |