18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2015 Microchip Technology
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#ifndef _LAN78XX_H
68c2ecf20Sopenharmony_ci#define _LAN78XX_H
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* USB Vendor Requests */
98c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_WRITE_REGISTER	0xA0
108c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_READ_REGISTER	0xA1
118c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_GET_STATS		0xA2
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* Interrupt Endpoint status word bitfields */
148c2ecf20Sopenharmony_ci#define INT_ENP_EEE_START_TX_LPI_INT		BIT(26)
158c2ecf20Sopenharmony_ci#define INT_ENP_EEE_STOP_TX_LPI_INT		BIT(25)
168c2ecf20Sopenharmony_ci#define INT_ENP_EEE_RX_LPI_INT			BIT(24)
178c2ecf20Sopenharmony_ci#define INT_ENP_RDFO_INT			BIT(22)
188c2ecf20Sopenharmony_ci#define INT_ENP_TXE_INT				BIT(21)
198c2ecf20Sopenharmony_ci#define INT_ENP_TX_DIS_INT			BIT(19)
208c2ecf20Sopenharmony_ci#define INT_ENP_RX_DIS_INT			BIT(18)
218c2ecf20Sopenharmony_ci#define INT_ENP_PHY_INT				BIT(17)
228c2ecf20Sopenharmony_ci#define INT_ENP_DP_INT				BIT(16)
238c2ecf20Sopenharmony_ci#define INT_ENP_MAC_ERR_INT			BIT(15)
248c2ecf20Sopenharmony_ci#define INT_ENP_TDFU_INT			BIT(14)
258c2ecf20Sopenharmony_ci#define INT_ENP_TDFO_INT			BIT(13)
268c2ecf20Sopenharmony_ci#define INT_ENP_UTX_FP_INT			BIT(12)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define TX_PKT_ALIGNMENT			4
298c2ecf20Sopenharmony_ci#define RX_PKT_ALIGNMENT			4
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci/* Tx Command A */
328c2ecf20Sopenharmony_ci#define TX_CMD_A_IGE_			(0x20000000)
338c2ecf20Sopenharmony_ci#define TX_CMD_A_ICE_			(0x10000000)
348c2ecf20Sopenharmony_ci#define TX_CMD_A_LSO_			(0x08000000)
358c2ecf20Sopenharmony_ci#define TX_CMD_A_IPE_			(0x04000000)
368c2ecf20Sopenharmony_ci#define TX_CMD_A_TPE_			(0x02000000)
378c2ecf20Sopenharmony_ci#define TX_CMD_A_IVTG_			(0x01000000)
388c2ecf20Sopenharmony_ci#define TX_CMD_A_RVTG_			(0x00800000)
398c2ecf20Sopenharmony_ci#define TX_CMD_A_FCS_			(0x00400000)
408c2ecf20Sopenharmony_ci#define TX_CMD_A_LEN_MASK_		(0x000FFFFF)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci/* Tx Command B */
438c2ecf20Sopenharmony_ci#define TX_CMD_B_MSS_SHIFT_		(16)
448c2ecf20Sopenharmony_ci#define TX_CMD_B_MSS_MASK_		(0x3FFF0000)
458c2ecf20Sopenharmony_ci#define TX_CMD_B_MSS_MIN_		((unsigned short)8)
468c2ecf20Sopenharmony_ci#define TX_CMD_B_VTAG_MASK_		(0x0000FFFF)
478c2ecf20Sopenharmony_ci#define TX_CMD_B_VTAG_PRI_MASK_		(0x0000E000)
488c2ecf20Sopenharmony_ci#define TX_CMD_B_VTAG_CFI_MASK_		(0x00001000)
498c2ecf20Sopenharmony_ci#define TX_CMD_B_VTAG_VID_MASK_		(0x00000FFF)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* Rx Command A */
528c2ecf20Sopenharmony_ci#define RX_CMD_A_ICE_			(0x80000000)
538c2ecf20Sopenharmony_ci#define RX_CMD_A_TCE_			(0x40000000)
548c2ecf20Sopenharmony_ci#define RX_CMD_A_CSE_MASK_		(0xC0000000)
558c2ecf20Sopenharmony_ci#define RX_CMD_A_IPV_			(0x20000000)
568c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_MASK_		(0x18000000)
578c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_NONE_IP_		(0x00000000)
588c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_TCP_IP_		(0x08000000)
598c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_UDP_IP_		(0x10000000)
608c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_IP_		(0x18000000)
618c2ecf20Sopenharmony_ci#define RX_CMD_A_PFF_			(0x04000000)
628c2ecf20Sopenharmony_ci#define RX_CMD_A_BAM_			(0x02000000)
638c2ecf20Sopenharmony_ci#define RX_CMD_A_MAM_			(0x01000000)
648c2ecf20Sopenharmony_ci#define RX_CMD_A_FVTG_			(0x00800000)
658c2ecf20Sopenharmony_ci#define RX_CMD_A_RED_			(0x00400000)
668c2ecf20Sopenharmony_ci#define RX_CMD_A_RX_ERRS_MASK_		(0xC03F0000)
678c2ecf20Sopenharmony_ci#define RX_CMD_A_RWT_			(0x00200000)
688c2ecf20Sopenharmony_ci#define RX_CMD_A_RUNT_			(0x00100000)
698c2ecf20Sopenharmony_ci#define RX_CMD_A_LONG_			(0x00080000)
708c2ecf20Sopenharmony_ci#define RX_CMD_A_RXE_			(0x00040000)
718c2ecf20Sopenharmony_ci#define RX_CMD_A_DRB_			(0x00020000)
728c2ecf20Sopenharmony_ci#define RX_CMD_A_FCS_			(0x00010000)
738c2ecf20Sopenharmony_ci#define RX_CMD_A_UAM_			(0x00008000)
748c2ecf20Sopenharmony_ci#define RX_CMD_A_ICSM_			(0x00004000)
758c2ecf20Sopenharmony_ci#define RX_CMD_A_LEN_MASK_		(0x00003FFF)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* Rx Command B */
788c2ecf20Sopenharmony_ci#define RX_CMD_B_CSUM_SHIFT_		(16)
798c2ecf20Sopenharmony_ci#define RX_CMD_B_CSUM_MASK_		(0xFFFF0000)
808c2ecf20Sopenharmony_ci#define RX_CMD_B_VTAG_MASK_		(0x0000FFFF)
818c2ecf20Sopenharmony_ci#define RX_CMD_B_VTAG_PRI_MASK_		(0x0000E000)
828c2ecf20Sopenharmony_ci#define RX_CMD_B_VTAG_CFI_MASK_		(0x00001000)
838c2ecf20Sopenharmony_ci#define RX_CMD_B_VTAG_VID_MASK_		(0x00000FFF)
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci/* Rx Command C */
868c2ecf20Sopenharmony_ci#define RX_CMD_C_WAKE_SHIFT_		(15)
878c2ecf20Sopenharmony_ci#define RX_CMD_C_WAKE_			(0x8000)
888c2ecf20Sopenharmony_ci#define RX_CMD_C_REF_FAIL_SHIFT_	(14)
898c2ecf20Sopenharmony_ci#define RX_CMD_C_REF_FAIL_		(0x4000)
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci/* SCSRs */
928c2ecf20Sopenharmony_ci#define NUMBER_OF_REGS			(193)
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define ID_REV				(0x00)
958c2ecf20Sopenharmony_ci#define ID_REV_CHIP_ID_MASK_		(0xFFFF0000)
968c2ecf20Sopenharmony_ci#define ID_REV_CHIP_REV_MASK_		(0x0000FFFF)
978c2ecf20Sopenharmony_ci#define ID_REV_CHIP_ID_7800_		(0x7800)
988c2ecf20Sopenharmony_ci#define ID_REV_CHIP_ID_7850_		(0x7850)
998c2ecf20Sopenharmony_ci#define ID_REV_CHIP_ID_7801_		(0x7801)
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define FPGA_REV			(0x04)
1028c2ecf20Sopenharmony_ci#define FPGA_REV_MINOR_MASK_		(0x0000FF00)
1038c2ecf20Sopenharmony_ci#define FPGA_REV_MAJOR_MASK_		(0x000000FF)
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define INT_STS				(0x0C)
1068c2ecf20Sopenharmony_ci#define INT_STS_CLEAR_ALL_		(0xFFFFFFFF)
1078c2ecf20Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STRT_	(0x04000000)
1088c2ecf20Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STOP_	(0x02000000)
1098c2ecf20Sopenharmony_ci#define INT_STS_EEE_RX_LPI_		(0x01000000)
1108c2ecf20Sopenharmony_ci#define INT_STS_RDFO_			(0x00400000)
1118c2ecf20Sopenharmony_ci#define INT_STS_TXE_			(0x00200000)
1128c2ecf20Sopenharmony_ci#define INT_STS_TX_DIS_			(0x00080000)
1138c2ecf20Sopenharmony_ci#define INT_STS_RX_DIS_			(0x00040000)
1148c2ecf20Sopenharmony_ci#define INT_STS_PHY_INT_		(0x00020000)
1158c2ecf20Sopenharmony_ci#define INT_STS_DP_INT_			(0x00010000)
1168c2ecf20Sopenharmony_ci#define INT_STS_MAC_ERR_		(0x00008000)
1178c2ecf20Sopenharmony_ci#define INT_STS_TDFU_			(0x00004000)
1188c2ecf20Sopenharmony_ci#define INT_STS_TDFO_			(0x00002000)
1198c2ecf20Sopenharmony_ci#define INT_STS_UFX_FP_			(0x00001000)
1208c2ecf20Sopenharmony_ci#define INT_STS_GPIO_MASK_		(0x00000FFF)
1218c2ecf20Sopenharmony_ci#define INT_STS_GPIO11_			(0x00000800)
1228c2ecf20Sopenharmony_ci#define INT_STS_GPIO10_			(0x00000400)
1238c2ecf20Sopenharmony_ci#define INT_STS_GPIO9_			(0x00000200)
1248c2ecf20Sopenharmony_ci#define INT_STS_GPIO8_			(0x00000100)
1258c2ecf20Sopenharmony_ci#define INT_STS_GPIO7_			(0x00000080)
1268c2ecf20Sopenharmony_ci#define INT_STS_GPIO6_			(0x00000040)
1278c2ecf20Sopenharmony_ci#define INT_STS_GPIO5_			(0x00000020)
1288c2ecf20Sopenharmony_ci#define INT_STS_GPIO4_			(0x00000010)
1298c2ecf20Sopenharmony_ci#define INT_STS_GPIO3_			(0x00000008)
1308c2ecf20Sopenharmony_ci#define INT_STS_GPIO2_			(0x00000004)
1318c2ecf20Sopenharmony_ci#define INT_STS_GPIO1_			(0x00000002)
1328c2ecf20Sopenharmony_ci#define INT_STS_GPIO0_			(0x00000001)
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci#define HW_CFG				(0x010)
1358c2ecf20Sopenharmony_ci#define HW_CFG_CLK125_EN_		(0x02000000)
1368c2ecf20Sopenharmony_ci#define HW_CFG_REFCLK25_EN_		(0x01000000)
1378c2ecf20Sopenharmony_ci#define HW_CFG_LED3_EN_			(0x00800000)
1388c2ecf20Sopenharmony_ci#define HW_CFG_LED2_EN_			(0x00400000)
1398c2ecf20Sopenharmony_ci#define HW_CFG_LED1_EN_			(0x00200000)
1408c2ecf20Sopenharmony_ci#define HW_CFG_LED0_EN_			(0x00100000)
1418c2ecf20Sopenharmony_ci#define HW_CFG_EEE_PHY_LUSU_		(0x00020000)
1428c2ecf20Sopenharmony_ci#define HW_CFG_EEE_TSU_			(0x00010000)
1438c2ecf20Sopenharmony_ci#define HW_CFG_NETDET_STS_		(0x00008000)
1448c2ecf20Sopenharmony_ci#define HW_CFG_NETDET_EN_		(0x00004000)
1458c2ecf20Sopenharmony_ci#define HW_CFG_EEM_			(0x00002000)
1468c2ecf20Sopenharmony_ci#define HW_CFG_RST_PROTECT_		(0x00001000)
1478c2ecf20Sopenharmony_ci#define HW_CFG_CONNECT_BUF_		(0x00000400)
1488c2ecf20Sopenharmony_ci#define HW_CFG_CONNECT_EN_		(0x00000200)
1498c2ecf20Sopenharmony_ci#define HW_CFG_CONNECT_POL_		(0x00000100)
1508c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_MASK_	(0x000000C0)
1518c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_2		(0x00000000)
1528c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_12N	(0x00000040)
1538c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_012N	(0x00000080)
1548c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_SEL_0123N	(0x000000C0)
1558c2ecf20Sopenharmony_ci#define HW_CFG_SUSPEND_N_POL_		(0x00000020)
1568c2ecf20Sopenharmony_ci#define HW_CFG_MEF_			(0x00000010)
1578c2ecf20Sopenharmony_ci#define HW_CFG_ETC_			(0x00000008)
1588c2ecf20Sopenharmony_ci#define HW_CFG_LRST_			(0x00000002)
1598c2ecf20Sopenharmony_ci#define HW_CFG_SRST_			(0x00000001)
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define PMT_CTL				(0x014)
1628c2ecf20Sopenharmony_ci#define PMT_CTL_EEE_WAKEUP_EN_		(0x00002000)
1638c2ecf20Sopenharmony_ci#define PMT_CTL_EEE_WUPS_		(0x00001000)
1648c2ecf20Sopenharmony_ci#define PMT_CTL_MAC_SRST_		(0x00000800)
1658c2ecf20Sopenharmony_ci#define PMT_CTL_PHY_PWRUP_		(0x00000400)
1668c2ecf20Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_MASK_	(0x00000300)
1678c2ecf20Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_STS_	(0x00000200)
1688c2ecf20Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_EN_		(0x00000100)
1698c2ecf20Sopenharmony_ci#define PMT_CTL_READY_			(0x00000080)
1708c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_MASK_		(0x00000060)
1718c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_0_		(0x00000000)
1728c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_1_		(0x00000020)
1738c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_2_		(0x00000040)
1748c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_3_		(0x00000060)
1758c2ecf20Sopenharmony_ci#define PMT_CTL_PHY_RST_		(0x00000010)
1768c2ecf20Sopenharmony_ci#define PMT_CTL_WOL_EN_			(0x00000008)
1778c2ecf20Sopenharmony_ci#define PMT_CTL_PHY_WAKE_EN_		(0x00000004)
1788c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_MASK_		(0x00000003)
1798c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_MLT_		(0x00000003)
1808c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_MAC_		(0x00000002)
1818c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_PHY_		(0x00000001)
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define GPIO_CFG0			(0x018)
1848c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOEN_MASK_		(0x0000F000)
1858c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOEN3_		(0x00008000)
1868c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOEN2_		(0x00004000)
1878c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOEN1_		(0x00002000)
1888c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOEN0_		(0x00001000)
1898c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOBUF_MASK_		(0x00000F00)
1908c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOBUF3_		(0x00000800)
1918c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOBUF2_		(0x00000400)
1928c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOBUF1_		(0x00000200)
1938c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOBUF0_		(0x00000100)
1948c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIODIR_MASK_		(0x000000F0)
1958c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIODIR3_		(0x00000080)
1968c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIODIR2_		(0x00000040)
1978c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIODIR1_		(0x00000020)
1988c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIODIR0_		(0x00000010)
1998c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOD_MASK_		(0x0000000F)
2008c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOD3_		(0x00000008)
2018c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOD2_		(0x00000004)
2028c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOD1_		(0x00000002)
2038c2ecf20Sopenharmony_ci#define GPIO_CFG0_GPIOD0_		(0x00000001)
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci#define GPIO_CFG1			(0x01C)
2068c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN_MASK_		(0xFF000000)
2078c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN11_		(0x80000000)
2088c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN10_		(0x40000000)
2098c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN9_		(0x20000000)
2108c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN8_		(0x10000000)
2118c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN7_		(0x08000000)
2128c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN6_		(0x04000000)
2138c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN5_		(0x02000000)
2148c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOEN4_		(0x01000000)
2158c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF_MASK_		(0x00FF0000)
2168c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF11_		(0x00800000)
2178c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF10_		(0x00400000)
2188c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF9_		(0x00200000)
2198c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF8_		(0x00100000)
2208c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF7_		(0x00080000)
2218c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF6_		(0x00040000)
2228c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF5_		(0x00020000)
2238c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOBUF4_		(0x00010000)
2248c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR_MASK_		(0x0000FF00)
2258c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR11_		(0x00008000)
2268c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR10_		(0x00004000)
2278c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR9_		(0x00002000)
2288c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR8_		(0x00001000)
2298c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR7_		(0x00000800)
2308c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR6_		(0x00000400)
2318c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR5_		(0x00000200)
2328c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIODIR4_		(0x00000100)
2338c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD_MASK_		(0x000000FF)
2348c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD11_		(0x00000080)
2358c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD10_		(0x00000040)
2368c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD9_		(0x00000020)
2378c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD8_		(0x00000010)
2388c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD7_		(0x00000008)
2398c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD6_		(0x00000004)
2408c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD6_		(0x00000004)
2418c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD5_		(0x00000002)
2428c2ecf20Sopenharmony_ci#define GPIO_CFG1_GPIOD4_		(0x00000001)
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci#define GPIO_WAKE			(0x020)
2458c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL_MASK_		(0x0FFF0000)
2468c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL11_		(0x08000000)
2478c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL10_		(0x04000000)
2488c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL9_		(0x02000000)
2498c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL8_		(0x01000000)
2508c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL7_		(0x00800000)
2518c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL6_		(0x00400000)
2528c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL5_		(0x00200000)
2538c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL4_		(0x00100000)
2548c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL3_		(0x00080000)
2558c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL2_		(0x00040000)
2568c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL1_		(0x00020000)
2578c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOPOL0_		(0x00010000)
2588c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK_MASK_		(0x00000FFF)
2598c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK11_		(0x00000800)
2608c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK10_		(0x00000400)
2618c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK9_		(0x00000200)
2628c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK8_		(0x00000100)
2638c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK7_		(0x00000080)
2648c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK6_		(0x00000040)
2658c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK5_		(0x00000020)
2668c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK4_		(0x00000010)
2678c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK3_		(0x00000008)
2688c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK2_		(0x00000004)
2698c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK1_		(0x00000002)
2708c2ecf20Sopenharmony_ci#define GPIO_WAKE_GPIOWK0_		(0x00000001)
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci#define DP_SEL				(0x024)
2738c2ecf20Sopenharmony_ci#define DP_SEL_DPRDY_			(0x80000000)
2748c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_MASK_		(0x0000000F)
2758c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_USB_PHY_CSRS_	(0x0000000F)
2768c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_OTP_64BIT_		(0x00000009)
2778c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_OTP_8BIT_		(0x00000008)
2788c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_UTX_BUF_RAM_	(0x00000007)
2798c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_DESC_RAM_		(0x00000005)
2808c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_TXFIFO_		(0x00000004)
2818c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_RXFIFO_		(0x00000003)
2828c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_LSO_		(0x00000002)
2838c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_VLAN_DA_		(0x00000001)
2848c2ecf20Sopenharmony_ci#define DP_SEL_RSEL_URXBUF_		(0x00000000)
2858c2ecf20Sopenharmony_ci#define DP_SEL_VHF_HASH_LEN		(16)
2868c2ecf20Sopenharmony_ci#define DP_SEL_VHF_VLAN_LEN		(128)
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci#define DP_CMD				(0x028)
2898c2ecf20Sopenharmony_ci#define DP_CMD_WRITE_			(0x00000001)
2908c2ecf20Sopenharmony_ci#define DP_CMD_READ_			(0x00000000)
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci#define DP_ADDR				(0x02C)
2938c2ecf20Sopenharmony_ci#define DP_ADDR_MASK_			(0x00003FFF)
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci#define DP_DATA				(0x030)
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci#define E2P_CMD				(0x040)
2988c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_BUSY_		(0x80000000)
2998c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_MASK_		(0x70000000)
3008c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_RELOAD_		(0x70000000)
3018c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_ERAL_		(0x60000000)
3028c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_ERASE_		(0x50000000)
3038c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_WRAL_		(0x40000000)
3048c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_WRITE_		(0x30000000)
3058c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_EWEN_		(0x20000000)
3068c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_EWDS_		(0x10000000)
3078c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_CMD_READ_		(0x00000000)
3088c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_TIMEOUT_		(0x00000400)
3098c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_DL_			(0x00000200)
3108c2ecf20Sopenharmony_ci#define E2P_CMD_EPC_ADDR_MASK_		(0x000001FF)
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define E2P_DATA			(0x044)
3138c2ecf20Sopenharmony_ci#define E2P_DATA_EEPROM_DATA_MASK_	(0x000000FF)
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#define BOS_ATTR			(0x050)
3168c2ecf20Sopenharmony_ci#define BOS_ATTR_BLOCK_SIZE_MASK_	(0x000000FF)
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci#define SS_ATTR				(0x054)
3198c2ecf20Sopenharmony_ci#define SS_ATTR_POLL_INT_MASK_		(0x00FF0000)
3208c2ecf20Sopenharmony_ci#define SS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
3218c2ecf20Sopenharmony_ci#define SS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci#define HS_ATTR				(0x058)
3248c2ecf20Sopenharmony_ci#define HS_ATTR_POLL_INT_MASK_		(0x00FF0000)
3258c2ecf20Sopenharmony_ci#define HS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
3268c2ecf20Sopenharmony_ci#define HS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci#define FS_ATTR				(0x05C)
3298c2ecf20Sopenharmony_ci#define FS_ATTR_POLL_INT_MASK_		(0x00FF0000)
3308c2ecf20Sopenharmony_ci#define FS_ATTR_DEV_DESC_SIZE_MASK_	(0x0000FF00)
3318c2ecf20Sopenharmony_ci#define FS_ATTR_CFG_BLK_SIZE_MASK_	(0x000000FF)
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci#define STR_ATTR0			    (0x060)
3348c2ecf20Sopenharmony_ci#define STR_ATTR0_CFGSTR_DESC_SIZE_MASK_    (0xFF000000)
3358c2ecf20Sopenharmony_ci#define STR_ATTR0_SERSTR_DESC_SIZE_MASK_    (0x00FF0000)
3368c2ecf20Sopenharmony_ci#define STR_ATTR0_PRODSTR_DESC_SIZE_MASK_   (0x0000FF00)
3378c2ecf20Sopenharmony_ci#define STR_ATTR0_MANUF_DESC_SIZE_MASK_     (0x000000FF)
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci#define STR_ATTR1			    (0x064)
3408c2ecf20Sopenharmony_ci#define STR_ATTR1_INTSTR_DESC_SIZE_MASK_    (0x000000FF)
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci#define STR_FLAG_ATTR			    (0x068)
3438c2ecf20Sopenharmony_ci#define STR_FLAG_ATTR_PME_FLAGS_MASK_	    (0x000000FF)
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci#define USB_CFG0			(0x080)
3468c2ecf20Sopenharmony_ci#define USB_CFG_LPM_RESPONSE_		(0x80000000)
3478c2ecf20Sopenharmony_ci#define USB_CFG_LPM_CAPABILITY_		(0x40000000)
3488c2ecf20Sopenharmony_ci#define USB_CFG_LPM_ENBL_SLPM_		(0x20000000)
3498c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_MASK_		(0x1F000000)
3508c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_960_		(0x1C000000)
3518c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_885_		(0x1B000000)
3528c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_810_		(0x1A000000)
3538c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_735_		(0x19000000)
3548c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_660_		(0x18000000)
3558c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_585_		(0x17000000)
3568c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_510_		(0x16000000)
3578c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_435_		(0x15000000)
3588c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_360_		(0x14000000)
3598c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_285_		(0x13000000)
3608c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_210_		(0x12000000)
3618c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_135_		(0x11000000)
3628c2ecf20Sopenharmony_ci#define USB_CFG_HIRD_THR_60_		(0x10000000)
3638c2ecf20Sopenharmony_ci#define USB_CFG_MAX_BURST_BI_MASK_	(0x00F00000)
3648c2ecf20Sopenharmony_ci#define USB_CFG_MAX_BURST_BO_MASK_	(0x000F0000)
3658c2ecf20Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_MASK_	(0x0000E000)
3668c2ecf20Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_SS_	(0x00008000)
3678c2ecf20Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_HS_	(0x00000000)
3688c2ecf20Sopenharmony_ci#define USB_CFG_MAX_DEV_SPEED_FS_	(0x00002000)
3698c2ecf20Sopenharmony_ci#define USB_CFG_PHY_BOOST_MASK_		(0x00000180)
3708c2ecf20Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_12_	(0x00000180)
3718c2ecf20Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_8_	(0x00000100)
3728c2ecf20Sopenharmony_ci#define USB_CFG_PHY_BOOST_PLUS_4_	(0x00000080)
3738c2ecf20Sopenharmony_ci#define USB_CFG_PHY_BOOST_NORMAL_	(0x00000000)
3748c2ecf20Sopenharmony_ci#define USB_CFG_BIR_			(0x00000040)
3758c2ecf20Sopenharmony_ci#define USB_CFG_BCE_			(0x00000020)
3768c2ecf20Sopenharmony_ci#define USB_CFG_PORT_SWAP_		(0x00000010)
3778c2ecf20Sopenharmony_ci#define USB_CFG_LPM_EN_			(0x00000008)
3788c2ecf20Sopenharmony_ci#define USB_CFG_RMT_WKP_		(0x00000004)
3798c2ecf20Sopenharmony_ci#define USB_CFG_PWR_SEL_		(0x00000002)
3808c2ecf20Sopenharmony_ci#define USB_CFG_STALL_BO_DIS_		(0x00000001)
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci#define USB_CFG1			(0x084)
3838c2ecf20Sopenharmony_ci#define USB_CFG1_U1_TIMEOUT_MASK_	(0xFF000000)
3848c2ecf20Sopenharmony_ci#define USB_CFG1_U2_TIMEOUT_MASK_	(0x00FF0000)
3858c2ecf20Sopenharmony_ci#define USB_CFG1_HS_TOUT_CAL_MASK_	(0x0000E000)
3868c2ecf20Sopenharmony_ci#define USB_CFG1_DEV_U2_INIT_EN_	(0x00001000)
3878c2ecf20Sopenharmony_ci#define USB_CFG1_DEV_U2_EN_		(0x00000800)
3888c2ecf20Sopenharmony_ci#define USB_CFG1_DEV_U1_INIT_EN_	(0x00000400)
3898c2ecf20Sopenharmony_ci#define USB_CFG1_DEV_U1_EN_		(0x00000200)
3908c2ecf20Sopenharmony_ci#define USB_CFG1_LTM_ENABLE_		(0x00000100)
3918c2ecf20Sopenharmony_ci#define USB_CFG1_FS_TOUT_CAL_MASK_	(0x00000070)
3928c2ecf20Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MASK_	(0x00000003)
3938c2ecf20Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE3_	(0x00000003)
3948c2ecf20Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE2_	(0x00000002)
3958c2ecf20Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE1_	(0x00000001)
3968c2ecf20Sopenharmony_ci#define USB_CFG1_SCALE_DOWN_MODE0_	(0x00000000)
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci#define USB_CFG2			    (0x088)
3998c2ecf20Sopenharmony_ci#define USB_CFG2_SS_DETACH_TIME_MASK_	    (0xFFFF0000)
4008c2ecf20Sopenharmony_ci#define USB_CFG2_HS_DETACH_TIME_MASK_	    (0x0000FFFF)
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci#define BURST_CAP			(0x090)
4038c2ecf20Sopenharmony_ci#define BURST_CAP_SIZE_MASK_		(0x000000FF)
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci#define BULK_IN_DLY			(0x094)
4068c2ecf20Sopenharmony_ci#define BULK_IN_DLY_MASK_		(0x0000FFFF)
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_ci#define INT_EP_CTL			(0x098)
4098c2ecf20Sopenharmony_ci#define INT_EP_INTEP_ON_		(0x80000000)
4108c2ecf20Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STRT_EN_	(0x04000000)
4118c2ecf20Sopenharmony_ci#define INT_STS_EEE_TX_LPI_STOP_EN_	(0x02000000)
4128c2ecf20Sopenharmony_ci#define INT_STS_EEE_RX_LPI_EN_		(0x01000000)
4138c2ecf20Sopenharmony_ci#define INT_EP_RDFO_EN_			(0x00400000)
4148c2ecf20Sopenharmony_ci#define INT_EP_TXE_EN_			(0x00200000)
4158c2ecf20Sopenharmony_ci#define INT_EP_TX_DIS_EN_		(0x00080000)
4168c2ecf20Sopenharmony_ci#define INT_EP_RX_DIS_EN_		(0x00040000)
4178c2ecf20Sopenharmony_ci#define INT_EP_PHY_INT_EN_		(0x00020000)
4188c2ecf20Sopenharmony_ci#define INT_EP_DP_INT_EN_		(0x00010000)
4198c2ecf20Sopenharmony_ci#define INT_EP_MAC_ERR_EN_		(0x00008000)
4208c2ecf20Sopenharmony_ci#define INT_EP_TDFU_EN_			(0x00004000)
4218c2ecf20Sopenharmony_ci#define INT_EP_TDFO_EN_			(0x00002000)
4228c2ecf20Sopenharmony_ci#define INT_EP_UTX_FP_EN_		(0x00001000)
4238c2ecf20Sopenharmony_ci#define INT_EP_GPIO_EN_MASK_		(0x00000FFF)
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ci#define PIPE_CTL			(0x09C)
4268c2ecf20Sopenharmony_ci#define PIPE_CTL_TXSWING_		(0x00000040)
4278c2ecf20Sopenharmony_ci#define PIPE_CTL_TXMARGIN_MASK_		(0x00000038)
4288c2ecf20Sopenharmony_ci#define PIPE_CTL_TXDEEMPHASIS_MASK_	(0x00000006)
4298c2ecf20Sopenharmony_ci#define PIPE_CTL_ELASTICITYBUFFERMODE_	(0x00000001)
4308c2ecf20Sopenharmony_ci
4318c2ecf20Sopenharmony_ci#define U1_LATENCY			(0xA0)
4328c2ecf20Sopenharmony_ci#define U2_LATENCY			(0xA4)
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci#define USB_STATUS			(0x0A8)
4358c2ecf20Sopenharmony_ci#define USB_STATUS_REMOTE_WK_		(0x00100000)
4368c2ecf20Sopenharmony_ci#define USB_STATUS_FUNC_REMOTE_WK_	(0x00080000)
4378c2ecf20Sopenharmony_ci#define USB_STATUS_LTM_ENABLE_		(0x00040000)
4388c2ecf20Sopenharmony_ci#define USB_STATUS_U2_ENABLE_		(0x00020000)
4398c2ecf20Sopenharmony_ci#define USB_STATUS_U1_ENABLE_		(0x00010000)
4408c2ecf20Sopenharmony_ci#define USB_STATUS_SET_SEL_		(0x00000020)
4418c2ecf20Sopenharmony_ci#define USB_STATUS_REMOTE_WK_STS_	(0x00000010)
4428c2ecf20Sopenharmony_ci#define USB_STATUS_FUNC_REMOTE_WK_STS_	(0x00000008)
4438c2ecf20Sopenharmony_ci#define USB_STATUS_LTM_ENABLE_STS_	(0x00000004)
4448c2ecf20Sopenharmony_ci#define USB_STATUS_U2_ENABLE_STS_	(0x00000002)
4458c2ecf20Sopenharmony_ci#define USB_STATUS_U1_ENABLE_STS_	(0x00000001)
4468c2ecf20Sopenharmony_ci
4478c2ecf20Sopenharmony_ci#define USB_CFG3			(0x0AC)
4488c2ecf20Sopenharmony_ci#define USB_CFG3_EN_U2_LTM_		(0x40000000)
4498c2ecf20Sopenharmony_ci#define USB_CFG3_BULK_OUT_NUMP_OVR_	(0x20000000)
4508c2ecf20Sopenharmony_ci#define USB_CFG3_DIS_FAST_U1_EXIT_	(0x10000000)
4518c2ecf20Sopenharmony_ci#define USB_CFG3_LPM_NYET_THR_		(0x0F000000)
4528c2ecf20Sopenharmony_ci#define USB_CFG3_RX_DET_2_POL_LFPS_	(0x00800000)
4538c2ecf20Sopenharmony_ci#define USB_CFG3_LFPS_FILT_		(0x00400000)
4548c2ecf20Sopenharmony_ci#define USB_CFG3_SKIP_RX_DET_		(0x00200000)
4558c2ecf20Sopenharmony_ci#define USB_CFG3_DELAY_P1P2P3_		(0x001C0000)
4568c2ecf20Sopenharmony_ci#define USB_CFG3_DELAY_PHY_PWR_CHG_	(0x00020000)
4578c2ecf20Sopenharmony_ci#define USB_CFG3_U1U2_EXIT_FR_		(0x00010000)
4588c2ecf20Sopenharmony_ci#define USB_CFG3_REQ_P1P2P3		(0x00008000)
4598c2ecf20Sopenharmony_ci#define USB_CFG3_HST_PRT_CMPL_		(0x00004000)
4608c2ecf20Sopenharmony_ci#define USB_CFG3_DIS_SCRAMB_		(0x00002000)
4618c2ecf20Sopenharmony_ci#define USB_CFG3_PWR_DN_SCALE_		(0x00001FFF)
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci#define RFE_CTL				(0x0B0)
4648c2ecf20Sopenharmony_ci#define RFE_CTL_IGMP_COE_		(0x00004000)
4658c2ecf20Sopenharmony_ci#define RFE_CTL_ICMP_COE_		(0x00002000)
4668c2ecf20Sopenharmony_ci#define RFE_CTL_TCPUDP_COE_		(0x00001000)
4678c2ecf20Sopenharmony_ci#define RFE_CTL_IP_COE_			(0x00000800)
4688c2ecf20Sopenharmony_ci#define RFE_CTL_BCAST_EN_		(0x00000400)
4698c2ecf20Sopenharmony_ci#define RFE_CTL_MCAST_EN_		(0x00000200)
4708c2ecf20Sopenharmony_ci#define RFE_CTL_UCAST_EN_		(0x00000100)
4718c2ecf20Sopenharmony_ci#define RFE_CTL_VLAN_STRIP_		(0x00000080)
4728c2ecf20Sopenharmony_ci#define RFE_CTL_DISCARD_UNTAGGED_	(0x00000040)
4738c2ecf20Sopenharmony_ci#define RFE_CTL_VLAN_FILTER_		(0x00000020)
4748c2ecf20Sopenharmony_ci#define RFE_CTL_SA_FILTER_		(0x00000010)
4758c2ecf20Sopenharmony_ci#define RFE_CTL_MCAST_HASH_		(0x00000008)
4768c2ecf20Sopenharmony_ci#define RFE_CTL_DA_HASH_		(0x00000004)
4778c2ecf20Sopenharmony_ci#define RFE_CTL_DA_PERFECT_		(0x00000002)
4788c2ecf20Sopenharmony_ci#define RFE_CTL_RST_			(0x00000001)
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ci#define VLAN_TYPE			(0x0B4)
4818c2ecf20Sopenharmony_ci#define VLAN_TYPE_MASK_			(0x0000FFFF)
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ci#define FCT_RX_CTL			(0x0C0)
4848c2ecf20Sopenharmony_ci#define FCT_RX_CTL_EN_			(0x80000000)
4858c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RST_			(0x40000000)
4868c2ecf20Sopenharmony_ci#define FCT_RX_CTL_SBF_			(0x02000000)
4878c2ecf20Sopenharmony_ci#define FCT_RX_CTL_OVFL_		(0x01000000)
4888c2ecf20Sopenharmony_ci#define FCT_RX_CTL_DROP_		(0x00800000)
4898c2ecf20Sopenharmony_ci#define FCT_RX_CTL_NOT_EMPTY_		(0x00400000)
4908c2ecf20Sopenharmony_ci#define FCT_RX_CTL_EMPTY_		(0x00200000)
4918c2ecf20Sopenharmony_ci#define FCT_RX_CTL_DIS_			(0x00100000)
4928c2ecf20Sopenharmony_ci#define FCT_RX_CTL_USED_MASK_		(0x0000FFFF)
4938c2ecf20Sopenharmony_ci
4948c2ecf20Sopenharmony_ci#define FCT_TX_CTL			(0x0C4)
4958c2ecf20Sopenharmony_ci#define FCT_TX_CTL_EN_			(0x80000000)
4968c2ecf20Sopenharmony_ci#define FCT_TX_CTL_RST_			(0x40000000)
4978c2ecf20Sopenharmony_ci#define FCT_TX_CTL_NOT_EMPTY_		(0x00400000)
4988c2ecf20Sopenharmony_ci#define FCT_TX_CTL_EMPTY_		(0x00200000)
4998c2ecf20Sopenharmony_ci#define FCT_TX_CTL_DIS_			(0x00100000)
5008c2ecf20Sopenharmony_ci#define FCT_TX_CTL_USED_MASK_		(0x0000FFFF)
5018c2ecf20Sopenharmony_ci
5028c2ecf20Sopenharmony_ci#define FCT_RX_FIFO_END			(0x0C8)
5038c2ecf20Sopenharmony_ci#define FCT_RX_FIFO_END_MASK_		(0x0000007F)
5048c2ecf20Sopenharmony_ci
5058c2ecf20Sopenharmony_ci#define FCT_TX_FIFO_END			(0x0CC)
5068c2ecf20Sopenharmony_ci#define FCT_TX_FIFO_END_MASK_		(0x0000003F)
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ci#define FCT_FLOW			(0x0D0)
5098c2ecf20Sopenharmony_ci#define FCT_FLOW_OFF_MASK_		(0x00007F00)
5108c2ecf20Sopenharmony_ci#define FCT_FLOW_ON_MASK_		(0x0000007F)
5118c2ecf20Sopenharmony_ci
5128c2ecf20Sopenharmony_ci#define RX_DP_STOR			(0x0D4)
5138c2ecf20Sopenharmony_ci#define RX_DP_STORE_TOT_RXUSED_MASK_	(0xFFFF0000)
5148c2ecf20Sopenharmony_ci#define RX_DP_STORE_UTX_RXUSED_MASK_	(0x0000FFFF)
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ci#define TX_DP_STOR			(0x0D8)
5178c2ecf20Sopenharmony_ci#define TX_DP_STORE_TOT_TXUSED_MASK_	(0xFFFF0000)
5188c2ecf20Sopenharmony_ci#define TX_DP_STORE_URX_TXUSED_MASK_	(0x0000FFFF)
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_ci#define LTM_BELT_IDLE0			(0x0E0)
5218c2ecf20Sopenharmony_ci#define LTM_BELT_IDLE0_IDLE1000_	(0x0FFF0000)
5228c2ecf20Sopenharmony_ci#define LTM_BELT_IDLE0_IDLE100_		(0x00000FFF)
5238c2ecf20Sopenharmony_ci
5248c2ecf20Sopenharmony_ci#define LTM_BELT_IDLE1			(0x0E4)
5258c2ecf20Sopenharmony_ci#define LTM_BELT_IDLE1_IDLE10_		(0x00000FFF)
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci#define LTM_BELT_ACT0			(0x0E8)
5288c2ecf20Sopenharmony_ci#define LTM_BELT_ACT0_ACT1000_		(0x0FFF0000)
5298c2ecf20Sopenharmony_ci#define LTM_BELT_ACT0_ACT100_		(0x00000FFF)
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci#define LTM_BELT_ACT1			(0x0EC)
5328c2ecf20Sopenharmony_ci#define LTM_BELT_ACT1_ACT10_		(0x00000FFF)
5338c2ecf20Sopenharmony_ci
5348c2ecf20Sopenharmony_ci#define LTM_INACTIVE0			(0x0F0)
5358c2ecf20Sopenharmony_ci#define LTM_INACTIVE0_TIMER1000_	(0xFFFF0000)
5368c2ecf20Sopenharmony_ci#define LTM_INACTIVE0_TIMER100_		(0x0000FFFF)
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci#define LTM_INACTIVE1			(0x0F4)
5398c2ecf20Sopenharmony_ci#define LTM_INACTIVE1_TIMER10_		(0x0000FFFF)
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_ci#define MAC_CR				(0x100)
5428c2ecf20Sopenharmony_ci#define MAC_CR_GMII_EN_			(0x00080000)
5438c2ecf20Sopenharmony_ci#define MAC_CR_EEE_TX_CLK_STOP_EN_	(0x00040000)
5448c2ecf20Sopenharmony_ci#define MAC_CR_EEE_EN_			(0x00020000)
5458c2ecf20Sopenharmony_ci#define MAC_CR_EEE_TLAR_EN_		(0x00010000)
5468c2ecf20Sopenharmony_ci#define MAC_CR_ADP_			(0x00002000)
5478c2ecf20Sopenharmony_ci#define MAC_CR_AUTO_DUPLEX_		(0x00001000)
5488c2ecf20Sopenharmony_ci#define MAC_CR_AUTO_SPEED_		(0x00000800)
5498c2ecf20Sopenharmony_ci#define MAC_CR_LOOPBACK_		(0x00000400)
5508c2ecf20Sopenharmony_ci#define MAC_CR_BOLMT_MASK_		(0x000000C0)
5518c2ecf20Sopenharmony_ci#define MAC_CR_FULL_DUPLEX_		(0x00000008)
5528c2ecf20Sopenharmony_ci#define MAC_CR_SPEED_MASK_		(0x00000006)
5538c2ecf20Sopenharmony_ci#define MAC_CR_SPEED_1000_		(0x00000004)
5548c2ecf20Sopenharmony_ci#define MAC_CR_SPEED_100_		(0x00000002)
5558c2ecf20Sopenharmony_ci#define MAC_CR_SPEED_10_		(0x00000000)
5568c2ecf20Sopenharmony_ci#define MAC_CR_RST_			(0x00000001)
5578c2ecf20Sopenharmony_ci
5588c2ecf20Sopenharmony_ci#define MAC_RX				(0x104)
5598c2ecf20Sopenharmony_ci#define MAC_RX_MAX_SIZE_SHIFT_		(16)
5608c2ecf20Sopenharmony_ci#define MAC_RX_MAX_SIZE_MASK_		(0x3FFF0000)
5618c2ecf20Sopenharmony_ci#define MAC_RX_FCS_STRIP_		(0x00000010)
5628c2ecf20Sopenharmony_ci#define MAC_RX_VLAN_FSE_		(0x00000004)
5638c2ecf20Sopenharmony_ci#define MAC_RX_RXD_			(0x00000002)
5648c2ecf20Sopenharmony_ci#define MAC_RX_RXEN_			(0x00000001)
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ci#define MAC_TX				(0x108)
5678c2ecf20Sopenharmony_ci#define MAC_TX_BAD_FCS_			(0x00000004)
5688c2ecf20Sopenharmony_ci#define MAC_TX_TXD_			(0x00000002)
5698c2ecf20Sopenharmony_ci#define MAC_TX_TXEN_			(0x00000001)
5708c2ecf20Sopenharmony_ci
5718c2ecf20Sopenharmony_ci#define FLOW				(0x10C)
5728c2ecf20Sopenharmony_ci#define FLOW_CR_FORCE_FC_		(0x80000000)
5738c2ecf20Sopenharmony_ci#define FLOW_CR_TX_FCEN_		(0x40000000)
5748c2ecf20Sopenharmony_ci#define FLOW_CR_RX_FCEN_		(0x20000000)
5758c2ecf20Sopenharmony_ci#define FLOW_CR_FPF_			(0x10000000)
5768c2ecf20Sopenharmony_ci#define FLOW_CR_FCPT_MASK_		(0x0000FFFF)
5778c2ecf20Sopenharmony_ci
5788c2ecf20Sopenharmony_ci#define RAND_SEED			(0x110)
5798c2ecf20Sopenharmony_ci#define RAND_SEED_MASK_			(0x0000FFFF)
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci#define ERR_STS				(0x114)
5828c2ecf20Sopenharmony_ci#define ERR_STS_FERR_			(0x00000100)
5838c2ecf20Sopenharmony_ci#define ERR_STS_LERR_			(0x00000080)
5848c2ecf20Sopenharmony_ci#define ERR_STS_RFERR_			(0x00000040)
5858c2ecf20Sopenharmony_ci#define ERR_STS_ECERR_			(0x00000010)
5868c2ecf20Sopenharmony_ci#define ERR_STS_ALERR_			(0x00000008)
5878c2ecf20Sopenharmony_ci#define ERR_STS_URERR_			(0x00000004)
5888c2ecf20Sopenharmony_ci
5898c2ecf20Sopenharmony_ci#define RX_ADDRH			(0x118)
5908c2ecf20Sopenharmony_ci#define RX_ADDRH_MASK_			(0x0000FFFF)
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_ci#define RX_ADDRL			(0x11C)
5938c2ecf20Sopenharmony_ci#define RX_ADDRL_MASK_			(0xFFFFFFFF)
5948c2ecf20Sopenharmony_ci
5958c2ecf20Sopenharmony_ci#define MII_ACC				(0x120)
5968c2ecf20Sopenharmony_ci#define MII_ACC_PHY_ADDR_SHIFT_		(11)
5978c2ecf20Sopenharmony_ci#define MII_ACC_PHY_ADDR_MASK_		(0x0000F800)
5988c2ecf20Sopenharmony_ci#define MII_ACC_MIIRINDA_SHIFT_		(6)
5998c2ecf20Sopenharmony_ci#define MII_ACC_MIIRINDA_MASK_		(0x000007C0)
6008c2ecf20Sopenharmony_ci#define MII_ACC_MII_READ_		(0x00000000)
6018c2ecf20Sopenharmony_ci#define MII_ACC_MII_WRITE_		(0x00000002)
6028c2ecf20Sopenharmony_ci#define MII_ACC_MII_BUSY_		(0x00000001)
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_ci#define MII_DATA			(0x124)
6058c2ecf20Sopenharmony_ci#define MII_DATA_MASK_			(0x0000FFFF)
6068c2ecf20Sopenharmony_ci
6078c2ecf20Sopenharmony_ci#define MAC_RGMII_ID			(0x128)
6088c2ecf20Sopenharmony_ci#define MAC_RGMII_ID_TXC_DELAY_EN_	(0x00000002)
6098c2ecf20Sopenharmony_ci#define MAC_RGMII_ID_RXC_DELAY_EN_	(0x00000001)
6108c2ecf20Sopenharmony_ci
6118c2ecf20Sopenharmony_ci#define EEE_TX_LPI_REQ_DLY		(0x130)
6128c2ecf20Sopenharmony_ci#define EEE_TX_LPI_REQ_DLY_CNT_MASK_	(0xFFFFFFFF)
6138c2ecf20Sopenharmony_ci
6148c2ecf20Sopenharmony_ci#define EEE_TW_TX_SYS			(0x134)
6158c2ecf20Sopenharmony_ci#define EEE_TW_TX_SYS_CNT1G_MASK_	(0xFFFF0000)
6168c2ecf20Sopenharmony_ci#define EEE_TW_TX_SYS_CNT100M_MASK_	(0x0000FFFF)
6178c2ecf20Sopenharmony_ci
6188c2ecf20Sopenharmony_ci#define EEE_TX_LPI_REM_DLY		(0x138)
6198c2ecf20Sopenharmony_ci#define EEE_TX_LPI_REM_DLY_CNT_		(0x00FFFFFF)
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_ci#define WUCSR				(0x140)
6228c2ecf20Sopenharmony_ci#define WUCSR_TESTMODE_			(0x80000000)
6238c2ecf20Sopenharmony_ci#define WUCSR_RFE_WAKE_EN_		(0x00004000)
6248c2ecf20Sopenharmony_ci#define WUCSR_EEE_TX_WAKE_		(0x00002000)
6258c2ecf20Sopenharmony_ci#define WUCSR_EEE_TX_WAKE_EN_		(0x00001000)
6268c2ecf20Sopenharmony_ci#define WUCSR_EEE_RX_WAKE_		(0x00000800)
6278c2ecf20Sopenharmony_ci#define WUCSR_EEE_RX_WAKE_EN_		(0x00000400)
6288c2ecf20Sopenharmony_ci#define WUCSR_RFE_WAKE_FR_		(0x00000200)
6298c2ecf20Sopenharmony_ci#define WUCSR_STORE_WAKE_		(0x00000100)
6308c2ecf20Sopenharmony_ci#define WUCSR_PFDA_FR_			(0x00000080)
6318c2ecf20Sopenharmony_ci#define WUCSR_WUFR_			(0x00000040)
6328c2ecf20Sopenharmony_ci#define WUCSR_MPR_			(0x00000020)
6338c2ecf20Sopenharmony_ci#define WUCSR_BCST_FR_			(0x00000010)
6348c2ecf20Sopenharmony_ci#define WUCSR_PFDA_EN_			(0x00000008)
6358c2ecf20Sopenharmony_ci#define WUCSR_WAKE_EN_			(0x00000004)
6368c2ecf20Sopenharmony_ci#define WUCSR_MPEN_			(0x00000002)
6378c2ecf20Sopenharmony_ci#define WUCSR_BCST_EN_			(0x00000001)
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_ci#define WK_SRC				(0x144)
6408c2ecf20Sopenharmony_ci#define WK_SRC_GPIOX_INT_WK_SHIFT_	(20)
6418c2ecf20Sopenharmony_ci#define WK_SRC_GPIOX_INT_WK_MASK_	(0xFFF00000)
6428c2ecf20Sopenharmony_ci#define WK_SRC_IPV6_TCPSYN_RCD_WK_	(0x00010000)
6438c2ecf20Sopenharmony_ci#define WK_SRC_IPV4_TCPSYN_RCD_WK_	(0x00008000)
6448c2ecf20Sopenharmony_ci#define WK_SRC_EEE_TX_WK_		(0x00004000)
6458c2ecf20Sopenharmony_ci#define WK_SRC_EEE_RX_WK_		(0x00002000)
6468c2ecf20Sopenharmony_ci#define WK_SRC_GOOD_FR_WK_		(0x00001000)
6478c2ecf20Sopenharmony_ci#define WK_SRC_PFDA_FR_WK_		(0x00000800)
6488c2ecf20Sopenharmony_ci#define WK_SRC_MP_FR_WK_		(0x00000400)
6498c2ecf20Sopenharmony_ci#define WK_SRC_BCAST_FR_WK_		(0x00000200)
6508c2ecf20Sopenharmony_ci#define WK_SRC_WU_FR_WK_		(0x00000100)
6518c2ecf20Sopenharmony_ci#define WK_SRC_WUFF_MATCH_MASK_		(0x0000001F)
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_ci#define WUF_CFG0			(0x150)
6548c2ecf20Sopenharmony_ci#define NUM_OF_WUF_CFG			(32)
6558c2ecf20Sopenharmony_ci#define WUF_CFG_BEGIN			(WUF_CFG0)
6568c2ecf20Sopenharmony_ci#define WUF_CFG(index)			(WUF_CFG_BEGIN + (4 * (index)))
6578c2ecf20Sopenharmony_ci#define WUF_CFGX_EN_			(0x80000000)
6588c2ecf20Sopenharmony_ci#define WUF_CFGX_TYPE_MASK_		(0x03000000)
6598c2ecf20Sopenharmony_ci#define WUF_CFGX_TYPE_MCAST_		(0x02000000)
6608c2ecf20Sopenharmony_ci#define WUF_CFGX_TYPE_ALL_		(0x01000000)
6618c2ecf20Sopenharmony_ci#define WUF_CFGX_TYPE_UCAST_		(0x00000000)
6628c2ecf20Sopenharmony_ci#define WUF_CFGX_OFFSET_SHIFT_		(16)
6638c2ecf20Sopenharmony_ci#define WUF_CFGX_OFFSET_MASK_		(0x00FF0000)
6648c2ecf20Sopenharmony_ci#define WUF_CFGX_CRC16_MASK_		(0x0000FFFF)
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci#define WUF_MASK0_0			(0x200)
6678c2ecf20Sopenharmony_ci#define WUF_MASK0_1			(0x204)
6688c2ecf20Sopenharmony_ci#define WUF_MASK0_2			(0x208)
6698c2ecf20Sopenharmony_ci#define WUF_MASK0_3			(0x20C)
6708c2ecf20Sopenharmony_ci#define NUM_OF_WUF_MASK			(32)
6718c2ecf20Sopenharmony_ci#define WUF_MASK0_BEGIN			(WUF_MASK0_0)
6728c2ecf20Sopenharmony_ci#define WUF_MASK1_BEGIN			(WUF_MASK0_1)
6738c2ecf20Sopenharmony_ci#define WUF_MASK2_BEGIN			(WUF_MASK0_2)
6748c2ecf20Sopenharmony_ci#define WUF_MASK3_BEGIN			(WUF_MASK0_3)
6758c2ecf20Sopenharmony_ci#define WUF_MASK0(index)		(WUF_MASK0_BEGIN + (0x10 * (index)))
6768c2ecf20Sopenharmony_ci#define WUF_MASK1(index)		(WUF_MASK1_BEGIN + (0x10 * (index)))
6778c2ecf20Sopenharmony_ci#define WUF_MASK2(index)		(WUF_MASK2_BEGIN + (0x10 * (index)))
6788c2ecf20Sopenharmony_ci#define WUF_MASK3(index)		(WUF_MASK3_BEGIN + (0x10 * (index)))
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci#define MAF_BASE			(0x400)
6818c2ecf20Sopenharmony_ci#define MAF_HIX				(0x00)
6828c2ecf20Sopenharmony_ci#define MAF_LOX				(0x04)
6838c2ecf20Sopenharmony_ci#define NUM_OF_MAF			(33)
6848c2ecf20Sopenharmony_ci#define MAF_HI_BEGIN			(MAF_BASE + MAF_HIX)
6858c2ecf20Sopenharmony_ci#define MAF_LO_BEGIN			(MAF_BASE + MAF_LOX)
6868c2ecf20Sopenharmony_ci#define MAF_HI(index)			(MAF_BASE + (8 * (index)) + (MAF_HIX))
6878c2ecf20Sopenharmony_ci#define MAF_LO(index)			(MAF_BASE + (8 * (index)) + (MAF_LOX))
6888c2ecf20Sopenharmony_ci#define MAF_HI_VALID_			(0x80000000)
6898c2ecf20Sopenharmony_ci#define MAF_HI_TYPE_MASK_		(0x40000000)
6908c2ecf20Sopenharmony_ci#define MAF_HI_TYPE_SRC_		(0x40000000)
6918c2ecf20Sopenharmony_ci#define MAF_HI_TYPE_DST_		(0x00000000)
6928c2ecf20Sopenharmony_ci#define MAF_HI_ADDR_MASK		(0x0000FFFF)
6938c2ecf20Sopenharmony_ci#define MAF_LO_ADDR_MASK		(0xFFFFFFFF)
6948c2ecf20Sopenharmony_ci
6958c2ecf20Sopenharmony_ci#define WUCSR2				(0x600)
6968c2ecf20Sopenharmony_ci#define WUCSR2_CSUM_DISABLE_		(0x80000000)
6978c2ecf20Sopenharmony_ci#define WUCSR2_NA_SA_SEL_		(0x00000100)
6988c2ecf20Sopenharmony_ci#define WUCSR2_NS_RCD_			(0x00000080)
6998c2ecf20Sopenharmony_ci#define WUCSR2_ARP_RCD_			(0x00000040)
7008c2ecf20Sopenharmony_ci#define WUCSR2_IPV6_TCPSYN_RCD_		(0x00000020)
7018c2ecf20Sopenharmony_ci#define WUCSR2_IPV4_TCPSYN_RCD_		(0x00000010)
7028c2ecf20Sopenharmony_ci#define WUCSR2_NS_OFFLOAD_EN_		(0x00000008)
7038c2ecf20Sopenharmony_ci#define WUCSR2_ARP_OFFLOAD_EN_		(0x00000004)
7048c2ecf20Sopenharmony_ci#define WUCSR2_IPV6_TCPSYN_WAKE_EN_	(0x00000002)
7058c2ecf20Sopenharmony_ci#define WUCSR2_IPV4_TCPSYN_WAKE_EN_	(0x00000001)
7068c2ecf20Sopenharmony_ci
7078c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_DEST0		(0x610)
7088c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_DEST1		(0x614)
7098c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_DEST2		(0x618)
7108c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_DEST3		(0x61C)
7118c2ecf20Sopenharmony_ci
7128c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_SRC0		(0x620)
7138c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_SRC1		(0x624)
7148c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_SRC2		(0x628)
7158c2ecf20Sopenharmony_ci#define NS1_IPV6_ADDR_SRC3		(0x62C)
7168c2ecf20Sopenharmony_ci
7178c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR0_0		(0x630)
7188c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR0_1		(0x634)
7198c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR0_2		(0x638)
7208c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR0_3		(0x63C)
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR1_0		(0x640)
7238c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR1_1		(0x644)
7248c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR1_2		(0x648)
7258c2ecf20Sopenharmony_ci#define NS1_ICMPV6_ADDR1_3		(0x64C)
7268c2ecf20Sopenharmony_ci
7278c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_DEST0		(0x650)
7288c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_DEST1		(0x654)
7298c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_DEST2		(0x658)
7308c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_DEST3		(0x65C)
7318c2ecf20Sopenharmony_ci
7328c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_SRC0		(0x660)
7338c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_SRC1		(0x664)
7348c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_SRC2		(0x668)
7358c2ecf20Sopenharmony_ci#define NS2_IPV6_ADDR_SRC3		(0x66C)
7368c2ecf20Sopenharmony_ci
7378c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR0_0		(0x670)
7388c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR0_1		(0x674)
7398c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR0_2		(0x678)
7408c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR0_3		(0x67C)
7418c2ecf20Sopenharmony_ci
7428c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR1_0		(0x680)
7438c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR1_1		(0x684)
7448c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR1_2		(0x688)
7458c2ecf20Sopenharmony_ci#define NS2_ICMPV6_ADDR1_3		(0x68C)
7468c2ecf20Sopenharmony_ci
7478c2ecf20Sopenharmony_ci#define SYN_IPV4_ADDR_SRC		(0x690)
7488c2ecf20Sopenharmony_ci#define SYN_IPV4_ADDR_DEST		(0x694)
7498c2ecf20Sopenharmony_ci#define SYN_IPV4_TCP_PORTS		(0x698)
7508c2ecf20Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_SHIFT_    (16)
7518c2ecf20Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_MASK_     (0xFFFF0000)
7528c2ecf20Sopenharmony_ci#define SYN_IPV4_TCP_PORTS_IPV4_SRC_PORT_MASK_	    (0x0000FFFF)
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_SRC0		(0x69C)
7558c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_SRC1		(0x6A0)
7568c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_SRC2		(0x6A4)
7578c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_SRC3		(0x6A8)
7588c2ecf20Sopenharmony_ci
7598c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_DEST0		(0x6AC)
7608c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_DEST1		(0x6B0)
7618c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_DEST2		(0x6B4)
7628c2ecf20Sopenharmony_ci#define SYN_IPV6_ADDR_DEST3		(0x6B8)
7638c2ecf20Sopenharmony_ci
7648c2ecf20Sopenharmony_ci#define SYN_IPV6_TCP_PORTS		(0x6BC)
7658c2ecf20Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_SHIFT_    (16)
7668c2ecf20Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_MASK_     (0xFFFF0000)
7678c2ecf20Sopenharmony_ci#define SYN_IPV6_TCP_PORTS_IPV6_SRC_PORT_MASK_	    (0x0000FFFF)
7688c2ecf20Sopenharmony_ci
7698c2ecf20Sopenharmony_ci#define ARP_SPA				(0x6C0)
7708c2ecf20Sopenharmony_ci#define ARP_TPA				(0x6C4)
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_ci#define PHY_DEV_ID			(0x700)
7738c2ecf20Sopenharmony_ci#define PHY_DEV_ID_REV_SHIFT_		(28)
7748c2ecf20Sopenharmony_ci#define PHY_DEV_ID_REV_SHIFT_		(28)
7758c2ecf20Sopenharmony_ci#define PHY_DEV_ID_REV_MASK_		(0xF0000000)
7768c2ecf20Sopenharmony_ci#define PHY_DEV_ID_MODEL_SHIFT_		(22)
7778c2ecf20Sopenharmony_ci#define PHY_DEV_ID_MODEL_MASK_		(0x0FC00000)
7788c2ecf20Sopenharmony_ci#define PHY_DEV_ID_OUI_MASK_		(0x003FFFFF)
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ci#define RGMII_TX_BYP_DLL		(0x708)
7818c2ecf20Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_TUNE_ADJ_MASK_	(0x000FC00)
7828c2ecf20Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_TUNE_SEL_MASK_	(0x00003F0)
7838c2ecf20Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_DLL_RESET_		(0x0000002)
7848c2ecf20Sopenharmony_ci#define RGMII_TX_BYP_DLL_TX_DLL_BYPASS_		(0x0000001)
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_ci#define RGMII_RX_BYP_DLL		(0x70C)
7878c2ecf20Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_TUNE_ADJ_MASK_	(0x000FC00)
7888c2ecf20Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_TUNE_SEL_MASK_	(0x00003F0)
7898c2ecf20Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_DLL_RESET_		(0x0000002)
7908c2ecf20Sopenharmony_ci#define RGMII_RX_BYP_DLL_RX_DLL_BYPASS_		(0x0000001)
7918c2ecf20Sopenharmony_ci
7928c2ecf20Sopenharmony_ci#define OTP_BASE_ADDR			(0x00001000)
7938c2ecf20Sopenharmony_ci#define OTP_ADDR_RANGE_			(0x1FF)
7948c2ecf20Sopenharmony_ci
7958c2ecf20Sopenharmony_ci#define OTP_PWR_DN			(OTP_BASE_ADDR + 4 * 0x00)
7968c2ecf20Sopenharmony_ci#define OTP_PWR_DN_PWRDN_N_		(0x01)
7978c2ecf20Sopenharmony_ci
7988c2ecf20Sopenharmony_ci#define OTP_ADDR1			(OTP_BASE_ADDR + 4 * 0x01)
7998c2ecf20Sopenharmony_ci#define OTP_ADDR1_15_11			(0x1F)
8008c2ecf20Sopenharmony_ci
8018c2ecf20Sopenharmony_ci#define OTP_ADDR2			(OTP_BASE_ADDR + 4 * 0x02)
8028c2ecf20Sopenharmony_ci#define OTP_ADDR2_10_3			(0xFF)
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci#define OTP_ADDR3			(OTP_BASE_ADDR + 4 * 0x03)
8058c2ecf20Sopenharmony_ci#define OTP_ADDR3_2_0			(0x03)
8068c2ecf20Sopenharmony_ci
8078c2ecf20Sopenharmony_ci#define OTP_PRGM_DATA			(OTP_BASE_ADDR + 4 * 0x04)
8088c2ecf20Sopenharmony_ci
8098c2ecf20Sopenharmony_ci#define OTP_PRGM_MODE			(OTP_BASE_ADDR + 4 * 0x05)
8108c2ecf20Sopenharmony_ci#define OTP_PRGM_MODE_BYTE_		(0x01)
8118c2ecf20Sopenharmony_ci
8128c2ecf20Sopenharmony_ci#define OTP_RD_DATA			(OTP_BASE_ADDR + 4 * 0x06)
8138c2ecf20Sopenharmony_ci
8148c2ecf20Sopenharmony_ci#define OTP_FUNC_CMD			(OTP_BASE_ADDR + 4 * 0x08)
8158c2ecf20Sopenharmony_ci#define OTP_FUNC_CMD_RESET_		(0x04)
8168c2ecf20Sopenharmony_ci#define OTP_FUNC_CMD_PROGRAM_		(0x02)
8178c2ecf20Sopenharmony_ci#define OTP_FUNC_CMD_READ_		(0x01)
8188c2ecf20Sopenharmony_ci
8198c2ecf20Sopenharmony_ci#define OTP_TST_CMD			(OTP_BASE_ADDR + 4 * 0x09)
8208c2ecf20Sopenharmony_ci#define OTP_TST_CMD_TEST_DEC_SEL_	(0x10)
8218c2ecf20Sopenharmony_ci#define OTP_TST_CMD_PRGVRFY_		(0x08)
8228c2ecf20Sopenharmony_ci#define OTP_TST_CMD_WRTEST_		(0x04)
8238c2ecf20Sopenharmony_ci#define OTP_TST_CMD_TESTDEC_		(0x02)
8248c2ecf20Sopenharmony_ci#define OTP_TST_CMD_BLANKCHECK_		(0x01)
8258c2ecf20Sopenharmony_ci
8268c2ecf20Sopenharmony_ci#define OTP_CMD_GO			(OTP_BASE_ADDR + 4 * 0x0A)
8278c2ecf20Sopenharmony_ci#define OTP_CMD_GO_GO_			(0x01)
8288c2ecf20Sopenharmony_ci
8298c2ecf20Sopenharmony_ci#define OTP_PASS_FAIL			(OTP_BASE_ADDR + 4 * 0x0B)
8308c2ecf20Sopenharmony_ci#define OTP_PASS_FAIL_PASS_		(0x02)
8318c2ecf20Sopenharmony_ci#define OTP_PASS_FAIL_FAIL_		(0x01)
8328c2ecf20Sopenharmony_ci
8338c2ecf20Sopenharmony_ci#define OTP_STATUS			(OTP_BASE_ADDR + 4 * 0x0C)
8348c2ecf20Sopenharmony_ci#define OTP_STATUS_OTP_LOCK_		(0x10)
8358c2ecf20Sopenharmony_ci#define OTP_STATUS_WEB_			(0x08)
8368c2ecf20Sopenharmony_ci#define OTP_STATUS_PGMEN		(0x04)
8378c2ecf20Sopenharmony_ci#define OTP_STATUS_CPUMPEN_		(0x02)
8388c2ecf20Sopenharmony_ci#define OTP_STATUS_BUSY_		(0x01)
8398c2ecf20Sopenharmony_ci
8408c2ecf20Sopenharmony_ci#define OTP_MAX_PRG			(OTP_BASE_ADDR + 4 * 0x0D)
8418c2ecf20Sopenharmony_ci#define OTP_MAX_PRG_MAX_PROG		(0x1F)
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_ci#define OTP_INTR_STATUS			(OTP_BASE_ADDR + 4 * 0x10)
8448c2ecf20Sopenharmony_ci#define OTP_INTR_STATUS_READY_		(0x01)
8458c2ecf20Sopenharmony_ci
8468c2ecf20Sopenharmony_ci#define OTP_INTR_MASK			(OTP_BASE_ADDR + 4 * 0x11)
8478c2ecf20Sopenharmony_ci#define OTP_INTR_MASK_READY_		(0x01)
8488c2ecf20Sopenharmony_ci
8498c2ecf20Sopenharmony_ci#define OTP_RSTB_PW1			(OTP_BASE_ADDR + 4 * 0x14)
8508c2ecf20Sopenharmony_ci#define OTP_RSTB_PW2			(OTP_BASE_ADDR + 4 * 0x15)
8518c2ecf20Sopenharmony_ci#define OTP_PGM_PW1			(OTP_BASE_ADDR + 4 * 0x18)
8528c2ecf20Sopenharmony_ci#define OTP_PGM_PW2			(OTP_BASE_ADDR + 4 * 0x19)
8538c2ecf20Sopenharmony_ci#define OTP_READ_PW1			(OTP_BASE_ADDR + 4 * 0x1C)
8548c2ecf20Sopenharmony_ci#define OTP_READ_PW2			(OTP_BASE_ADDR + 4 * 0x1D)
8558c2ecf20Sopenharmony_ci#define OTP_TCRST			(OTP_BASE_ADDR + 4 * 0x20)
8568c2ecf20Sopenharmony_ci#define OTP_RSRD			(OTP_BASE_ADDR + 4 * 0x21)
8578c2ecf20Sopenharmony_ci#define OTP_TREADEN_VAL			(OTP_BASE_ADDR + 4 * 0x22)
8588c2ecf20Sopenharmony_ci#define OTP_TDLES_VAL			(OTP_BASE_ADDR + 4 * 0x23)
8598c2ecf20Sopenharmony_ci#define OTP_TWWL_VAL			(OTP_BASE_ADDR + 4 * 0x24)
8608c2ecf20Sopenharmony_ci#define OTP_TDLEH_VAL			(OTP_BASE_ADDR + 4 * 0x25)
8618c2ecf20Sopenharmony_ci#define OTP_TWPED_VAL			(OTP_BASE_ADDR + 4 * 0x26)
8628c2ecf20Sopenharmony_ci#define OTP_TPES_VAL			(OTP_BASE_ADDR + 4 * 0x27)
8638c2ecf20Sopenharmony_ci#define OTP_TCPS_VAL			(OTP_BASE_ADDR + 4 * 0x28)
8648c2ecf20Sopenharmony_ci#define OTP_TCPH_VAL			(OTP_BASE_ADDR + 4 * 0x29)
8658c2ecf20Sopenharmony_ci#define OTP_TPGMVFY_VAL			(OTP_BASE_ADDR + 4 * 0x2A)
8668c2ecf20Sopenharmony_ci#define OTP_TPEH_VAL			(OTP_BASE_ADDR + 4 * 0x2B)
8678c2ecf20Sopenharmony_ci#define OTP_TPGRST_VAL			(OTP_BASE_ADDR + 4 * 0x2C)
8688c2ecf20Sopenharmony_ci#define OTP_TCLES_VAL			(OTP_BASE_ADDR + 4 * 0x2D)
8698c2ecf20Sopenharmony_ci#define OTP_TCLEH_VAL			(OTP_BASE_ADDR + 4 * 0x2E)
8708c2ecf20Sopenharmony_ci#define OTP_TRDES_VAL			(OTP_BASE_ADDR + 4 * 0x2F)
8718c2ecf20Sopenharmony_ci#define OTP_TBCACC_VAL			(OTP_BASE_ADDR + 4 * 0x30)
8728c2ecf20Sopenharmony_ci#define OTP_TAAC_VAL			(OTP_BASE_ADDR + 4 * 0x31)
8738c2ecf20Sopenharmony_ci#define OTP_TACCT_VAL			(OTP_BASE_ADDR + 4 * 0x32)
8748c2ecf20Sopenharmony_ci#define OTP_TRDEP_VAL			(OTP_BASE_ADDR + 4 * 0x38)
8758c2ecf20Sopenharmony_ci#define OTP_TPGSV_VAL			(OTP_BASE_ADDR + 4 * 0x39)
8768c2ecf20Sopenharmony_ci#define OTP_TPVSR_VAL			(OTP_BASE_ADDR + 4 * 0x3A)
8778c2ecf20Sopenharmony_ci#define OTP_TPVHR_VAL			(OTP_BASE_ADDR + 4 * 0x3B)
8788c2ecf20Sopenharmony_ci#define OTP_TPVSA_VAL			(OTP_BASE_ADDR + 4 * 0x3C)
8798c2ecf20Sopenharmony_ci#endif /* _LAN78XX_H */
880