162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2015 Microchip Technology
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci#ifndef _LAN78XX_H
662306a36Sopenharmony_ci#define _LAN78XX_H
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* USB Vendor Requests */
962306a36Sopenharmony_ci#define USB_VENDOR_REQUEST_WRITE_REGISTER	0xA0
1062306a36Sopenharmony_ci#define USB_VENDOR_REQUEST_READ_REGISTER	0xA1
1162306a36Sopenharmony_ci#define USB_VENDOR_REQUEST_GET_STATS		0xA2
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci/* Interrupt Endpoint status word bitfields */
1462306a36Sopenharmony_ci#define INT_ENP_EEE_START_TX_LPI_INT		BIT(26)
1562306a36Sopenharmony_ci#define INT_ENP_EEE_STOP_TX_LPI_INT		BIT(25)
1662306a36Sopenharmony_ci#define INT_ENP_EEE_RX_LPI_INT			BIT(24)
1762306a36Sopenharmony_ci#define INT_ENP_RDFO_INT			BIT(22)
1862306a36Sopenharmony_ci#define INT_ENP_TXE_INT				BIT(21)
1962306a36Sopenharmony_ci#define INT_ENP_TX_DIS_INT			BIT(19)
2062306a36Sopenharmony_ci#define INT_ENP_RX_DIS_INT			BIT(18)
2162306a36Sopenharmony_ci#define INT_ENP_PHY_INT				BIT(17)
2262306a36Sopenharmony_ci#define INT_ENP_DP_INT				BIT(16)
2362306a36Sopenharmony_ci#define INT_ENP_MAC_ERR_INT			BIT(15)
2462306a36Sopenharmony_ci#define INT_ENP_TDFU_INT			BIT(14)
2562306a36Sopenharmony_ci#define INT_ENP_TDFO_INT			BIT(13)
2662306a36Sopenharmony_ci#define INT_ENP_UTX_FP_INT			BIT(12)
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define TX_PKT_ALIGNMENT			4
2962306a36Sopenharmony_ci#define RX_PKT_ALIGNMENT			4
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci/* Tx Command A */
3262306a36Sopenharmony_ci#define TX_CMD_A_IGE_			(0x20000000)
3362306a36Sopenharmony_ci#define TX_CMD_A_ICE_			(0x10000000)
3462306a36Sopenharmony_ci#define TX_CMD_A_LSO_			(0x08000000)
3562306a36Sopenharmony_ci#define TX_CMD_A_IPE_			(0x04000000)
3662306a36Sopenharmony_ci#define TX_CMD_A_TPE_			(0x02000000)
3762306a36Sopenharmony_ci#define TX_CMD_A_IVTG_			(0x01000000)
3862306a36Sopenharmony_ci#define TX_CMD_A_RVTG_			(0x00800000)
3962306a36Sopenharmony_ci#define TX_CMD_A_FCS_			(0x00400000)
4062306a36Sopenharmony_ci#define TX_CMD_A_LEN_MASK_		(0x000FFFFF)
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci/* Tx Command B */
4362306a36Sopenharmony_ci#define TX_CMD_B_MSS_SHIFT_		(16)
4462306a36Sopenharmony_ci#define TX_CMD_B_MSS_MASK_		(0x3FFF0000)
4562306a36Sopenharmony_ci#define TX_CMD_B_MSS_MIN_		((unsigned short)8)
4662306a36Sopenharmony_ci#define TX_CMD_B_VTAG_MASK_		(0x0000FFFF)
4762306a36Sopenharmony_ci#define TX_CMD_B_VTAG_PRI_MASK_		(0x0000E000)
4862306a36Sopenharmony_ci#define TX_CMD_B_VTAG_CFI_MASK_		(0x00001000)
4962306a36Sopenharmony_ci#define TX_CMD_B_VTAG_VID_MASK_		(0x00000FFF)
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci/* Rx Command A */
5262306a36Sopenharmony_ci#define RX_CMD_A_ICE_			(0x80000000)
5362306a36Sopenharmony_ci#define RX_CMD_A_TCE_			(0x40000000)
5462306a36Sopenharmony_ci#define RX_CMD_A_CSE_MASK_		(0xC0000000)
5562306a36Sopenharmony_ci#define RX_CMD_A_IPV_			(0x20000000)
5662306a36Sopenharmony_ci#define RX_CMD_A_PID_MASK_		(0x18000000)
5762306a36Sopenharmony_ci#define RX_CMD_A_PID_NONE_IP_		(0x00000000)
5862306a36Sopenharmony_ci#define RX_CMD_A_PID_TCP_IP_		(0x08000000)
5962306a36Sopenharmony_ci#define RX_CMD_A_PID_UDP_IP_		(0x10000000)
6062306a36Sopenharmony_ci#define RX_CMD_A_PID_IP_		(0x18000000)
6162306a36Sopenharmony_ci#define RX_CMD_A_PFF_			(0x04000000)
6262306a36Sopenharmony_ci#define RX_CMD_A_BAM_			(0x02000000)
6362306a36Sopenharmony_ci#define RX_CMD_A_MAM_			(0x01000000)
6462306a36Sopenharmony_ci#define RX_CMD_A_FVTG_			(0x00800000)
6562306a36Sopenharmony_ci#define RX_CMD_A_RED_			(0x00400000)
6662306a36Sopenharmony_ci#define RX_CMD_A_RX_ERRS_MASK_		(0xC03F0000)
6762306a36Sopenharmony_ci#define RX_CMD_A_RWT_			(0x00200000)
6862306a36Sopenharmony_ci#define RX_CMD_A_RUNT_			(0x00100000)
6962306a36Sopenharmony_ci#define RX_CMD_A_LONG_			(0x00080000)
7062306a36Sopenharmony_ci#define RX_CMD_A_RXE_			(0x00040000)
7162306a36Sopenharmony_ci#define RX_CMD_A_DRB_			(0x00020000)
7262306a36Sopenharmony_ci#define RX_CMD_A_FCS_			(0x00010000)
7362306a36Sopenharmony_ci#define RX_CMD_A_UAM_			(0x00008000)
7462306a36Sopenharmony_ci#define RX_CMD_A_ICSM_			(0x00004000)
7562306a36Sopenharmony_ci#define RX_CMD_A_LEN_MASK_		(0x00003FFF)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci/* Rx Command B */
7862306a36Sopenharmony_ci#define RX_CMD_B_CSUM_SHIFT_		(16)
7962306a36Sopenharmony_ci#define RX_CMD_B_CSUM_MASK_		(0xFFFF0000)
8062306a36Sopenharmony_ci#define RX_CMD_B_VTAG_MASK_		(0x0000FFFF)
8162306a36Sopenharmony_ci#define RX_CMD_B_VTAG_PRI_MASK_		(0x0000E000)
8262306a36Sopenharmony_ci#define RX_CMD_B_VTAG_CFI_MASK_		(0x00001000)
8362306a36Sopenharmony_ci#define RX_CMD_B_VTAG_VID_MASK_		(0x00000FFF)
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci/* Rx Command C */
8662306a36Sopenharmony_ci#define RX_CMD_C_WAKE_SHIFT_		(15)
8762306a36Sopenharmony_ci#define RX_CMD_C_WAKE_			(0x8000)
8862306a36Sopenharmony_ci#define RX_CMD_C_REF_FAIL_SHIFT_	(14)
8962306a36Sopenharmony_ci#define RX_CMD_C_REF_FAIL_		(0x4000)
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci/* SCSRs */
9262306a36Sopenharmony_ci#define NUMBER_OF_REGS			(193)
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define ID_REV				(0x00)
9562306a36Sopenharmony_ci#define ID_REV_CHIP_ID_MASK_		(0xFFFF0000)
9662306a36Sopenharmony_ci#define ID_REV_CHIP_REV_MASK_		(0x0000FFFF)
9762306a36Sopenharmony_ci#define ID_REV_CHIP_ID_7800_		(0x7800)
9862306a36Sopenharmony_ci#define ID_REV_CHIP_ID_7850_		(0x7850)
9962306a36Sopenharmony_ci#define ID_REV_CHIP_ID_7801_		(0x7801)
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci#define FPGA_REV			(0x04)
10262306a36Sopenharmony_ci#define FPGA_REV_MINOR_MASK_		(0x0000FF00)
10362306a36Sopenharmony_ci#define FPGA_REV_MAJOR_MASK_		(0x000000FF)
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci#define INT_STS				(0x0C)
10662306a36Sopenharmony_ci#define INT_STS_CLEAR_ALL_		(0xFFFFFFFF)
10762306a36Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STRT_	(0x04000000)
10862306a36Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STOP_	(0x02000000)
10962306a36Sopenharmony_ci#define INT_STS_EEE_RX_LPI_		(0x01000000)
11062306a36Sopenharmony_ci#define INT_STS_RDFO_			(0x00400000)
11162306a36Sopenharmony_ci#define INT_STS_TXE_			(0x00200000)
11262306a36Sopenharmony_ci#define INT_STS_TX_DIS_			(0x00080000)
11362306a36Sopenharmony_ci#define INT_STS_RX_DIS_			(0x00040000)
11462306a36Sopenharmony_ci#define INT_STS_PHY_INT_		(0x00020000)
11562306a36Sopenharmony_ci#define INT_STS_DP_INT_			(0x00010000)
11662306a36Sopenharmony_ci#define INT_STS_MAC_ERR_		(0x00008000)
11762306a36Sopenharmony_ci#define INT_STS_TDFU_			(0x00004000)
11862306a36Sopenharmony_ci#define INT_STS_TDFO_			(0x00002000)
11962306a36Sopenharmony_ci#define INT_STS_UFX_FP_			(0x00001000)
12062306a36Sopenharmony_ci#define INT_STS_GPIO_MASK_		(0x00000FFF)
12162306a36Sopenharmony_ci#define INT_STS_GPIO11_			(0x00000800)
12262306a36Sopenharmony_ci#define INT_STS_GPIO10_			(0x00000400)
12362306a36Sopenharmony_ci#define INT_STS_GPIO9_			(0x00000200)
12462306a36Sopenharmony_ci#define INT_STS_GPIO8_			(0x00000100)
12562306a36Sopenharmony_ci#define INT_STS_GPIO7_			(0x00000080)
12662306a36Sopenharmony_ci#define INT_STS_GPIO6_			(0x00000040)
12762306a36Sopenharmony_ci#define INT_STS_GPIO5_			(0x00000020)
12862306a36Sopenharmony_ci#define INT_STS_GPIO4_			(0x00000010)
12962306a36Sopenharmony_ci#define INT_STS_GPIO3_			(0x00000008)
13062306a36Sopenharmony_ci#define INT_STS_GPIO2_			(0x00000004)
13162306a36Sopenharmony_ci#define INT_STS_GPIO1_			(0x00000002)
13262306a36Sopenharmony_ci#define INT_STS_GPIO0_			(0x00000001)
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci#define HW_CFG				(0x010)
13562306a36Sopenharmony_ci#define HW_CFG_CLK125_EN_		(0x02000000)
13662306a36Sopenharmony_ci#define HW_CFG_REFCLK25_EN_		(0x01000000)
13762306a36Sopenharmony_ci#define HW_CFG_LED3_EN_			(0x00800000)
13862306a36Sopenharmony_ci#define HW_CFG_LED2_EN_			(0x00400000)
13962306a36Sopenharmony_ci#define HW_CFG_LED1_EN_			(0x00200000)
14062306a36Sopenharmony_ci#define HW_CFG_LED0_EN_			(0x00100000)
14162306a36Sopenharmony_ci#define HW_CFG_EEE_PHY_LUSU_		(0x00020000)
14262306a36Sopenharmony_ci#define HW_CFG_EEE_TSU_			(0x00010000)
14362306a36Sopenharmony_ci#define HW_CFG_NETDET_STS_		(0x00008000)
14462306a36Sopenharmony_ci#define HW_CFG_NETDET_EN_		(0x00004000)
14562306a36Sopenharmony_ci#define HW_CFG_EEM_			(0x00002000)
14662306a36Sopenharmony_ci#define HW_CFG_RST_PROTECT_		(0x00001000)
14762306a36Sopenharmony_ci#define HW_CFG_CONNECT_BUF_		(0x00000400)
14862306a36Sopenharmony_ci#define HW_CFG_CONNECT_EN_		(0x00000200)
14962306a36Sopenharmony_ci#define HW_CFG_CONNECT_POL_		(0x00000100)
15062306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_MASK_	(0x000000C0)
15162306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_2		(0x00000000)
15262306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_12N	(0x00000040)
15362306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_012N	(0x00000080)
15462306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_0123N	(0x000000C0)
15562306a36Sopenharmony_ci#define HW_CFG_SUSPEND_N_POL_		(0x00000020)
15662306a36Sopenharmony_ci#define HW_CFG_MEF_			(0x00000010)
15762306a36Sopenharmony_ci#define HW_CFG_ETC_			(0x00000008)
15862306a36Sopenharmony_ci#define HW_CFG_LRST_			(0x00000002)
15962306a36Sopenharmony_ci#define HW_CFG_SRST_			(0x00000001)
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define PMT_CTL				(0x014)
16262306a36Sopenharmony_ci#define PMT_CTL_EEE_WAKEUP_EN_		(0x00002000)
16362306a36Sopenharmony_ci#define PMT_CTL_EEE_WUPS_		(0x00001000)
16462306a36Sopenharmony_ci#define PMT_CTL_MAC_SRST_		(0x00000800)
16562306a36Sopenharmony_ci#define PMT_CTL_PHY_PWRUP_		(0x00000400)
16662306a36Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_MASK_	(0x00000300)
16762306a36Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_STS_	(0x00000200)
16862306a36Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_EN_		(0x00000100)
16962306a36Sopenharmony_ci#define PMT_CTL_READY_			(0x00000080)
17062306a36Sopenharmony_ci#define PMT_CTL_SUS_MODE_MASK_		(0x00000060)
17162306a36Sopenharmony_ci#define PMT_CTL_SUS_MODE_0_		(0x00000000)
17262306a36Sopenharmony_ci#define PMT_CTL_SUS_MODE_1_		(0x00000020)
17362306a36Sopenharmony_ci#define PMT_CTL_SUS_MODE_2_		(0x00000040)
17462306a36Sopenharmony_ci#define PMT_CTL_SUS_MODE_3_		(0x00000060)
17562306a36Sopenharmony_ci#define PMT_CTL_PHY_RST_		(0x00000010)
17662306a36Sopenharmony_ci#define PMT_CTL_WOL_EN_			(0x00000008)
17762306a36Sopenharmony_ci#define PMT_CTL_PHY_WAKE_EN_		(0x00000004)
17862306a36Sopenharmony_ci#define PMT_CTL_WUPS_MASK_		(0x00000003)
17962306a36Sopenharmony_ci#define PMT_CTL_WUPS_MLT_		(0x00000003)
18062306a36Sopenharmony_ci#define PMT_CTL_WUPS_MAC_		(0x00000002)
18162306a36Sopenharmony_ci#define PMT_CTL_WUPS_PHY_		(0x00000001)
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci#define GPIO_CFG0			(0x018)
18462306a36Sopenharmony_ci#define GPIO_CFG0_GPIOEN_MASK_		(0x0000F000)
18562306a36Sopenharmony_ci#define GPIO_CFG0_GPIOEN3_		(0x00008000)
18662306a36Sopenharmony_ci#define GPIO_CFG0_GPIOEN2_		(0x00004000)
18762306a36Sopenharmony_ci#define GPIO_CFG0_GPIOEN1_		(0x00002000)
18862306a36Sopenharmony_ci#define GPIO_CFG0_GPIOEN0_		(0x00001000)
18962306a36Sopenharmony_ci#define GPIO_CFG0_GPIOBUF_MASK_		(0x00000F00)
19062306a36Sopenharmony_ci#define GPIO_CFG0_GPIOBUF3_		(0x00000800)
19162306a36Sopenharmony_ci#define GPIO_CFG0_GPIOBUF2_		(0x00000400)
19262306a36Sopenharmony_ci#define GPIO_CFG0_GPIOBUF1_		(0x00000200)
19362306a36Sopenharmony_ci#define GPIO_CFG0_GPIOBUF0_		(0x00000100)
19462306a36Sopenharmony_ci#define GPIO_CFG0_GPIODIR_MASK_		(0x000000F0)
19562306a36Sopenharmony_ci#define GPIO_CFG0_GPIODIR3_		(0x00000080)
19662306a36Sopenharmony_ci#define GPIO_CFG0_GPIODIR2_		(0x00000040)
19762306a36Sopenharmony_ci#define GPIO_CFG0_GPIODIR1_		(0x00000020)
19862306a36Sopenharmony_ci#define GPIO_CFG0_GPIODIR0_		(0x00000010)
19962306a36Sopenharmony_ci#define GPIO_CFG0_GPIOD_MASK_		(0x0000000F)
20062306a36Sopenharmony_ci#define GPIO_CFG0_GPIOD3_		(0x00000008)
20162306a36Sopenharmony_ci#define GPIO_CFG0_GPIOD2_		(0x00000004)
20262306a36Sopenharmony_ci#define GPIO_CFG0_GPIOD1_		(0x00000002)
20362306a36Sopenharmony_ci#define GPIO_CFG0_GPIOD0_		(0x00000001)
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci#define GPIO_CFG1			(0x01C)
20662306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN_MASK_		(0xFF000000)
20762306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN11_		(0x80000000)
20862306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN10_		(0x40000000)
20962306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN9_		(0x20000000)
21062306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN8_		(0x10000000)
21162306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN7_		(0x08000000)
21262306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN6_		(0x04000000)
21362306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN5_		(0x02000000)
21462306a36Sopenharmony_ci#define GPIO_CFG1_GPIOEN4_		(0x01000000)
21562306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF_MASK_		(0x00FF0000)
21662306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF11_		(0x00800000)
21762306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF10_		(0x00400000)
21862306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF9_		(0x00200000)
21962306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF8_		(0x00100000)
22062306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF7_		(0x00080000)
22162306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF6_		(0x00040000)
22262306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF5_		(0x00020000)
22362306a36Sopenharmony_ci#define GPIO_CFG1_GPIOBUF4_		(0x00010000)
22462306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR_MASK_		(0x0000FF00)
22562306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR11_		(0x00008000)
22662306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR10_		(0x00004000)
22762306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR9_		(0x00002000)
22862306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR8_		(0x00001000)
22962306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR7_		(0x00000800)
23062306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR6_		(0x00000400)
23162306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR5_		(0x00000200)
23262306a36Sopenharmony_ci#define GPIO_CFG1_GPIODIR4_		(0x00000100)
23362306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD_MASK_		(0x000000FF)
23462306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD11_		(0x00000080)
23562306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD10_		(0x00000040)
23662306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD9_		(0x00000020)
23762306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD8_		(0x00000010)
23862306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD7_		(0x00000008)
23962306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD6_		(0x00000004)
24062306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD6_		(0x00000004)
24162306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD5_		(0x00000002)
24262306a36Sopenharmony_ci#define GPIO_CFG1_GPIOD4_		(0x00000001)
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci#define GPIO_WAKE			(0x020)
24562306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL_MASK_		(0x0FFF0000)
24662306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL11_		(0x08000000)
24762306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL10_		(0x04000000)
24862306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL9_		(0x02000000)
24962306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL8_		(0x01000000)
25062306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL7_		(0x00800000)
25162306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL6_		(0x00400000)
25262306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL5_		(0x00200000)
25362306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL4_		(0x00100000)
25462306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL3_		(0x00080000)
25562306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL2_		(0x00040000)
25662306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL1_		(0x00020000)
25762306a36Sopenharmony_ci#define GPIO_WAKE_GPIOPOL0_		(0x00010000)
25862306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK_MASK_		(0x00000FFF)
25962306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK11_		(0x00000800)
26062306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK10_		(0x00000400)
26162306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK9_		(0x00000200)
26262306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK8_		(0x00000100)
26362306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK7_		(0x00000080)
26462306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK6_		(0x00000040)
26562306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK5_		(0x00000020)
26662306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK4_		(0x00000010)
26762306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK3_		(0x00000008)
26862306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK2_		(0x00000004)
26962306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK1_		(0x00000002)
27062306a36Sopenharmony_ci#define GPIO_WAKE_GPIOWK0_		(0x00000001)
27162306a36Sopenharmony_ci
27262306a36Sopenharmony_ci#define DP_SEL				(0x024)
27362306a36Sopenharmony_ci#define DP_SEL_DPRDY_			(0x80000000)
27462306a36Sopenharmony_ci#define DP_SEL_RSEL_MASK_		(0x0000000F)
27562306a36Sopenharmony_ci#define DP_SEL_RSEL_USB_PHY_CSRS_	(0x0000000F)
27662306a36Sopenharmony_ci#define DP_SEL_RSEL_OTP_64BIT_		(0x00000009)
27762306a36Sopenharmony_ci#define DP_SEL_RSEL_OTP_8BIT_		(0x00000008)
27862306a36Sopenharmony_ci#define DP_SEL_RSEL_UTX_BUF_RAM_	(0x00000007)
27962306a36Sopenharmony_ci#define DP_SEL_RSEL_DESC_RAM_		(0x00000005)
28062306a36Sopenharmony_ci#define DP_SEL_RSEL_TXFIFO_		(0x00000004)
28162306a36Sopenharmony_ci#define DP_SEL_RSEL_RXFIFO_		(0x00000003)
28262306a36Sopenharmony_ci#define DP_SEL_RSEL_LSO_		(0x00000002)
28362306a36Sopenharmony_ci#define DP_SEL_RSEL_VLAN_DA_		(0x00000001)
28462306a36Sopenharmony_ci#define DP_SEL_RSEL_URXBUF_		(0x00000000)
28562306a36Sopenharmony_ci#define DP_SEL_VHF_HASH_LEN		(16)
28662306a36Sopenharmony_ci#define DP_SEL_VHF_VLAN_LEN		(128)
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ci#define DP_CMD				(0x028)
28962306a36Sopenharmony_ci#define DP_CMD_WRITE_			(0x00000001)
29062306a36Sopenharmony_ci#define DP_CMD_READ_			(0x00000000)
29162306a36Sopenharmony_ci
29262306a36Sopenharmony_ci#define DP_ADDR				(0x02C)
29362306a36Sopenharmony_ci#define DP_ADDR_MASK_			(0x00003FFF)
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci#define DP_DATA				(0x030)
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_ci#define E2P_CMD				(0x040)
29862306a36Sopenharmony_ci#define E2P_CMD_EPC_BUSY_		(0x80000000)
29962306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_MASK_		(0x70000000)
30062306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_RELOAD_		(0x70000000)
30162306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_ERAL_		(0x60000000)
30262306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_ERASE_		(0x50000000)
30362306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_WRAL_		(0x40000000)
30462306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_WRITE_		(0x30000000)
30562306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_EWEN_		(0x20000000)
30662306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_EWDS_		(0x10000000)
30762306a36Sopenharmony_ci#define E2P_CMD_EPC_CMD_READ_		(0x00000000)
30862306a36Sopenharmony_ci#define E2P_CMD_EPC_TIMEOUT_		(0x00000400)
30962306a36Sopenharmony_ci#define E2P_CMD_EPC_DL_			(0x00000200)
31062306a36Sopenharmony_ci#define E2P_CMD_EPC_ADDR_MASK_		(0x000001FF)
31162306a36Sopenharmony_ci
31262306a36Sopenharmony_ci#define E2P_DATA			(0x044)
31362306a36Sopenharmony_ci#define E2P_DATA_EEPROM_DATA_MASK_	(0x000000FF)
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ci#define BOS_ATTR			(0x050)
31662306a36Sopenharmony_ci#define BOS_ATTR_BLOCK_SIZE_MASK_	(0x000000FF)
31762306a36Sopenharmony_ci
31862306a36Sopenharmony_ci#define SS_ATTR				(0x054)
31962306a36Sopenharmony_ci#define SS_ATTR_POLL_INT_MASK_		(0x00FF0000)
32062306a36Sopenharmony_ci#define SS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
32162306a36Sopenharmony_ci#define SS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
32262306a36Sopenharmony_ci
32362306a36Sopenharmony_ci#define HS_ATTR				(0x058)
32462306a36Sopenharmony_ci#define HS_ATTR_POLL_INT_MASK_		(0x00FF0000)
32562306a36Sopenharmony_ci#define HS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
32662306a36Sopenharmony_ci#define HS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci#define FS_ATTR				(0x05C)
32962306a36Sopenharmony_ci#define FS_ATTR_POLL_INT_MASK_		(0x00FF0000)
33062306a36Sopenharmony_ci#define FS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
33162306a36Sopenharmony_ci#define FS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ci#define STR_ATTR0			    (0x060)
33462306a36Sopenharmony_ci#define STR_ATTR0_CFGSTR_DESC_SIZE_MASK_    (0xFF000000)
33562306a36Sopenharmony_ci#define STR_ATTR0_SERSTR_DESC_SIZE_MASK_    (0x00FF0000)
33662306a36Sopenharmony_ci#define STR_ATTR0_PRODSTR_DESC_SIZE_MASK_   (0x0000FF00)
33762306a36Sopenharmony_ci#define STR_ATTR0_MANUF_DESC_SIZE_MASK_     (0x000000FF)
33862306a36Sopenharmony_ci
33962306a36Sopenharmony_ci#define STR_ATTR1			    (0x064)
34062306a36Sopenharmony_ci#define STR_ATTR1_INTSTR_DESC_SIZE_MASK_    (0x000000FF)
34162306a36Sopenharmony_ci
34262306a36Sopenharmony_ci#define STR_FLAG_ATTR			    (0x068)
34362306a36Sopenharmony_ci#define STR_FLAG_ATTR_PME_FLAGS_MASK_	    (0x000000FF)
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci#define USB_CFG0			(0x080)
34662306a36Sopenharmony_ci#define USB_CFG_LPM_RESPONSE_		(0x80000000)
34762306a36Sopenharmony_ci#define USB_CFG_LPM_CAPABILITY_		(0x40000000)
34862306a36Sopenharmony_ci#define USB_CFG_LPM_ENBL_SLPM_		(0x20000000)
34962306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_MASK_		(0x1F000000)
35062306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_960_		(0x1C000000)
35162306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_885_		(0x1B000000)
35262306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_810_		(0x1A000000)
35362306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_735_		(0x19000000)
35462306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_660_		(0x18000000)
35562306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_585_		(0x17000000)
35662306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_510_		(0x16000000)
35762306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_435_		(0x15000000)
35862306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_360_		(0x14000000)
35962306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_285_		(0x13000000)
36062306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_210_		(0x12000000)
36162306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_135_		(0x11000000)
36262306a36Sopenharmony_ci#define USB_CFG_HIRD_THR_60_		(0x10000000)
36362306a36Sopenharmony_ci#define USB_CFG_MAX_BURST_BI_MASK_	(0x00F00000)
36462306a36Sopenharmony_ci#define USB_CFG_MAX_BURST_BO_MASK_	(0x000F0000)
36562306a36Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_MASK_	(0x0000E000)
36662306a36Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_SS_	(0x00008000)
36762306a36Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_HS_	(0x00000000)
36862306a36Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_FS_	(0x00002000)
36962306a36Sopenharmony_ci#define USB_CFG_PHY_BOOST_MASK_		(0x00000180)
37062306a36Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_12_	(0x00000180)
37162306a36Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_8_	(0x00000100)
37262306a36Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_4_	(0x00000080)
37362306a36Sopenharmony_ci#define USB_CFG_PHY_BOOST_NORMAL_	(0x00000000)
37462306a36Sopenharmony_ci#define USB_CFG_BIR_			(0x00000040)
37562306a36Sopenharmony_ci#define USB_CFG_BCE_			(0x00000020)
37662306a36Sopenharmony_ci#define USB_CFG_PORT_SWAP_		(0x00000010)
37762306a36Sopenharmony_ci#define USB_CFG_LPM_EN_			(0x00000008)
37862306a36Sopenharmony_ci#define USB_CFG_RMT_WKP_		(0x00000004)
37962306a36Sopenharmony_ci#define USB_CFG_PWR_SEL_		(0x00000002)
38062306a36Sopenharmony_ci#define USB_CFG_STALL_BO_DIS_		(0x00000001)
38162306a36Sopenharmony_ci
38262306a36Sopenharmony_ci#define USB_CFG1			(0x084)
38362306a36Sopenharmony_ci#define USB_CFG1_U1_TIMEOUT_MASK_	(0xFF000000)
38462306a36Sopenharmony_ci#define USB_CFG1_U2_TIMEOUT_MASK_	(0x00FF0000)
38562306a36Sopenharmony_ci#define USB_CFG1_HS_TOUT_CAL_MASK_	(0x0000E000)
38662306a36Sopenharmony_ci#define USB_CFG1_DEV_U2_INIT_EN_	(0x00001000)
38762306a36Sopenharmony_ci#define USB_CFG1_DEV_U2_EN_		(0x00000800)
38862306a36Sopenharmony_ci#define USB_CFG1_DEV_U1_INIT_EN_	(0x00000400)
38962306a36Sopenharmony_ci#define USB_CFG1_DEV_U1_EN_		(0x00000200)
39062306a36Sopenharmony_ci#define USB_CFG1_LTM_ENABLE_		(0x00000100)
39162306a36Sopenharmony_ci#define USB_CFG1_FS_TOUT_CAL_MASK_	(0x00000070)
39262306a36Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MASK_	(0x00000003)
39362306a36Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE3_	(0x00000003)
39462306a36Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE2_	(0x00000002)
39562306a36Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE1_	(0x00000001)
39662306a36Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE0_	(0x00000000)
39762306a36Sopenharmony_ci
39862306a36Sopenharmony_ci#define USB_CFG2			    (0x088)
39962306a36Sopenharmony_ci#define USB_CFG2_SS_DETACH_TIME_MASK_	    (0xFFFF0000)
40062306a36Sopenharmony_ci#define USB_CFG2_HS_DETACH_TIME_MASK_	    (0x0000FFFF)
40162306a36Sopenharmony_ci
40262306a36Sopenharmony_ci#define BURST_CAP			(0x090)
40362306a36Sopenharmony_ci#define BURST_CAP_SIZE_MASK_		(0x000000FF)
40462306a36Sopenharmony_ci
40562306a36Sopenharmony_ci#define BULK_IN_DLY			(0x094)
40662306a36Sopenharmony_ci#define BULK_IN_DLY_MASK_		(0x0000FFFF)
40762306a36Sopenharmony_ci
40862306a36Sopenharmony_ci#define INT_EP_CTL			(0x098)
40962306a36Sopenharmony_ci#define INT_EP_INTEP_ON_		(0x80000000)
41062306a36Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STRT_EN_	(0x04000000)
41162306a36Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STOP_EN_	(0x02000000)
41262306a36Sopenharmony_ci#define INT_STS_EEE_RX_LPI_EN_		(0x01000000)
41362306a36Sopenharmony_ci#define INT_EP_RDFO_EN_			(0x00400000)
41462306a36Sopenharmony_ci#define INT_EP_TXE_EN_			(0x00200000)
41562306a36Sopenharmony_ci#define INT_EP_TX_DIS_EN_		(0x00080000)
41662306a36Sopenharmony_ci#define INT_EP_RX_DIS_EN_		(0x00040000)
41762306a36Sopenharmony_ci#define INT_EP_PHY_INT_EN_		(0x00020000)
41862306a36Sopenharmony_ci#define INT_EP_DP_INT_EN_		(0x00010000)
41962306a36Sopenharmony_ci#define INT_EP_MAC_ERR_EN_		(0x00008000)
42062306a36Sopenharmony_ci#define INT_EP_TDFU_EN_			(0x00004000)
42162306a36Sopenharmony_ci#define INT_EP_TDFO_EN_			(0x00002000)
42262306a36Sopenharmony_ci#define INT_EP_UTX_FP_EN_		(0x00001000)
42362306a36Sopenharmony_ci#define INT_EP_GPIO_EN_MASK_		(0x00000FFF)
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci#define PIPE_CTL			(0x09C)
42662306a36Sopenharmony_ci#define PIPE_CTL_TXSWING_		(0x00000040)
42762306a36Sopenharmony_ci#define PIPE_CTL_TXMARGIN_MASK_		(0x00000038)
42862306a36Sopenharmony_ci#define PIPE_CTL_TXDEEMPHASIS_MASK_	(0x00000006)
42962306a36Sopenharmony_ci#define PIPE_CTL_ELASTICITYBUFFERMODE_	(0x00000001)
43062306a36Sopenharmony_ci
43162306a36Sopenharmony_ci#define U1_LATENCY			(0xA0)
43262306a36Sopenharmony_ci#define U2_LATENCY			(0xA4)
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_ci#define USB_STATUS			(0x0A8)
43562306a36Sopenharmony_ci#define USB_STATUS_REMOTE_WK_		(0x00100000)
43662306a36Sopenharmony_ci#define USB_STATUS_FUNC_REMOTE_WK_	(0x00080000)
43762306a36Sopenharmony_ci#define USB_STATUS_LTM_ENABLE_		(0x00040000)
43862306a36Sopenharmony_ci#define USB_STATUS_U2_ENABLE_		(0x00020000)
43962306a36Sopenharmony_ci#define USB_STATUS_U1_ENABLE_		(0x00010000)
44062306a36Sopenharmony_ci#define USB_STATUS_SET_SEL_		(0x00000020)
44162306a36Sopenharmony_ci#define USB_STATUS_REMOTE_WK_STS_	(0x00000010)
44262306a36Sopenharmony_ci#define USB_STATUS_FUNC_REMOTE_WK_STS_	(0x00000008)
44362306a36Sopenharmony_ci#define USB_STATUS_LTM_ENABLE_STS_	(0x00000004)
44462306a36Sopenharmony_ci#define USB_STATUS_U2_ENABLE_STS_	(0x00000002)
44562306a36Sopenharmony_ci#define USB_STATUS_U1_ENABLE_STS_	(0x00000001)
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci#define USB_CFG3			(0x0AC)
44862306a36Sopenharmony_ci#define USB_CFG3_EN_U2_LTM_		(0x40000000)
44962306a36Sopenharmony_ci#define USB_CFG3_BULK_OUT_NUMP_OVR_	(0x20000000)
45062306a36Sopenharmony_ci#define USB_CFG3_DIS_FAST_U1_EXIT_	(0x10000000)
45162306a36Sopenharmony_ci#define USB_CFG3_LPM_NYET_THR_		(0x0F000000)
45262306a36Sopenharmony_ci#define USB_CFG3_RX_DET_2_POL_LFPS_	(0x00800000)
45362306a36Sopenharmony_ci#define USB_CFG3_LFPS_FILT_		(0x00400000)
45462306a36Sopenharmony_ci#define USB_CFG3_SKIP_RX_DET_		(0x00200000)
45562306a36Sopenharmony_ci#define USB_CFG3_DELAY_P1P2P3_		(0x001C0000)
45662306a36Sopenharmony_ci#define USB_CFG3_DELAY_PHY_PWR_CHG_	(0x00020000)
45762306a36Sopenharmony_ci#define USB_CFG3_U1U2_EXIT_FR_		(0x00010000)
45862306a36Sopenharmony_ci#define USB_CFG3_REQ_P1P2P3		(0x00008000)
45962306a36Sopenharmony_ci#define USB_CFG3_HST_PRT_CMPL_		(0x00004000)
46062306a36Sopenharmony_ci#define USB_CFG3_DIS_SCRAMB_		(0x00002000)
46162306a36Sopenharmony_ci#define USB_CFG3_PWR_DN_SCALE_		(0x00001FFF)
46262306a36Sopenharmony_ci
46362306a36Sopenharmony_ci#define RFE_CTL				(0x0B0)
46462306a36Sopenharmony_ci#define RFE_CTL_IGMP_COE_		(0x00004000)
46562306a36Sopenharmony_ci#define RFE_CTL_ICMP_COE_		(0x00002000)
46662306a36Sopenharmony_ci#define RFE_CTL_TCPUDP_COE_		(0x00001000)
46762306a36Sopenharmony_ci#define RFE_CTL_IP_COE_			(0x00000800)
46862306a36Sopenharmony_ci#define RFE_CTL_BCAST_EN_		(0x00000400)
46962306a36Sopenharmony_ci#define RFE_CTL_MCAST_EN_		(0x00000200)
47062306a36Sopenharmony_ci#define RFE_CTL_UCAST_EN_		(0x00000100)
47162306a36Sopenharmony_ci#define RFE_CTL_VLAN_STRIP_		(0x00000080)
47262306a36Sopenharmony_ci#define RFE_CTL_DISCARD_UNTAGGED_	(0x00000040)
47362306a36Sopenharmony_ci#define RFE_CTL_VLAN_FILTER_		(0x00000020)
47462306a36Sopenharmony_ci#define RFE_CTL_SA_FILTER_		(0x00000010)
47562306a36Sopenharmony_ci#define RFE_CTL_MCAST_HASH_		(0x00000008)
47662306a36Sopenharmony_ci#define RFE_CTL_DA_HASH_		(0x00000004)
47762306a36Sopenharmony_ci#define RFE_CTL_DA_PERFECT_		(0x00000002)
47862306a36Sopenharmony_ci#define RFE_CTL_RST_			(0x00000001)
47962306a36Sopenharmony_ci
48062306a36Sopenharmony_ci#define VLAN_TYPE			(0x0B4)
48162306a36Sopenharmony_ci#define VLAN_TYPE_MASK_			(0x0000FFFF)
48262306a36Sopenharmony_ci
48362306a36Sopenharmony_ci#define FCT_RX_CTL			(0x0C0)
48462306a36Sopenharmony_ci#define FCT_RX_CTL_EN_			(0x80000000)
48562306a36Sopenharmony_ci#define FCT_RX_CTL_RST_			(0x40000000)
48662306a36Sopenharmony_ci#define FCT_RX_CTL_SBF_			(0x02000000)
48762306a36Sopenharmony_ci#define FCT_RX_CTL_OVFL_		(0x01000000)
48862306a36Sopenharmony_ci#define FCT_RX_CTL_DROP_		(0x00800000)
48962306a36Sopenharmony_ci#define FCT_RX_CTL_NOT_EMPTY_		(0x00400000)
49062306a36Sopenharmony_ci#define FCT_RX_CTL_EMPTY_		(0x00200000)
49162306a36Sopenharmony_ci#define FCT_RX_CTL_DIS_			(0x00100000)
49262306a36Sopenharmony_ci#define FCT_RX_CTL_USED_MASK_		(0x0000FFFF)
49362306a36Sopenharmony_ci
49462306a36Sopenharmony_ci#define FCT_TX_CTL			(0x0C4)
49562306a36Sopenharmony_ci#define FCT_TX_CTL_EN_			(0x80000000)
49662306a36Sopenharmony_ci#define FCT_TX_CTL_RST_			(0x40000000)
49762306a36Sopenharmony_ci#define FCT_TX_CTL_NOT_EMPTY_		(0x00400000)
49862306a36Sopenharmony_ci#define FCT_TX_CTL_EMPTY_		(0x00200000)
49962306a36Sopenharmony_ci#define FCT_TX_CTL_DIS_			(0x00100000)
50062306a36Sopenharmony_ci#define FCT_TX_CTL_USED_MASK_		(0x0000FFFF)
50162306a36Sopenharmony_ci
50262306a36Sopenharmony_ci#define FCT_RX_FIFO_END			(0x0C8)
50362306a36Sopenharmony_ci#define FCT_RX_FIFO_END_MASK_		(0x0000007F)
50462306a36Sopenharmony_ci
50562306a36Sopenharmony_ci#define FCT_TX_FIFO_END			(0x0CC)
50662306a36Sopenharmony_ci#define FCT_TX_FIFO_END_MASK_		(0x0000003F)
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_ci#define FCT_FLOW			(0x0D0)
50962306a36Sopenharmony_ci#define FCT_FLOW_OFF_MASK_		(0x00007F00)
51062306a36Sopenharmony_ci#define FCT_FLOW_ON_MASK_		(0x0000007F)
51162306a36Sopenharmony_ci
51262306a36Sopenharmony_ci#define RX_DP_STOR			(0x0D4)
51362306a36Sopenharmony_ci#define RX_DP_STORE_TOT_RXUSED_MASK_	(0xFFFF0000)
51462306a36Sopenharmony_ci#define RX_DP_STORE_UTX_RXUSED_MASK_	(0x0000FFFF)
51562306a36Sopenharmony_ci
51662306a36Sopenharmony_ci#define TX_DP_STOR			(0x0D8)
51762306a36Sopenharmony_ci#define TX_DP_STORE_TOT_TXUSED_MASK_	(0xFFFF0000)
51862306a36Sopenharmony_ci#define TX_DP_STORE_URX_TXUSED_MASK_	(0x0000FFFF)
51962306a36Sopenharmony_ci
52062306a36Sopenharmony_ci#define LTM_BELT_IDLE0			(0x0E0)
52162306a36Sopenharmony_ci#define LTM_BELT_IDLE0_IDLE1000_	(0x0FFF0000)
52262306a36Sopenharmony_ci#define LTM_BELT_IDLE0_IDLE100_		(0x00000FFF)
52362306a36Sopenharmony_ci
52462306a36Sopenharmony_ci#define LTM_BELT_IDLE1			(0x0E4)
52562306a36Sopenharmony_ci#define LTM_BELT_IDLE1_IDLE10_		(0x00000FFF)
52662306a36Sopenharmony_ci
52762306a36Sopenharmony_ci#define LTM_BELT_ACT0			(0x0E8)
52862306a36Sopenharmony_ci#define LTM_BELT_ACT0_ACT1000_		(0x0FFF0000)
52962306a36Sopenharmony_ci#define LTM_BELT_ACT0_ACT100_		(0x00000FFF)
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_ci#define LTM_BELT_ACT1			(0x0EC)
53262306a36Sopenharmony_ci#define LTM_BELT_ACT1_ACT10_		(0x00000FFF)
53362306a36Sopenharmony_ci
53462306a36Sopenharmony_ci#define LTM_INACTIVE0			(0x0F0)
53562306a36Sopenharmony_ci#define LTM_INACTIVE0_TIMER1000_	(0xFFFF0000)
53662306a36Sopenharmony_ci#define LTM_INACTIVE0_TIMER100_		(0x0000FFFF)
53762306a36Sopenharmony_ci
53862306a36Sopenharmony_ci#define LTM_INACTIVE1			(0x0F4)
53962306a36Sopenharmony_ci#define LTM_INACTIVE1_TIMER10_		(0x0000FFFF)
54062306a36Sopenharmony_ci
54162306a36Sopenharmony_ci#define MAC_CR				(0x100)
54262306a36Sopenharmony_ci#define MAC_CR_GMII_EN_			(0x00080000)
54362306a36Sopenharmony_ci#define MAC_CR_EEE_TX_CLK_STOP_EN_	(0x00040000)
54462306a36Sopenharmony_ci#define MAC_CR_EEE_EN_			(0x00020000)
54562306a36Sopenharmony_ci#define MAC_CR_EEE_TLAR_EN_		(0x00010000)
54662306a36Sopenharmony_ci#define MAC_CR_ADP_			(0x00002000)
54762306a36Sopenharmony_ci#define MAC_CR_AUTO_DUPLEX_		(0x00001000)
54862306a36Sopenharmony_ci#define MAC_CR_AUTO_SPEED_		(0x00000800)
54962306a36Sopenharmony_ci#define MAC_CR_LOOPBACK_		(0x00000400)
55062306a36Sopenharmony_ci#define MAC_CR_BOLMT_MASK_		(0x000000C0)
55162306a36Sopenharmony_ci#define MAC_CR_FULL_DUPLEX_		(0x00000008)
55262306a36Sopenharmony_ci#define MAC_CR_SPEED_MASK_		(0x00000006)
55362306a36Sopenharmony_ci#define MAC_CR_SPEED_1000_		(0x00000004)
55462306a36Sopenharmony_ci#define MAC_CR_SPEED_100_		(0x00000002)
55562306a36Sopenharmony_ci#define MAC_CR_SPEED_10_		(0x00000000)
55662306a36Sopenharmony_ci#define MAC_CR_RST_			(0x00000001)
55762306a36Sopenharmony_ci
55862306a36Sopenharmony_ci#define MAC_RX				(0x104)
55962306a36Sopenharmony_ci#define MAC_RX_MAX_SIZE_SHIFT_		(16)
56062306a36Sopenharmony_ci#define MAC_RX_MAX_SIZE_MASK_		(0x3FFF0000)
56162306a36Sopenharmony_ci#define MAC_RX_FCS_STRIP_		(0x00000010)
56262306a36Sopenharmony_ci#define MAC_RX_VLAN_FSE_		(0x00000004)
56362306a36Sopenharmony_ci#define MAC_RX_RXD_			(0x00000002)
56462306a36Sopenharmony_ci#define MAC_RX_RXEN_			(0x00000001)
56562306a36Sopenharmony_ci
56662306a36Sopenharmony_ci#define MAC_TX				(0x108)
56762306a36Sopenharmony_ci#define MAC_TX_BAD_FCS_			(0x00000004)
56862306a36Sopenharmony_ci#define MAC_TX_TXD_			(0x00000002)
56962306a36Sopenharmony_ci#define MAC_TX_TXEN_			(0x00000001)
57062306a36Sopenharmony_ci
57162306a36Sopenharmony_ci#define FLOW				(0x10C)
57262306a36Sopenharmony_ci#define FLOW_CR_FORCE_FC_		(0x80000000)
57362306a36Sopenharmony_ci#define FLOW_CR_TX_FCEN_		(0x40000000)
57462306a36Sopenharmony_ci#define FLOW_CR_RX_FCEN_		(0x20000000)
57562306a36Sopenharmony_ci#define FLOW_CR_FPF_			(0x10000000)
57662306a36Sopenharmony_ci#define FLOW_CR_FCPT_MASK_		(0x0000FFFF)
57762306a36Sopenharmony_ci
57862306a36Sopenharmony_ci#define RAND_SEED			(0x110)
57962306a36Sopenharmony_ci#define RAND_SEED_MASK_			(0x0000FFFF)
58062306a36Sopenharmony_ci
58162306a36Sopenharmony_ci#define ERR_STS				(0x114)
58262306a36Sopenharmony_ci#define ERR_STS_FERR_			(0x00000100)
58362306a36Sopenharmony_ci#define ERR_STS_LERR_			(0x00000080)
58462306a36Sopenharmony_ci#define ERR_STS_RFERR_			(0x00000040)
58562306a36Sopenharmony_ci#define ERR_STS_ECERR_			(0x00000010)
58662306a36Sopenharmony_ci#define ERR_STS_ALERR_			(0x00000008)
58762306a36Sopenharmony_ci#define ERR_STS_URERR_			(0x00000004)
58862306a36Sopenharmony_ci
58962306a36Sopenharmony_ci#define RX_ADDRH			(0x118)
59062306a36Sopenharmony_ci#define RX_ADDRH_MASK_			(0x0000FFFF)
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_ci#define RX_ADDRL			(0x11C)
59362306a36Sopenharmony_ci#define RX_ADDRL_MASK_			(0xFFFFFFFF)
59462306a36Sopenharmony_ci
59562306a36Sopenharmony_ci#define MII_ACC				(0x120)
59662306a36Sopenharmony_ci#define MII_ACC_PHY_ADDR_SHIFT_		(11)
59762306a36Sopenharmony_ci#define MII_ACC_PHY_ADDR_MASK_		(0x0000F800)
59862306a36Sopenharmony_ci#define MII_ACC_MIIRINDA_SHIFT_		(6)
59962306a36Sopenharmony_ci#define MII_ACC_MIIRINDA_MASK_		(0x000007C0)
60062306a36Sopenharmony_ci#define MII_ACC_MII_READ_		(0x00000000)
60162306a36Sopenharmony_ci#define MII_ACC_MII_WRITE_		(0x00000002)
60262306a36Sopenharmony_ci#define MII_ACC_MII_BUSY_		(0x00000001)
60362306a36Sopenharmony_ci
60462306a36Sopenharmony_ci#define MII_DATA			(0x124)
60562306a36Sopenharmony_ci#define MII_DATA_MASK_			(0x0000FFFF)
60662306a36Sopenharmony_ci
60762306a36Sopenharmony_ci#define MAC_RGMII_ID			(0x128)
60862306a36Sopenharmony_ci#define MAC_RGMII_ID_TXC_DELAY_EN_	(0x00000002)
60962306a36Sopenharmony_ci#define MAC_RGMII_ID_RXC_DELAY_EN_	(0x00000001)
61062306a36Sopenharmony_ci
61162306a36Sopenharmony_ci#define EEE_TX_LPI_REQ_DLY		(0x130)
61262306a36Sopenharmony_ci#define EEE_TX_LPI_REQ_DLY_CNT_MASK_	(0xFFFFFFFF)
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci#define EEE_TW_TX_SYS			(0x134)
61562306a36Sopenharmony_ci#define EEE_TW_TX_SYS_CNT1G_MASK_	(0xFFFF0000)
61662306a36Sopenharmony_ci#define EEE_TW_TX_SYS_CNT100M_MASK_	(0x0000FFFF)
61762306a36Sopenharmony_ci
61862306a36Sopenharmony_ci#define EEE_TX_LPI_REM_DLY		(0x138)
61962306a36Sopenharmony_ci#define EEE_TX_LPI_REM_DLY_CNT_		(0x00FFFFFF)
62062306a36Sopenharmony_ci
62162306a36Sopenharmony_ci#define WUCSR				(0x140)
62262306a36Sopenharmony_ci#define WUCSR_TESTMODE_			(0x80000000)
62362306a36Sopenharmony_ci#define WUCSR_RFE_WAKE_EN_		(0x00004000)
62462306a36Sopenharmony_ci#define WUCSR_EEE_TX_WAKE_		(0x00002000)
62562306a36Sopenharmony_ci#define WUCSR_EEE_TX_WAKE_EN_		(0x00001000)
62662306a36Sopenharmony_ci#define WUCSR_EEE_RX_WAKE_		(0x00000800)
62762306a36Sopenharmony_ci#define WUCSR_EEE_RX_WAKE_EN_		(0x00000400)
62862306a36Sopenharmony_ci#define WUCSR_RFE_WAKE_FR_		(0x00000200)
62962306a36Sopenharmony_ci#define WUCSR_STORE_WAKE_		(0x00000100)
63062306a36Sopenharmony_ci#define WUCSR_PFDA_FR_			(0x00000080)
63162306a36Sopenharmony_ci#define WUCSR_WUFR_			(0x00000040)
63262306a36Sopenharmony_ci#define WUCSR_MPR_			(0x00000020)
63362306a36Sopenharmony_ci#define WUCSR_BCST_FR_			(0x00000010)
63462306a36Sopenharmony_ci#define WUCSR_PFDA_EN_			(0x00000008)
63562306a36Sopenharmony_ci#define WUCSR_WAKE_EN_			(0x00000004)
63662306a36Sopenharmony_ci#define WUCSR_MPEN_			(0x00000002)
63762306a36Sopenharmony_ci#define WUCSR_BCST_EN_			(0x00000001)
63862306a36Sopenharmony_ci
63962306a36Sopenharmony_ci#define WK_SRC				(0x144)
64062306a36Sopenharmony_ci#define WK_SRC_GPIOX_INT_WK_SHIFT_	(20)
64162306a36Sopenharmony_ci#define WK_SRC_GPIOX_INT_WK_MASK_	(0xFFF00000)
64262306a36Sopenharmony_ci#define WK_SRC_IPV6_TCPSYN_RCD_WK_	(0x00010000)
64362306a36Sopenharmony_ci#define WK_SRC_IPV4_TCPSYN_RCD_WK_	(0x00008000)
64462306a36Sopenharmony_ci#define WK_SRC_EEE_TX_WK_		(0x00004000)
64562306a36Sopenharmony_ci#define WK_SRC_EEE_RX_WK_		(0x00002000)
64662306a36Sopenharmony_ci#define WK_SRC_GOOD_FR_WK_		(0x00001000)
64762306a36Sopenharmony_ci#define WK_SRC_PFDA_FR_WK_		(0x00000800)
64862306a36Sopenharmony_ci#define WK_SRC_MP_FR_WK_		(0x00000400)
64962306a36Sopenharmony_ci#define WK_SRC_BCAST_FR_WK_		(0x00000200)
65062306a36Sopenharmony_ci#define WK_SRC_WU_FR_WK_		(0x00000100)
65162306a36Sopenharmony_ci#define WK_SRC_WUFF_MATCH_MASK_		(0x0000001F)
65262306a36Sopenharmony_ci
65362306a36Sopenharmony_ci#define WUF_CFG0			(0x150)
65462306a36Sopenharmony_ci#define NUM_OF_WUF_CFG			(32)
65562306a36Sopenharmony_ci#define WUF_CFG_BEGIN			(WUF_CFG0)
65662306a36Sopenharmony_ci#define WUF_CFG(index)			(WUF_CFG_BEGIN + (4 * (index)))
65762306a36Sopenharmony_ci#define WUF_CFGX_EN_			(0x80000000)
65862306a36Sopenharmony_ci#define WUF_CFGX_TYPE_MASK_		(0x03000000)
65962306a36Sopenharmony_ci#define WUF_CFGX_TYPE_MCAST_		(0x02000000)
66062306a36Sopenharmony_ci#define WUF_CFGX_TYPE_ALL_		(0x01000000)
66162306a36Sopenharmony_ci#define WUF_CFGX_TYPE_UCAST_		(0x00000000)
66262306a36Sopenharmony_ci#define WUF_CFGX_OFFSET_SHIFT_		(16)
66362306a36Sopenharmony_ci#define WUF_CFGX_OFFSET_MASK_		(0x00FF0000)
66462306a36Sopenharmony_ci#define WUF_CFGX_CRC16_MASK_		(0x0000FFFF)
66562306a36Sopenharmony_ci
66662306a36Sopenharmony_ci#define WUF_MASK0_0			(0x200)
66762306a36Sopenharmony_ci#define WUF_MASK0_1			(0x204)
66862306a36Sopenharmony_ci#define WUF_MASK0_2			(0x208)
66962306a36Sopenharmony_ci#define WUF_MASK0_3			(0x20C)
67062306a36Sopenharmony_ci#define NUM_OF_WUF_MASK			(32)
67162306a36Sopenharmony_ci#define WUF_MASK0_BEGIN			(WUF_MASK0_0)
67262306a36Sopenharmony_ci#define WUF_MASK1_BEGIN			(WUF_MASK0_1)
67362306a36Sopenharmony_ci#define WUF_MASK2_BEGIN			(WUF_MASK0_2)
67462306a36Sopenharmony_ci#define WUF_MASK3_BEGIN			(WUF_MASK0_3)
67562306a36Sopenharmony_ci#define WUF_MASK0(index)		(WUF_MASK0_BEGIN + (0x10 * (index)))
67662306a36Sopenharmony_ci#define WUF_MASK1(index)		(WUF_MASK1_BEGIN + (0x10 * (index)))
67762306a36Sopenharmony_ci#define WUF_MASK2(index)		(WUF_MASK2_BEGIN + (0x10 * (index)))
67862306a36Sopenharmony_ci#define WUF_MASK3(index)		(WUF_MASK3_BEGIN + (0x10 * (index)))
67962306a36Sopenharmony_ci
68062306a36Sopenharmony_ci#define MAF_BASE			(0x400)
68162306a36Sopenharmony_ci#define MAF_HIX				(0x00)
68262306a36Sopenharmony_ci#define MAF_LOX				(0x04)
68362306a36Sopenharmony_ci#define NUM_OF_MAF			(33)
68462306a36Sopenharmony_ci#define MAF_HI_BEGIN			(MAF_BASE + MAF_HIX)
68562306a36Sopenharmony_ci#define MAF_LO_BEGIN			(MAF_BASE + MAF_LOX)
68662306a36Sopenharmony_ci#define MAF_HI(index)			(MAF_BASE + (8 * (index)) + (MAF_HIX))
68762306a36Sopenharmony_ci#define MAF_LO(index)			(MAF_BASE + (8 * (index)) + (MAF_LOX))
68862306a36Sopenharmony_ci#define MAF_HI_VALID_			(0x80000000)
68962306a36Sopenharmony_ci#define MAF_HI_TYPE_MASK_		(0x40000000)
69062306a36Sopenharmony_ci#define MAF_HI_TYPE_SRC_		(0x40000000)
69162306a36Sopenharmony_ci#define MAF_HI_TYPE_DST_		(0x00000000)
69262306a36Sopenharmony_ci#define MAF_HI_ADDR_MASK		(0x0000FFFF)
69362306a36Sopenharmony_ci#define MAF_LO_ADDR_MASK		(0xFFFFFFFF)
69462306a36Sopenharmony_ci
69562306a36Sopenharmony_ci#define WUCSR2				(0x600)
69662306a36Sopenharmony_ci#define WUCSR2_CSUM_DISABLE_		(0x80000000)
69762306a36Sopenharmony_ci#define WUCSR2_NA_SA_SEL_		(0x00000100)
69862306a36Sopenharmony_ci#define WUCSR2_NS_RCD_			(0x00000080)
69962306a36Sopenharmony_ci#define WUCSR2_ARP_RCD_			(0x00000040)
70062306a36Sopenharmony_ci#define WUCSR2_IPV6_TCPSYN_RCD_		(0x00000020)
70162306a36Sopenharmony_ci#define WUCSR2_IPV4_TCPSYN_RCD_		(0x00000010)
70262306a36Sopenharmony_ci#define WUCSR2_NS_OFFLOAD_EN_		(0x00000008)
70362306a36Sopenharmony_ci#define WUCSR2_ARP_OFFLOAD_EN_		(0x00000004)
70462306a36Sopenharmony_ci#define WUCSR2_IPV6_TCPSYN_WAKE_EN_	(0x00000002)
70562306a36Sopenharmony_ci#define WUCSR2_IPV4_TCPSYN_WAKE_EN_	(0x00000001)
70662306a36Sopenharmony_ci
70762306a36Sopenharmony_ci#define NS1_IPV6_ADDR_DEST0		(0x610)
70862306a36Sopenharmony_ci#define NS1_IPV6_ADDR_DEST1		(0x614)
70962306a36Sopenharmony_ci#define NS1_IPV6_ADDR_DEST2		(0x618)
71062306a36Sopenharmony_ci#define NS1_IPV6_ADDR_DEST3		(0x61C)
71162306a36Sopenharmony_ci
71262306a36Sopenharmony_ci#define NS1_IPV6_ADDR_SRC0		(0x620)
71362306a36Sopenharmony_ci#define NS1_IPV6_ADDR_SRC1		(0x624)
71462306a36Sopenharmony_ci#define NS1_IPV6_ADDR_SRC2		(0x628)
71562306a36Sopenharmony_ci#define NS1_IPV6_ADDR_SRC3		(0x62C)
71662306a36Sopenharmony_ci
71762306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR0_0		(0x630)
71862306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR0_1		(0x634)
71962306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR0_2		(0x638)
72062306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR0_3		(0x63C)
72162306a36Sopenharmony_ci
72262306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR1_0		(0x640)
72362306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR1_1		(0x644)
72462306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR1_2		(0x648)
72562306a36Sopenharmony_ci#define NS1_ICMPV6_ADDR1_3		(0x64C)
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_ci#define NS2_IPV6_ADDR_DEST0		(0x650)
72862306a36Sopenharmony_ci#define NS2_IPV6_ADDR_DEST1		(0x654)
72962306a36Sopenharmony_ci#define NS2_IPV6_ADDR_DEST2		(0x658)
73062306a36Sopenharmony_ci#define NS2_IPV6_ADDR_DEST3		(0x65C)
73162306a36Sopenharmony_ci
73262306a36Sopenharmony_ci#define NS2_IPV6_ADDR_SRC0		(0x660)
73362306a36Sopenharmony_ci#define NS2_IPV6_ADDR_SRC1		(0x664)
73462306a36Sopenharmony_ci#define NS2_IPV6_ADDR_SRC2		(0x668)
73562306a36Sopenharmony_ci#define NS2_IPV6_ADDR_SRC3		(0x66C)
73662306a36Sopenharmony_ci
73762306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR0_0		(0x670)
73862306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR0_1		(0x674)
73962306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR0_2		(0x678)
74062306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR0_3		(0x67C)
74162306a36Sopenharmony_ci
74262306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR1_0		(0x680)
74362306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR1_1		(0x684)
74462306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR1_2		(0x688)
74562306a36Sopenharmony_ci#define NS2_ICMPV6_ADDR1_3		(0x68C)
74662306a36Sopenharmony_ci
74762306a36Sopenharmony_ci#define SYN_IPV4_ADDR_SRC		(0x690)
74862306a36Sopenharmony_ci#define SYN_IPV4_ADDR_DEST		(0x694)
74962306a36Sopenharmony_ci#define SYN_IPV4_TCP_PORTS		(0x698)
75062306a36Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_SHIFT_    (16)
75162306a36Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_MASK_     (0xFFFF0000)
75262306a36Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_SRC_PORT_MASK_	    (0x0000FFFF)
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_ci#define SYN_IPV6_ADDR_SRC0		(0x69C)
75562306a36Sopenharmony_ci#define SYN_IPV6_ADDR_SRC1		(0x6A0)
75662306a36Sopenharmony_ci#define SYN_IPV6_ADDR_SRC2		(0x6A4)
75762306a36Sopenharmony_ci#define SYN_IPV6_ADDR_SRC3		(0x6A8)
75862306a36Sopenharmony_ci
75962306a36Sopenharmony_ci#define SYN_IPV6_ADDR_DEST0		(0x6AC)
76062306a36Sopenharmony_ci#define SYN_IPV6_ADDR_DEST1		(0x6B0)
76162306a36Sopenharmony_ci#define SYN_IPV6_ADDR_DEST2		(0x6B4)
76262306a36Sopenharmony_ci#define SYN_IPV6_ADDR_DEST3		(0x6B8)
76362306a36Sopenharmony_ci
76462306a36Sopenharmony_ci#define SYN_IPV6_TCP_PORTS		(0x6BC)
76562306a36Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_SHIFT_    (16)
76662306a36Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_MASK_     (0xFFFF0000)
76762306a36Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_SRC_PORT_MASK_	    (0x0000FFFF)
76862306a36Sopenharmony_ci
76962306a36Sopenharmony_ci#define ARP_SPA				(0x6C0)
77062306a36Sopenharmony_ci#define ARP_TPA				(0x6C4)
77162306a36Sopenharmony_ci
77262306a36Sopenharmony_ci#define PHY_DEV_ID			(0x700)
77362306a36Sopenharmony_ci#define PHY_DEV_ID_REV_SHIFT_		(28)
77462306a36Sopenharmony_ci#define PHY_DEV_ID_REV_SHIFT_		(28)
77562306a36Sopenharmony_ci#define PHY_DEV_ID_REV_MASK_		(0xF0000000)
77662306a36Sopenharmony_ci#define PHY_DEV_ID_MODEL_SHIFT_		(22)
77762306a36Sopenharmony_ci#define PHY_DEV_ID_MODEL_MASK_		(0x0FC00000)
77862306a36Sopenharmony_ci#define PHY_DEV_ID_OUI_MASK_		(0x003FFFFF)
77962306a36Sopenharmony_ci
78062306a36Sopenharmony_ci#define RGMII_TX_BYP_DLL		(0x708)
78162306a36Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_TUNE_ADJ_MASK_	(0x000FC00)
78262306a36Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_TUNE_SEL_MASK_	(0x00003F0)
78362306a36Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_DLL_RESET_		(0x0000002)
78462306a36Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_DLL_BYPASS_		(0x0000001)
78562306a36Sopenharmony_ci
78662306a36Sopenharmony_ci#define RGMII_RX_BYP_DLL		(0x70C)
78762306a36Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_TUNE_ADJ_MASK_	(0x000FC00)
78862306a36Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_TUNE_SEL_MASK_	(0x00003F0)
78962306a36Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_DLL_RESET_		(0x0000002)
79062306a36Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_DLL_BYPASS_		(0x0000001)
79162306a36Sopenharmony_ci
79262306a36Sopenharmony_ci#define OTP_BASE_ADDR			(0x00001000)
79362306a36Sopenharmony_ci#define OTP_ADDR_RANGE_			(0x1FF)
79462306a36Sopenharmony_ci
79562306a36Sopenharmony_ci#define OTP_PWR_DN			(OTP_BASE_ADDR + 4 * 0x00)
79662306a36Sopenharmony_ci#define OTP_PWR_DN_PWRDN_N_		(0x01)
79762306a36Sopenharmony_ci
79862306a36Sopenharmony_ci#define OTP_ADDR1			(OTP_BASE_ADDR + 4 * 0x01)
79962306a36Sopenharmony_ci#define OTP_ADDR1_15_11			(0x1F)
80062306a36Sopenharmony_ci
80162306a36Sopenharmony_ci#define OTP_ADDR2			(OTP_BASE_ADDR + 4 * 0x02)
80262306a36Sopenharmony_ci#define OTP_ADDR2_10_3			(0xFF)
80362306a36Sopenharmony_ci
80462306a36Sopenharmony_ci#define OTP_ADDR3			(OTP_BASE_ADDR + 4 * 0x03)
80562306a36Sopenharmony_ci#define OTP_ADDR3_2_0			(0x03)
80662306a36Sopenharmony_ci
80762306a36Sopenharmony_ci#define OTP_PRGM_DATA			(OTP_BASE_ADDR + 4 * 0x04)
80862306a36Sopenharmony_ci
80962306a36Sopenharmony_ci#define OTP_PRGM_MODE			(OTP_BASE_ADDR + 4 * 0x05)
81062306a36Sopenharmony_ci#define OTP_PRGM_MODE_BYTE_		(0x01)
81162306a36Sopenharmony_ci
81262306a36Sopenharmony_ci#define OTP_RD_DATA			(OTP_BASE_ADDR + 4 * 0x06)
81362306a36Sopenharmony_ci
81462306a36Sopenharmony_ci#define OTP_FUNC_CMD			(OTP_BASE_ADDR + 4 * 0x08)
81562306a36Sopenharmony_ci#define OTP_FUNC_CMD_RESET_		(0x04)
81662306a36Sopenharmony_ci#define OTP_FUNC_CMD_PROGRAM_		(0x02)
81762306a36Sopenharmony_ci#define OTP_FUNC_CMD_READ_		(0x01)
81862306a36Sopenharmony_ci
81962306a36Sopenharmony_ci#define OTP_TST_CMD			(OTP_BASE_ADDR + 4 * 0x09)
82062306a36Sopenharmony_ci#define OTP_TST_CMD_TEST_DEC_SEL_	(0x10)
82162306a36Sopenharmony_ci#define OTP_TST_CMD_PRGVRFY_		(0x08)
82262306a36Sopenharmony_ci#define OTP_TST_CMD_WRTEST_		(0x04)
82362306a36Sopenharmony_ci#define OTP_TST_CMD_TESTDEC_		(0x02)
82462306a36Sopenharmony_ci#define OTP_TST_CMD_BLANKCHECK_		(0x01)
82562306a36Sopenharmony_ci
82662306a36Sopenharmony_ci#define OTP_CMD_GO			(OTP_BASE_ADDR + 4 * 0x0A)
82762306a36Sopenharmony_ci#define OTP_CMD_GO_GO_			(0x01)
82862306a36Sopenharmony_ci
82962306a36Sopenharmony_ci#define OTP_PASS_FAIL			(OTP_BASE_ADDR + 4 * 0x0B)
83062306a36Sopenharmony_ci#define OTP_PASS_FAIL_PASS_		(0x02)
83162306a36Sopenharmony_ci#define OTP_PASS_FAIL_FAIL_		(0x01)
83262306a36Sopenharmony_ci
83362306a36Sopenharmony_ci#define OTP_STATUS			(OTP_BASE_ADDR + 4 * 0x0C)
83462306a36Sopenharmony_ci#define OTP_STATUS_OTP_LOCK_		(0x10)
83562306a36Sopenharmony_ci#define OTP_STATUS_WEB_			(0x08)
83662306a36Sopenharmony_ci#define OTP_STATUS_PGMEN		(0x04)
83762306a36Sopenharmony_ci#define OTP_STATUS_CPUMPEN_		(0x02)
83862306a36Sopenharmony_ci#define OTP_STATUS_BUSY_		(0x01)
83962306a36Sopenharmony_ci
84062306a36Sopenharmony_ci#define OTP_MAX_PRG			(OTP_BASE_ADDR + 4 * 0x0D)
84162306a36Sopenharmony_ci#define OTP_MAX_PRG_MAX_PROG		(0x1F)
84262306a36Sopenharmony_ci
84362306a36Sopenharmony_ci#define OTP_INTR_STATUS			(OTP_BASE_ADDR + 4 * 0x10)
84462306a36Sopenharmony_ci#define OTP_INTR_STATUS_READY_		(0x01)
84562306a36Sopenharmony_ci
84662306a36Sopenharmony_ci#define OTP_INTR_MASK			(OTP_BASE_ADDR + 4 * 0x11)
84762306a36Sopenharmony_ci#define OTP_INTR_MASK_READY_		(0x01)
84862306a36Sopenharmony_ci
84962306a36Sopenharmony_ci#define OTP_RSTB_PW1			(OTP_BASE_ADDR + 4 * 0x14)
85062306a36Sopenharmony_ci#define OTP_RSTB_PW2			(OTP_BASE_ADDR + 4 * 0x15)
85162306a36Sopenharmony_ci#define OTP_PGM_PW1			(OTP_BASE_ADDR + 4 * 0x18)
85262306a36Sopenharmony_ci#define OTP_PGM_PW2			(OTP_BASE_ADDR + 4 * 0x19)
85362306a36Sopenharmony_ci#define OTP_READ_PW1			(OTP_BASE_ADDR + 4 * 0x1C)
85462306a36Sopenharmony_ci#define OTP_READ_PW2			(OTP_BASE_ADDR + 4 * 0x1D)
85562306a36Sopenharmony_ci#define OTP_TCRST			(OTP_BASE_ADDR + 4 * 0x20)
85662306a36Sopenharmony_ci#define OTP_RSRD			(OTP_BASE_ADDR + 4 * 0x21)
85762306a36Sopenharmony_ci#define OTP_TREADEN_VAL			(OTP_BASE_ADDR + 4 * 0x22)
85862306a36Sopenharmony_ci#define OTP_TDLES_VAL			(OTP_BASE_ADDR + 4 * 0x23)
85962306a36Sopenharmony_ci#define OTP_TWWL_VAL			(OTP_BASE_ADDR + 4 * 0x24)
86062306a36Sopenharmony_ci#define OTP_TDLEH_VAL			(OTP_BASE_ADDR + 4 * 0x25)
86162306a36Sopenharmony_ci#define OTP_TWPED_VAL			(OTP_BASE_ADDR + 4 * 0x26)
86262306a36Sopenharmony_ci#define OTP_TPES_VAL			(OTP_BASE_ADDR + 4 * 0x27)
86362306a36Sopenharmony_ci#define OTP_TCPS_VAL			(OTP_BASE_ADDR + 4 * 0x28)
86462306a36Sopenharmony_ci#define OTP_TCPH_VAL			(OTP_BASE_ADDR + 4 * 0x29)
86562306a36Sopenharmony_ci#define OTP_TPGMVFY_VAL			(OTP_BASE_ADDR + 4 * 0x2A)
86662306a36Sopenharmony_ci#define OTP_TPEH_VAL			(OTP_BASE_ADDR + 4 * 0x2B)
86762306a36Sopenharmony_ci#define OTP_TPGRST_VAL			(OTP_BASE_ADDR + 4 * 0x2C)
86862306a36Sopenharmony_ci#define OTP_TCLES_VAL			(OTP_BASE_ADDR + 4 * 0x2D)
86962306a36Sopenharmony_ci#define OTP_TCLEH_VAL			(OTP_BASE_ADDR + 4 * 0x2E)
87062306a36Sopenharmony_ci#define OTP_TRDES_VAL			(OTP_BASE_ADDR + 4 * 0x2F)
87162306a36Sopenharmony_ci#define OTP_TBCACC_VAL			(OTP_BASE_ADDR + 4 * 0x30)
87262306a36Sopenharmony_ci#define OTP_TAAC_VAL			(OTP_BASE_ADDR + 4 * 0x31)
87362306a36Sopenharmony_ci#define OTP_TACCT_VAL			(OTP_BASE_ADDR + 4 * 0x32)
87462306a36Sopenharmony_ci#define OTP_TRDEP_VAL			(OTP_BASE_ADDR + 4 * 0x38)
87562306a36Sopenharmony_ci#define OTP_TPGSV_VAL			(OTP_BASE_ADDR + 4 * 0x39)
87662306a36Sopenharmony_ci#define OTP_TPVSR_VAL			(OTP_BASE_ADDR + 4 * 0x3A)
87762306a36Sopenharmony_ci#define OTP_TPVHR_VAL			(OTP_BASE_ADDR + 4 * 0x3B)
87862306a36Sopenharmony_ci#define OTP_TPVSA_VAL			(OTP_BASE_ADDR + 4 * 0x3C)
87962306a36Sopenharmony_ci#endif /* _LAN78XX_H */
880