On machines using OPAL the serial output can be corrupted if OS writes too fast since driver doesn't retry if OPAL is BUSY. This is well visible reading the output of "dmesg" or cat a long file, user will find missing chars and mixed parts of two different lines.
This patch adds OPAL_CONSOLE_WRITE error handling and implements a call to OPAL_CONSOLE_WRITE_BUFFER_SPACE to verify if there's enough space on opal console before writing to it.
The patch was tested on Raptor Blackbird using a serial cable connected to another machine. Tested target is powerpc64 (BE)