162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2013 Samsung Electronics Co., Ltd. 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef _UNIPRO_H_ 762306a36Sopenharmony_ci#define _UNIPRO_H_ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci/* 1062306a36Sopenharmony_ci * M-TX Configuration Attributes 1162306a36Sopenharmony_ci */ 1262306a36Sopenharmony_ci#define TX_HIBERN8TIME_CAPABILITY 0x000F 1362306a36Sopenharmony_ci#define TX_MODE 0x0021 1462306a36Sopenharmony_ci#define TX_HSRATE_SERIES 0x0022 1562306a36Sopenharmony_ci#define TX_HSGEAR 0x0023 1662306a36Sopenharmony_ci#define TX_PWMGEAR 0x0024 1762306a36Sopenharmony_ci#define TX_AMPLITUDE 0x0025 1862306a36Sopenharmony_ci#define TX_HS_SLEWRATE 0x0026 1962306a36Sopenharmony_ci#define TX_SYNC_SOURCE 0x0027 2062306a36Sopenharmony_ci#define TX_HS_SYNC_LENGTH 0x0028 2162306a36Sopenharmony_ci#define TX_HS_PREPARE_LENGTH 0x0029 2262306a36Sopenharmony_ci#define TX_LS_PREPARE_LENGTH 0x002A 2362306a36Sopenharmony_ci#define TX_HIBERN8_CONTROL 0x002B 2462306a36Sopenharmony_ci#define TX_LCC_ENABLE 0x002C 2562306a36Sopenharmony_ci#define TX_PWM_BURST_CLOSURE_EXTENSION 0x002D 2662306a36Sopenharmony_ci#define TX_BYPASS_8B10B_ENABLE 0x002E 2762306a36Sopenharmony_ci#define TX_DRIVER_POLARITY 0x002F 2862306a36Sopenharmony_ci#define TX_HS_UNTERMINATED_LINE_DRIVE_ENABLE 0x0030 2962306a36Sopenharmony_ci#define TX_LS_TERMINATED_LINE_DRIVE_ENABLE 0x0031 3062306a36Sopenharmony_ci#define TX_LCC_SEQUENCER 0x0032 3162306a36Sopenharmony_ci#define TX_MIN_ACTIVATETIME 0x0033 3262306a36Sopenharmony_ci#define TX_PWM_G6_G7_SYNC_LENGTH 0x0034 3362306a36Sopenharmony_ci#define TX_REFCLKFREQ 0x00EB 3462306a36Sopenharmony_ci#define TX_CFGCLKFREQVAL 0x00EC 3562306a36Sopenharmony_ci#define CFGEXTRATTR 0x00F0 3662306a36Sopenharmony_ci#define DITHERCTRL2 0x00F1 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci/* 3962306a36Sopenharmony_ci * M-RX Configuration Attributes 4062306a36Sopenharmony_ci */ 4162306a36Sopenharmony_ci#define RX_HS_G1_SYNC_LENGTH_CAP 0x008B 4262306a36Sopenharmony_ci#define RX_HS_G1_PREP_LENGTH_CAP 0x008C 4362306a36Sopenharmony_ci#define RX_MIN_ACTIVATETIME_CAPABILITY 0x008F 4462306a36Sopenharmony_ci#define RX_HIBERN8TIME_CAPABILITY 0x0092 4562306a36Sopenharmony_ci#define RX_HS_G2_SYNC_LENGTH_CAP 0x0094 4662306a36Sopenharmony_ci#define RX_HS_G3_SYNC_LENGTH_CAP 0x0095 4762306a36Sopenharmony_ci#define RX_HS_G2_PREP_LENGTH_CAP 0x0096 4862306a36Sopenharmony_ci#define RX_HS_G3_PREP_LENGTH_CAP 0x0097 4962306a36Sopenharmony_ci#define RX_ADV_GRANULARITY_CAP 0x0098 5062306a36Sopenharmony_ci#define RX_HIBERN8TIME_CAP 0x0092 5162306a36Sopenharmony_ci#define RX_ADV_HIBERN8TIME_CAP 0x0099 5262306a36Sopenharmony_ci#define RX_ADV_MIN_ACTIVATETIME_CAP 0x009A 5362306a36Sopenharmony_ci#define RX_MODE 0x00A1 5462306a36Sopenharmony_ci#define RX_HSRATE_SERIES 0x00A2 5562306a36Sopenharmony_ci#define RX_HSGEAR 0x00A3 5662306a36Sopenharmony_ci#define RX_PWMGEAR 0x00A4 5762306a36Sopenharmony_ci#define RX_LS_TERMINATED_ENABLE 0x00A5 5862306a36Sopenharmony_ci#define RX_HS_UNTERMINATED_ENABLE 0x00A6 5962306a36Sopenharmony_ci#define RX_ENTER_HIBERN8 0x00A7 6062306a36Sopenharmony_ci#define RX_BYPASS_8B10B_ENABLE 0x00A8 6162306a36Sopenharmony_ci#define RX_TERMINATION_FORCE_ENABLE 0x00A9 6262306a36Sopenharmony_ci#define RXCALCTRL 0x00B4 6362306a36Sopenharmony_ci#define RXSQCTRL 0x00B5 6462306a36Sopenharmony_ci#define CFGRXCDR8 0x00BA 6562306a36Sopenharmony_ci#define CFGRXOVR8 0x00BD 6662306a36Sopenharmony_ci#define CFGRXOVR6 0x00BF 6762306a36Sopenharmony_ci#define RXDIRECTCTRL2 0x00C7 6862306a36Sopenharmony_ci#define CFGRXOVR4 0x00E9 6962306a36Sopenharmony_ci#define RX_REFCLKFREQ 0x00EB 7062306a36Sopenharmony_ci#define RX_CFGCLKFREQVAL 0x00EC 7162306a36Sopenharmony_ci#define CFGWIDEINLN 0x00F0 7262306a36Sopenharmony_ci#define ENARXDIRECTCFG4 0x00F2 7362306a36Sopenharmony_ci#define ENARXDIRECTCFG3 0x00F3 7462306a36Sopenharmony_ci#define ENARXDIRECTCFG2 0x00F4 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci#define is_mphy_tx_attr(attr) (attr < RX_MODE) 7862306a36Sopenharmony_ci#define RX_ADV_FINE_GRAN_STEP(x) ((((x) & 0x3) << 1) | 0x1) 7962306a36Sopenharmony_ci#define SYNC_LEN_FINE(x) ((x) & 0x3F) 8062306a36Sopenharmony_ci#define SYNC_LEN_COARSE(x) ((1 << 6) | ((x) & 0x3F)) 8162306a36Sopenharmony_ci#define PREP_LEN(x) ((x) & 0xF) 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define RX_MIN_ACTIVATETIME_UNIT_US 100 8462306a36Sopenharmony_ci#define HIBERN8TIME_UNIT_US 100 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci/* 8762306a36Sopenharmony_ci * Common Block Attributes 8862306a36Sopenharmony_ci */ 8962306a36Sopenharmony_ci#define TX_GLOBALHIBERNATE UNIPRO_CB_OFFSET(0x002B) 9062306a36Sopenharmony_ci#define REFCLKMODE UNIPRO_CB_OFFSET(0x00BF) 9162306a36Sopenharmony_ci#define DIRECTCTRL19 UNIPRO_CB_OFFSET(0x00CD) 9262306a36Sopenharmony_ci#define DIRECTCTRL10 UNIPRO_CB_OFFSET(0x00E6) 9362306a36Sopenharmony_ci#define CDIRECTCTRL6 UNIPRO_CB_OFFSET(0x00EA) 9462306a36Sopenharmony_ci#define RTOBSERVESELECT UNIPRO_CB_OFFSET(0x00F0) 9562306a36Sopenharmony_ci#define CBDIVFACTOR UNIPRO_CB_OFFSET(0x00F1) 9662306a36Sopenharmony_ci#define CBDCOCTRL5 UNIPRO_CB_OFFSET(0x00F3) 9762306a36Sopenharmony_ci#define CBPRGPLL2 UNIPRO_CB_OFFSET(0x00F8) 9862306a36Sopenharmony_ci#define CBPRGTUNING UNIPRO_CB_OFFSET(0x00FB) 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci#define UNIPRO_CB_OFFSET(x) (0x8000 | x) 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci/* 10362306a36Sopenharmony_ci * PHY Adapter attributes 10462306a36Sopenharmony_ci */ 10562306a36Sopenharmony_ci#define PA_PHY_TYPE 0x1500 10662306a36Sopenharmony_ci#define PA_AVAILTXDATALANES 0x1520 10762306a36Sopenharmony_ci#define PA_MAXTXSPEEDFAST 0x1521 10862306a36Sopenharmony_ci#define PA_MAXTXSPEEDSLOW 0x1522 10962306a36Sopenharmony_ci#define PA_MAXRXSPEEDFAST 0x1541 11062306a36Sopenharmony_ci#define PA_MAXRXSPEEDSLOW 0x1542 11162306a36Sopenharmony_ci#define PA_TXLINKSTARTUPHS 0x1544 11262306a36Sopenharmony_ci#define PA_AVAILRXDATALANES 0x1540 11362306a36Sopenharmony_ci#define PA_MINRXTRAILINGCLOCKS 0x1543 11462306a36Sopenharmony_ci#define PA_LOCAL_TX_LCC_ENABLE 0x155E 11562306a36Sopenharmony_ci#define PA_ACTIVETXDATALANES 0x1560 11662306a36Sopenharmony_ci#define PA_CONNECTEDTXDATALANES 0x1561 11762306a36Sopenharmony_ci#define PA_TXFORCECLOCK 0x1562 11862306a36Sopenharmony_ci#define PA_TXPWRMODE 0x1563 11962306a36Sopenharmony_ci#define PA_TXTRAILINGCLOCKS 0x1564 12062306a36Sopenharmony_ci#define PA_TXSPEEDFAST 0x1565 12162306a36Sopenharmony_ci#define PA_TXSPEEDSLOW 0x1566 12262306a36Sopenharmony_ci#define PA_TXPWRSTATUS 0x1567 12362306a36Sopenharmony_ci#define PA_TXGEAR 0x1568 12462306a36Sopenharmony_ci#define PA_TXTERMINATION 0x1569 12562306a36Sopenharmony_ci#define PA_HSSERIES 0x156A 12662306a36Sopenharmony_ci#define PA_LEGACYDPHYESCDL 0x1570 12762306a36Sopenharmony_ci#define PA_PWRMODE 0x1571 12862306a36Sopenharmony_ci#define PA_ACTIVERXDATALANES 0x1580 12962306a36Sopenharmony_ci#define PA_CONNECTEDRXDATALANES 0x1581 13062306a36Sopenharmony_ci#define PA_RXPWRSTATUS 0x1582 13162306a36Sopenharmony_ci#define PA_RXGEAR 0x1583 13262306a36Sopenharmony_ci#define PA_RXTERMINATION 0x1584 13362306a36Sopenharmony_ci#define PA_MAXRXPWMGEAR 0x1586 13462306a36Sopenharmony_ci#define PA_MAXRXHSGEAR 0x1587 13562306a36Sopenharmony_ci#define PA_PACPREQTIMEOUT 0x1590 13662306a36Sopenharmony_ci#define PA_PACPREQEOBTIMEOUT 0x1591 13762306a36Sopenharmony_ci#define PA_REMOTEVERINFO 0x15A0 13862306a36Sopenharmony_ci#define PA_LOGICALLANEMAP 0x15A1 13962306a36Sopenharmony_ci#define PA_SLEEPNOCONFIGTIME 0x15A2 14062306a36Sopenharmony_ci#define PA_STALLNOCONFIGTIME 0x15A3 14162306a36Sopenharmony_ci#define PA_SAVECONFIGTIME 0x15A4 14262306a36Sopenharmony_ci#define PA_RXHSUNTERMCAP 0x15A5 14362306a36Sopenharmony_ci#define PA_RXLSTERMCAP 0x15A6 14462306a36Sopenharmony_ci#define PA_HIBERN8TIME 0x15A7 14562306a36Sopenharmony_ci#define PA_LOCALVERINFO 0x15A9 14662306a36Sopenharmony_ci#define PA_GRANULARITY 0x15AA 14762306a36Sopenharmony_ci#define PA_TACTIVATE 0x15A8 14862306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA0 0x15B0 14962306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA1 0x15B1 15062306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA2 0x15B2 15162306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA3 0x15B3 15262306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA4 0x15B4 15362306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA5 0x15B5 15462306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA6 0x15B6 15562306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA7 0x15B7 15662306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA8 0x15B8 15762306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA9 0x15B9 15862306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA10 0x15BA 15962306a36Sopenharmony_ci#define PA_PWRMODEUSERDATA11 0x15BB 16062306a36Sopenharmony_ci#define PA_PACPFRAMECOUNT 0x15C0 16162306a36Sopenharmony_ci#define PA_PACPERRORCOUNT 0x15C1 16262306a36Sopenharmony_ci#define PA_PHYTESTCONTROL 0x15C2 16362306a36Sopenharmony_ci#define PA_TXHSADAPTTYPE 0x15D4 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci/* Adpat type for PA_TXHSADAPTTYPE attribute */ 16662306a36Sopenharmony_ci#define PA_REFRESH_ADAPT 0x00 16762306a36Sopenharmony_ci#define PA_INITIAL_ADAPT 0x01 16862306a36Sopenharmony_ci#define PA_NO_ADAPT 0x03 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci#define PA_TACTIVATE_TIME_UNIT_US 10 17162306a36Sopenharmony_ci#define PA_HIBERN8_TIME_UNIT_US 100 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_ci/*Other attributes*/ 17462306a36Sopenharmony_ci#define VS_POWERSTATE 0xD083 17562306a36Sopenharmony_ci#define VS_MPHYCFGUPDT 0xD085 17662306a36Sopenharmony_ci#define VS_DEBUGOMC 0xD09E 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci#define PA_GRANULARITY_MIN_VAL 1 17962306a36Sopenharmony_ci#define PA_GRANULARITY_MAX_VAL 6 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci/* PHY Adapter Protocol Constants */ 18262306a36Sopenharmony_ci#define PA_MAXDATALANES 4 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci#define DL_FC0ProtectionTimeOutVal_Default 8191 18562306a36Sopenharmony_ci#define DL_TC0ReplayTimeOutVal_Default 65535 18662306a36Sopenharmony_ci#define DL_AFC0ReqTimeOutVal_Default 32767 18762306a36Sopenharmony_ci#define DL_FC1ProtectionTimeOutVal_Default 8191 18862306a36Sopenharmony_ci#define DL_TC1ReplayTimeOutVal_Default 65535 18962306a36Sopenharmony_ci#define DL_AFC1ReqTimeOutVal_Default 32767 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#define DME_LocalFC0ProtectionTimeOutVal 0xD041 19262306a36Sopenharmony_ci#define DME_LocalTC0ReplayTimeOutVal 0xD042 19362306a36Sopenharmony_ci#define DME_LocalAFC0ReqTimeOutVal 0xD043 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci/* PA power modes */ 19662306a36Sopenharmony_cienum { 19762306a36Sopenharmony_ci FAST_MODE = 1, 19862306a36Sopenharmony_ci SLOW_MODE = 2, 19962306a36Sopenharmony_ci FASTAUTO_MODE = 4, 20062306a36Sopenharmony_ci SLOWAUTO_MODE = 5, 20162306a36Sopenharmony_ci UNCHANGED = 7, 20262306a36Sopenharmony_ci}; 20362306a36Sopenharmony_ci 20462306a36Sopenharmony_ci#define PWRMODE_MASK 0xF 20562306a36Sopenharmony_ci#define PWRMODE_RX_OFFSET 4 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci/* PA TX/RX Frequency Series */ 20862306a36Sopenharmony_cienum { 20962306a36Sopenharmony_ci PA_HS_MODE_A = 1, 21062306a36Sopenharmony_ci PA_HS_MODE_B = 2, 21162306a36Sopenharmony_ci}; 21262306a36Sopenharmony_ci 21362306a36Sopenharmony_cienum ufs_pwm_gear_tag { 21462306a36Sopenharmony_ci UFS_PWM_DONT_CHANGE, /* Don't change Gear */ 21562306a36Sopenharmony_ci UFS_PWM_G1, /* PWM Gear 1 (default for reset) */ 21662306a36Sopenharmony_ci UFS_PWM_G2, /* PWM Gear 2 */ 21762306a36Sopenharmony_ci UFS_PWM_G3, /* PWM Gear 3 */ 21862306a36Sopenharmony_ci UFS_PWM_G4, /* PWM Gear 4 */ 21962306a36Sopenharmony_ci UFS_PWM_G5, /* PWM Gear 5 */ 22062306a36Sopenharmony_ci UFS_PWM_G6, /* PWM Gear 6 */ 22162306a36Sopenharmony_ci UFS_PWM_G7, /* PWM Gear 7 */ 22262306a36Sopenharmony_ci}; 22362306a36Sopenharmony_ci 22462306a36Sopenharmony_cienum ufs_hs_gear_tag { 22562306a36Sopenharmony_ci UFS_HS_DONT_CHANGE, /* Don't change Gear */ 22662306a36Sopenharmony_ci UFS_HS_G1, /* HS Gear 1 (default for reset) */ 22762306a36Sopenharmony_ci UFS_HS_G2, /* HS Gear 2 */ 22862306a36Sopenharmony_ci UFS_HS_G3, /* HS Gear 3 */ 22962306a36Sopenharmony_ci UFS_HS_G4, /* HS Gear 4 */ 23062306a36Sopenharmony_ci UFS_HS_G5 /* HS Gear 5 */ 23162306a36Sopenharmony_ci}; 23262306a36Sopenharmony_ci 23362306a36Sopenharmony_cienum ufs_lanes { 23462306a36Sopenharmony_ci UFS_LANE_DONT_CHANGE, /* Don't change Lane */ 23562306a36Sopenharmony_ci UFS_LANE_1, /* Lane 1 (default for reset) */ 23662306a36Sopenharmony_ci UFS_LANE_2, /* Lane 2 */ 23762306a36Sopenharmony_ci}; 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_cienum ufs_unipro_ver { 24062306a36Sopenharmony_ci UFS_UNIPRO_VER_RESERVED = 0, 24162306a36Sopenharmony_ci UFS_UNIPRO_VER_1_40 = 1, /* UniPro version 1.40 */ 24262306a36Sopenharmony_ci UFS_UNIPRO_VER_1_41 = 2, /* UniPro version 1.41 */ 24362306a36Sopenharmony_ci UFS_UNIPRO_VER_1_6 = 3, /* UniPro version 1.6 */ 24462306a36Sopenharmony_ci UFS_UNIPRO_VER_1_61 = 4, /* UniPro version 1.61 */ 24562306a36Sopenharmony_ci UFS_UNIPRO_VER_1_8 = 5, /* UniPro version 1.8 */ 24662306a36Sopenharmony_ci UFS_UNIPRO_VER_MAX = 6, /* UniPro unsupported version */ 24762306a36Sopenharmony_ci /* UniPro version field mask in PA_LOCALVERINFO */ 24862306a36Sopenharmony_ci UFS_UNIPRO_VER_MASK = 0xF, 24962306a36Sopenharmony_ci}; 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_ci/* 25262306a36Sopenharmony_ci * Data Link Layer Attributes 25362306a36Sopenharmony_ci */ 25462306a36Sopenharmony_ci#define DL_TXPREEMPTIONCAP 0x2000 25562306a36Sopenharmony_ci#define DL_TC0TXMAXSDUSIZE 0x2001 25662306a36Sopenharmony_ci#define DL_TC0RXINITCREDITVAL 0x2002 25762306a36Sopenharmony_ci#define DL_TC1TXMAXSDUSIZE 0x2003 25862306a36Sopenharmony_ci#define DL_TC1RXINITCREDITVAL 0x2004 25962306a36Sopenharmony_ci#define DL_TC0TXBUFFERSIZE 0x2005 26062306a36Sopenharmony_ci#define DL_TC1TXBUFFERSIZE 0x2006 26162306a36Sopenharmony_ci#define DL_TC0TXFCTHRESHOLD 0x2040 26262306a36Sopenharmony_ci#define DL_FC0PROTTIMEOUTVAL 0x2041 26362306a36Sopenharmony_ci#define DL_TC0REPLAYTIMEOUTVAL 0x2042 26462306a36Sopenharmony_ci#define DL_AFC0REQTIMEOUTVAL 0x2043 26562306a36Sopenharmony_ci#define DL_AFC0CREDITTHRESHOLD 0x2044 26662306a36Sopenharmony_ci#define DL_TC0OUTACKTHRESHOLD 0x2045 26762306a36Sopenharmony_ci#define DL_PEERTC0PRESENT 0x2046 26862306a36Sopenharmony_ci#define DL_PEERTC0RXINITCREVAL 0x2047 26962306a36Sopenharmony_ci#define DL_TC1TXFCTHRESHOLD 0x2060 27062306a36Sopenharmony_ci#define DL_FC1PROTTIMEOUTVAL 0x2061 27162306a36Sopenharmony_ci#define DL_TC1REPLAYTIMEOUTVAL 0x2062 27262306a36Sopenharmony_ci#define DL_AFC1REQTIMEOUTVAL 0x2063 27362306a36Sopenharmony_ci#define DL_AFC1CREDITTHRESHOLD 0x2064 27462306a36Sopenharmony_ci#define DL_TC1OUTACKTHRESHOLD 0x2065 27562306a36Sopenharmony_ci#define DL_PEERTC1PRESENT 0x2066 27662306a36Sopenharmony_ci#define DL_PEERTC1RXINITCREVAL 0x2067 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci/* 27962306a36Sopenharmony_ci * Network Layer Attributes 28062306a36Sopenharmony_ci */ 28162306a36Sopenharmony_ci#define N_DEVICEID 0x3000 28262306a36Sopenharmony_ci#define N_DEVICEID_VALID 0x3001 28362306a36Sopenharmony_ci#define N_TC0TXMAXSDUSIZE 0x3020 28462306a36Sopenharmony_ci#define N_TC1TXMAXSDUSIZE 0x3021 28562306a36Sopenharmony_ci 28662306a36Sopenharmony_ci/* 28762306a36Sopenharmony_ci * Transport Layer Attributes 28862306a36Sopenharmony_ci */ 28962306a36Sopenharmony_ci#define T_NUMCPORTS 0x4000 29062306a36Sopenharmony_ci#define T_NUMTESTFEATURES 0x4001 29162306a36Sopenharmony_ci#define T_CONNECTIONSTATE 0x4020 29262306a36Sopenharmony_ci#define T_PEERDEVICEID 0x4021 29362306a36Sopenharmony_ci#define T_PEERCPORTID 0x4022 29462306a36Sopenharmony_ci#define T_TRAFFICCLASS 0x4023 29562306a36Sopenharmony_ci#define T_PROTOCOLID 0x4024 29662306a36Sopenharmony_ci#define T_CPORTFLAGS 0x4025 29762306a36Sopenharmony_ci#define T_TXTOKENVALUE 0x4026 29862306a36Sopenharmony_ci#define T_RXTOKENVALUE 0x4027 29962306a36Sopenharmony_ci#define T_LOCALBUFFERSPACE 0x4028 30062306a36Sopenharmony_ci#define T_PEERBUFFERSPACE 0x4029 30162306a36Sopenharmony_ci#define T_CREDITSTOSEND 0x402A 30262306a36Sopenharmony_ci#define T_CPORTMODE 0x402B 30362306a36Sopenharmony_ci#define T_TC0TXMAXSDUSIZE 0x4060 30462306a36Sopenharmony_ci#define T_TC1TXMAXSDUSIZE 0x4061 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_ci/* CPort setting */ 30762306a36Sopenharmony_ci#define E2EFC_ON (1 << 0) 30862306a36Sopenharmony_ci#define E2EFC_OFF (0 << 0) 30962306a36Sopenharmony_ci#define CSD_N_ON (0 << 1) 31062306a36Sopenharmony_ci#define CSD_N_OFF (1 << 1) 31162306a36Sopenharmony_ci#define CSV_N_ON (0 << 2) 31262306a36Sopenharmony_ci#define CSV_N_OFF (1 << 2) 31362306a36Sopenharmony_ci#define CPORT_DEF_FLAGS (CSV_N_OFF | CSD_N_OFF | E2EFC_OFF) 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci/* CPort connection state */ 31662306a36Sopenharmony_cienum { 31762306a36Sopenharmony_ci CPORT_IDLE = 0, 31862306a36Sopenharmony_ci CPORT_CONNECTED, 31962306a36Sopenharmony_ci}; 32062306a36Sopenharmony_ci 32162306a36Sopenharmony_ci#endif /* _UNIPRO_H_ */ 322