On 21/2/20 2:27 pm, Alastair D'Silva wrote:
From: Alastair D'Silva <alastair@xxxxxxxxxxx> These values have been taken from the device specifications. Signed-off-by: Alastair D'Silva <alastair@xxxxxxxxxxx>
I've compared these values against the internal version of the device specifications that I have access to, and they appear to match.
A few minor comments below, otherwise: Reviewed-by: Andrew Donnellan <ajd@xxxxxxxxxxxxx>
+#define GLOBAL_MMIO_HCI_ACRW BIT_ULL(0) +#define GLOBAL_MMIO_HCI_NSCRW BIT_ULL(1) +#define GLOBAL_MMIO_HCI_AFU_RESET BIT_ULL(2) +#define GLOBAL_MMIO_HCI_FW_DEBUG BIT_ULL(3) +#define GLOBAL_MMIO_HCI_CONTROLLER_DUMP BIT_ULL(4) +#define GLOBAL_MMIO_HCI_CONTROLLER_DUMP_COLLECTED BIT_ULL(5) +#define GLOBAL_MMIO_HCI_REQ_HEALTH_PERF BIT_ULL(6)
The labelling of some of these bits deviates from the standard abbreviations in the spec, which is fine I guess as these names are more descriptive, but maybe add a brief comment with the original abbreviation?
+ +#define ADMIN_COMMAND_HEARTBEAT 0x00u +#define ADMIN_COMMAND_SHUTDOWN 0x01u +#define ADMIN_COMMAND_FW_UPDATE 0x02u +#define ADMIN_COMMAND_FW_DEBUG 0x03u +#define ADMIN_COMMAND_ERRLOG 0x04u +#define ADMIN_COMMAND_SMART 0x05u +#define ADMIN_COMMAND_CONTROLLER_STATS 0x06u +#define ADMIN_COMMAND_CONTROLLER_DUMP 0x07u +#define ADMIN_COMMAND_CMD_CAPS 0x08u +#define ADMIN_COMMAND_MAX 0x08u + +#define STATUS_SUCCESS 0x00 +#define STATUS_MEM_UNAVAILABLE 0x20
There's also a "blocked on account of background task" code, 0x21.
+#define STATUS_BAD_OPCODE 0x50 +#define STATUS_BAD_REQUEST_PARM 0x51 +#define STATUS_BAD_DATA_PARM 0x52 +#define STATUS_DEBUG_BLOCKED 0x70 +#define STATUS_FAIL 0xFF + +#define STATUS_FW_UPDATE_BLOCKED 0x21 +#define STATUS_FW_ARG_INVALID 0x51 +#define STATUS_FW_INVALID 0x52
These status codes seem, from the specification, to correspond to the generic error codes above, so perhaps they're not needed.
-- Andrew Donnellan OzLabs, ADL Canberra ajd@xxxxxxxxxxxxx IBM Australia Limited