18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci /*************************************************************************** 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 2007-2010 SMSC 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci *****************************************************************************/ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef _SMSC75XX_H 98c2ecf20Sopenharmony_ci#define _SMSC75XX_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci/* Tx command words */ 128c2ecf20Sopenharmony_ci#define TX_CMD_A_LSO (0x08000000) 138c2ecf20Sopenharmony_ci#define TX_CMD_A_IPE (0x04000000) 148c2ecf20Sopenharmony_ci#define TX_CMD_A_TPE (0x02000000) 158c2ecf20Sopenharmony_ci#define TX_CMD_A_IVTG (0x01000000) 168c2ecf20Sopenharmony_ci#define TX_CMD_A_RVTG (0x00800000) 178c2ecf20Sopenharmony_ci#define TX_CMD_A_FCS (0x00400000) 188c2ecf20Sopenharmony_ci#define TX_CMD_A_LEN (0x000FFFFF) 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#define TX_CMD_B_MSS (0x3FFF0000) 218c2ecf20Sopenharmony_ci#define TX_CMD_B_MSS_SHIFT (16) 228c2ecf20Sopenharmony_ci#define TX_MSS_MIN ((u16)8) 238c2ecf20Sopenharmony_ci#define TX_CMD_B_VTAG (0x0000FFFF) 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* Rx command words */ 268c2ecf20Sopenharmony_ci#define RX_CMD_A_ICE (0x80000000) 278c2ecf20Sopenharmony_ci#define RX_CMD_A_TCE (0x40000000) 288c2ecf20Sopenharmony_ci#define RX_CMD_A_IPV (0x20000000) 298c2ecf20Sopenharmony_ci#define RX_CMD_A_PID (0x18000000) 308c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_NIP (0x00000000) 318c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_TCP (0x08000000) 328c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_UDP (0x10000000) 338c2ecf20Sopenharmony_ci#define RX_CMD_A_PID_PP (0x18000000) 348c2ecf20Sopenharmony_ci#define RX_CMD_A_PFF (0x04000000) 358c2ecf20Sopenharmony_ci#define RX_CMD_A_BAM (0x02000000) 368c2ecf20Sopenharmony_ci#define RX_CMD_A_MAM (0x01000000) 378c2ecf20Sopenharmony_ci#define RX_CMD_A_FVTG (0x00800000) 388c2ecf20Sopenharmony_ci#define RX_CMD_A_RED (0x00400000) 398c2ecf20Sopenharmony_ci#define RX_CMD_A_RWT (0x00200000) 408c2ecf20Sopenharmony_ci#define RX_CMD_A_RUNT (0x00100000) 418c2ecf20Sopenharmony_ci#define RX_CMD_A_LONG (0x00080000) 428c2ecf20Sopenharmony_ci#define RX_CMD_A_RXE (0x00040000) 438c2ecf20Sopenharmony_ci#define RX_CMD_A_DRB (0x00020000) 448c2ecf20Sopenharmony_ci#define RX_CMD_A_FCS (0x00010000) 458c2ecf20Sopenharmony_ci#define RX_CMD_A_UAM (0x00008000) 468c2ecf20Sopenharmony_ci#define RX_CMD_A_LCSM (0x00004000) 478c2ecf20Sopenharmony_ci#define RX_CMD_A_LEN (0x00003FFF) 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define RX_CMD_B_CSUM (0xFFFF0000) 508c2ecf20Sopenharmony_ci#define RX_CMD_B_CSUM_SHIFT (16) 518c2ecf20Sopenharmony_ci#define RX_CMD_B_VTAG (0x0000FFFF) 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci/* SCSRs */ 548c2ecf20Sopenharmony_ci#define ID_REV (0x0000) 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#define FPGA_REV (0x0004) 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define BOND_CTL (0x0008) 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define INT_STS (0x000C) 618c2ecf20Sopenharmony_ci#define INT_STS_RDFO_INT (0x00400000) 628c2ecf20Sopenharmony_ci#define INT_STS_TXE_INT (0x00200000) 638c2ecf20Sopenharmony_ci#define INT_STS_MACRTO_INT (0x00100000) 648c2ecf20Sopenharmony_ci#define INT_STS_TX_DIS_INT (0x00080000) 658c2ecf20Sopenharmony_ci#define INT_STS_RX_DIS_INT (0x00040000) 668c2ecf20Sopenharmony_ci#define INT_STS_PHY_INT_ (0x00020000) 678c2ecf20Sopenharmony_ci#define INT_STS_MAC_ERR_INT (0x00008000) 688c2ecf20Sopenharmony_ci#define INT_STS_TDFU (0x00004000) 698c2ecf20Sopenharmony_ci#define INT_STS_TDFO (0x00002000) 708c2ecf20Sopenharmony_ci#define INT_STS_GPIOS (0x00000FFF) 718c2ecf20Sopenharmony_ci#define INT_STS_CLEAR_ALL (0xFFFFFFFF) 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define HW_CFG (0x0010) 748c2ecf20Sopenharmony_ci#define HW_CFG_SMDET_STS (0x00008000) 758c2ecf20Sopenharmony_ci#define HW_CFG_SMDET_EN (0x00004000) 768c2ecf20Sopenharmony_ci#define HW_CFG_EEM (0x00002000) 778c2ecf20Sopenharmony_ci#define HW_CFG_RST_PROTECT (0x00001000) 788c2ecf20Sopenharmony_ci#define HW_CFG_PORT_SWAP (0x00000800) 798c2ecf20Sopenharmony_ci#define HW_CFG_PHY_BOOST (0x00000600) 808c2ecf20Sopenharmony_ci#define HW_CFG_PHY_BOOST_NORMAL (0x00000000) 818c2ecf20Sopenharmony_ci#define HW_CFG_PHY_BOOST_4 (0x00002000) 828c2ecf20Sopenharmony_ci#define HW_CFG_PHY_BOOST_8 (0x00004000) 838c2ecf20Sopenharmony_ci#define HW_CFG_PHY_BOOST_12 (0x00006000) 848c2ecf20Sopenharmony_ci#define HW_CFG_LEDB (0x00000100) 858c2ecf20Sopenharmony_ci#define HW_CFG_BIR (0x00000080) 868c2ecf20Sopenharmony_ci#define HW_CFG_SBP (0x00000040) 878c2ecf20Sopenharmony_ci#define HW_CFG_IME (0x00000020) 888c2ecf20Sopenharmony_ci#define HW_CFG_MEF (0x00000010) 898c2ecf20Sopenharmony_ci#define HW_CFG_ETC (0x00000008) 908c2ecf20Sopenharmony_ci#define HW_CFG_BCE (0x00000004) 918c2ecf20Sopenharmony_ci#define HW_CFG_LRST (0x00000002) 928c2ecf20Sopenharmony_ci#define HW_CFG_SRST (0x00000001) 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci#define PMT_CTL (0x0014) 958c2ecf20Sopenharmony_ci#define PMT_CTL_PHY_PWRUP (0x00000400) 968c2ecf20Sopenharmony_ci#define PMT_CTL_RES_CLR_WKP_EN (0x00000100) 978c2ecf20Sopenharmony_ci#define PMT_CTL_DEV_RDY (0x00000080) 988c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE (0x00000060) 998c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_0 (0x00000000) 1008c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_1 (0x00000020) 1018c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_2 (0x00000040) 1028c2ecf20Sopenharmony_ci#define PMT_CTL_SUS_MODE_3 (0x00000060) 1038c2ecf20Sopenharmony_ci#define PMT_CTL_PHY_RST (0x00000010) 1048c2ecf20Sopenharmony_ci#define PMT_CTL_WOL_EN (0x00000008) 1058c2ecf20Sopenharmony_ci#define PMT_CTL_ED_EN (0x00000004) 1068c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS (0x00000003) 1078c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_NO (0x00000000) 1088c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_ED (0x00000001) 1098c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_WOL (0x00000002) 1108c2ecf20Sopenharmony_ci#define PMT_CTL_WUPS_MULTI (0x00000003) 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci#define LED_GPIO_CFG (0x0018) 1138c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LED2_FUN_SEL (0x80000000) 1148c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LED10_FUN_SEL (0x40000000) 1158c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LEDGPIO_EN (0x0000F000) 1168c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LEDGPIO_EN_0 (0x00001000) 1178c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LEDGPIO_EN_1 (0x00002000) 1188c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LEDGPIO_EN_2 (0x00004000) 1198c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_LEDGPIO_EN_3 (0x00008000) 1208c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPBUF (0x00000F00) 1218c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPBUF_0 (0x00000100) 1228c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPBUF_1 (0x00000200) 1238c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPBUF_2 (0x00000400) 1248c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPBUF_3 (0x00000800) 1258c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDIR (0x000000F0) 1268c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDIR_0 (0x00000010) 1278c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDIR_1 (0x00000020) 1288c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDIR_2 (0x00000040) 1298c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDIR_3 (0x00000080) 1308c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDATA (0x0000000F) 1318c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDATA_0 (0x00000001) 1328c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDATA_1 (0x00000002) 1338c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDATA_2 (0x00000004) 1348c2ecf20Sopenharmony_ci#define LED_GPIO_CFG_GPDATA_3 (0x00000008) 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci#define GPIO_CFG (0x001C) 1378c2ecf20Sopenharmony_ci#define GPIO_CFG_SHIFT (24) 1388c2ecf20Sopenharmony_ci#define GPIO_CFG_GPEN (0xFF000000) 1398c2ecf20Sopenharmony_ci#define GPIO_CFG_GPBUF (0x00FF0000) 1408c2ecf20Sopenharmony_ci#define GPIO_CFG_GPDIR (0x0000FF00) 1418c2ecf20Sopenharmony_ci#define GPIO_CFG_GPDATA (0x000000FF) 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci#define GPIO_WAKE (0x0020) 1448c2ecf20Sopenharmony_ci#define GPIO_WAKE_PHY_LINKUP_EN (0x80000000) 1458c2ecf20Sopenharmony_ci#define GPIO_WAKE_POL (0x0FFF0000) 1468c2ecf20Sopenharmony_ci#define GPIO_WAKE_POL_SHIFT (16) 1478c2ecf20Sopenharmony_ci#define GPIO_WAKE_WK (0x00000FFF) 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_ci#define DP_SEL (0x0024) 1508c2ecf20Sopenharmony_ci#define DP_SEL_DPRDY (0x80000000) 1518c2ecf20Sopenharmony_ci#define DP_SEL_RSEL (0x0000000F) 1528c2ecf20Sopenharmony_ci#define DP_SEL_URX (0x00000000) 1538c2ecf20Sopenharmony_ci#define DP_SEL_VHF (0x00000001) 1548c2ecf20Sopenharmony_ci#define DP_SEL_VHF_HASH_LEN (16) 1558c2ecf20Sopenharmony_ci#define DP_SEL_VHF_VLAN_LEN (128) 1568c2ecf20Sopenharmony_ci#define DP_SEL_LSO_HEAD (0x00000002) 1578c2ecf20Sopenharmony_ci#define DP_SEL_FCT_RX (0x00000003) 1588c2ecf20Sopenharmony_ci#define DP_SEL_FCT_TX (0x00000004) 1598c2ecf20Sopenharmony_ci#define DP_SEL_DESCRIPTOR (0x00000005) 1608c2ecf20Sopenharmony_ci#define DP_SEL_WOL (0x00000006) 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci#define DP_CMD (0x0028) 1638c2ecf20Sopenharmony_ci#define DP_CMD_WRITE (0x01) 1648c2ecf20Sopenharmony_ci#define DP_CMD_READ (0x00) 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci#define DP_ADDR (0x002C) 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci#define DP_DATA (0x0030) 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ci#define BURST_CAP (0x0034) 1718c2ecf20Sopenharmony_ci#define BURST_CAP_MASK (0x0000000F) 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci#define INT_EP_CTL (0x0038) 1748c2ecf20Sopenharmony_ci#define INT_EP_CTL_INTEP_ON (0x80000000) 1758c2ecf20Sopenharmony_ci#define INT_EP_CTL_RDFO_EN (0x00400000) 1768c2ecf20Sopenharmony_ci#define INT_EP_CTL_TXE_EN (0x00200000) 1778c2ecf20Sopenharmony_ci#define INT_EP_CTL_MACROTO_EN (0x00100000) 1788c2ecf20Sopenharmony_ci#define INT_EP_CTL_TX_DIS_EN (0x00080000) 1798c2ecf20Sopenharmony_ci#define INT_EP_CTL_RX_DIS_EN (0x00040000) 1808c2ecf20Sopenharmony_ci#define INT_EP_CTL_PHY_EN_ (0x00020000) 1818c2ecf20Sopenharmony_ci#define INT_EP_CTL_MAC_ERR_EN (0x00008000) 1828c2ecf20Sopenharmony_ci#define INT_EP_CTL_TDFU_EN (0x00004000) 1838c2ecf20Sopenharmony_ci#define INT_EP_CTL_TDFO_EN (0x00002000) 1848c2ecf20Sopenharmony_ci#define INT_EP_CTL_RX_FIFO_EN (0x00001000) 1858c2ecf20Sopenharmony_ci#define INT_EP_CTL_GPIOX_EN (0x00000FFF) 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci#define BULK_IN_DLY (0x003C) 1888c2ecf20Sopenharmony_ci#define BULK_IN_DLY_MASK (0xFFFF) 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci#define E2P_CMD (0x0040) 1918c2ecf20Sopenharmony_ci#define E2P_CMD_BUSY (0x80000000) 1928c2ecf20Sopenharmony_ci#define E2P_CMD_MASK (0x70000000) 1938c2ecf20Sopenharmony_ci#define E2P_CMD_READ (0x00000000) 1948c2ecf20Sopenharmony_ci#define E2P_CMD_EWDS (0x10000000) 1958c2ecf20Sopenharmony_ci#define E2P_CMD_EWEN (0x20000000) 1968c2ecf20Sopenharmony_ci#define E2P_CMD_WRITE (0x30000000) 1978c2ecf20Sopenharmony_ci#define E2P_CMD_WRAL (0x40000000) 1988c2ecf20Sopenharmony_ci#define E2P_CMD_ERASE (0x50000000) 1998c2ecf20Sopenharmony_ci#define E2P_CMD_ERAL (0x60000000) 2008c2ecf20Sopenharmony_ci#define E2P_CMD_RELOAD (0x70000000) 2018c2ecf20Sopenharmony_ci#define E2P_CMD_TIMEOUT (0x00000400) 2028c2ecf20Sopenharmony_ci#define E2P_CMD_LOADED (0x00000200) 2038c2ecf20Sopenharmony_ci#define E2P_CMD_ADDR (0x000001FF) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci#define MAX_EEPROM_SIZE (512) 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci#define E2P_DATA (0x0044) 2088c2ecf20Sopenharmony_ci#define E2P_DATA_MASK_ (0x000000FF) 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci#define RFE_CTL (0x0060) 2118c2ecf20Sopenharmony_ci#define RFE_CTL_TCPUDP_CKM (0x00001000) 2128c2ecf20Sopenharmony_ci#define RFE_CTL_IP_CKM (0x00000800) 2138c2ecf20Sopenharmony_ci#define RFE_CTL_AB (0x00000400) 2148c2ecf20Sopenharmony_ci#define RFE_CTL_AM (0x00000200) 2158c2ecf20Sopenharmony_ci#define RFE_CTL_AU (0x00000100) 2168c2ecf20Sopenharmony_ci#define RFE_CTL_VS (0x00000080) 2178c2ecf20Sopenharmony_ci#define RFE_CTL_UF (0x00000040) 2188c2ecf20Sopenharmony_ci#define RFE_CTL_VF (0x00000020) 2198c2ecf20Sopenharmony_ci#define RFE_CTL_SPF (0x00000010) 2208c2ecf20Sopenharmony_ci#define RFE_CTL_MHF (0x00000008) 2218c2ecf20Sopenharmony_ci#define RFE_CTL_DHF (0x00000004) 2228c2ecf20Sopenharmony_ci#define RFE_CTL_DPF (0x00000002) 2238c2ecf20Sopenharmony_ci#define RFE_CTL_RST_RF (0x00000001) 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_ci#define VLAN_TYPE (0x0064) 2268c2ecf20Sopenharmony_ci#define VLAN_TYPE_MASK (0x0000FFFF) 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci#define FCT_RX_CTL (0x0090) 2298c2ecf20Sopenharmony_ci#define FCT_RX_CTL_EN (0x80000000) 2308c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RST (0x40000000) 2318c2ecf20Sopenharmony_ci#define FCT_RX_CTL_SBF (0x02000000) 2328c2ecf20Sopenharmony_ci#define FCT_RX_CTL_OVERFLOW (0x01000000) 2338c2ecf20Sopenharmony_ci#define FCT_RX_CTL_FRM_DROP (0x00800000) 2348c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RX_NOT_EMPTY (0x00400000) 2358c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RX_EMPTY (0x00200000) 2368c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RX_DISABLED (0x00100000) 2378c2ecf20Sopenharmony_ci#define FCT_RX_CTL_RXUSED (0x0000FFFF) 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci#define FCT_TX_CTL (0x0094) 2408c2ecf20Sopenharmony_ci#define FCT_TX_CTL_EN (0x80000000) 2418c2ecf20Sopenharmony_ci#define FCT_TX_CTL_RST (0x40000000) 2428c2ecf20Sopenharmony_ci#define FCT_TX_CTL_TX_NOT_EMPTY (0x00400000) 2438c2ecf20Sopenharmony_ci#define FCT_TX_CTL_TX_EMPTY (0x00200000) 2448c2ecf20Sopenharmony_ci#define FCT_TX_CTL_TX_DISABLED (0x00100000) 2458c2ecf20Sopenharmony_ci#define FCT_TX_CTL_TXUSED (0x0000FFFF) 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ci#define FCT_RX_FIFO_END (0x0098) 2488c2ecf20Sopenharmony_ci#define FCT_RX_FIFO_END_MASK (0x0000007F) 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci#define FCT_TX_FIFO_END (0x009C) 2518c2ecf20Sopenharmony_ci#define FCT_TX_FIFO_END_MASK (0x0000003F) 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_ci#define FCT_FLOW (0x00A0) 2548c2ecf20Sopenharmony_ci#define FCT_FLOW_THRESHOLD_OFF (0x00007F00) 2558c2ecf20Sopenharmony_ci#define FCT_FLOW_THRESHOLD_OFF_SHIFT (8) 2568c2ecf20Sopenharmony_ci#define FCT_FLOW_THRESHOLD_ON (0x0000007F) 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci/* MAC CSRs */ 2598c2ecf20Sopenharmony_ci#define MAC_CR (0x100) 2608c2ecf20Sopenharmony_ci#define MAC_CR_ADP (0x00002000) 2618c2ecf20Sopenharmony_ci#define MAC_CR_ADD (0x00001000) 2628c2ecf20Sopenharmony_ci#define MAC_CR_ASD (0x00000800) 2638c2ecf20Sopenharmony_ci#define MAC_CR_INT_LOOP (0x00000400) 2648c2ecf20Sopenharmony_ci#define MAC_CR_BOLMT (0x000000C0) 2658c2ecf20Sopenharmony_ci#define MAC_CR_FDPX (0x00000008) 2668c2ecf20Sopenharmony_ci#define MAC_CR_CFG (0x00000006) 2678c2ecf20Sopenharmony_ci#define MAC_CR_CFG_10 (0x00000000) 2688c2ecf20Sopenharmony_ci#define MAC_CR_CFG_100 (0x00000002) 2698c2ecf20Sopenharmony_ci#define MAC_CR_CFG_1000 (0x00000004) 2708c2ecf20Sopenharmony_ci#define MAC_CR_RST (0x00000001) 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci#define MAC_RX (0x104) 2738c2ecf20Sopenharmony_ci#define MAC_RX_MAX_SIZE (0x3FFF0000) 2748c2ecf20Sopenharmony_ci#define MAC_RX_MAX_SIZE_SHIFT (16) 2758c2ecf20Sopenharmony_ci#define MAC_RX_FCS_STRIP (0x00000010) 2768c2ecf20Sopenharmony_ci#define MAC_RX_FSE (0x00000004) 2778c2ecf20Sopenharmony_ci#define MAC_RX_RXD (0x00000002) 2788c2ecf20Sopenharmony_ci#define MAC_RX_RXEN (0x00000001) 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci#define MAC_TX (0x108) 2818c2ecf20Sopenharmony_ci#define MAC_TX_BFCS (0x00000004) 2828c2ecf20Sopenharmony_ci#define MAC_TX_TXD (0x00000002) 2838c2ecf20Sopenharmony_ci#define MAC_TX_TXEN (0x00000001) 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci#define FLOW (0x10C) 2868c2ecf20Sopenharmony_ci#define FLOW_FORCE_FC (0x80000000) 2878c2ecf20Sopenharmony_ci#define FLOW_TX_FCEN (0x40000000) 2888c2ecf20Sopenharmony_ci#define FLOW_RX_FCEN (0x20000000) 2898c2ecf20Sopenharmony_ci#define FLOW_FPF (0x10000000) 2908c2ecf20Sopenharmony_ci#define FLOW_PAUSE_TIME (0x0000FFFF) 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci#define RAND_SEED (0x110) 2938c2ecf20Sopenharmony_ci#define RAND_SEED_MASK (0x0000FFFF) 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci#define ERR_STS (0x114) 2968c2ecf20Sopenharmony_ci#define ERR_STS_FCS_ERR (0x00000100) 2978c2ecf20Sopenharmony_ci#define ERR_STS_LFRM_ERR (0x00000080) 2988c2ecf20Sopenharmony_ci#define ERR_STS_RUNT_ERR (0x00000040) 2998c2ecf20Sopenharmony_ci#define ERR_STS_COLLISION_ERR (0x00000010) 3008c2ecf20Sopenharmony_ci#define ERR_STS_ALIGN_ERR (0x00000008) 3018c2ecf20Sopenharmony_ci#define ERR_STS_URUN_ERR (0x00000004) 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci#define RX_ADDRH (0x118) 3048c2ecf20Sopenharmony_ci#define RX_ADDRH_MASK (0x0000FFFF) 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci#define RX_ADDRL (0x11C) 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci#define MII_ACCESS (0x120) 3098c2ecf20Sopenharmony_ci#define MII_ACCESS_PHY_ADDR (0x0000F800) 3108c2ecf20Sopenharmony_ci#define MII_ACCESS_PHY_ADDR_SHIFT (11) 3118c2ecf20Sopenharmony_ci#define MII_ACCESS_REG_ADDR (0x000007C0) 3128c2ecf20Sopenharmony_ci#define MII_ACCESS_REG_ADDR_SHIFT (6) 3138c2ecf20Sopenharmony_ci#define MII_ACCESS_READ (0x00000000) 3148c2ecf20Sopenharmony_ci#define MII_ACCESS_WRITE (0x00000002) 3158c2ecf20Sopenharmony_ci#define MII_ACCESS_BUSY (0x00000001) 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci#define MII_DATA (0x124) 3188c2ecf20Sopenharmony_ci#define MII_DATA_MASK (0x0000FFFF) 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_ci#define WUCSR (0x140) 3218c2ecf20Sopenharmony_ci#define WUCSR_PFDA_FR (0x00000080) 3228c2ecf20Sopenharmony_ci#define WUCSR_WUFR (0x00000040) 3238c2ecf20Sopenharmony_ci#define WUCSR_MPR (0x00000020) 3248c2ecf20Sopenharmony_ci#define WUCSR_BCAST_FR (0x00000010) 3258c2ecf20Sopenharmony_ci#define WUCSR_PFDA_EN (0x00000008) 3268c2ecf20Sopenharmony_ci#define WUCSR_WUEN (0x00000004) 3278c2ecf20Sopenharmony_ci#define WUCSR_MPEN (0x00000002) 3288c2ecf20Sopenharmony_ci#define WUCSR_BCST_EN (0x00000001) 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_ci#define WUF_CFGX (0x144) 3318c2ecf20Sopenharmony_ci#define WUF_CFGX_EN (0x80000000) 3328c2ecf20Sopenharmony_ci#define WUF_CFGX_ATYPE (0x03000000) 3338c2ecf20Sopenharmony_ci#define WUF_CFGX_ATYPE_UNICAST (0x00000000) 3348c2ecf20Sopenharmony_ci#define WUF_CFGX_ATYPE_MULTICAST (0x02000000) 3358c2ecf20Sopenharmony_ci#define WUF_CFGX_ATYPE_ALL (0x03000000) 3368c2ecf20Sopenharmony_ci#define WUF_CFGX_PATTERN_OFFSET (0x007F0000) 3378c2ecf20Sopenharmony_ci#define WUF_CFGX_PATTERN_OFFSET_SHIFT (16) 3388c2ecf20Sopenharmony_ci#define WUF_CFGX_CRC16 (0x0000FFFF) 3398c2ecf20Sopenharmony_ci#define WUF_NUM (8) 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci#define WUF_MASKX (0x170) 3428c2ecf20Sopenharmony_ci#define WUF_MASKX_AVALID (0x80000000) 3438c2ecf20Sopenharmony_ci#define WUF_MASKX_ATYPE (0x40000000) 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ci#define ADDR_FILTX (0x300) 3468c2ecf20Sopenharmony_ci#define ADDR_FILTX_FB_VALID (0x80000000) 3478c2ecf20Sopenharmony_ci#define ADDR_FILTX_FB_TYPE (0x40000000) 3488c2ecf20Sopenharmony_ci#define ADDR_FILTX_FB_ADDRHI (0x0000FFFF) 3498c2ecf20Sopenharmony_ci#define ADDR_FILTX_SB_ADDRLO (0xFFFFFFFF) 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_ci#define WUCSR2 (0x500) 3528c2ecf20Sopenharmony_ci#define WUCSR2_NS_RCD (0x00000040) 3538c2ecf20Sopenharmony_ci#define WUCSR2_ARP_RCD (0x00000020) 3548c2ecf20Sopenharmony_ci#define WUCSR2_TCPSYN_RCD (0x00000010) 3558c2ecf20Sopenharmony_ci#define WUCSR2_NS_OFFLOAD (0x00000004) 3568c2ecf20Sopenharmony_ci#define WUCSR2_ARP_OFFLOAD (0x00000002) 3578c2ecf20Sopenharmony_ci#define WUCSR2_TCPSYN_OFFLOAD (0x00000001) 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ci#define WOL_FIFO_STS (0x504) 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci#define IPV6_ADDRX (0x510) 3628c2ecf20Sopenharmony_ci 3638c2ecf20Sopenharmony_ci#define IPV4_ADDRX (0x590) 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ci/* Vendor-specific PHY Definitions */ 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ci/* Mode Control/Status Register */ 3698c2ecf20Sopenharmony_ci#define PHY_MODE_CTRL_STS (17) 3708c2ecf20Sopenharmony_ci#define MODE_CTRL_STS_EDPWRDOWN ((u16)0x2000) 3718c2ecf20Sopenharmony_ci#define MODE_CTRL_STS_ENERGYON ((u16)0x0002) 3728c2ecf20Sopenharmony_ci 3738c2ecf20Sopenharmony_ci#define PHY_INT_SRC (29) 3748c2ecf20Sopenharmony_ci#define PHY_INT_SRC_ENERGY_ON ((u16)0x0080) 3758c2ecf20Sopenharmony_ci#define PHY_INT_SRC_ANEG_COMP ((u16)0x0040) 3768c2ecf20Sopenharmony_ci#define PHY_INT_SRC_REMOTE_FAULT ((u16)0x0020) 3778c2ecf20Sopenharmony_ci#define PHY_INT_SRC_LINK_DOWN ((u16)0x0010) 3788c2ecf20Sopenharmony_ci#define PHY_INT_SRC_CLEAR_ALL ((u16)0xffff) 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_ci#define PHY_INT_MASK (30) 3818c2ecf20Sopenharmony_ci#define PHY_INT_MASK_ENERGY_ON ((u16)0x0080) 3828c2ecf20Sopenharmony_ci#define PHY_INT_MASK_ANEG_COMP ((u16)0x0040) 3838c2ecf20Sopenharmony_ci#define PHY_INT_MASK_REMOTE_FAULT ((u16)0x0020) 3848c2ecf20Sopenharmony_ci#define PHY_INT_MASK_LINK_DOWN ((u16)0x0010) 3858c2ecf20Sopenharmony_ci#define PHY_INT_MASK_DEFAULT (PHY_INT_MASK_ANEG_COMP | \ 3868c2ecf20Sopenharmony_ci PHY_INT_MASK_LINK_DOWN) 3878c2ecf20Sopenharmony_ci 3888c2ecf20Sopenharmony_ci#define PHY_SPECIAL (31) 3898c2ecf20Sopenharmony_ci#define PHY_SPECIAL_SPD ((u16)0x001C) 3908c2ecf20Sopenharmony_ci#define PHY_SPECIAL_SPD_10HALF ((u16)0x0004) 3918c2ecf20Sopenharmony_ci#define PHY_SPECIAL_SPD_10FULL ((u16)0x0014) 3928c2ecf20Sopenharmony_ci#define PHY_SPECIAL_SPD_100HALF ((u16)0x0008) 3938c2ecf20Sopenharmony_ci#define PHY_SPECIAL_SPD_100FULL ((u16)0x0018) 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_ci/* USB Vendor Requests */ 3968c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0 3978c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_READ_REGISTER 0xA1 3988c2ecf20Sopenharmony_ci#define USB_VENDOR_REQUEST_GET_STATS 0xA2 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci/* Interrupt Endpoint status word bitfields */ 4018c2ecf20Sopenharmony_ci#define INT_ENP_RDFO_INT ((u32)BIT(22)) 4028c2ecf20Sopenharmony_ci#define INT_ENP_TXE_INT ((u32)BIT(21)) 4038c2ecf20Sopenharmony_ci#define INT_ENP_TX_DIS_INT ((u32)BIT(19)) 4048c2ecf20Sopenharmony_ci#define INT_ENP_RX_DIS_INT ((u32)BIT(18)) 4058c2ecf20Sopenharmony_ci#define INT_ENP_PHY_INT ((u32)BIT(17)) 4068c2ecf20Sopenharmony_ci#define INT_ENP_MAC_ERR_INT ((u32)BIT(15)) 4078c2ecf20Sopenharmony_ci#define INT_ENP_RX_FIFO_DATA_INT ((u32)BIT(12)) 4088c2ecf20Sopenharmony_ci 4098c2ecf20Sopenharmony_ci#endif /* _SMSC75XX_H */ 410