summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorStewart Smith <stewart@flamingspork.com>2020-01-29 13:38:01 -0600
committerRAJA DAS <rajadas2@in.ibm.com>2020-02-04 07:58:39 -0600
commit7c74ddaef092837bb14eed0aaf3cc65f9a0490d8 (patch)
tree65e179f8eae85f95e9b9399fb471555a6da52b9c /src/sbefw
parent462aea8b0872200c15e0dc0bf6863a3e0e17223c (diff)
downloadtalos-sbe-7c74ddaef092837bb14eed0aaf3cc65f9a0490d8.tar.gz
talos-sbe-7c74ddaef092837bb14eed0aaf3cc65f9a0490d8.zip
Use full UART TX buffer (shave 5s off booting)
This patch makes us use the full TX buffer of the UART rather than waiting for each character to go through. This practically means we get a *massive* IPL speed up. Measured on my Raptor Blackbird with P9N DD2.21, from "Welcome to SBE" to "Booting Hostboot" (timed on a stopwatch): Before (with UART output): 15 seconds With this patch (with UART output): 10 seconds. A full 33% reduction in boot time for SBE is nothing to sneeze at! Change-Id: Iac50d4b820f3b998e55e5f6e0bff60b067c1df45 Signed-off-by: Stewart Smith <stewart@flamingspork.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90587 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Andrew R Jeffery <andrewrj@au1.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/core/sbeConsole.C34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/sbefw/core/sbeConsole.C b/src/sbefw/core/sbeConsole.C
index d3d3f3f6..a79974f2 100644
--- a/src/sbefw/core/sbeConsole.C
+++ b/src/sbefw/core/sbeConsole.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -165,7 +165,9 @@ static void uartPutChar(char c)
{
#define SBE_FUNC "uartPutChar"
uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
- do {
+ static unsigned char tx_room = 16;
+ if(tx_room < 1)
+ {
static const uint64_t DELAY_NS = 100;
static const uint64_t DELAY_LOOPS = 100000000;
@@ -188,27 +190,21 @@ static void uartPutChar(char c)
if(rc != SBE_SEC_OPERATION_SUCCESSFUL)
{
SBE_ERROR(SBE_FUNC " LSR read error.");
- break;
- }
- if(data == LSR_BAD)
- {
+ } else if(data == LSR_BAD) {
SBE_ERROR(SBE_FUNC " LSR_BAD data error.");
- break;
- }
- if(loops >= DELAY_LOOPS)
- {
+ } else if(loops >= DELAY_LOOPS) {
SBE_ERROR(SBE_FUNC " FIFO timeout.");
- break;
- }
-
- rc = writeReg(THR, c);
- if(rc != SBE_SEC_OPERATION_SUCCESSFUL)
- {
- SBE_ERROR(SBE_FUNC " failure to write THR");
- break;
+ } else {
+ tx_room = 16;
}
+ }
- } while(0);
+ rc = writeReg(THR, c);
+ if(rc != SBE_SEC_OPERATION_SUCCESSFUL) {
+ SBE_ERROR(SBE_FUNC " failure to write THR");
+ } else {
+ tx_room--;
+ }
#undef SBE_FUNC
}
OpenPOWER on IntegriCloud