18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * drivers/scsi/ufs/unipro.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2013 Samsung Electronics Co., Ltd.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _UNIPRO_H_
98c2ecf20Sopenharmony_ci#define _UNIPRO_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci/*
128c2ecf20Sopenharmony_ci * M-TX Configuration Attributes
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci#define TX_HIBERN8TIME_CAPABILITY		0x000F
158c2ecf20Sopenharmony_ci#define TX_MODE					0x0021
168c2ecf20Sopenharmony_ci#define TX_HSRATE_SERIES			0x0022
178c2ecf20Sopenharmony_ci#define TX_HSGEAR				0x0023
188c2ecf20Sopenharmony_ci#define TX_PWMGEAR				0x0024
198c2ecf20Sopenharmony_ci#define TX_AMPLITUDE				0x0025
208c2ecf20Sopenharmony_ci#define TX_HS_SLEWRATE				0x0026
218c2ecf20Sopenharmony_ci#define TX_SYNC_SOURCE				0x0027
228c2ecf20Sopenharmony_ci#define TX_HS_SYNC_LENGTH			0x0028
238c2ecf20Sopenharmony_ci#define TX_HS_PREPARE_LENGTH			0x0029
248c2ecf20Sopenharmony_ci#define TX_LS_PREPARE_LENGTH			0x002A
258c2ecf20Sopenharmony_ci#define TX_HIBERN8_CONTROL			0x002B
268c2ecf20Sopenharmony_ci#define TX_LCC_ENABLE				0x002C
278c2ecf20Sopenharmony_ci#define TX_PWM_BURST_CLOSURE_EXTENSION		0x002D
288c2ecf20Sopenharmony_ci#define TX_BYPASS_8B10B_ENABLE			0x002E
298c2ecf20Sopenharmony_ci#define TX_DRIVER_POLARITY			0x002F
308c2ecf20Sopenharmony_ci#define TX_HS_UNTERMINATED_LINE_DRIVE_ENABLE	0x0030
318c2ecf20Sopenharmony_ci#define TX_LS_TERMINATED_LINE_DRIVE_ENABLE	0x0031
328c2ecf20Sopenharmony_ci#define TX_LCC_SEQUENCER			0x0032
338c2ecf20Sopenharmony_ci#define TX_MIN_ACTIVATETIME			0x0033
348c2ecf20Sopenharmony_ci#define TX_PWM_G6_G7_SYNC_LENGTH		0x0034
358c2ecf20Sopenharmony_ci#define TX_REFCLKFREQ				0x00EB
368c2ecf20Sopenharmony_ci#define TX_CFGCLKFREQVAL			0x00EC
378c2ecf20Sopenharmony_ci#define	CFGEXTRATTR				0x00F0
388c2ecf20Sopenharmony_ci#define DITHERCTRL2				0x00F1
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/*
418c2ecf20Sopenharmony_ci * M-RX Configuration Attributes
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_ci#define RX_MODE					0x00A1
448c2ecf20Sopenharmony_ci#define RX_HSRATE_SERIES			0x00A2
458c2ecf20Sopenharmony_ci#define RX_HSGEAR				0x00A3
468c2ecf20Sopenharmony_ci#define RX_PWMGEAR				0x00A4
478c2ecf20Sopenharmony_ci#define RX_LS_TERMINATED_ENABLE			0x00A5
488c2ecf20Sopenharmony_ci#define RX_HS_UNTERMINATED_ENABLE		0x00A6
498c2ecf20Sopenharmony_ci#define RX_ENTER_HIBERN8			0x00A7
508c2ecf20Sopenharmony_ci#define RX_BYPASS_8B10B_ENABLE			0x00A8
518c2ecf20Sopenharmony_ci#define RX_TERMINATION_FORCE_ENABLE		0x00A9
528c2ecf20Sopenharmony_ci#define RX_MIN_ACTIVATETIME_CAPABILITY		0x008F
538c2ecf20Sopenharmony_ci#define RX_HIBERN8TIME_CAPABILITY		0x0092
548c2ecf20Sopenharmony_ci#define RX_REFCLKFREQ				0x00EB
558c2ecf20Sopenharmony_ci#define	RX_CFGCLKFREQVAL			0x00EC
568c2ecf20Sopenharmony_ci#define CFGWIDEINLN				0x00F0
578c2ecf20Sopenharmony_ci#define CFGRXCDR8				0x00BA
588c2ecf20Sopenharmony_ci#define ENARXDIRECTCFG4				0x00F2
598c2ecf20Sopenharmony_ci#define CFGRXOVR8				0x00BD
608c2ecf20Sopenharmony_ci#define RXDIRECTCTRL2				0x00C7
618c2ecf20Sopenharmony_ci#define ENARXDIRECTCFG3				0x00F3
628c2ecf20Sopenharmony_ci#define RXCALCTRL				0x00B4
638c2ecf20Sopenharmony_ci#define ENARXDIRECTCFG2				0x00F4
648c2ecf20Sopenharmony_ci#define CFGRXOVR4				0x00E9
658c2ecf20Sopenharmony_ci#define RXSQCTRL				0x00B5
668c2ecf20Sopenharmony_ci#define CFGRXOVR6				0x00BF
678c2ecf20Sopenharmony_ci#define RX_HS_G1_SYNC_LENGTH_CAP		0x008B
688c2ecf20Sopenharmony_ci#define RX_HS_G1_PREP_LENGTH_CAP		0x008C
698c2ecf20Sopenharmony_ci#define RX_HS_G2_SYNC_LENGTH_CAP		0x0094
708c2ecf20Sopenharmony_ci#define RX_HS_G3_SYNC_LENGTH_CAP		0x0095
718c2ecf20Sopenharmony_ci#define RX_HS_G2_PREP_LENGTH_CAP		0x0096
728c2ecf20Sopenharmony_ci#define RX_HS_G3_PREP_LENGTH_CAP		0x0097
738c2ecf20Sopenharmony_ci#define RX_ADV_GRANULARITY_CAP			0x0098
748c2ecf20Sopenharmony_ci#define RX_MIN_ACTIVATETIME_CAP			0x008F
758c2ecf20Sopenharmony_ci#define RX_HIBERN8TIME_CAP			0x0092
768c2ecf20Sopenharmony_ci#define RX_ADV_HIBERN8TIME_CAP			0x0099
778c2ecf20Sopenharmony_ci#define RX_ADV_MIN_ACTIVATETIME_CAP		0x009A
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#define is_mphy_tx_attr(attr)			(attr < RX_MODE)
818c2ecf20Sopenharmony_ci#define RX_ADV_FINE_GRAN_STEP(x)		((((x) & 0x3) << 1) | 0x1)
828c2ecf20Sopenharmony_ci#define SYNC_LEN_FINE(x)			((x) & 0x3F)
838c2ecf20Sopenharmony_ci#define SYNC_LEN_COARSE(x)			((1 << 6) | ((x) & 0x3F))
848c2ecf20Sopenharmony_ci#define PREP_LEN(x)				((x) & 0xF)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define RX_MIN_ACTIVATETIME_UNIT_US		100
878c2ecf20Sopenharmony_ci#define HIBERN8TIME_UNIT_US			100
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/*
908c2ecf20Sopenharmony_ci * Common Block Attributes
918c2ecf20Sopenharmony_ci */
928c2ecf20Sopenharmony_ci#define TX_GLOBALHIBERNATE			UNIPRO_CB_OFFSET(0x002B)
938c2ecf20Sopenharmony_ci#define REFCLKMODE				UNIPRO_CB_OFFSET(0x00BF)
948c2ecf20Sopenharmony_ci#define DIRECTCTRL19				UNIPRO_CB_OFFSET(0x00CD)
958c2ecf20Sopenharmony_ci#define DIRECTCTRL10				UNIPRO_CB_OFFSET(0x00E6)
968c2ecf20Sopenharmony_ci#define CDIRECTCTRL6				UNIPRO_CB_OFFSET(0x00EA)
978c2ecf20Sopenharmony_ci#define RTOBSERVESELECT				UNIPRO_CB_OFFSET(0x00F0)
988c2ecf20Sopenharmony_ci#define CBDIVFACTOR				UNIPRO_CB_OFFSET(0x00F1)
998c2ecf20Sopenharmony_ci#define CBDCOCTRL5				UNIPRO_CB_OFFSET(0x00F3)
1008c2ecf20Sopenharmony_ci#define CBPRGPLL2				UNIPRO_CB_OFFSET(0x00F8)
1018c2ecf20Sopenharmony_ci#define CBPRGTUNING				UNIPRO_CB_OFFSET(0x00FB)
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define UNIPRO_CB_OFFSET(x)			(0x8000 | x)
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci/*
1068c2ecf20Sopenharmony_ci * PHY Adpater attributes
1078c2ecf20Sopenharmony_ci */
1088c2ecf20Sopenharmony_ci#define PA_ACTIVETXDATALANES	0x1560
1098c2ecf20Sopenharmony_ci#define PA_ACTIVERXDATALANES	0x1580
1108c2ecf20Sopenharmony_ci#define PA_TXTRAILINGCLOCKS	0x1564
1118c2ecf20Sopenharmony_ci#define PA_PHY_TYPE		0x1500
1128c2ecf20Sopenharmony_ci#define PA_AVAILTXDATALANES	0x1520
1138c2ecf20Sopenharmony_ci#define PA_AVAILRXDATALANES	0x1540
1148c2ecf20Sopenharmony_ci#define PA_MINRXTRAILINGCLOCKS	0x1543
1158c2ecf20Sopenharmony_ci#define PA_TXPWRSTATUS		0x1567
1168c2ecf20Sopenharmony_ci#define PA_RXPWRSTATUS		0x1582
1178c2ecf20Sopenharmony_ci#define PA_TXFORCECLOCK		0x1562
1188c2ecf20Sopenharmony_ci#define PA_TXPWRMODE		0x1563
1198c2ecf20Sopenharmony_ci#define PA_LEGACYDPHYESCDL	0x1570
1208c2ecf20Sopenharmony_ci#define PA_MAXTXSPEEDFAST	0x1521
1218c2ecf20Sopenharmony_ci#define PA_MAXTXSPEEDSLOW	0x1522
1228c2ecf20Sopenharmony_ci#define PA_MAXRXSPEEDFAST	0x1541
1238c2ecf20Sopenharmony_ci#define PA_MAXRXSPEEDSLOW	0x1542
1248c2ecf20Sopenharmony_ci#define PA_TXLINKSTARTUPHS	0x1544
1258c2ecf20Sopenharmony_ci#define PA_LOCAL_TX_LCC_ENABLE	0x155E
1268c2ecf20Sopenharmony_ci#define PA_TXSPEEDFAST		0x1565
1278c2ecf20Sopenharmony_ci#define PA_TXSPEEDSLOW		0x1566
1288c2ecf20Sopenharmony_ci#define PA_REMOTEVERINFO	0x15A0
1298c2ecf20Sopenharmony_ci#define PA_TXGEAR		0x1568
1308c2ecf20Sopenharmony_ci#define PA_TXTERMINATION	0x1569
1318c2ecf20Sopenharmony_ci#define PA_HSSERIES		0x156A
1328c2ecf20Sopenharmony_ci#define PA_PWRMODE		0x1571
1338c2ecf20Sopenharmony_ci#define PA_RXGEAR		0x1583
1348c2ecf20Sopenharmony_ci#define PA_RXTERMINATION	0x1584
1358c2ecf20Sopenharmony_ci#define PA_MAXRXPWMGEAR		0x1586
1368c2ecf20Sopenharmony_ci#define PA_MAXRXHSGEAR		0x1587
1378c2ecf20Sopenharmony_ci#define PA_RXHSUNTERMCAP	0x15A5
1388c2ecf20Sopenharmony_ci#define PA_RXLSTERMCAP		0x15A6
1398c2ecf20Sopenharmony_ci#define PA_GRANULARITY		0x15AA
1408c2ecf20Sopenharmony_ci#define PA_PACPREQTIMEOUT	0x1590
1418c2ecf20Sopenharmony_ci#define PA_PACPREQEOBTIMEOUT	0x1591
1428c2ecf20Sopenharmony_ci#define PA_HIBERN8TIME		0x15A7
1438c2ecf20Sopenharmony_ci#define PA_LOCALVERINFO		0x15A9
1448c2ecf20Sopenharmony_ci#define PA_GRANULARITY		0x15AA
1458c2ecf20Sopenharmony_ci#define PA_TACTIVATE		0x15A8
1468c2ecf20Sopenharmony_ci#define PA_PACPFRAMECOUNT	0x15C0
1478c2ecf20Sopenharmony_ci#define PA_PACPERRORCOUNT	0x15C1
1488c2ecf20Sopenharmony_ci#define PA_PHYTESTCONTROL	0x15C2
1498c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA0	0x15B0
1508c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA1	0x15B1
1518c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA2	0x15B2
1528c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA3	0x15B3
1538c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA4	0x15B4
1548c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA5	0x15B5
1558c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA6	0x15B6
1568c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA7	0x15B7
1578c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA8	0x15B8
1588c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA9	0x15B9
1598c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA10	0x15BA
1608c2ecf20Sopenharmony_ci#define PA_PWRMODEUSERDATA11	0x15BB
1618c2ecf20Sopenharmony_ci#define PA_CONNECTEDTXDATALANES	0x1561
1628c2ecf20Sopenharmony_ci#define PA_CONNECTEDRXDATALANES	0x1581
1638c2ecf20Sopenharmony_ci#define PA_LOGICALLANEMAP	0x15A1
1648c2ecf20Sopenharmony_ci#define PA_SLEEPNOCONFIGTIME	0x15A2
1658c2ecf20Sopenharmony_ci#define PA_STALLNOCONFIGTIME	0x15A3
1668c2ecf20Sopenharmony_ci#define PA_SAVECONFIGTIME	0x15A4
1678c2ecf20Sopenharmony_ci#define PA_TXHSADAPTTYPE       0x15D4
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/* Adpat type for PA_TXHSADAPTTYPE attribute */
1708c2ecf20Sopenharmony_ci#define PA_REFRESH_ADAPT       0x00
1718c2ecf20Sopenharmony_ci#define PA_INITIAL_ADAPT       0x01
1728c2ecf20Sopenharmony_ci#define PA_NO_ADAPT            0x03
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci#define PA_TACTIVATE_TIME_UNIT_US	10
1758c2ecf20Sopenharmony_ci#define PA_HIBERN8_TIME_UNIT_US		100
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci/*Other attributes*/
1788c2ecf20Sopenharmony_ci#define VS_MPHYCFGUPDT		0xD085
1798c2ecf20Sopenharmony_ci#define VS_DEBUGOMC		0xD09E
1808c2ecf20Sopenharmony_ci#define VS_POWERSTATE		0xD083
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define PA_GRANULARITY_MIN_VAL	1
1838c2ecf20Sopenharmony_ci#define PA_GRANULARITY_MAX_VAL	6
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* PHY Adapter Protocol Constants */
1868c2ecf20Sopenharmony_ci#define PA_MAXDATALANES	4
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci#define DL_FC0ProtectionTimeOutVal_Default	8191
1898c2ecf20Sopenharmony_ci#define DL_TC0ReplayTimeOutVal_Default		65535
1908c2ecf20Sopenharmony_ci#define DL_AFC0ReqTimeOutVal_Default		32767
1918c2ecf20Sopenharmony_ci#define DL_FC1ProtectionTimeOutVal_Default	8191
1928c2ecf20Sopenharmony_ci#define DL_TC1ReplayTimeOutVal_Default		65535
1938c2ecf20Sopenharmony_ci#define DL_AFC1ReqTimeOutVal_Default		32767
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define DME_LocalFC0ProtectionTimeOutVal	0xD041
1968c2ecf20Sopenharmony_ci#define DME_LocalTC0ReplayTimeOutVal		0xD042
1978c2ecf20Sopenharmony_ci#define DME_LocalAFC0ReqTimeOutVal		0xD043
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci/* PA power modes */
2008c2ecf20Sopenharmony_cienum {
2018c2ecf20Sopenharmony_ci	FAST_MODE	= 1,
2028c2ecf20Sopenharmony_ci	SLOW_MODE	= 2,
2038c2ecf20Sopenharmony_ci	FASTAUTO_MODE	= 4,
2048c2ecf20Sopenharmony_ci	SLOWAUTO_MODE	= 5,
2058c2ecf20Sopenharmony_ci	UNCHANGED	= 7,
2068c2ecf20Sopenharmony_ci};
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci#define PWRMODE_MASK		0xF
2098c2ecf20Sopenharmony_ci#define PWRMODE_RX_OFFSET	4
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci/* PA TX/RX Frequency Series */
2128c2ecf20Sopenharmony_cienum {
2138c2ecf20Sopenharmony_ci	PA_HS_MODE_A	= 1,
2148c2ecf20Sopenharmony_ci	PA_HS_MODE_B	= 2,
2158c2ecf20Sopenharmony_ci};
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_cienum ufs_pwm_gear_tag {
2188c2ecf20Sopenharmony_ci	UFS_PWM_DONT_CHANGE,	/* Don't change Gear */
2198c2ecf20Sopenharmony_ci	UFS_PWM_G1,		/* PWM Gear 1 (default for reset) */
2208c2ecf20Sopenharmony_ci	UFS_PWM_G2,		/* PWM Gear 2 */
2218c2ecf20Sopenharmony_ci	UFS_PWM_G3,		/* PWM Gear 3 */
2228c2ecf20Sopenharmony_ci	UFS_PWM_G4,		/* PWM Gear 4 */
2238c2ecf20Sopenharmony_ci	UFS_PWM_G5,		/* PWM Gear 5 */
2248c2ecf20Sopenharmony_ci	UFS_PWM_G6,		/* PWM Gear 6 */
2258c2ecf20Sopenharmony_ci	UFS_PWM_G7,		/* PWM Gear 7 */
2268c2ecf20Sopenharmony_ci};
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_cienum ufs_hs_gear_tag {
2298c2ecf20Sopenharmony_ci	UFS_HS_DONT_CHANGE,	/* Don't change Gear */
2308c2ecf20Sopenharmony_ci	UFS_HS_G1,		/* HS Gear 1 (default for reset) */
2318c2ecf20Sopenharmony_ci	UFS_HS_G2,		/* HS Gear 2 */
2328c2ecf20Sopenharmony_ci	UFS_HS_G3,		/* HS Gear 3 */
2338c2ecf20Sopenharmony_ci	UFS_HS_G4,		/* HS Gear 4 */
2348c2ecf20Sopenharmony_ci};
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_cienum ufs_unipro_ver {
2378c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_RESERVED = 0,
2388c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_1_40 = 1, /* UniPro version 1.40 */
2398c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_1_41 = 2, /* UniPro version 1.41 */
2408c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_1_6 = 3,  /* UniPro version 1.6 */
2418c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_MAX = 4,  /* UniPro unsupported version */
2428c2ecf20Sopenharmony_ci	/* UniPro version field mask in PA_LOCALVERINFO */
2438c2ecf20Sopenharmony_ci	UFS_UNIPRO_VER_MASK = 0xF,
2448c2ecf20Sopenharmony_ci};
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/*
2478c2ecf20Sopenharmony_ci * Data Link Layer Attributes
2488c2ecf20Sopenharmony_ci */
2498c2ecf20Sopenharmony_ci#define DL_TC0TXFCTHRESHOLD	0x2040
2508c2ecf20Sopenharmony_ci#define DL_FC0PROTTIMEOUTVAL	0x2041
2518c2ecf20Sopenharmony_ci#define DL_TC0REPLAYTIMEOUTVAL	0x2042
2528c2ecf20Sopenharmony_ci#define DL_AFC0REQTIMEOUTVAL	0x2043
2538c2ecf20Sopenharmony_ci#define DL_AFC0CREDITTHRESHOLD	0x2044
2548c2ecf20Sopenharmony_ci#define DL_TC0OUTACKTHRESHOLD	0x2045
2558c2ecf20Sopenharmony_ci#define DL_TC1TXFCTHRESHOLD	0x2060
2568c2ecf20Sopenharmony_ci#define DL_FC1PROTTIMEOUTVAL	0x2061
2578c2ecf20Sopenharmony_ci#define DL_TC1REPLAYTIMEOUTVAL	0x2062
2588c2ecf20Sopenharmony_ci#define DL_AFC1REQTIMEOUTVAL	0x2063
2598c2ecf20Sopenharmony_ci#define DL_AFC1CREDITTHRESHOLD	0x2064
2608c2ecf20Sopenharmony_ci#define DL_TC1OUTACKTHRESHOLD	0x2065
2618c2ecf20Sopenharmony_ci#define DL_TXPREEMPTIONCAP	0x2000
2628c2ecf20Sopenharmony_ci#define DL_TC0TXMAXSDUSIZE	0x2001
2638c2ecf20Sopenharmony_ci#define DL_TC0RXINITCREDITVAL	0x2002
2648c2ecf20Sopenharmony_ci#define DL_TC0TXBUFFERSIZE	0x2005
2658c2ecf20Sopenharmony_ci#define DL_PEERTC0PRESENT	0x2046
2668c2ecf20Sopenharmony_ci#define DL_PEERTC0RXINITCREVAL	0x2047
2678c2ecf20Sopenharmony_ci#define DL_TC1TXMAXSDUSIZE	0x2003
2688c2ecf20Sopenharmony_ci#define DL_TC1RXINITCREDITVAL	0x2004
2698c2ecf20Sopenharmony_ci#define DL_TC1TXBUFFERSIZE	0x2006
2708c2ecf20Sopenharmony_ci#define DL_PEERTC1PRESENT	0x2066
2718c2ecf20Sopenharmony_ci#define DL_PEERTC1RXINITCREVAL	0x2067
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci/*
2748c2ecf20Sopenharmony_ci * Network Layer Attributes
2758c2ecf20Sopenharmony_ci */
2768c2ecf20Sopenharmony_ci#define N_DEVICEID		0x3000
2778c2ecf20Sopenharmony_ci#define N_DEVICEID_VALID	0x3001
2788c2ecf20Sopenharmony_ci#define N_TC0TXMAXSDUSIZE	0x3020
2798c2ecf20Sopenharmony_ci#define N_TC1TXMAXSDUSIZE	0x3021
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci/*
2828c2ecf20Sopenharmony_ci * Transport Layer Attributes
2838c2ecf20Sopenharmony_ci */
2848c2ecf20Sopenharmony_ci#define T_NUMCPORTS		0x4000
2858c2ecf20Sopenharmony_ci#define T_NUMTESTFEATURES	0x4001
2868c2ecf20Sopenharmony_ci#define T_CONNECTIONSTATE	0x4020
2878c2ecf20Sopenharmony_ci#define T_PEERDEVICEID		0x4021
2888c2ecf20Sopenharmony_ci#define T_PEERCPORTID		0x4022
2898c2ecf20Sopenharmony_ci#define T_TRAFFICCLASS		0x4023
2908c2ecf20Sopenharmony_ci#define T_PROTOCOLID		0x4024
2918c2ecf20Sopenharmony_ci#define T_CPORTFLAGS		0x4025
2928c2ecf20Sopenharmony_ci#define T_TXTOKENVALUE		0x4026
2938c2ecf20Sopenharmony_ci#define T_RXTOKENVALUE		0x4027
2948c2ecf20Sopenharmony_ci#define T_LOCALBUFFERSPACE	0x4028
2958c2ecf20Sopenharmony_ci#define T_PEERBUFFERSPACE	0x4029
2968c2ecf20Sopenharmony_ci#define T_CREDITSTOSEND		0x402A
2978c2ecf20Sopenharmony_ci#define T_CPORTMODE		0x402B
2988c2ecf20Sopenharmony_ci#define T_TC0TXMAXSDUSIZE	0x4060
2998c2ecf20Sopenharmony_ci#define T_TC1TXMAXSDUSIZE	0x4061
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci#ifdef FALSE
3028c2ecf20Sopenharmony_ci#undef FALSE
3038c2ecf20Sopenharmony_ci#endif
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci#ifdef TRUE
3068c2ecf20Sopenharmony_ci#undef TRUE
3078c2ecf20Sopenharmony_ci#endif
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci/* Boolean attribute values */
3108c2ecf20Sopenharmony_cienum {
3118c2ecf20Sopenharmony_ci	FALSE = 0,
3128c2ecf20Sopenharmony_ci	TRUE,
3138c2ecf20Sopenharmony_ci};
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci/* CPort setting */
3168c2ecf20Sopenharmony_ci#define E2EFC_ON	(1 << 0)
3178c2ecf20Sopenharmony_ci#define E2EFC_OFF	(0 << 0)
3188c2ecf20Sopenharmony_ci#define CSD_N_ON	(0 << 1)
3198c2ecf20Sopenharmony_ci#define CSD_N_OFF	(1 << 1)
3208c2ecf20Sopenharmony_ci#define CSV_N_ON	(0 << 2)
3218c2ecf20Sopenharmony_ci#define CSV_N_OFF	(1 << 2)
3228c2ecf20Sopenharmony_ci#define CPORT_DEF_FLAGS	(CSV_N_OFF | CSD_N_OFF | E2EFC_OFF)
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci/* CPort connection state */
3258c2ecf20Sopenharmony_cienum {
3268c2ecf20Sopenharmony_ci	CPORT_IDLE = 0,
3278c2ecf20Sopenharmony_ci	CPORT_CONNECTED,
3288c2ecf20Sopenharmony_ci};
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci#endif /* _UNIPRO_H_ */
331