From f538d4cbe355a98be2675468da6f3a24078893e8 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Fri, 17 Feb 2012 15:50:22 -0600 Subject: Base Mailbox device driver read/write function Change-Id: I71cee7950d4dff6279422b6ee7fbcc94dcfaf8df Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/679 Reviewed-by: A. Patrick Williams III Tested-by: Jenkins Server --- src/include/usr/devicefw/userif.H | 13 +++++----- src/include/usr/hbotcompid.H | 9 +++++-- src/include/usr/mbox/mbox_reasoncodes.H | 46 +++++++++++++++++++++++++++++++++ src/include/usr/mbox/mboxif.H | 41 +++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 src/include/usr/mbox/mbox_reasoncodes.H create mode 100644 src/include/usr/mbox/mboxif.H (limited to 'src/include/usr') diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 336bce720..8d95db3a9 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -63,12 +63,6 @@ namespace DeviceFW #define DEVICE_PRESENT_ADDRESS() \ DeviceFW::PRESENT - /** Construct the device addressing parameters for FSI device ops. - * @param[in] i_address - FSI address to operate on. - */ - #define DEVICE_FSI_ADDRESS(i_address) \ - DeviceFW::FSI, static_cast((i_address)) - /** * Construct a PNOR DD address * address = 0000_0000_0000_000c_aaaa_aaaa_aaaa_aaaa @@ -94,6 +88,13 @@ namespace DeviceFW #define DEVICE_SPD_ADDRESS( i_keyword )\ DeviceFW::SPD, static_cast(( i_keyword )) + /** + * Construct the device addressing parameters for the MAILBOX device. + * @param[out] o_status - Set with all available status bits + * from MBOX::MboxReadStatus + */ + #define DEVICE_MBOX_ADDRESS(o_status) \ + DeviceFW::MAILBOX, static_cast((o_status)) /** * @brief Perform a hardware read operation. diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H index 0c36827a3..6e812ea5b 100644 --- a/src/include/usr/hbotcompid.H +++ b/src/include/usr/hbotcompid.H @@ -170,7 +170,6 @@ const compId_t INTR_COMP_ID = 0x0F00; const char INTR_COMP_NAME[] = "intr"; //@} - /** @name SPD * EEPROM device driver component */ @@ -179,6 +178,13 @@ const compId_t SPD_COMP_ID = 0x1000; const char SPD_COMP_NAME[] = "spd"; //@} +/** @name MBOX + * MBOX component + */ +//@{ +const compId_t MBOX_COMP_ID = 0x1100; +const char MBOX_COMP_NAME[] = "mbox"; +//@} /** @name RESERVED * Reserved component ID. x3100 is the component ID @@ -189,7 +195,6 @@ const char SPD_COMP_NAME[] = "spd"; //@{ const compId_t RESERVED_COMP_ID = 0x3100; const char RESERVED_COMP_NAME[] = "reserved"; -//@} // ---------------------------------------------------------- // CXXTEST Unit Test, reserve compid near the end... diff --git a/src/include/usr/mbox/mbox_reasoncodes.H b/src/include/usr/mbox/mbox_reasoncodes.H new file mode 100644 index 000000000..126eb2f75 --- /dev/null +++ b/src/include/usr/mbox/mbox_reasoncodes.H @@ -0,0 +1,46 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/mbox/mbox_reasoncodes.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef __MBOX_REASONCODES_H +#define __MBOX_REASONCODES_H + +#include + +namespace MBOX +{ + enum MBOXModuleId + { + MOD_MBOXDD_INVALID = 0x00, /**< Zero is an invalid module id */ + MOD_MBOXDD_READ = 0x01, + MOD_MBOXDD_WRITE = 0x02, + }; + + enum MBOXReasonCode + { + RC_INVALID_LENGTH = MBOX_COMP_ID | 0x01, + RC_INVALID_MESSAGE_TYPE = MBOX_COMP_ID | 0x02, + RC_NO_PERM_TO_SEND = MBOX_COMP_ID | 0x03, + RC_MSG_PENDING = MBOX_COMP_ID | 0x04, + }; +}; + +#endif diff --git a/src/include/usr/mbox/mboxif.H b/src/include/usr/mbox/mboxif.H new file mode 100644 index 000000000..214f73c37 --- /dev/null +++ b/src/include/usr/mbox/mboxif.H @@ -0,0 +1,41 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/mbox/mboxif.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef __MBOX_MBOXIF_H +#define __MBOX_MBOXIF_H + +namespace MBOX +{ + static const uint32_t MBOX_MAX_DATA_BYTES = 64; //16 32-bit Data Registers + + enum MboxReadStatus { + MBOX_ABORT_LAST_MSG = 0x00000040, /* Cancel Timed Out Operation */ + MBOX_DOORBELL_ERROR = 0x00000010, /* Error Set In Error Register */ + MBOX_XDN_ACK = 0x00000004, /* LBUS Data Acknowledgment */ + MBOX_DATA_PENDING = 0x00000001, /* PIB Data Pending */ + MBOX_ILLEGAL_OP = 0x08000000, /* Illegal Operation Attempted */ + MBOX_DATA_WRITE_ERR = 0x04000000, /* Write Full LBUS Mailbox Error */ + MBOX_DATA_READ_ERR = 0x02000000, /* Read Empty LBUS Mailbox Error */ + MBOX_PARITY_ERR = 0x01000000, /* LBUS RAM Parity Error Detected */ + }; +}; +#endif -- cgit v1.2.1