Skip to content

Commit

Permalink
Use full UART TX buffer (shave 5s off booting)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stewartsmith authored and RAJA DAS committed Feb 4, 2020
1 parent 462aea8 commit 7c74dda
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/sbefw/core/sbeConsole.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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;

Expand All @@ -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
}
Expand Down

0 comments on commit 7c74dda

Please sign in to comment.