18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Marvell 88SE64xx/88SE94xx const head file
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 2007 Red Hat, Inc.
68c2ecf20Sopenharmony_ci * Copyright 2008 Marvell. <kewei@marvell.com>
78c2ecf20Sopenharmony_ci * Copyright 2009-2011 Marvell. <yuxiangl@marvell.com>
88c2ecf20Sopenharmony_ci*/
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _MV_DEFS_H_
118c2ecf20Sopenharmony_ci#define _MV_DEFS_H_
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define PCI_DEVICE_ID_ARECA_1300	0x1300
148c2ecf20Sopenharmony_ci#define PCI_DEVICE_ID_ARECA_1320	0x1320
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cienum chip_flavors {
178c2ecf20Sopenharmony_ci	chip_6320,
188c2ecf20Sopenharmony_ci	chip_6440,
198c2ecf20Sopenharmony_ci	chip_6485,
208c2ecf20Sopenharmony_ci	chip_9480,
218c2ecf20Sopenharmony_ci	chip_9180,
228c2ecf20Sopenharmony_ci	chip_9445,
238c2ecf20Sopenharmony_ci	chip_9485,
248c2ecf20Sopenharmony_ci	chip_1300,
258c2ecf20Sopenharmony_ci	chip_1320
268c2ecf20Sopenharmony_ci};
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* driver compile-time configuration */
298c2ecf20Sopenharmony_cienum driver_configuration {
308c2ecf20Sopenharmony_ci	MVS_TX_RING_SZ		= 1024,	/* TX ring size (12-bit) */
318c2ecf20Sopenharmony_ci	MVS_RX_RING_SZ		= 1024, /* RX ring size (12-bit) */
328c2ecf20Sopenharmony_ci					/* software requires power-of-2
338c2ecf20Sopenharmony_ci					   ring size */
348c2ecf20Sopenharmony_ci	MVS_SOC_SLOTS		= 64,
358c2ecf20Sopenharmony_ci	MVS_SOC_TX_RING_SZ	= MVS_SOC_SLOTS * 2,
368c2ecf20Sopenharmony_ci	MVS_SOC_RX_RING_SZ	= MVS_SOC_SLOTS * 2,
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci	MVS_SLOT_BUF_SZ		= 8192, /* cmd tbl + IU + status + PRD */
398c2ecf20Sopenharmony_ci	MVS_SSP_CMD_SZ		= 64,	/* SSP command table buffer size */
408c2ecf20Sopenharmony_ci	MVS_ATA_CMD_SZ		= 96,	/* SATA command table buffer size */
418c2ecf20Sopenharmony_ci	MVS_OAF_SZ		= 64,	/* Open address frame buffer size */
428c2ecf20Sopenharmony_ci	MVS_QUEUE_SIZE		= 64,	/* Support Queue depth */
438c2ecf20Sopenharmony_ci	MVS_SOC_CAN_QUEUE	= MVS_SOC_SLOTS - 2,
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* unchangeable hardware details */
478c2ecf20Sopenharmony_cienum hardware_details {
488c2ecf20Sopenharmony_ci	MVS_MAX_PHYS		= 8,	/* max. possible phys */
498c2ecf20Sopenharmony_ci	MVS_MAX_PORTS		= 8,	/* max. possible ports */
508c2ecf20Sopenharmony_ci	MVS_SOC_PHYS		= 4,	/* soc phys */
518c2ecf20Sopenharmony_ci	MVS_SOC_PORTS		= 4,	/* soc phys */
528c2ecf20Sopenharmony_ci	MVS_MAX_DEVICES	= 1024,	/* max supported device */
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* peripheral registers (BAR2) */
568c2ecf20Sopenharmony_cienum peripheral_registers {
578c2ecf20Sopenharmony_ci	SPI_CTL			= 0x10,	/* EEPROM control */
588c2ecf20Sopenharmony_ci	SPI_CMD			= 0x14,	/* EEPROM command */
598c2ecf20Sopenharmony_ci	SPI_DATA		= 0x18, /* EEPROM data */
608c2ecf20Sopenharmony_ci};
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_cienum peripheral_register_bits {
638c2ecf20Sopenharmony_ci	TWSI_RDY		= (1U << 7),	/* EEPROM interface ready */
648c2ecf20Sopenharmony_ci	TWSI_RD			= (1U << 4),	/* EEPROM read access */
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	SPI_ADDR_MASK		= 0x3ffff,	/* bits 17:0 */
678c2ecf20Sopenharmony_ci};
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cienum hw_register_bits {
708c2ecf20Sopenharmony_ci	/* MVS_GBL_CTL */
718c2ecf20Sopenharmony_ci	INT_EN			= (1U << 1),	/* Global int enable */
728c2ecf20Sopenharmony_ci	HBA_RST			= (1U << 0),	/* HBA reset */
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	/* MVS_GBL_INT_STAT */
758c2ecf20Sopenharmony_ci	INT_XOR			= (1U << 4),	/* XOR engine event */
768c2ecf20Sopenharmony_ci	INT_SAS_SATA		= (1U << 0),	/* SAS/SATA event */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci	/* MVS_GBL_PORT_TYPE */			/* shl for ports 1-3 */
798c2ecf20Sopenharmony_ci	SATA_TARGET		= (1U << 16),	/* port0 SATA target enable */
808c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT7 = (1U << 15),	/* port0 SAS/SATA autodetect */
818c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT6 = (1U << 14),
828c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT5 = (1U << 13),
838c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT4 = (1U << 12),
848c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT3 = (1U << 11),
858c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT2 = (1U << 10),
868c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT1 = (1U << 9),
878c2ecf20Sopenharmony_ci	MODE_AUTO_DET_PORT0 = (1U << 8),
888c2ecf20Sopenharmony_ci	MODE_AUTO_DET_EN    =	MODE_AUTO_DET_PORT0 | MODE_AUTO_DET_PORT1 |
898c2ecf20Sopenharmony_ci				MODE_AUTO_DET_PORT2 | MODE_AUTO_DET_PORT3 |
908c2ecf20Sopenharmony_ci				MODE_AUTO_DET_PORT4 | MODE_AUTO_DET_PORT5 |
918c2ecf20Sopenharmony_ci				MODE_AUTO_DET_PORT6 | MODE_AUTO_DET_PORT7,
928c2ecf20Sopenharmony_ci	MODE_SAS_PORT7_MASK = (1U << 7),  /* port0 SAS(1), SATA(0) mode */
938c2ecf20Sopenharmony_ci	MODE_SAS_PORT6_MASK = (1U << 6),
948c2ecf20Sopenharmony_ci	MODE_SAS_PORT5_MASK = (1U << 5),
958c2ecf20Sopenharmony_ci	MODE_SAS_PORT4_MASK = (1U << 4),
968c2ecf20Sopenharmony_ci	MODE_SAS_PORT3_MASK = (1U << 3),
978c2ecf20Sopenharmony_ci	MODE_SAS_PORT2_MASK = (1U << 2),
988c2ecf20Sopenharmony_ci	MODE_SAS_PORT1_MASK = (1U << 1),
998c2ecf20Sopenharmony_ci	MODE_SAS_PORT0_MASK = (1U << 0),
1008c2ecf20Sopenharmony_ci	MODE_SAS_SATA	=	MODE_SAS_PORT0_MASK | MODE_SAS_PORT1_MASK |
1018c2ecf20Sopenharmony_ci				MODE_SAS_PORT2_MASK | MODE_SAS_PORT3_MASK |
1028c2ecf20Sopenharmony_ci				MODE_SAS_PORT4_MASK | MODE_SAS_PORT5_MASK |
1038c2ecf20Sopenharmony_ci				MODE_SAS_PORT6_MASK | MODE_SAS_PORT7_MASK,
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci				/* SAS_MODE value may be
1068c2ecf20Sopenharmony_ci				 * dictated (in hw) by values
1078c2ecf20Sopenharmony_ci				 * of SATA_TARGET & AUTO_DET
1088c2ecf20Sopenharmony_ci				 */
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci	/* MVS_TX_CFG */
1118c2ecf20Sopenharmony_ci	TX_EN			= (1U << 16),	/* Enable TX */
1128c2ecf20Sopenharmony_ci	TX_RING_SZ_MASK		= 0xfff,	/* TX ring size, bits 11:0 */
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	/* MVS_RX_CFG */
1158c2ecf20Sopenharmony_ci	RX_EN			= (1U << 16),	/* Enable RX */
1168c2ecf20Sopenharmony_ci	RX_RING_SZ_MASK		= 0xfff,	/* RX ring size, bits 11:0 */
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci	/* MVS_INT_COAL */
1198c2ecf20Sopenharmony_ci	COAL_EN			= (1U << 16),	/* Enable int coalescing */
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci	/* MVS_INT_STAT, MVS_INT_MASK */
1228c2ecf20Sopenharmony_ci	CINT_I2C		= (1U << 31),	/* I2C event */
1238c2ecf20Sopenharmony_ci	CINT_SW0		= (1U << 30),	/* software event 0 */
1248c2ecf20Sopenharmony_ci	CINT_SW1		= (1U << 29),	/* software event 1 */
1258c2ecf20Sopenharmony_ci	CINT_PRD_BC		= (1U << 28),	/* PRD BC err for read cmd */
1268c2ecf20Sopenharmony_ci	CINT_DMA_PCIE		= (1U << 27),	/* DMA to PCIE timeout */
1278c2ecf20Sopenharmony_ci	CINT_MEM		= (1U << 26),	/* int mem parity err */
1288c2ecf20Sopenharmony_ci	CINT_I2C_SLAVE		= (1U << 25),	/* slave I2C event */
1298c2ecf20Sopenharmony_ci	CINT_NON_SPEC_NCQ_ERROR	= (1U << 25),	/* Non specific NCQ error */
1308c2ecf20Sopenharmony_ci	CINT_SRS		= (1U << 3),	/* SRS event */
1318c2ecf20Sopenharmony_ci	CINT_CI_STOP		= (1U << 1),	/* cmd issue stopped */
1328c2ecf20Sopenharmony_ci	CINT_DONE		= (1U << 0),	/* cmd completion */
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci						/* shl for ports 1-3 */
1358c2ecf20Sopenharmony_ci	CINT_PORT_STOPPED	= (1U << 16),	/* port0 stopped */
1368c2ecf20Sopenharmony_ci	CINT_PORT		= (1U << 8),	/* port0 event */
1378c2ecf20Sopenharmony_ci	CINT_PORT_MASK_OFFSET	= 8,
1388c2ecf20Sopenharmony_ci	CINT_PORT_MASK		= (0xFF << CINT_PORT_MASK_OFFSET),
1398c2ecf20Sopenharmony_ci	CINT_PHY_MASK_OFFSET	= 4,
1408c2ecf20Sopenharmony_ci	CINT_PHY_MASK		= (0x0F << CINT_PHY_MASK_OFFSET),
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci	/* TX (delivery) ring bits */
1438c2ecf20Sopenharmony_ci	TXQ_CMD_SHIFT		= 29,
1448c2ecf20Sopenharmony_ci	TXQ_CMD_SSP		= 1,		/* SSP protocol */
1458c2ecf20Sopenharmony_ci	TXQ_CMD_SMP		= 2,		/* SMP protocol */
1468c2ecf20Sopenharmony_ci	TXQ_CMD_STP		= 3,		/* STP/SATA protocol */
1478c2ecf20Sopenharmony_ci	TXQ_CMD_SSP_FREE_LIST	= 4,		/* add to SSP target free list */
1488c2ecf20Sopenharmony_ci	TXQ_CMD_SLOT_RESET	= 7,		/* reset command slot */
1498c2ecf20Sopenharmony_ci	TXQ_MODE_I		= (1U << 28),	/* mode: 0=target,1=initiator */
1508c2ecf20Sopenharmony_ci	TXQ_MODE_TARGET 	= 0,
1518c2ecf20Sopenharmony_ci	TXQ_MODE_INITIATOR	= 1,
1528c2ecf20Sopenharmony_ci	TXQ_PRIO_HI		= (1U << 27),	/* priority: 0=normal, 1=high */
1538c2ecf20Sopenharmony_ci	TXQ_PRI_NORMAL		= 0,
1548c2ecf20Sopenharmony_ci	TXQ_PRI_HIGH		= 1,
1558c2ecf20Sopenharmony_ci	TXQ_SRS_SHIFT		= 20,		/* SATA register set */
1568c2ecf20Sopenharmony_ci	TXQ_SRS_MASK		= 0x7f,
1578c2ecf20Sopenharmony_ci	TXQ_PHY_SHIFT		= 12,		/* PHY bitmap */
1588c2ecf20Sopenharmony_ci	TXQ_PHY_MASK		= 0xff,
1598c2ecf20Sopenharmony_ci	TXQ_SLOT_MASK		= 0xfff,	/* slot number */
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci	/* RX (completion) ring bits */
1628c2ecf20Sopenharmony_ci	RXQ_GOOD		= (1U << 23),	/* Response good */
1638c2ecf20Sopenharmony_ci	RXQ_SLOT_RESET		= (1U << 21),	/* Slot reset complete */
1648c2ecf20Sopenharmony_ci	RXQ_CMD_RX		= (1U << 20),	/* target cmd received */
1658c2ecf20Sopenharmony_ci	RXQ_ATTN		= (1U << 19),	/* attention */
1668c2ecf20Sopenharmony_ci	RXQ_RSP			= (1U << 18),	/* response frame xfer'd */
1678c2ecf20Sopenharmony_ci	RXQ_ERR			= (1U << 17),	/* err info rec xfer'd */
1688c2ecf20Sopenharmony_ci	RXQ_DONE		= (1U << 16),	/* cmd complete */
1698c2ecf20Sopenharmony_ci	RXQ_SLOT_MASK		= 0xfff,	/* slot number */
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci	/* mvs_cmd_hdr bits */
1728c2ecf20Sopenharmony_ci	MCH_PRD_LEN_SHIFT	= 16,		/* 16-bit PRD table len */
1738c2ecf20Sopenharmony_ci	MCH_SSP_FR_TYPE_SHIFT	= 13,		/* SSP frame type */
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci						/* SSP initiator only */
1768c2ecf20Sopenharmony_ci	MCH_SSP_FR_CMD		= 0x0,		/* COMMAND frame */
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci						/* SSP initiator or target */
1798c2ecf20Sopenharmony_ci	MCH_SSP_FR_TASK		= 0x1,		/* TASK frame */
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci						/* SSP target only */
1828c2ecf20Sopenharmony_ci	MCH_SSP_FR_XFER_RDY	= 0x4,		/* XFER_RDY frame */
1838c2ecf20Sopenharmony_ci	MCH_SSP_FR_RESP		= 0x5,		/* RESPONSE frame */
1848c2ecf20Sopenharmony_ci	MCH_SSP_FR_READ		= 0x6,		/* Read DATA frame(s) */
1858c2ecf20Sopenharmony_ci	MCH_SSP_FR_READ_RESP	= 0x7,		/* ditto, plus RESPONSE */
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci	MCH_SSP_MODE_PASSTHRU	= 1,
1888c2ecf20Sopenharmony_ci	MCH_SSP_MODE_NORMAL	= 0,
1898c2ecf20Sopenharmony_ci	MCH_PASSTHRU		= (1U << 12),	/* pass-through (SSP) */
1908c2ecf20Sopenharmony_ci	MCH_FBURST		= (1U << 11),	/* first burst (SSP) */
1918c2ecf20Sopenharmony_ci	MCH_CHK_LEN		= (1U << 10),	/* chk xfer len (SSP) */
1928c2ecf20Sopenharmony_ci	MCH_RETRY		= (1U << 9),	/* tport layer retry (SSP) */
1938c2ecf20Sopenharmony_ci	MCH_PROTECTION		= (1U << 8),	/* protection info rec (SSP) */
1948c2ecf20Sopenharmony_ci	MCH_RESET		= (1U << 7),	/* Reset (STP/SATA) */
1958c2ecf20Sopenharmony_ci	MCH_FPDMA		= (1U << 6),	/* First party DMA (STP/SATA) */
1968c2ecf20Sopenharmony_ci	MCH_ATAPI		= (1U << 5),	/* ATAPI (STP/SATA) */
1978c2ecf20Sopenharmony_ci	MCH_BIST		= (1U << 4),	/* BIST activate (STP/SATA) */
1988c2ecf20Sopenharmony_ci	MCH_PMP_MASK		= 0xf,		/* PMP from cmd FIS (STP/SATA)*/
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci	CCTL_RST		= (1U << 5),	/* port logic reset */
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci						/* 0(LSB first), 1(MSB first) */
2038c2ecf20Sopenharmony_ci	CCTL_ENDIAN_DATA	= (1U << 3),	/* PRD data */
2048c2ecf20Sopenharmony_ci	CCTL_ENDIAN_RSP		= (1U << 2),	/* response frame */
2058c2ecf20Sopenharmony_ci	CCTL_ENDIAN_OPEN	= (1U << 1),	/* open address frame */
2068c2ecf20Sopenharmony_ci	CCTL_ENDIAN_CMD		= (1U << 0),	/* command table */
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci	/* MVS_Px_SER_CTLSTAT (per-phy control) */
2098c2ecf20Sopenharmony_ci	PHY_SSP_RST		= (1U << 3),	/* reset SSP link layer */
2108c2ecf20Sopenharmony_ci	PHY_BCAST_CHG		= (1U << 2),	/* broadcast(change) notif */
2118c2ecf20Sopenharmony_ci	PHY_RST_HARD		= (1U << 1),	/* hard reset + phy reset */
2128c2ecf20Sopenharmony_ci	PHY_RST			= (1U << 0),	/* phy reset */
2138c2ecf20Sopenharmony_ci	PHY_READY_MASK		= (1U << 20),
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci	/* MVS_Px_INT_STAT, MVS_Px_INT_MASK (per-phy events) */
2168c2ecf20Sopenharmony_ci	PHYEV_DEC_ERR		= (1U << 24),	/* Phy Decoding Error */
2178c2ecf20Sopenharmony_ci	PHYEV_DCDR_ERR		= (1U << 23),	/* STP Deocder Error */
2188c2ecf20Sopenharmony_ci	PHYEV_CRC_ERR		= (1U << 22),	/* STP CRC Error */
2198c2ecf20Sopenharmony_ci	PHYEV_UNASSOC_FIS	= (1U << 19),	/* unassociated FIS rx'd */
2208c2ecf20Sopenharmony_ci	PHYEV_AN		= (1U << 18),	/* SATA async notification */
2218c2ecf20Sopenharmony_ci	PHYEV_BIST_ACT		= (1U << 17),	/* BIST activate FIS */
2228c2ecf20Sopenharmony_ci	PHYEV_SIG_FIS		= (1U << 16),	/* signature FIS */
2238c2ecf20Sopenharmony_ci	PHYEV_POOF		= (1U << 12),	/* phy ready from 1 -> 0 */
2248c2ecf20Sopenharmony_ci	PHYEV_IU_BIG		= (1U << 11),	/* IU too long err */
2258c2ecf20Sopenharmony_ci	PHYEV_IU_SMALL		= (1U << 10),	/* IU too short err */
2268c2ecf20Sopenharmony_ci	PHYEV_UNK_TAG		= (1U << 9),	/* unknown tag */
2278c2ecf20Sopenharmony_ci	PHYEV_BROAD_CH		= (1U << 8),	/* broadcast(CHANGE) */
2288c2ecf20Sopenharmony_ci	PHYEV_COMWAKE		= (1U << 7),	/* COMWAKE rx'd */
2298c2ecf20Sopenharmony_ci	PHYEV_PORT_SEL		= (1U << 6),	/* port selector present */
2308c2ecf20Sopenharmony_ci	PHYEV_HARD_RST		= (1U << 5),	/* hard reset rx'd */
2318c2ecf20Sopenharmony_ci	PHYEV_ID_TMOUT		= (1U << 4),	/* identify timeout */
2328c2ecf20Sopenharmony_ci	PHYEV_ID_FAIL		= (1U << 3),	/* identify failed */
2338c2ecf20Sopenharmony_ci	PHYEV_ID_DONE		= (1U << 2),	/* identify done */
2348c2ecf20Sopenharmony_ci	PHYEV_HARD_RST_DONE	= (1U << 1),	/* hard reset done */
2358c2ecf20Sopenharmony_ci	PHYEV_RDY_CH		= (1U << 0),	/* phy ready changed state */
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci	/* MVS_PCS */
2388c2ecf20Sopenharmony_ci	PCS_EN_SATA_REG_SHIFT	= (16),		/* Enable SATA Register Set */
2398c2ecf20Sopenharmony_ci	PCS_EN_PORT_XMT_SHIFT	= (12),		/* Enable Port Transmit */
2408c2ecf20Sopenharmony_ci	PCS_EN_PORT_XMT_SHIFT2	= (8),		/* For 6485 */
2418c2ecf20Sopenharmony_ci	PCS_SATA_RETRY		= (1U << 8),	/* retry ctl FIS on R_ERR */
2428c2ecf20Sopenharmony_ci	PCS_RSP_RX_EN		= (1U << 7),	/* raw response rx */
2438c2ecf20Sopenharmony_ci	PCS_SATA_RETRY_2	= (1U << 6),	/* For 9180 */
2448c2ecf20Sopenharmony_ci	PCS_SELF_CLEAR		= (1U << 5),	/* self-clearing int mode */
2458c2ecf20Sopenharmony_ci	PCS_FIS_RX_EN		= (1U << 4),	/* FIS rx enable */
2468c2ecf20Sopenharmony_ci	PCS_CMD_STOP_ERR	= (1U << 3),	/* cmd stop-on-err enable */
2478c2ecf20Sopenharmony_ci	PCS_CMD_RST		= (1U << 1),	/* reset cmd issue */
2488c2ecf20Sopenharmony_ci	PCS_CMD_EN		= (1U << 0),	/* enable cmd issue */
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci	/* Port n Attached Device Info */
2518c2ecf20Sopenharmony_ci	PORT_DEV_SSP_TRGT	= (1U << 19),
2528c2ecf20Sopenharmony_ci	PORT_DEV_SMP_TRGT	= (1U << 18),
2538c2ecf20Sopenharmony_ci	PORT_DEV_STP_TRGT	= (1U << 17),
2548c2ecf20Sopenharmony_ci	PORT_DEV_SSP_INIT	= (1U << 11),
2558c2ecf20Sopenharmony_ci	PORT_DEV_SMP_INIT	= (1U << 10),
2568c2ecf20Sopenharmony_ci	PORT_DEV_STP_INIT	= (1U << 9),
2578c2ecf20Sopenharmony_ci	PORT_PHY_ID_MASK	= (0xFFU << 24),
2588c2ecf20Sopenharmony_ci	PORT_SSP_TRGT_MASK	= (0x1U << 19),
2598c2ecf20Sopenharmony_ci	PORT_SSP_INIT_MASK	= (0x1U << 11),
2608c2ecf20Sopenharmony_ci	PORT_DEV_TRGT_MASK	= (0x7U << 17),
2618c2ecf20Sopenharmony_ci	PORT_DEV_INIT_MASK	= (0x7U << 9),
2628c2ecf20Sopenharmony_ci	PORT_DEV_TYPE_MASK	= (0x7U << 0),
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci	/* Port n PHY Status */
2658c2ecf20Sopenharmony_ci	PHY_RDY			= (1U << 2),
2668c2ecf20Sopenharmony_ci	PHY_DW_SYNC		= (1U << 1),
2678c2ecf20Sopenharmony_ci	PHY_OOB_DTCTD		= (1U << 0),
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci	/* VSR */
2708c2ecf20Sopenharmony_ci	/* PHYMODE 6 (CDB) */
2718c2ecf20Sopenharmony_ci	PHY_MODE6_LATECLK	= (1U << 29),	/* Lock Clock */
2728c2ecf20Sopenharmony_ci	PHY_MODE6_DTL_SPEED	= (1U << 27),	/* Digital Loop Speed */
2738c2ecf20Sopenharmony_ci	PHY_MODE6_FC_ORDER	= (1U << 26),	/* Fibre Channel Mode Order*/
2748c2ecf20Sopenharmony_ci	PHY_MODE6_MUCNT_EN	= (1U << 24),	/* u Count Enable */
2758c2ecf20Sopenharmony_ci	PHY_MODE6_SEL_MUCNT_LEN	= (1U << 22),	/* Training Length Select */
2768c2ecf20Sopenharmony_ci	PHY_MODE6_SELMUPI	= (1U << 20),	/* Phase Multi Select (init) */
2778c2ecf20Sopenharmony_ci	PHY_MODE6_SELMUPF	= (1U << 18),	/* Phase Multi Select (final) */
2788c2ecf20Sopenharmony_ci	PHY_MODE6_SELMUFF	= (1U << 16),	/* Freq Loop Multi Sel(final) */
2798c2ecf20Sopenharmony_ci	PHY_MODE6_SELMUFI	= (1U << 14),	/* Freq Loop Multi Sel(init) */
2808c2ecf20Sopenharmony_ci	PHY_MODE6_FREEZE_LOOP	= (1U << 12),	/* Freeze Rx CDR Loop */
2818c2ecf20Sopenharmony_ci	PHY_MODE6_INT_RXFOFFS	= (1U << 3),	/* Rx CDR Freq Loop Enable */
2828c2ecf20Sopenharmony_ci	PHY_MODE6_FRC_RXFOFFS	= (1U << 2),	/* Initial Rx CDR Offset */
2838c2ecf20Sopenharmony_ci	PHY_MODE6_STAU_0D8	= (1U << 1),	/* Rx CDR Freq Loop Saturate */
2848c2ecf20Sopenharmony_ci	PHY_MODE6_RXSAT_DIS	= (1U << 0),	/* Saturate Ctl */
2858c2ecf20Sopenharmony_ci};
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci/* SAS/SATA configuration port registers, aka phy registers */
2888c2ecf20Sopenharmony_cienum sas_sata_config_port_regs {
2898c2ecf20Sopenharmony_ci	PHYR_IDENTIFY		= 0x00,	/* info for IDENTIFY frame */
2908c2ecf20Sopenharmony_ci	PHYR_ADDR_LO		= 0x04,	/* my SAS address (low) */
2918c2ecf20Sopenharmony_ci	PHYR_ADDR_HI		= 0x08,	/* my SAS address (high) */
2928c2ecf20Sopenharmony_ci	PHYR_ATT_DEV_INFO	= 0x0C,	/* attached device info */
2938c2ecf20Sopenharmony_ci	PHYR_ATT_ADDR_LO	= 0x10,	/* attached dev SAS addr (low) */
2948c2ecf20Sopenharmony_ci	PHYR_ATT_ADDR_HI	= 0x14,	/* attached dev SAS addr (high) */
2958c2ecf20Sopenharmony_ci	PHYR_SATA_CTL		= 0x18,	/* SATA control */
2968c2ecf20Sopenharmony_ci	PHYR_PHY_STAT		= 0x1C,	/* PHY status */
2978c2ecf20Sopenharmony_ci	PHYR_SATA_SIG0	= 0x20,	/*port SATA signature FIS(Byte 0-3) */
2988c2ecf20Sopenharmony_ci	PHYR_SATA_SIG1	= 0x24,	/*port SATA signature FIS(Byte 4-7) */
2998c2ecf20Sopenharmony_ci	PHYR_SATA_SIG2	= 0x28,	/*port SATA signature FIS(Byte 8-11) */
3008c2ecf20Sopenharmony_ci	PHYR_SATA_SIG3	= 0x2c,	/*port SATA signature FIS(Byte 12-15) */
3018c2ecf20Sopenharmony_ci	PHYR_R_ERR_COUNT	= 0x30, /* port R_ERR count register */
3028c2ecf20Sopenharmony_ci	PHYR_CRC_ERR_COUNT	= 0x34, /* port CRC error count register */
3038c2ecf20Sopenharmony_ci	PHYR_WIDE_PORT	= 0x38,	/* wide port participating */
3048c2ecf20Sopenharmony_ci	PHYR_CURRENT0		= 0x80,	/* current connection info 0 */
3058c2ecf20Sopenharmony_ci	PHYR_CURRENT1		= 0x84,	/* current connection info 1 */
3068c2ecf20Sopenharmony_ci	PHYR_CURRENT2		= 0x88,	/* current connection info 2 */
3078c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME0       = 0x100, /* Port device ID frame register 0 */
3088c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME1       = 0x104, /* Port device ID frame register 1 */
3098c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME2       = 0x108, /* Port device ID frame register 2 */
3108c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME3       = 0x10c, /* Port device ID frame register 3 */
3118c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME4       = 0x110, /* Port device ID frame register 4 */
3128c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME5       = 0x114, /* Port device ID frame register 5 */
3138c2ecf20Sopenharmony_ci	CONFIG_ID_FRAME6       = 0x118, /* Port device ID frame register 6 */
3148c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME0   = 0x11c, /* attached ID frame register 0 */
3158c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME1   = 0x120, /* attached ID frame register 1 */
3168c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME2   = 0x124, /* attached ID frame register 2 */
3178c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME3   = 0x128, /* attached ID frame register 3 */
3188c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME4   = 0x12c, /* attached ID frame register 4 */
3198c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME5   = 0x130, /* attached ID frame register 5 */
3208c2ecf20Sopenharmony_ci	CONFIG_ATT_ID_FRAME6   = 0x134, /* attached ID frame register 6 */
3218c2ecf20Sopenharmony_ci};
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_cienum sas_cmd_port_registers {
3248c2ecf20Sopenharmony_ci	CMD_CMRST_OOB_DET	= 0x100, /* COMRESET OOB detect register */
3258c2ecf20Sopenharmony_ci	CMD_CMWK_OOB_DET	= 0x104, /* COMWAKE OOB detect register */
3268c2ecf20Sopenharmony_ci	CMD_CMSAS_OOB_DET	= 0x108, /* COMSAS OOB detect register */
3278c2ecf20Sopenharmony_ci	CMD_BRST_OOB_DET	= 0x10c, /* burst OOB detect register */
3288c2ecf20Sopenharmony_ci	CMD_OOB_SPACE	= 0x110, /* OOB space control register */
3298c2ecf20Sopenharmony_ci	CMD_OOB_BURST	= 0x114, /* OOB burst control register */
3308c2ecf20Sopenharmony_ci	CMD_PHY_TIMER		= 0x118, /* PHY timer control register */
3318c2ecf20Sopenharmony_ci	CMD_PHY_CONFIG0	= 0x11c, /* PHY config register 0 */
3328c2ecf20Sopenharmony_ci	CMD_PHY_CONFIG1	= 0x120, /* PHY config register 1 */
3338c2ecf20Sopenharmony_ci	CMD_SAS_CTL0		= 0x124, /* SAS control register 0 */
3348c2ecf20Sopenharmony_ci	CMD_SAS_CTL1		= 0x128, /* SAS control register 1 */
3358c2ecf20Sopenharmony_ci	CMD_SAS_CTL2		= 0x12c, /* SAS control register 2 */
3368c2ecf20Sopenharmony_ci	CMD_SAS_CTL3		= 0x130, /* SAS control register 3 */
3378c2ecf20Sopenharmony_ci	CMD_ID_TEST		= 0x134, /* ID test register */
3388c2ecf20Sopenharmony_ci	CMD_PL_TIMER		= 0x138, /* PL timer register */
3398c2ecf20Sopenharmony_ci	CMD_WD_TIMER		= 0x13c, /* WD timer register */
3408c2ecf20Sopenharmony_ci	CMD_PORT_SEL_COUNT	= 0x140, /* port selector count register */
3418c2ecf20Sopenharmony_ci	CMD_APP_MEM_CTL	= 0x144, /* Application Memory Control */
3428c2ecf20Sopenharmony_ci	CMD_XOR_MEM_CTL	= 0x148, /* XOR Block Memory Control */
3438c2ecf20Sopenharmony_ci	CMD_DMA_MEM_CTL	= 0x14c, /* DMA Block Memory Control */
3448c2ecf20Sopenharmony_ci	CMD_PORT_MEM_CTL0	= 0x150, /* Port Memory Control 0 */
3458c2ecf20Sopenharmony_ci	CMD_PORT_MEM_CTL1	= 0x154, /* Port Memory Control 1 */
3468c2ecf20Sopenharmony_ci	CMD_SATA_PORT_MEM_CTL0	= 0x158, /* SATA Port Memory Control 0 */
3478c2ecf20Sopenharmony_ci	CMD_SATA_PORT_MEM_CTL1	= 0x15c, /* SATA Port Memory Control 1 */
3488c2ecf20Sopenharmony_ci	CMD_XOR_MEM_BIST_CTL	= 0x160, /* XOR Memory BIST Control */
3498c2ecf20Sopenharmony_ci	CMD_XOR_MEM_BIST_STAT	= 0x164, /* XOR Memroy BIST Status */
3508c2ecf20Sopenharmony_ci	CMD_DMA_MEM_BIST_CTL	= 0x168, /* DMA Memory BIST Control */
3518c2ecf20Sopenharmony_ci	CMD_DMA_MEM_BIST_STAT	= 0x16c, /* DMA Memory BIST Status */
3528c2ecf20Sopenharmony_ci	CMD_PORT_MEM_BIST_CTL	= 0x170, /* Port Memory BIST Control */
3538c2ecf20Sopenharmony_ci	CMD_PORT_MEM_BIST_STAT0 = 0x174, /* Port Memory BIST Status 0 */
3548c2ecf20Sopenharmony_ci	CMD_PORT_MEM_BIST_STAT1 = 0x178, /* Port Memory BIST Status 1 */
3558c2ecf20Sopenharmony_ci	CMD_STP_MEM_BIST_CTL	= 0x17c, /* STP Memory BIST Control */
3568c2ecf20Sopenharmony_ci	CMD_STP_MEM_BIST_STAT0	= 0x180, /* STP Memory BIST Status 0 */
3578c2ecf20Sopenharmony_ci	CMD_STP_MEM_BIST_STAT1	= 0x184, /* STP Memory BIST Status 1 */
3588c2ecf20Sopenharmony_ci	CMD_RESET_COUNT		= 0x188, /* Reset Count */
3598c2ecf20Sopenharmony_ci	CMD_MONTR_DATA_SEL	= 0x18C, /* Monitor Data/Select */
3608c2ecf20Sopenharmony_ci	CMD_PLL_PHY_CONFIG	= 0x190, /* PLL/PHY Configuration */
3618c2ecf20Sopenharmony_ci	CMD_PHY_CTL		= 0x194, /* PHY Control and Status */
3628c2ecf20Sopenharmony_ci	CMD_PHY_TEST_COUNT0	= 0x198, /* Phy Test Count 0 */
3638c2ecf20Sopenharmony_ci	CMD_PHY_TEST_COUNT1	= 0x19C, /* Phy Test Count 1 */
3648c2ecf20Sopenharmony_ci	CMD_PHY_TEST_COUNT2	= 0x1A0, /* Phy Test Count 2 */
3658c2ecf20Sopenharmony_ci	CMD_APP_ERR_CONFIG	= 0x1A4, /* Application Error Configuration */
3668c2ecf20Sopenharmony_ci	CMD_PND_FIFO_CTL0	= 0x1A8, /* Pending FIFO Control 0 */
3678c2ecf20Sopenharmony_ci	CMD_HOST_CTL		= 0x1AC, /* Host Control Status */
3688c2ecf20Sopenharmony_ci	CMD_HOST_WR_DATA	= 0x1B0, /* Host Write Data */
3698c2ecf20Sopenharmony_ci	CMD_HOST_RD_DATA	= 0x1B4, /* Host Read Data */
3708c2ecf20Sopenharmony_ci	CMD_PHY_MODE_21		= 0x1B8, /* Phy Mode 21 */
3718c2ecf20Sopenharmony_ci	CMD_SL_MODE0		= 0x1BC, /* SL Mode 0 */
3728c2ecf20Sopenharmony_ci	CMD_SL_MODE1		= 0x1C0, /* SL Mode 1 */
3738c2ecf20Sopenharmony_ci	CMD_PND_FIFO_CTL1	= 0x1C4, /* Pending FIFO Control 1 */
3748c2ecf20Sopenharmony_ci	CMD_PORT_LAYER_TIMER1	= 0x1E0, /* Port Layer Timer 1 */
3758c2ecf20Sopenharmony_ci	CMD_LINK_TIMER		= 0x1E4, /* Link Timer */
3768c2ecf20Sopenharmony_ci};
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_cienum mvs_info_flags {
3798c2ecf20Sopenharmony_ci	MVF_PHY_PWR_FIX	= (1U << 1),	/* bug workaround */
3808c2ecf20Sopenharmony_ci	MVF_FLAG_SOC		= (1U << 2),	/* SoC integrated controllers */
3818c2ecf20Sopenharmony_ci};
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_cienum mvs_event_flags {
3848c2ecf20Sopenharmony_ci	PHY_PLUG_EVENT		= (3U),
3858c2ecf20Sopenharmony_ci	PHY_PLUG_IN		= (1U << 0),	/* phy plug in */
3868c2ecf20Sopenharmony_ci	PHY_PLUG_OUT		= (1U << 1),	/* phy plug out */
3878c2ecf20Sopenharmony_ci	EXP_BRCT_CHG		= (1U << 2),	/* broadcast change */
3888c2ecf20Sopenharmony_ci};
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_cienum mvs_port_type {
3918c2ecf20Sopenharmony_ci	PORT_TGT_MASK	=  (1U << 5),
3928c2ecf20Sopenharmony_ci	PORT_INIT_PORT	=  (1U << 4),
3938c2ecf20Sopenharmony_ci	PORT_TGT_PORT	=  (1U << 3),
3948c2ecf20Sopenharmony_ci	PORT_INIT_TGT_PORT = (PORT_INIT_PORT | PORT_TGT_PORT),
3958c2ecf20Sopenharmony_ci	PORT_TYPE_SAS	=  (1U << 1),
3968c2ecf20Sopenharmony_ci	PORT_TYPE_SATA	=  (1U << 0),
3978c2ecf20Sopenharmony_ci};
3988c2ecf20Sopenharmony_ci
3998c2ecf20Sopenharmony_ci/* Command Table Format */
4008c2ecf20Sopenharmony_cienum ct_format {
4018c2ecf20Sopenharmony_ci	/* SSP */
4028c2ecf20Sopenharmony_ci	SSP_F_H		=  0x00,
4038c2ecf20Sopenharmony_ci	SSP_F_IU	=  0x18,
4048c2ecf20Sopenharmony_ci	SSP_F_MAX	=  0x4D,
4058c2ecf20Sopenharmony_ci	/* STP */
4068c2ecf20Sopenharmony_ci	STP_CMD_FIS	=  0x00,
4078c2ecf20Sopenharmony_ci	STP_ATAPI_CMD	=  0x40,
4088c2ecf20Sopenharmony_ci	STP_F_MAX	=  0x10,
4098c2ecf20Sopenharmony_ci	/* SMP */
4108c2ecf20Sopenharmony_ci	SMP_F_T		=  0x00,
4118c2ecf20Sopenharmony_ci	SMP_F_DEP	=  0x01,
4128c2ecf20Sopenharmony_ci	SMP_F_MAX	=  0x101,
4138c2ecf20Sopenharmony_ci};
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_cienum status_buffer {
4168c2ecf20Sopenharmony_ci	SB_EIR_OFF	=  0x00,	/* Error Information Record */
4178c2ecf20Sopenharmony_ci	SB_RFB_OFF	=  0x08,	/* Response Frame Buffer */
4188c2ecf20Sopenharmony_ci	SB_RFB_MAX	=  0x400,	/* RFB size*/
4198c2ecf20Sopenharmony_ci};
4208c2ecf20Sopenharmony_ci
4218c2ecf20Sopenharmony_cienum error_info_rec {
4228c2ecf20Sopenharmony_ci	CMD_ISS_STPD	= (1U << 31),	/* Cmd Issue Stopped */
4238c2ecf20Sopenharmony_ci	CMD_PI_ERR	= (1U << 30),	/* Protection info error.  see flags2 */
4248c2ecf20Sopenharmony_ci	RSP_OVER	= (1U << 29),	/* rsp buffer overflow */
4258c2ecf20Sopenharmony_ci	RETRY_LIM	= (1U << 28),	/* FIS/frame retry limit exceeded */
4268c2ecf20Sopenharmony_ci	UNK_FIS 	= (1U << 27),	/* unknown FIS */
4278c2ecf20Sopenharmony_ci	DMA_TERM	= (1U << 26),	/* DMA terminate primitive rx'd */
4288c2ecf20Sopenharmony_ci	SYNC_ERR	= (1U << 25),	/* SYNC rx'd during frame xmit */
4298c2ecf20Sopenharmony_ci	TFILE_ERR	= (1U << 24),	/* SATA taskfile Error bit set */
4308c2ecf20Sopenharmony_ci	R_ERR		= (1U << 23),	/* SATA returned R_ERR prim */
4318c2ecf20Sopenharmony_ci	RD_OFS		= (1U << 20),	/* Read DATA frame invalid offset */
4328c2ecf20Sopenharmony_ci	XFER_RDY_OFS	= (1U << 19),	/* XFER_RDY offset error */
4338c2ecf20Sopenharmony_ci	UNEXP_XFER_RDY	= (1U << 18),	/* unexpected XFER_RDY error */
4348c2ecf20Sopenharmony_ci	DATA_OVER_UNDER = (1U << 16),	/* data overflow/underflow */
4358c2ecf20Sopenharmony_ci	INTERLOCK	= (1U << 15),	/* interlock error */
4368c2ecf20Sopenharmony_ci	NAK		= (1U << 14),	/* NAK rx'd */
4378c2ecf20Sopenharmony_ci	ACK_NAK_TO	= (1U << 13),	/* ACK/NAK timeout */
4388c2ecf20Sopenharmony_ci	CXN_CLOSED	= (1U << 12),	/* cxn closed w/out ack/nak */
4398c2ecf20Sopenharmony_ci	OPEN_TO 	= (1U << 11),	/* I_T nexus lost, open cxn timeout */
4408c2ecf20Sopenharmony_ci	PATH_BLOCKED	= (1U << 10),	/* I_T nexus lost, pathway blocked */
4418c2ecf20Sopenharmony_ci	NO_DEST 	= (1U << 9),	/* I_T nexus lost, no destination */
4428c2ecf20Sopenharmony_ci	STP_RES_BSY	= (1U << 8),	/* STP resources busy */
4438c2ecf20Sopenharmony_ci	BREAK		= (1U << 7),	/* break received */
4448c2ecf20Sopenharmony_ci	BAD_DEST	= (1U << 6),	/* bad destination */
4458c2ecf20Sopenharmony_ci	BAD_PROTO	= (1U << 5),	/* protocol not supported */
4468c2ecf20Sopenharmony_ci	BAD_RATE	= (1U << 4),	/* cxn rate not supported */
4478c2ecf20Sopenharmony_ci	WRONG_DEST	= (1U << 3),	/* wrong destination error */
4488c2ecf20Sopenharmony_ci	CREDIT_TO	= (1U << 2),	/* credit timeout */
4498c2ecf20Sopenharmony_ci	WDOG_TO 	= (1U << 1),	/* watchdog timeout */
4508c2ecf20Sopenharmony_ci	BUF_PAR 	= (1U << 0),	/* buffer parity error */
4518c2ecf20Sopenharmony_ci};
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_cienum error_info_rec_2 {
4548c2ecf20Sopenharmony_ci	SLOT_BSY_ERR	= (1U << 31),	/* Slot Busy Error */
4558c2ecf20Sopenharmony_ci	GRD_CHK_ERR	= (1U << 14),	/* Guard Check Error */
4568c2ecf20Sopenharmony_ci	APP_CHK_ERR	= (1U << 13),	/* Application Check error */
4578c2ecf20Sopenharmony_ci	REF_CHK_ERR	= (1U << 12),	/* Reference Check Error */
4588c2ecf20Sopenharmony_ci	USR_BLK_NM	= (1U << 0),	/* User Block Number */
4598c2ecf20Sopenharmony_ci};
4608c2ecf20Sopenharmony_ci
4618c2ecf20Sopenharmony_cienum pci_cfg_register_bits {
4628c2ecf20Sopenharmony_ci	PCTL_PWR_OFF	= (0xFU << 24),
4638c2ecf20Sopenharmony_ci	PCTL_COM_ON	= (0xFU << 20),
4648c2ecf20Sopenharmony_ci	PCTL_LINK_RST	= (0xFU << 16),
4658c2ecf20Sopenharmony_ci	PCTL_LINK_OFFS	= (16),
4668c2ecf20Sopenharmony_ci	PCTL_PHY_DSBL	= (0xFU << 12),
4678c2ecf20Sopenharmony_ci	PCTL_PHY_DSBL_OFFS	= (12),
4688c2ecf20Sopenharmony_ci	PRD_REQ_SIZE	= (0x4000),
4698c2ecf20Sopenharmony_ci	PRD_REQ_MASK	= (0x00007000),
4708c2ecf20Sopenharmony_ci	PLS_NEG_LINK_WD		= (0x3FU << 4),
4718c2ecf20Sopenharmony_ci	PLS_NEG_LINK_WD_OFFS	= 4,
4728c2ecf20Sopenharmony_ci	PLS_LINK_SPD		= (0x0FU << 0),
4738c2ecf20Sopenharmony_ci	PLS_LINK_SPD_OFFS	= 0,
4748c2ecf20Sopenharmony_ci};
4758c2ecf20Sopenharmony_ci
4768c2ecf20Sopenharmony_cienum open_frame_protocol {
4778c2ecf20Sopenharmony_ci	PROTOCOL_SMP	= 0x0,
4788c2ecf20Sopenharmony_ci	PROTOCOL_SSP	= 0x1,
4798c2ecf20Sopenharmony_ci	PROTOCOL_STP	= 0x2,
4808c2ecf20Sopenharmony_ci};
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_ci/* define for response frame datapres field */
4838c2ecf20Sopenharmony_cienum datapres_field {
4848c2ecf20Sopenharmony_ci	NO_DATA		= 0,
4858c2ecf20Sopenharmony_ci	RESPONSE_DATA	= 1,
4868c2ecf20Sopenharmony_ci	SENSE_DATA	= 2,
4878c2ecf20Sopenharmony_ci};
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_ci/* define task management IU */
4908c2ecf20Sopenharmony_cistruct mvs_tmf_task{
4918c2ecf20Sopenharmony_ci	u8 tmf;
4928c2ecf20Sopenharmony_ci	u16 tag_of_task_to_be_managed;
4938c2ecf20Sopenharmony_ci};
4948c2ecf20Sopenharmony_ci#endif
495