Skip to content

Commit

Permalink
superio driver to control accesss to SIO registers
Browse files Browse the repository at this point in the history
The SuperIO driver makes accesses to the SIO chip from the console and
pnor module thread safe.

Change-Id: Ib07dea2867d14684806c56cd965b26c95810f7f3
RTC:115576
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20928
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
  • Loading branch information
Manali Kumar authored and A. Patrick Williams III committed Dec 8, 2015
1 parent dee70f6 commit 1fbe5e7
Show file tree
Hide file tree
Showing 18 changed files with 1,452 additions and 825 deletions.
17 changes: 17 additions & 0 deletions src/include/usr/devicefw/userif.H
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ namespace DeviceFW
IPMIBT, // As opposed to other phy's
PVPD,
TPM,
SIO,
AHB_SIO,

LAST_ACCESS_TYPE,
};
Expand Down Expand Up @@ -214,6 +216,21 @@ namespace DeviceFW
DeviceFW::LPC, static_cast<uint64_t>(( i_trans_type )),\
static_cast<uint64_t>(( i_address ))

/**
* Construct the device addressing parameters for the SIO device ops.
* @param[i] i_device - SIO device to operate on
* @param[i] i_address - SIO address to operate on
*/
#define DEVICE_SIO_ADDRESS(i_device, i_address)\
DeviceFW::SIO, static_cast<uint64_t>((i_device)),\
static_cast<uint64_t>((i_address))

/**
* Construct the device addressing parameters for the AHB_SIO device ops.
* @param[i] i_address - AHB_SIO address to operate on
*/
#define DEVICE_AHB_SIO_ADDRESS(i_address)\
DeviceFW::AHB_SIO, static_cast<uint64_t>((i_address))

/**
* Construct the device addressing parameters for the EEPROM device ops.
Expand Down
8 changes: 8 additions & 0 deletions src/include/usr/hbotcompid.H
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ const compId_t FIPS_ERRL_COMP_ID = 0x3100;
const char FIPS_ERRL_COMP_NAME[] = "hb-trace";
//@}

/** @name SIO
* SIO driver
*/
//@{
const compId_t SIO_COMP_ID = 0x3200;
const char SIO_COMP_NAME[] = "sio";
//@}

/** @name PRDF
* PRDF component
* @Note PRDF_COMP_ID=0xE500 matches with what
Expand Down
51 changes: 51 additions & 0 deletions src/include/usr/sio/sio.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/include/usr/sio/sio.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
#ifndef __SIO_SIO_H
#define __SIO_SIO_H

namespace SIO
{
/**
* SIO constants
*/
enum{
SIO_DEVICE_SELECT_REG = 0x07, /**< Regsiter to select SIO device */
SIO_ADDR_REG_2E = 0x2E, /**< SuperIO address register */
SIO_DATA_REG_2F = 0x2F, /**< SuperIO data register */
SIO_PASSWORD_REG = 0xA5, /**< SuperIO password register (to be unlocked to access SIO) */
SUART1 = 0x02, /**< SIO device */
iLPC2AHB = 0x0D, /**< SIO device */
KBC = 0x05, /**< SIO device: Keyboard Controller */
MB = 0x0E, /**< SIO device: Mailbox */
DONT_CARE = 0x02, /**< SIO device: Don't care for boot flags version */
ENABLE_DEVICE = 0x01, /**< Enable SIO device by writing 1 to reg 30 of device */
DISABLE_DEVICE = 0x00, /**< Disable SIO device by writing 0 to reg 30 of device */
SIO_iLPC2AHB_LENGTH = 0x02, /**< SIO to iLPC2AHB length */
SIO_ILPC2AHB_TRIGGER = 0xCF, /**< Read/Write 0xCF to reg FE of iLPC2AHB to trigger read/write for SIO/iLPC2AHB */
SIO_SCRATCH_REG1 = 0x21, /**< Scratch Reg */
SIO_SCRATCH_REG2 = 0x22, /**< Scratch Reg */
};
}
#endif
2 changes: 2 additions & 0 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ BASE_MODULES += secureboot_base
BASE_MODULES += lpc
BASE_MODULES += pnor
BASE_MODULES += vfs
BASE_MODULES += $(if $(CONFIG_AST2400), sio)

EXTENDED_MODULES += targeting
EXTENDED_MODULES += ecmddatabuffer
Expand Down Expand Up @@ -208,6 +209,7 @@ TESTCASE_MODULES += testrtloader
TESTCASE_MODULES += testsbe
TESTCASE_MODULES += testlpc
TESTCASE_MODULES += $(if $(CONFIG_HTMGT),testhtmgt)
TESTCASE_MODULES += $(if $(CONFIG_AST2400), testsio)

RUNTIME_OBJECTS += rt_start.o
RUNTIME_OBJECTS += rt_main.o
Expand Down
8 changes: 7 additions & 1 deletion src/usr/console/HBconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
config CONSOLE
default y if BMC_AST2400
default y if (BMC_AST2400 || CONSOLE_DEFAULT_UART)
help
Enable console support.

config CONSOLE_DEFAULT_UART
default n
depends on !BMC_AST2400
help
Enable a default UART driver for the console.
Loading

0 comments on commit 1fbe5e7

Please sign in to comment.