Add Register Class

Register is an abstract base class for real and virtual registers.  A
few examples of these registers are; HardwareRegister, ConstantRegister,
NotRegister, and AndRegister.  As a base class of register types, the
Register class creates a place where these registers can be put
together like logical building blocks.  For example, Register makes this
possible:

Register * fir = new HardwareRegister(REG_ADDRESS, REG_WIDTH,
                                      DEFAULT_CHIP_TYPE, ACCESS_RO);
Register * mask = new ConstantRegister( 0xffffffff00000000 );
Register * fir_mask = new AndRegister(fir, mask);
const BitString * bs = fir_mask->getBitString();

The getBitString function (defined by each register) provides access to
the BitString that manages each register's data.  In this example bs
will contain the result of fir & mask.

Change-Id: I497d997c1cc338c53cb04a827bf2f4aca6b781c9
Signed-off-by: Paul Greenwood <Paul.Greenwood@ibm.com>
5 files changed
tree: 899eb3fe2197cdb2ab490d771cd1a0c458efb172
  1. src/
  2. test/
  3. .gitignore
  4. LICENSE
  5. MAINTAINERS
  6. meson.build
  7. meson_options.txt
  8. README.md
README.md

openpower-libhei: Hardware Error Isolation for POWER Systems

This library is a common, portable code base for isolating errors reported by hardware registers on POWER Systems chips.

The primary consumers (and requirements drivers) will be:

Core API

See the primary API definitions for details on how to use this library.

Integration

This library is intended to be integrated into containing user applications as a set of source files (either imported, or as a git subtree/submodule).

Details TBD.

User Application Requirements and APIs

  • The method to access hardware register data will vary per user application. Therefore, this library will declare the hardware access user APIs, but each containing user application must implement the APIs for their own environment.
  • This library will not contain data regarding hardware specific information. Instead, that information will be provided by the user application in the form of the Chip Data Files.
  • Tracing, or logging, methods will vary per user application. Specifically, FSP and Hostboot firmware utilize specialized macros as a mechanism to save code image space. Therefore, the user application will need to provide a specific header file that defines these macros. Details are included in the user APIs.
  • Methods to assert programming bugs will vary per user application. Therefore, much like tracing, the user application will need to provide a specific header file that defines macros for assertion. Details are included in the user APIs.

Environment configuration

  • __HEI_READ_ONLY: When defined, it will ensure any hardware write support is disabled. Note that the Chip Data Files will contain rules for clearing and masking register bits. Both of which will require modifying hardware registers, which is not allowed by user applications like OpenBMC or FSP firmware.

Development Notes

  • The Hostboot and FSP environments only support up to C++11. Therefore, this library cannot use anything newer at this time.
  • Hostboot has a very limited environment. It does not include libc or libstdc++. However, Hostboot has implemented select functions from those libraries as needed. For details, you can reference src/include/ in the POWER Systems Hostboot firmware.