162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci/*
462306a36Sopenharmony_ci * This is the Fusion MPT base driver providing common API layer interface
562306a36Sopenharmony_ci * to store diag trigger values into persistent driver triggers pages
662306a36Sopenharmony_ci * for MPT (Message Passing Technology) based controllers.
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Copyright (C) 2020  Broadcom Inc.
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * Authors: Broadcom Inc.
1162306a36Sopenharmony_ci * Sreekanth Reddy  <sreekanth.reddy@broadcom.com>
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci * Send feedback to : MPT-FusionLinux.pdl@broadcom.com)
1462306a36Sopenharmony_ci */
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#include "mpi/mpi2_cnfg.h"
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#ifndef MPI2_TRIGGER_PAGES_H
1962306a36Sopenharmony_ci#define MPI2_TRIGGER_PAGES_H
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER    (0xE0)
2262306a36Sopenharmony_ci#define MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION               (0x01)
2362306a36Sopenharmony_citypedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_0 {
2462306a36Sopenharmony_ci	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
2562306a36Sopenharmony_ci	U16	TriggerFlags;		/* 0x08  */
2662306a36Sopenharmony_ci	U16	Reserved0xA;		/* 0x0A */
2762306a36Sopenharmony_ci	U32	Reserved0xC[61];	/* 0x0C */
2862306a36Sopenharmony_ci} _MPI26_CONFIG_PAGE_DRIVER_TIGGER_0, Mpi26DriverTriggerPage0_t;
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/* Trigger Flags */
3162306a36Sopenharmony_ci#define  MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID       (0x0001)
3262306a36Sopenharmony_ci#define  MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID    (0x0002)
3362306a36Sopenharmony_ci#define  MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID   (0x0004)
3462306a36Sopenharmony_ci#define  MPI26_DRIVER_TRIGGER0_FLAG_LOGINFO_TRIGGER_VALID      (0x0008)
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION               (0x01)
3762306a36Sopenharmony_citypedef struct _MPI26_DRIVER_MASTER_TIGGER_ENTRY {
3862306a36Sopenharmony_ci	U32	MasterTriggerFlags;
3962306a36Sopenharmony_ci} MPI26_DRIVER_MASTER_TIGGER_ENTRY;
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define MPI26_MAX_MASTER_TRIGGERS                                   (1)
4262306a36Sopenharmony_citypedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_1 {
4362306a36Sopenharmony_ci	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00 */
4462306a36Sopenharmony_ci	U16	NumMasterTrigger;	/* 0x08 */
4562306a36Sopenharmony_ci	U16	Reserved0xA;		/* 0x0A */
4662306a36Sopenharmony_ci	MPI26_DRIVER_MASTER_TIGGER_ENTRY MasterTriggers[MPI26_MAX_MASTER_TRIGGERS];	/* 0x0C */
4762306a36Sopenharmony_ci} MPI26_CONFIG_PAGE_DRIVER_TIGGER_1, Mpi26DriverTriggerPage1_t;
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION               (0x01)
5062306a36Sopenharmony_citypedef struct _MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY {
5162306a36Sopenharmony_ci	U16	MPIEventCode;		/* 0x00 */
5262306a36Sopenharmony_ci	U16	MPIEventCodeSpecific;	/* 0x02 */
5362306a36Sopenharmony_ci} MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY;
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci#define MPI26_MAX_MPI_EVENT_TRIGGERS                            (20)
5662306a36Sopenharmony_citypedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_2 {
5762306a36Sopenharmony_ci	MPI2_CONFIG_EXTENDED_PAGE_HEADER        Header;	/* 0x00  */
5862306a36Sopenharmony_ci	U16	NumMPIEventTrigger;     /* 0x08  */
5962306a36Sopenharmony_ci	U16	Reserved0xA;		/* 0x0A */
6062306a36Sopenharmony_ci	MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY MPIEventTriggers[MPI26_MAX_MPI_EVENT_TRIGGERS]; /* 0x0C */
6162306a36Sopenharmony_ci} MPI26_CONFIG_PAGE_DRIVER_TIGGER_2, Mpi26DriverTriggerPage2_t;
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION               (0x01)
6462306a36Sopenharmony_citypedef struct _MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY {
6562306a36Sopenharmony_ci	U8     ASCQ;		/* 0x00 */
6662306a36Sopenharmony_ci	U8     ASC;		/* 0x01 */
6762306a36Sopenharmony_ci	U8     SenseKey;	/* 0x02 */
6862306a36Sopenharmony_ci	U8     Reserved;	/* 0x03 */
6962306a36Sopenharmony_ci} MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY;
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define MPI26_MAX_SCSI_SENSE_TRIGGERS                            (20)
7262306a36Sopenharmony_citypedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_3 {
7362306a36Sopenharmony_ci	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
7462306a36Sopenharmony_ci	U16	NumSCSISenseTrigger;			/* 0x08  */
7562306a36Sopenharmony_ci	U16	Reserved0xA;				/* 0x0A */
7662306a36Sopenharmony_ci	MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY SCSISenseTriggers[MPI26_MAX_SCSI_SENSE_TRIGGERS];	/* 0x0C */
7762306a36Sopenharmony_ci} MPI26_CONFIG_PAGE_DRIVER_TIGGER_3, Mpi26DriverTriggerPage3_t;
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION               (0x01)
8062306a36Sopenharmony_citypedef struct _MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY {
8162306a36Sopenharmony_ci	U16        IOCStatus;      /* 0x00 */
8262306a36Sopenharmony_ci	U16        Reserved;       /* 0x02 */
8362306a36Sopenharmony_ci	U32        LogInfo;        /* 0x04 */
8462306a36Sopenharmony_ci} MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY;
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define MPI26_MAX_LOGINFO_TRIGGERS                            (20)
8762306a36Sopenharmony_citypedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_4 {
8862306a36Sopenharmony_ci	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
8962306a36Sopenharmony_ci	U16	NumIOCStatusLogInfoTrigger;		/* 0x08  */
9062306a36Sopenharmony_ci	U16	Reserved0xA;				/* 0x0A */
9162306a36Sopenharmony_ci	MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY IOCStatusLoginfoTriggers[MPI26_MAX_LOGINFO_TRIGGERS];	/* 0x0C */
9262306a36Sopenharmony_ci} MPI26_CONFIG_PAGE_DRIVER_TIGGER_4, Mpi26DriverTriggerPage4_t;
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#endif
95