162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * mtu3_hw_regs.h - MediaTek USB3 DRD register and field definitions 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2016 MediaTek Inc. 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Author: Chunfeng Yun <chunfeng.yun@mediatek.com> 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _SSUSB_HW_REGS_H_ 1162306a36Sopenharmony_ci#define _SSUSB_HW_REGS_H_ 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci/* segment offset of MAC register */ 1462306a36Sopenharmony_ci#define SSUSB_DEV_BASE 0x0000 1562306a36Sopenharmony_ci#define SSUSB_EPCTL_CSR_BASE 0x0800 1662306a36Sopenharmony_ci#define SSUSB_USB3_MAC_CSR_BASE 0x1400 1762306a36Sopenharmony_ci#define SSUSB_USB3_SYS_CSR_BASE 0x1400 1862306a36Sopenharmony_ci#define SSUSB_USB2_CSR_BASE 0x2400 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci/* IPPC register in Infra */ 2162306a36Sopenharmony_ci#define SSUSB_SIFSLV_IPPC_BASE 0x0000 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* --------------- SSUSB_DEV REGISTER DEFINITION --------------- */ 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#define U3D_LV1ISR (SSUSB_DEV_BASE + 0x0000) 2662306a36Sopenharmony_ci#define U3D_LV1IER (SSUSB_DEV_BASE + 0x0004) 2762306a36Sopenharmony_ci#define U3D_LV1IESR (SSUSB_DEV_BASE + 0x0008) 2862306a36Sopenharmony_ci#define U3D_LV1IECR (SSUSB_DEV_BASE + 0x000C) 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#define U3D_EPISR (SSUSB_DEV_BASE + 0x0080) 3162306a36Sopenharmony_ci#define U3D_EPIER (SSUSB_DEV_BASE + 0x0084) 3262306a36Sopenharmony_ci#define U3D_EPIESR (SSUSB_DEV_BASE + 0x0088) 3362306a36Sopenharmony_ci#define U3D_EPIECR (SSUSB_DEV_BASE + 0x008C) 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#define U3D_EP0CSR (SSUSB_DEV_BASE + 0x0100) 3662306a36Sopenharmony_ci#define U3D_RXCOUNT0 (SSUSB_DEV_BASE + 0x0108) 3762306a36Sopenharmony_ci#define U3D_RESERVED (SSUSB_DEV_BASE + 0x010C) 3862306a36Sopenharmony_ci#define U3D_TX1CSR0 (SSUSB_DEV_BASE + 0x0110) 3962306a36Sopenharmony_ci#define U3D_TX1CSR1 (SSUSB_DEV_BASE + 0x0114) 4062306a36Sopenharmony_ci#define U3D_TX1CSR2 (SSUSB_DEV_BASE + 0x0118) 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#define U3D_RX1CSR0 (SSUSB_DEV_BASE + 0x0210) 4362306a36Sopenharmony_ci#define U3D_RX1CSR1 (SSUSB_DEV_BASE + 0x0214) 4462306a36Sopenharmony_ci#define U3D_RX1CSR2 (SSUSB_DEV_BASE + 0x0218) 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci#define U3D_FIFO0 (SSUSB_DEV_BASE + 0x0300) 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#define U3D_QCR0 (SSUSB_DEV_BASE + 0x0400) 4962306a36Sopenharmony_ci#define U3D_QCR1 (SSUSB_DEV_BASE + 0x0404) 5062306a36Sopenharmony_ci#define U3D_QCR2 (SSUSB_DEV_BASE + 0x0408) 5162306a36Sopenharmony_ci#define U3D_QCR3 (SSUSB_DEV_BASE + 0x040C) 5262306a36Sopenharmony_ci#define U3D_QFCR (SSUSB_DEV_BASE + 0x0428) 5362306a36Sopenharmony_ci#define U3D_TXQHIAR1 (SSUSB_DEV_BASE + 0x0484) 5462306a36Sopenharmony_ci#define U3D_RXQHIAR1 (SSUSB_DEV_BASE + 0x04C4) 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#define U3D_TXQCSR1 (SSUSB_DEV_BASE + 0x0510) 5762306a36Sopenharmony_ci#define U3D_TXQSAR1 (SSUSB_DEV_BASE + 0x0514) 5862306a36Sopenharmony_ci#define U3D_TXQCPR1 (SSUSB_DEV_BASE + 0x0518) 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci#define U3D_RXQCSR1 (SSUSB_DEV_BASE + 0x0610) 6162306a36Sopenharmony_ci#define U3D_RXQSAR1 (SSUSB_DEV_BASE + 0x0614) 6262306a36Sopenharmony_ci#define U3D_RXQCPR1 (SSUSB_DEV_BASE + 0x0618) 6362306a36Sopenharmony_ci#define U3D_RXQLDPR1 (SSUSB_DEV_BASE + 0x061C) 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci#define U3D_QISAR0 (SSUSB_DEV_BASE + 0x0700) 6662306a36Sopenharmony_ci#define U3D_QIER0 (SSUSB_DEV_BASE + 0x0704) 6762306a36Sopenharmony_ci#define U3D_QIESR0 (SSUSB_DEV_BASE + 0x0708) 6862306a36Sopenharmony_ci#define U3D_QIECR0 (SSUSB_DEV_BASE + 0x070C) 6962306a36Sopenharmony_ci#define U3D_QISAR1 (SSUSB_DEV_BASE + 0x0710) 7062306a36Sopenharmony_ci#define U3D_QIER1 (SSUSB_DEV_BASE + 0x0714) 7162306a36Sopenharmony_ci#define U3D_QIESR1 (SSUSB_DEV_BASE + 0x0718) 7262306a36Sopenharmony_ci#define U3D_QIECR1 (SSUSB_DEV_BASE + 0x071C) 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci#define U3D_TQERRIR0 (SSUSB_DEV_BASE + 0x0780) 7562306a36Sopenharmony_ci#define U3D_TQERRIER0 (SSUSB_DEV_BASE + 0x0784) 7662306a36Sopenharmony_ci#define U3D_TQERRIESR0 (SSUSB_DEV_BASE + 0x0788) 7762306a36Sopenharmony_ci#define U3D_TQERRIECR0 (SSUSB_DEV_BASE + 0x078C) 7862306a36Sopenharmony_ci#define U3D_RQERRIR0 (SSUSB_DEV_BASE + 0x07C0) 7962306a36Sopenharmony_ci#define U3D_RQERRIER0 (SSUSB_DEV_BASE + 0x07C4) 8062306a36Sopenharmony_ci#define U3D_RQERRIESR0 (SSUSB_DEV_BASE + 0x07C8) 8162306a36Sopenharmony_ci#define U3D_RQERRIECR0 (SSUSB_DEV_BASE + 0x07CC) 8262306a36Sopenharmony_ci#define U3D_RQERRIR1 (SSUSB_DEV_BASE + 0x07D0) 8362306a36Sopenharmony_ci#define U3D_RQERRIER1 (SSUSB_DEV_BASE + 0x07D4) 8462306a36Sopenharmony_ci#define U3D_RQERRIESR1 (SSUSB_DEV_BASE + 0x07D8) 8562306a36Sopenharmony_ci#define U3D_RQERRIECR1 (SSUSB_DEV_BASE + 0x07DC) 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci#define U3D_CAP_EP0FFSZ (SSUSB_DEV_BASE + 0x0C04) 8862306a36Sopenharmony_ci#define U3D_CAP_EPNTXFFSZ (SSUSB_DEV_BASE + 0x0C08) 8962306a36Sopenharmony_ci#define U3D_CAP_EPNRXFFSZ (SSUSB_DEV_BASE + 0x0C0C) 9062306a36Sopenharmony_ci#define U3D_CAP_EPINFO (SSUSB_DEV_BASE + 0x0C10) 9162306a36Sopenharmony_ci#define U3D_MISC_CTRL (SSUSB_DEV_BASE + 0x0C84) 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci/*---------------- SSUSB_DEV FIELD DEFINITION ---------------*/ 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci/* U3D_LV1ISR */ 9662306a36Sopenharmony_ci#define EP_CTRL_INTR BIT(5) 9762306a36Sopenharmony_ci#define MAC2_INTR BIT(4) 9862306a36Sopenharmony_ci#define DMA_INTR BIT(3) 9962306a36Sopenharmony_ci#define MAC3_INTR BIT(2) 10062306a36Sopenharmony_ci#define QMU_INTR BIT(1) 10162306a36Sopenharmony_ci#define BMU_INTR BIT(0) 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci/* U3D_LV1IECR */ 10462306a36Sopenharmony_ci#define LV1IECR_MSK GENMASK(31, 0) 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci/* U3D_EPISR */ 10762306a36Sopenharmony_ci#define EPRISR(x) (BIT(16) << (x)) 10862306a36Sopenharmony_ci#define SETUPENDISR BIT(16) 10962306a36Sopenharmony_ci#define EPTISR(x) (BIT(0) << (x)) 11062306a36Sopenharmony_ci#define EP0ISR BIT(0) 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci/* U3D_EP0CSR */ 11362306a36Sopenharmony_ci#define EP0_SENDSTALL BIT(25) 11462306a36Sopenharmony_ci#define EP0_FIFOFULL BIT(23) 11562306a36Sopenharmony_ci#define EP0_SENTSTALL BIT(22) 11662306a36Sopenharmony_ci#define EP0_DPHTX BIT(20) 11762306a36Sopenharmony_ci#define EP0_DATAEND BIT(19) 11862306a36Sopenharmony_ci#define EP0_TXPKTRDY BIT(18) 11962306a36Sopenharmony_ci#define EP0_SETUPPKTRDY BIT(17) 12062306a36Sopenharmony_ci#define EP0_RXPKTRDY BIT(16) 12162306a36Sopenharmony_ci#define EP0_MAXPKTSZ_MSK GENMASK(9, 0) 12262306a36Sopenharmony_ci#define EP0_MAXPKTSZ(x) ((x) & EP0_MAXPKTSZ_MSK) 12362306a36Sopenharmony_ci#define EP0_W1C_BITS (~(EP0_RXPKTRDY | EP0_SETUPPKTRDY | EP0_SENTSTALL)) 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci/* U3D_TX1CSR0 */ 12662306a36Sopenharmony_ci#define TX_DMAREQEN BIT(29) 12762306a36Sopenharmony_ci#define TX_FIFOFULL BIT(25) 12862306a36Sopenharmony_ci#define TX_FIFOEMPTY BIT(24) 12962306a36Sopenharmony_ci#define TX_SENTSTALL BIT(22) 13062306a36Sopenharmony_ci#define TX_SENDSTALL BIT(21) 13162306a36Sopenharmony_ci#define TX_FLUSHFIFO BIT(20) 13262306a36Sopenharmony_ci#define TX_TXPKTRDY BIT(16) 13362306a36Sopenharmony_ci#define TX_TXMAXPKTSZ_MSK GENMASK(10, 0) 13462306a36Sopenharmony_ci#define TX_TXMAXPKTSZ(x) ((x) & TX_TXMAXPKTSZ_MSK) 13562306a36Sopenharmony_ci#define TX_W1C_BITS (~(TX_SENTSTALL)) 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ci/* U3D_TX1CSR1 */ 13862306a36Sopenharmony_ci#define TX_MAX_PKT_G2(x) (((x) & 0xff) << 24) 13962306a36Sopenharmony_ci#define TX_MULT_G2(x) (((x) & 0x7) << 21) 14062306a36Sopenharmony_ci#define TX_MULT_OG(x) (((x) & 0x3) << 22) 14162306a36Sopenharmony_ci#define TX_MAX_PKT_OG(x) (((x) & 0x3f) << 16) 14262306a36Sopenharmony_ci#define TX_SLOT(x) (((x) & 0x3f) << 8) 14362306a36Sopenharmony_ci#define TX_TYPE(x) (((x) & 0x3) << 4) 14462306a36Sopenharmony_ci#define TX_SS_BURST(x) (((x) & 0xf) << 0) 14562306a36Sopenharmony_ci#define TX_MULT(g2c, x) \ 14662306a36Sopenharmony_ci({ \ 14762306a36Sopenharmony_ci typeof(x) x_ = (x); \ 14862306a36Sopenharmony_ci (g2c) ? TX_MULT_G2(x_) : TX_MULT_OG(x_); \ 14962306a36Sopenharmony_ci}) 15062306a36Sopenharmony_ci#define TX_MAX_PKT(g2c, x) \ 15162306a36Sopenharmony_ci({ \ 15262306a36Sopenharmony_ci typeof(x) x_ = (x); \ 15362306a36Sopenharmony_ci (g2c) ? TX_MAX_PKT_G2(x_) : TX_MAX_PKT_OG(x_); \ 15462306a36Sopenharmony_ci}) 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci/* for TX_TYPE & RX_TYPE */ 15762306a36Sopenharmony_ci#define TYPE_BULK (0x0) 15862306a36Sopenharmony_ci#define TYPE_INT (0x1) 15962306a36Sopenharmony_ci#define TYPE_ISO (0x2) 16062306a36Sopenharmony_ci#define TYPE_MASK (0x3) 16162306a36Sopenharmony_ci 16262306a36Sopenharmony_ci/* U3D_TX1CSR2 */ 16362306a36Sopenharmony_ci#define TX_BINTERVAL(x) (((x) & 0xff) << 24) 16462306a36Sopenharmony_ci#define TX_FIFOSEGSIZE(x) (((x) & 0xf) << 16) 16562306a36Sopenharmony_ci#define TX_FIFOADDR(x) (((x) & 0x1fff) << 0) 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ci/* U3D_RX1CSR0 */ 16862306a36Sopenharmony_ci#define RX_DMAREQEN BIT(29) 16962306a36Sopenharmony_ci#define RX_SENTSTALL BIT(22) 17062306a36Sopenharmony_ci#define RX_SENDSTALL BIT(21) 17162306a36Sopenharmony_ci#define RX_RXPKTRDY BIT(16) 17262306a36Sopenharmony_ci#define RX_RXMAXPKTSZ_MSK GENMASK(10, 0) 17362306a36Sopenharmony_ci#define RX_RXMAXPKTSZ(x) ((x) & RX_RXMAXPKTSZ_MSK) 17462306a36Sopenharmony_ci#define RX_W1C_BITS (~(RX_SENTSTALL | RX_RXPKTRDY)) 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ci/* U3D_RX1CSR1 */ 17762306a36Sopenharmony_ci#define RX_MAX_PKT_G2(x) (((x) & 0xff) << 24) 17862306a36Sopenharmony_ci#define RX_MULT_G2(x) (((x) & 0x7) << 21) 17962306a36Sopenharmony_ci#define RX_MULT_OG(x) (((x) & 0x3) << 22) 18062306a36Sopenharmony_ci#define RX_MAX_PKT_OG(x) (((x) & 0x3f) << 16) 18162306a36Sopenharmony_ci#define RX_SLOT(x) (((x) & 0x3f) << 8) 18262306a36Sopenharmony_ci#define RX_TYPE(x) (((x) & 0x3) << 4) 18362306a36Sopenharmony_ci#define RX_SS_BURST(x) (((x) & 0xf) << 0) 18462306a36Sopenharmony_ci#define RX_MULT(g2c, x) \ 18562306a36Sopenharmony_ci({ \ 18662306a36Sopenharmony_ci typeof(x) x_ = (x); \ 18762306a36Sopenharmony_ci (g2c) ? RX_MULT_G2(x_) : RX_MULT_OG(x_); \ 18862306a36Sopenharmony_ci}) 18962306a36Sopenharmony_ci#define RX_MAX_PKT(g2c, x) \ 19062306a36Sopenharmony_ci({ \ 19162306a36Sopenharmony_ci typeof(x) x_ = (x); \ 19262306a36Sopenharmony_ci (g2c) ? RX_MAX_PKT_G2(x_) : RX_MAX_PKT_OG(x_); \ 19362306a36Sopenharmony_ci}) 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci/* U3D_RX1CSR2 */ 19662306a36Sopenharmony_ci#define RX_BINTERVAL(x) (((x) & 0xff) << 24) 19762306a36Sopenharmony_ci#define RX_FIFOSEGSIZE(x) (((x) & 0xf) << 16) 19862306a36Sopenharmony_ci#define RX_FIFOADDR(x) (((x) & 0x1fff) << 0) 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_ci/* U3D_QCR0 */ 20162306a36Sopenharmony_ci#define QMU_RX_CS_EN(x) (BIT(16) << (x)) 20262306a36Sopenharmony_ci#define QMU_TX_CS_EN(x) (BIT(0) << (x)) 20362306a36Sopenharmony_ci#define QMU_CS16B_EN BIT(0) 20462306a36Sopenharmony_ci 20562306a36Sopenharmony_ci/* U3D_QCR1 */ 20662306a36Sopenharmony_ci#define QMU_TX_ZLP(x) (BIT(0) << (x)) 20762306a36Sopenharmony_ci 20862306a36Sopenharmony_ci/* U3D_QCR3 */ 20962306a36Sopenharmony_ci#define QMU_RX_COZ(x) (BIT(16) << (x)) 21062306a36Sopenharmony_ci#define QMU_RX_ZLP(x) (BIT(0) << (x)) 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_ci/* U3D_TXQHIAR1 */ 21362306a36Sopenharmony_ci/* U3D_RXQHIAR1 */ 21462306a36Sopenharmony_ci#define QMU_LAST_DONE_PTR_HI(x) (((x) >> 16) & 0xf) 21562306a36Sopenharmony_ci#define QMU_CUR_GPD_ADDR_HI(x) (((x) >> 8) & 0xf) 21662306a36Sopenharmony_ci#define QMU_START_ADDR_HI_MSK GENMASK(3, 0) 21762306a36Sopenharmony_ci#define QMU_START_ADDR_HI(x) (((x) & 0xf) << 0) 21862306a36Sopenharmony_ci 21962306a36Sopenharmony_ci/* U3D_TXQCSR1 */ 22062306a36Sopenharmony_ci/* U3D_RXQCSR1 */ 22162306a36Sopenharmony_ci#define QMU_Q_ACTIVE BIT(15) 22262306a36Sopenharmony_ci#define QMU_Q_STOP BIT(2) 22362306a36Sopenharmony_ci#define QMU_Q_RESUME BIT(1) 22462306a36Sopenharmony_ci#define QMU_Q_START BIT(0) 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_ci/* U3D_QISAR0, U3D_QIER0, U3D_QIESR0, U3D_QIECR0 */ 22762306a36Sopenharmony_ci#define QMU_RX_DONE_INT(x) (BIT(16) << (x)) 22862306a36Sopenharmony_ci#define QMU_TX_DONE_INT(x) (BIT(0) << (x)) 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci/* U3D_QISAR1, U3D_QIER1, U3D_QIESR1, U3D_QIECR1 */ 23162306a36Sopenharmony_ci#define RXQ_ZLPERR_INT BIT(20) 23262306a36Sopenharmony_ci#define RXQ_LENERR_INT BIT(18) 23362306a36Sopenharmony_ci#define RXQ_CSERR_INT BIT(17) 23462306a36Sopenharmony_ci#define RXQ_EMPTY_INT BIT(16) 23562306a36Sopenharmony_ci#define TXQ_LENERR_INT BIT(2) 23662306a36Sopenharmony_ci#define TXQ_CSERR_INT BIT(1) 23762306a36Sopenharmony_ci#define TXQ_EMPTY_INT BIT(0) 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_ci/* U3D_TQERRIR0, U3D_TQERRIER0, U3D_TQERRIESR0, U3D_TQERRIECR0 */ 24062306a36Sopenharmony_ci#define QMU_TX_LEN_ERR(x) (BIT(16) << (x)) 24162306a36Sopenharmony_ci#define QMU_TX_CS_ERR(x) (BIT(0) << (x)) 24262306a36Sopenharmony_ci 24362306a36Sopenharmony_ci/* U3D_RQERRIR0, U3D_RQERRIER0, U3D_RQERRIESR0, U3D_RQERRIECR0 */ 24462306a36Sopenharmony_ci#define QMU_RX_LEN_ERR(x) (BIT(16) << (x)) 24562306a36Sopenharmony_ci#define QMU_RX_CS_ERR(x) (BIT(0) << (x)) 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ci/* U3D_RQERRIR1, U3D_RQERRIER1, U3D_RQERRIESR1, U3D_RQERRIECR1 */ 24862306a36Sopenharmony_ci#define QMU_RX_ZLP_ERR(n) (BIT(16) << (n)) 24962306a36Sopenharmony_ci 25062306a36Sopenharmony_ci/* U3D_CAP_EPINFO */ 25162306a36Sopenharmony_ci#define CAP_RX_EP_NUM(x) (((x) >> 8) & 0x1f) 25262306a36Sopenharmony_ci#define CAP_TX_EP_NUM(x) ((x) & 0x1f) 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_ci/* U3D_MISC_CTRL */ 25562306a36Sopenharmony_ci#define DMA_ADDR_36BIT BIT(31) 25662306a36Sopenharmony_ci#define VBUS_ON BIT(1) 25762306a36Sopenharmony_ci#define VBUS_FRC_EN BIT(0) 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci 26062306a36Sopenharmony_ci/*---------------- SSUSB_EPCTL_CSR REGISTER DEFINITION ----------------*/ 26162306a36Sopenharmony_ci 26262306a36Sopenharmony_ci#define U3D_DEVICE_CONF (SSUSB_EPCTL_CSR_BASE + 0x0000) 26362306a36Sopenharmony_ci#define U3D_EP_RST (SSUSB_EPCTL_CSR_BASE + 0x0004) 26462306a36Sopenharmony_ci 26562306a36Sopenharmony_ci#define U3D_DEV_LINK_INTR_ENABLE (SSUSB_EPCTL_CSR_BASE + 0x0050) 26662306a36Sopenharmony_ci#define U3D_DEV_LINK_INTR (SSUSB_EPCTL_CSR_BASE + 0x0054) 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci/*---------------- SSUSB_EPCTL_CSR FIELD DEFINITION ----------------*/ 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_ci/* U3D_DEVICE_CONF */ 27162306a36Sopenharmony_ci#define DEV_ADDR_MSK GENMASK(30, 24) 27262306a36Sopenharmony_ci#define DEV_ADDR(x) ((0x7f & (x)) << 24) 27362306a36Sopenharmony_ci#define HW_USB2_3_SEL BIT(18) 27462306a36Sopenharmony_ci#define SW_USB2_3_SEL_EN BIT(17) 27562306a36Sopenharmony_ci#define SW_USB2_3_SEL BIT(16) 27662306a36Sopenharmony_ci#define SSUSB_DEV_SPEED(x) ((x) & 0x7) 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci/* U3D_EP_RST */ 27962306a36Sopenharmony_ci#define EP1_IN_RST BIT(17) 28062306a36Sopenharmony_ci#define EP1_OUT_RST BIT(1) 28162306a36Sopenharmony_ci#define EP_RST(is_in, epnum) (((is_in) ? BIT(16) : BIT(0)) << (epnum)) 28262306a36Sopenharmony_ci#define EP0_RST BIT(0) 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_ci/* U3D_DEV_LINK_INTR_ENABLE */ 28562306a36Sopenharmony_ci/* U3D_DEV_LINK_INTR */ 28662306a36Sopenharmony_ci#define SSUSB_DEV_SPEED_CHG_INTR BIT(0) 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci 28962306a36Sopenharmony_ci/*---------------- SSUSB_USB3_MAC_CSR REGISTER DEFINITION ----------------*/ 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ci#define U3D_LTSSM_CTRL (SSUSB_USB3_MAC_CSR_BASE + 0x0010) 29262306a36Sopenharmony_ci#define U3D_USB3_CONFIG (SSUSB_USB3_MAC_CSR_BASE + 0x001C) 29362306a36Sopenharmony_ci 29462306a36Sopenharmony_ci#define U3D_LINK_STATE_MACHINE (SSUSB_USB3_MAC_CSR_BASE + 0x0134) 29562306a36Sopenharmony_ci#define U3D_LTSSM_INTR_ENABLE (SSUSB_USB3_MAC_CSR_BASE + 0x013C) 29662306a36Sopenharmony_ci#define U3D_LTSSM_INTR (SSUSB_USB3_MAC_CSR_BASE + 0x0140) 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_ci#define U3D_U3U2_SWITCH_CTRL (SSUSB_USB3_MAC_CSR_BASE + 0x0170) 29962306a36Sopenharmony_ci 30062306a36Sopenharmony_ci/*---------------- SSUSB_USB3_MAC_CSR FIELD DEFINITION ----------------*/ 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci/* U3D_LTSSM_CTRL */ 30362306a36Sopenharmony_ci#define FORCE_POLLING_FAIL BIT(4) 30462306a36Sopenharmony_ci#define FORCE_RXDETECT_FAIL BIT(3) 30562306a36Sopenharmony_ci#define SOFT_U3_EXIT_EN BIT(2) 30662306a36Sopenharmony_ci#define COMPLIANCE_EN BIT(1) 30762306a36Sopenharmony_ci#define U1_GO_U2_EN BIT(0) 30862306a36Sopenharmony_ci 30962306a36Sopenharmony_ci/* U3D_USB3_CONFIG */ 31062306a36Sopenharmony_ci#define USB3_EN BIT(0) 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_ci/* U3D_LINK_STATE_MACHINE */ 31362306a36Sopenharmony_ci#define LTSSM_STATE(x) ((x) & 0x1f) 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci/* U3D_LTSSM_INTR_ENABLE */ 31662306a36Sopenharmony_ci/* U3D_LTSSM_INTR */ 31762306a36Sopenharmony_ci#define U3_RESUME_INTR BIT(18) 31862306a36Sopenharmony_ci#define U3_LFPS_TMOUT_INTR BIT(17) 31962306a36Sopenharmony_ci#define VBUS_FALL_INTR BIT(16) 32062306a36Sopenharmony_ci#define VBUS_RISE_INTR BIT(15) 32162306a36Sopenharmony_ci#define RXDET_SUCCESS_INTR BIT(14) 32262306a36Sopenharmony_ci#define EXIT_U3_INTR BIT(13) 32362306a36Sopenharmony_ci#define EXIT_U2_INTR BIT(12) 32462306a36Sopenharmony_ci#define EXIT_U1_INTR BIT(11) 32562306a36Sopenharmony_ci#define ENTER_U3_INTR BIT(10) 32662306a36Sopenharmony_ci#define ENTER_U2_INTR BIT(9) 32762306a36Sopenharmony_ci#define ENTER_U1_INTR BIT(8) 32862306a36Sopenharmony_ci#define ENTER_U0_INTR BIT(7) 32962306a36Sopenharmony_ci#define RECOVERY_INTR BIT(6) 33062306a36Sopenharmony_ci#define WARM_RST_INTR BIT(5) 33162306a36Sopenharmony_ci#define HOT_RST_INTR BIT(4) 33262306a36Sopenharmony_ci#define LOOPBACK_INTR BIT(3) 33362306a36Sopenharmony_ci#define COMPLIANCE_INTR BIT(2) 33462306a36Sopenharmony_ci#define SS_DISABLE_INTR BIT(1) 33562306a36Sopenharmony_ci#define SS_INACTIVE_INTR BIT(0) 33662306a36Sopenharmony_ci 33762306a36Sopenharmony_ci/* U3D_U3U2_SWITCH_CTRL */ 33862306a36Sopenharmony_ci#define SOFTCON_CLR_AUTO_EN BIT(0) 33962306a36Sopenharmony_ci 34062306a36Sopenharmony_ci/*---------------- SSUSB_USB3_SYS_CSR REGISTER DEFINITION ----------------*/ 34162306a36Sopenharmony_ci 34262306a36Sopenharmony_ci#define U3D_LINK_UX_INACT_TIMER (SSUSB_USB3_SYS_CSR_BASE + 0x020C) 34362306a36Sopenharmony_ci#define U3D_LINK_POWER_CONTROL (SSUSB_USB3_SYS_CSR_BASE + 0x0210) 34462306a36Sopenharmony_ci#define U3D_LINK_ERR_COUNT (SSUSB_USB3_SYS_CSR_BASE + 0x0214) 34562306a36Sopenharmony_ci#define U3D_DEV_NOTIF_0 (SSUSB_USB3_SYS_CSR_BASE + 0x0290) 34662306a36Sopenharmony_ci#define U3D_DEV_NOTIF_1 (SSUSB_USB3_SYS_CSR_BASE + 0x0294) 34762306a36Sopenharmony_ci 34862306a36Sopenharmony_ci/*---------------- SSUSB_USB3_SYS_CSR FIELD DEFINITION ----------------*/ 34962306a36Sopenharmony_ci 35062306a36Sopenharmony_ci/* U3D_LINK_UX_INACT_TIMER */ 35162306a36Sopenharmony_ci#define DEV_U2_INACT_TIMEOUT_MSK GENMASK(23, 16) 35262306a36Sopenharmony_ci#define DEV_U2_INACT_TIMEOUT_VALUE(x) (((x) & 0xff) << 16) 35362306a36Sopenharmony_ci#define U2_INACT_TIMEOUT_MSK GENMASK(15, 8) 35462306a36Sopenharmony_ci#define U1_INACT_TIMEOUT_MSK GENMASK(7, 0) 35562306a36Sopenharmony_ci#define U1_INACT_TIMEOUT_VALUE(x) ((x) & 0xff) 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci/* U3D_LINK_POWER_CONTROL */ 35862306a36Sopenharmony_ci#define SW_U2_ACCEPT_ENABLE BIT(9) 35962306a36Sopenharmony_ci#define SW_U1_ACCEPT_ENABLE BIT(8) 36062306a36Sopenharmony_ci#define UX_EXIT BIT(5) 36162306a36Sopenharmony_ci#define LGO_U3 BIT(4) 36262306a36Sopenharmony_ci#define LGO_U2 BIT(3) 36362306a36Sopenharmony_ci#define LGO_U1 BIT(2) 36462306a36Sopenharmony_ci#define SW_U2_REQUEST_ENABLE BIT(1) 36562306a36Sopenharmony_ci#define SW_U1_REQUEST_ENABLE BIT(0) 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci/* U3D_LINK_ERR_COUNT */ 36862306a36Sopenharmony_ci#define CLR_LINK_ERR_CNT BIT(16) 36962306a36Sopenharmony_ci#define LINK_ERROR_COUNT GENMASK(15, 0) 37062306a36Sopenharmony_ci 37162306a36Sopenharmony_ci/* U3D_DEV_NOTIF_0 */ 37262306a36Sopenharmony_ci#define DEV_NOTIF_TYPE_SPECIFIC_LOW_MSK GENMASK(31, 8) 37362306a36Sopenharmony_ci#define DEV_NOTIF_VAL_FW(x) (((x) & 0xff) << 8) 37462306a36Sopenharmony_ci#define DEV_NOTIF_VAL_LTM(x) (((x) & 0xfff) << 8) 37562306a36Sopenharmony_ci#define DEV_NOTIF_VAL_IAM(x) (((x) & 0xffff) << 8) 37662306a36Sopenharmony_ci#define DEV_NOTIF_TYPE_MSK GENMASK(7, 4) 37762306a36Sopenharmony_ci/* Notification Type */ 37862306a36Sopenharmony_ci#define TYPE_FUNCTION_WAKE (0x1 << 4) 37962306a36Sopenharmony_ci#define TYPE_LATENCY_TOLERANCE_MESSAGE (0x2 << 4) 38062306a36Sopenharmony_ci#define TYPE_BUS_INTERVAL_ADJUST_MESSAGE (0x3 << 4) 38162306a36Sopenharmony_ci#define TYPE_HOST_ROLE_REQUEST (0x4 << 4) 38262306a36Sopenharmony_ci#define TYPE_SUBLINK_SPEED (0x5 << 4) 38362306a36Sopenharmony_ci#define SEND_DEV_NOTIF BIT(0) 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci/*---------------- SSUSB_USB2_CSR REGISTER DEFINITION ----------------*/ 38662306a36Sopenharmony_ci 38762306a36Sopenharmony_ci#define U3D_POWER_MANAGEMENT (SSUSB_USB2_CSR_BASE + 0x0004) 38862306a36Sopenharmony_ci#define U3D_DEVICE_CONTROL (SSUSB_USB2_CSR_BASE + 0x000C) 38962306a36Sopenharmony_ci#define U3D_USB2_TEST_MODE (SSUSB_USB2_CSR_BASE + 0x0014) 39062306a36Sopenharmony_ci#define U3D_COMMON_USB_INTR_ENABLE (SSUSB_USB2_CSR_BASE + 0x0018) 39162306a36Sopenharmony_ci#define U3D_COMMON_USB_INTR (SSUSB_USB2_CSR_BASE + 0x001C) 39262306a36Sopenharmony_ci#define U3D_LINK_RESET_INFO (SSUSB_USB2_CSR_BASE + 0x0024) 39362306a36Sopenharmony_ci#define U3D_USB20_FRAME_NUM (SSUSB_USB2_CSR_BASE + 0x003C) 39462306a36Sopenharmony_ci#define U3D_USB20_LPM_PARAMETER (SSUSB_USB2_CSR_BASE + 0x0044) 39562306a36Sopenharmony_ci#define U3D_USB20_MISC_CONTROL (SSUSB_USB2_CSR_BASE + 0x004C) 39662306a36Sopenharmony_ci#define U3D_USB20_OPSTATE (SSUSB_USB2_CSR_BASE + 0x0060) 39762306a36Sopenharmony_ci 39862306a36Sopenharmony_ci/*---------------- SSUSB_USB2_CSR FIELD DEFINITION ----------------*/ 39962306a36Sopenharmony_ci 40062306a36Sopenharmony_ci/* U3D_POWER_MANAGEMENT */ 40162306a36Sopenharmony_ci#define LPM_BESL_STALL BIT(14) 40262306a36Sopenharmony_ci#define LPM_BESLD_STALL BIT(13) 40362306a36Sopenharmony_ci#define LPM_RWP BIT(11) 40462306a36Sopenharmony_ci#define LPM_HRWE BIT(10) 40562306a36Sopenharmony_ci#define LPM_MODE(x) (((x) & 0x3) << 8) 40662306a36Sopenharmony_ci#define ISO_UPDATE BIT(7) 40762306a36Sopenharmony_ci#define SOFT_CONN BIT(6) 40862306a36Sopenharmony_ci#define HS_ENABLE BIT(5) 40962306a36Sopenharmony_ci#define RESUME BIT(2) 41062306a36Sopenharmony_ci#define SUSPENDM_ENABLE BIT(0) 41162306a36Sopenharmony_ci 41262306a36Sopenharmony_ci/* U3D_DEVICE_CONTROL */ 41362306a36Sopenharmony_ci#define DC_HOSTREQ BIT(1) 41462306a36Sopenharmony_ci#define DC_SESSION BIT(0) 41562306a36Sopenharmony_ci 41662306a36Sopenharmony_ci/* U3D_USB2_TEST_MODE */ 41762306a36Sopenharmony_ci#define U2U3_AUTO_SWITCH BIT(10) 41862306a36Sopenharmony_ci#define LPM_FORCE_STALL BIT(8) 41962306a36Sopenharmony_ci#define FIFO_ACCESS BIT(6) 42062306a36Sopenharmony_ci#define FORCE_FS BIT(5) 42162306a36Sopenharmony_ci#define FORCE_HS BIT(4) 42262306a36Sopenharmony_ci#define TEST_PACKET_MODE BIT(3) 42362306a36Sopenharmony_ci#define TEST_K_MODE BIT(2) 42462306a36Sopenharmony_ci#define TEST_J_MODE BIT(1) 42562306a36Sopenharmony_ci#define TEST_SE0_NAK_MODE BIT(0) 42662306a36Sopenharmony_ci 42762306a36Sopenharmony_ci/* U3D_COMMON_USB_INTR_ENABLE */ 42862306a36Sopenharmony_ci/* U3D_COMMON_USB_INTR */ 42962306a36Sopenharmony_ci#define LPM_RESUME_INTR BIT(9) 43062306a36Sopenharmony_ci#define LPM_INTR BIT(8) 43162306a36Sopenharmony_ci#define DISCONN_INTR BIT(5) 43262306a36Sopenharmony_ci#define CONN_INTR BIT(4) 43362306a36Sopenharmony_ci#define SOF_INTR BIT(3) 43462306a36Sopenharmony_ci#define RESET_INTR BIT(2) 43562306a36Sopenharmony_ci#define RESUME_INTR BIT(1) 43662306a36Sopenharmony_ci#define SUSPEND_INTR BIT(0) 43762306a36Sopenharmony_ci 43862306a36Sopenharmony_ci/* U3D_LINK_RESET_INFO */ 43962306a36Sopenharmony_ci#define WTCHRP_MSK GENMASK(19, 16) 44062306a36Sopenharmony_ci 44162306a36Sopenharmony_ci/* U3D_USB20_LPM_PARAMETER */ 44262306a36Sopenharmony_ci#define LPM_BESLCK_U3(x) (((x) & 0xf) << 12) 44362306a36Sopenharmony_ci#define LPM_BESLCK(x) (((x) & 0xf) << 8) 44462306a36Sopenharmony_ci#define LPM_BESLDCK(x) (((x) & 0xf) << 4) 44562306a36Sopenharmony_ci#define LPM_BESL GENMASK(3, 0) 44662306a36Sopenharmony_ci 44762306a36Sopenharmony_ci/* U3D_USB20_MISC_CONTROL */ 44862306a36Sopenharmony_ci#define LPM_U3_ACK_EN BIT(0) 44962306a36Sopenharmony_ci 45062306a36Sopenharmony_ci/*---------------- SSUSB_SIFSLV_IPPC REGISTER DEFINITION ----------------*/ 45162306a36Sopenharmony_ci 45262306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_CTRL0 (SSUSB_SIFSLV_IPPC_BASE + 0x0000) 45362306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_CTRL1 (SSUSB_SIFSLV_IPPC_BASE + 0x0004) 45462306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_CTRL2 (SSUSB_SIFSLV_IPPC_BASE + 0x0008) 45562306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_CTRL3 (SSUSB_SIFSLV_IPPC_BASE + 0x000C) 45662306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_STS1 (SSUSB_SIFSLV_IPPC_BASE + 0x0010) 45762306a36Sopenharmony_ci#define U3D_SSUSB_IP_PW_STS2 (SSUSB_SIFSLV_IPPC_BASE + 0x0014) 45862306a36Sopenharmony_ci#define U3D_SSUSB_OTG_STS (SSUSB_SIFSLV_IPPC_BASE + 0x0018) 45962306a36Sopenharmony_ci#define U3D_SSUSB_OTG_STS_CLR (SSUSB_SIFSLV_IPPC_BASE + 0x001C) 46062306a36Sopenharmony_ci#define U3D_SSUSB_IP_XHCI_CAP (SSUSB_SIFSLV_IPPC_BASE + 0x0024) 46162306a36Sopenharmony_ci#define U3D_SSUSB_IP_DEV_CAP (SSUSB_SIFSLV_IPPC_BASE + 0x0028) 46262306a36Sopenharmony_ci#define U3D_SSUSB_OTG_INT_EN (SSUSB_SIFSLV_IPPC_BASE + 0x002C) 46362306a36Sopenharmony_ci#define U3D_SSUSB_U3_CTRL_0P (SSUSB_SIFSLV_IPPC_BASE + 0x0030) 46462306a36Sopenharmony_ci#define U3D_SSUSB_U2_CTRL_0P (SSUSB_SIFSLV_IPPC_BASE + 0x0050) 46562306a36Sopenharmony_ci#define U3D_SSUSB_REF_CK_CTRL (SSUSB_SIFSLV_IPPC_BASE + 0x008C) 46662306a36Sopenharmony_ci#define U3D_SSUSB_DEV_RST_CTRL (SSUSB_SIFSLV_IPPC_BASE + 0x0098) 46762306a36Sopenharmony_ci#define U3D_SSUSB_HW_ID (SSUSB_SIFSLV_IPPC_BASE + 0x00A0) 46862306a36Sopenharmony_ci#define U3D_SSUSB_HW_SUB_ID (SSUSB_SIFSLV_IPPC_BASE + 0x00A4) 46962306a36Sopenharmony_ci#define U3D_SSUSB_IP_TRUNK_VERS (U3D_SSUSB_HW_SUB_ID) 47062306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL0 (SSUSB_SIFSLV_IPPC_BASE + 0x00B0) 47162306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL1 (SSUSB_SIFSLV_IPPC_BASE + 0x00B4) 47262306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL2 (SSUSB_SIFSLV_IPPC_BASE + 0x00B8) 47362306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL3 (SSUSB_SIFSLV_IPPC_BASE + 0x00BC) 47462306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL4 (SSUSB_SIFSLV_IPPC_BASE + 0x00C0) 47562306a36Sopenharmony_ci#define U3D_SSUSB_PRB_CTRL5 (SSUSB_SIFSLV_IPPC_BASE + 0x00C4) 47662306a36Sopenharmony_ci#define U3D_SSUSB_IP_SPARE0 (SSUSB_SIFSLV_IPPC_BASE + 0x00C8) 47762306a36Sopenharmony_ci 47862306a36Sopenharmony_ci/*---------------- SSUSB_SIFSLV_IPPC FIELD DEFINITION ----------------*/ 47962306a36Sopenharmony_ci 48062306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_CTRL0 */ 48162306a36Sopenharmony_ci#define SSUSB_IP_SW_RST BIT(0) 48262306a36Sopenharmony_ci 48362306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_CTRL1 */ 48462306a36Sopenharmony_ci#define SSUSB_IP_HOST_PDN BIT(0) 48562306a36Sopenharmony_ci 48662306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_CTRL2 */ 48762306a36Sopenharmony_ci#define SSUSB_IP_DEV_PDN BIT(0) 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_CTRL3 */ 49062306a36Sopenharmony_ci#define SSUSB_IP_PCIE_PDN BIT(0) 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_STS1 */ 49362306a36Sopenharmony_ci#define SSUSB_IP_SLEEP_STS BIT(30) 49462306a36Sopenharmony_ci#define SSUSB_U3_MAC_RST_B_STS BIT(16) 49562306a36Sopenharmony_ci#define SSUSB_XHCI_RST_B_STS BIT(11) 49662306a36Sopenharmony_ci#define SSUSB_SYS125_RST_B_STS BIT(10) 49762306a36Sopenharmony_ci#define SSUSB_REF_RST_B_STS BIT(8) 49862306a36Sopenharmony_ci#define SSUSB_SYSPLL_STABLE BIT(0) 49962306a36Sopenharmony_ci 50062306a36Sopenharmony_ci/* U3D_SSUSB_IP_PW_STS2 */ 50162306a36Sopenharmony_ci#define SSUSB_U2_MAC_SYS_RST_B_STS BIT(0) 50262306a36Sopenharmony_ci 50362306a36Sopenharmony_ci/* U3D_SSUSB_OTG_STS */ 50462306a36Sopenharmony_ci#define SSUSB_VBUS_VALID BIT(9) 50562306a36Sopenharmony_ci 50662306a36Sopenharmony_ci/* U3D_SSUSB_OTG_STS_CLR */ 50762306a36Sopenharmony_ci#define SSUSB_VBUS_INTR_CLR BIT(6) 50862306a36Sopenharmony_ci 50962306a36Sopenharmony_ci/* U3D_SSUSB_IP_XHCI_CAP */ 51062306a36Sopenharmony_ci#define SSUSB_IP_XHCI_U2_PORT_NUM(x) (((x) >> 8) & 0xff) 51162306a36Sopenharmony_ci#define SSUSB_IP_XHCI_U3_PORT_NUM(x) ((x) & 0xff) 51262306a36Sopenharmony_ci 51362306a36Sopenharmony_ci/* U3D_SSUSB_IP_DEV_CAP */ 51462306a36Sopenharmony_ci#define SSUSB_IP_DEV_U3_PORT_NUM(x) ((x) & 0xff) 51562306a36Sopenharmony_ci 51662306a36Sopenharmony_ci/* U3D_SSUSB_OTG_INT_EN */ 51762306a36Sopenharmony_ci#define SSUSB_VBUS_CHG_INT_A_EN BIT(7) 51862306a36Sopenharmony_ci#define SSUSB_VBUS_CHG_INT_B_EN BIT(6) 51962306a36Sopenharmony_ci 52062306a36Sopenharmony_ci/* U3D_SSUSB_U3_CTRL_0P */ 52162306a36Sopenharmony_ci#define SSUSB_U3_PORT_SSP_SPEED BIT(9) 52262306a36Sopenharmony_ci#define SSUSB_U3_PORT_DUAL_MODE BIT(7) 52362306a36Sopenharmony_ci#define SSUSB_U3_PORT_HOST_SEL BIT(2) 52462306a36Sopenharmony_ci#define SSUSB_U3_PORT_PDN BIT(1) 52562306a36Sopenharmony_ci#define SSUSB_U3_PORT_DIS BIT(0) 52662306a36Sopenharmony_ci 52762306a36Sopenharmony_ci/* U3D_SSUSB_U2_CTRL_0P */ 52862306a36Sopenharmony_ci#define SSUSB_U2_PORT_RG_IDDIG BIT(12) 52962306a36Sopenharmony_ci#define SSUSB_U2_PORT_FORCE_IDDIG BIT(11) 53062306a36Sopenharmony_ci#define SSUSB_U2_PORT_VBUSVALID BIT(9) 53162306a36Sopenharmony_ci#define SSUSB_U2_PORT_OTG_SEL BIT(7) 53262306a36Sopenharmony_ci#define SSUSB_U2_PORT_HOST BIT(2) 53362306a36Sopenharmony_ci#define SSUSB_U2_PORT_PDN BIT(1) 53462306a36Sopenharmony_ci#define SSUSB_U2_PORT_DIS BIT(0) 53562306a36Sopenharmony_ci#define SSUSB_U2_PORT_HOST_SEL (SSUSB_U2_PORT_VBUSVALID | SSUSB_U2_PORT_HOST) 53662306a36Sopenharmony_ci 53762306a36Sopenharmony_ci/* U3D_SSUSB_DEV_RST_CTRL */ 53862306a36Sopenharmony_ci#define SSUSB_DEV_SW_RST BIT(0) 53962306a36Sopenharmony_ci 54062306a36Sopenharmony_ci/* U3D_SSUSB_IP_TRUNK_VERS */ 54162306a36Sopenharmony_ci#define IP_TRUNK_VERS(x) (((x) >> 16) & 0xffff) 54262306a36Sopenharmony_ci 54362306a36Sopenharmony_ci#endif /* _SSUSB_HW_REGS_H_ */ 544