From de06d0f09c74f1bcf777716fb33db356b320dcf6 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Mon, 16 Jul 2018 16:09:14 +0930 Subject: console: ast2400: Indicate SP has met configuration requirements 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 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62506 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Dean Sanner Tested-by: Jenkins OP HW Reviewed-by: Nicholas E. Bofferding Disable-CI: Nicholas E. Bofferding Disable-CI: Daniel M. Crowell Reviewed-by: Daniel M. Crowell --- src/usr/console/ast2400.C | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/usr/console/ast2400.C b/src/usr/console/ast2400.C index 43ec9ef6b..0fd7f4b53 100644 --- a/src/usr/console/ast2400.C +++ b/src/usr/console/ast2400.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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 @@ -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 @@ -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 { @@ -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(uart_config & CONFIG_MASK); + consoleConfig_t uart_config = + static_cast(plat_config & CONSOLE_FLAGS); - switch ( config ) + switch ( uart_config ) { case SELECT_SUART: { -- cgit v1.2.1