Skip to content

Commit

Permalink
console: ast2400: Indicate SP has met configuration requirements
Browse files Browse the repository at this point in the history
If the service processor has pre-configured the hardware to the state
required by the host firmware it can set a bit to indicate this. If the
bit is set, avoid touching the UART configuration.

Change-Id: I96d228b5d89749eb531522e4ae90396b47776c43
Signed-off-by: Andrew Jeffery <andrewrj@au1.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62506
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Disable-CI: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Disable-CI: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Andrew Jeffery authored and dcrowell77 committed Jul 25, 2018
1 parent 8f9c605 commit de06d0f
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions src/usr/console/ast2400.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,9 +40,6 @@ namespace CONSOLE
const uint32_t VUART1_ADDRL = VUART1_BASE + 0x28;
const uint32_t VUART1_ADDRH = VUART1_BASE + 0x2c;

// used to test config flags related to console output selection
const uint8_t CONFIG_MASK = 0xC0;

/** Overload the base class with Ast2400 specifics.
*
* In initialization we need to program the SIO device on the AST2400 to
Expand All @@ -51,6 +48,21 @@ namespace CONSOLE
class Ast2400Uart : public Uart
{
public:
enum platFlagsMask_t
{
/**
* @brief ISOLATE_SP flag
*
* If the ISOLATE_SP flag is set, then the service processor must
* configure:
*
* 1. A UART device at 0x3f8, SIRQ 4, low polarity
* 2. The BT device at 0xe4, SIRQ 10, low polarity
*/
ISOLATE_SP = 0x01,
CONSOLE_FLAGS = 0xc0,
};

enum consoleConfig_t
{
NONE = 0x00, // No output selected
Expand Down Expand Up @@ -281,7 +293,7 @@ namespace CONSOLE

errlHndl_t l_err = NULL;
size_t l_len = sizeof(uint8_t);
uint8_t uart_config = 0x00;
uint8_t plat_config = 0x00;

do
{
Expand All @@ -297,16 +309,23 @@ namespace CONSOLE
{
l_err = deviceOp( DeviceFW::READ,
TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
&(uart_config),
&(plat_config),
l_len,
DEVICE_SIO_ADDRESS(SIO::SUART1, 0x2d));
if (l_err) { break; }

if (plat_config & ISOLATE_SP)
{
printk("ast2400: UART configured by BMC\n");
Uart::initialize();
break;
}

// determine which config has been selected
consoleConfig_t config =
static_cast<consoleConfig_t>(uart_config & CONFIG_MASK);
consoleConfig_t uart_config =
static_cast<consoleConfig_t>(plat_config & CONSOLE_FLAGS);

switch ( config )
switch ( uart_config )
{
case SELECT_SUART:
{
Expand Down

0 comments on commit de06d0f

Please sign in to comment.