18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* $Id: tg3.h,v 1.37.2.32 2002/03/11 12:18:18 davem Exp $ 38c2ecf20Sopenharmony_ci * tg3.h: Definitions for Broadcom Tigon3 ethernet driver. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) 68c2ecf20Sopenharmony_ci * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) 78c2ecf20Sopenharmony_ci * Copyright (C) 2004 Sun Microsystems Inc. 88c2ecf20Sopenharmony_ci * Copyright (C) 2007-2016 Broadcom Corporation. 98c2ecf20Sopenharmony_ci * Copyright (C) 2016-2017 Broadcom Limited. 108c2ecf20Sopenharmony_ci * Copyright (C) 2018 Broadcom. All Rights Reserved. The term "Broadcom" 118c2ecf20Sopenharmony_ci * refers to Broadcom Inc. and/or its subsidiaries. 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#ifndef _T3_H 158c2ecf20Sopenharmony_ci#define _T3_H 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define TG3_64BIT_REG_HIGH 0x00UL 188c2ecf20Sopenharmony_ci#define TG3_64BIT_REG_LOW 0x04UL 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* Descriptor block info. */ 218c2ecf20Sopenharmony_ci#define TG3_BDINFO_HOST_ADDR 0x0UL /* 64-bit */ 228c2ecf20Sopenharmony_ci#define TG3_BDINFO_MAXLEN_FLAGS 0x8UL /* 32-bit */ 238c2ecf20Sopenharmony_ci#define BDINFO_FLAGS_USE_EXT_RECV 0x00000001 /* ext rx_buffer_desc */ 248c2ecf20Sopenharmony_ci#define BDINFO_FLAGS_DISABLED 0x00000002 258c2ecf20Sopenharmony_ci#define BDINFO_FLAGS_MAXLEN_MASK 0xffff0000 268c2ecf20Sopenharmony_ci#define BDINFO_FLAGS_MAXLEN_SHIFT 16 278c2ecf20Sopenharmony_ci#define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */ 288c2ecf20Sopenharmony_ci#define TG3_BDINFO_SIZE 0x10UL 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define TG3_RX_STD_MAX_SIZE_5700 512 318c2ecf20Sopenharmony_ci#define TG3_RX_STD_MAX_SIZE_5717 2048 328c2ecf20Sopenharmony_ci#define TG3_RX_JMB_MAX_SIZE_5700 256 338c2ecf20Sopenharmony_ci#define TG3_RX_JMB_MAX_SIZE_5717 1024 348c2ecf20Sopenharmony_ci#define TG3_RX_RET_MAX_SIZE_5700 1024 358c2ecf20Sopenharmony_ci#define TG3_RX_RET_MAX_SIZE_5705 512 368c2ecf20Sopenharmony_ci#define TG3_RX_RET_MAX_SIZE_5717 4096 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#define TG3_RSS_INDIR_TBL_SIZE 128 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* First 256 bytes are a mirror of PCI config space. */ 418c2ecf20Sopenharmony_ci#define TG3PCI_VENDOR 0x00000000 428c2ecf20Sopenharmony_ci#define TG3PCI_VENDOR_BROADCOM 0x14e4 438c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE 0x00000002 448c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_1 0x1644 /* BCM5700 */ 458c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_2 0x1645 /* BCM5701 */ 468c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_3 0x1646 /* BCM5702 */ 478c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_4 0x1647 /* BCM5703 */ 488c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5761S 0x1688 498c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5761SE 0x1689 508c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57780 0x1692 518c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5787M 0x1693 528c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57760 0x1690 538c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57790 0x1694 548c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57788 0x1691 558c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */ 568c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ 578c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5717 0x1655 588c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5717_C 0x1665 598c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5718 0x1656 608c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57781 0x16b1 618c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57785 0x16b5 628c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57761 0x16b0 638c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57765 0x16b4 648c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57791 0x16b2 658c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57795 0x16b6 668c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5719 0x1657 678c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5720 0x165f 688c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57762 0x1682 698c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57766 0x1686 708c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57786 0x16b3 718c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57782 0x16b7 728c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5762 0x1687 738c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5725 0x1643 748c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_5727 0x16f3 758c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57764 0x1642 768c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57767 0x1683 778c2ecf20Sopenharmony_ci#define TG3PCI_DEVICE_TIGON3_57787 0x1641 788c2ecf20Sopenharmony_ci/* 0x04 --> 0x2c unused */ 798c2ecf20Sopenharmony_ci#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM 808c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644 818c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5 0x0001 828c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6 0x0002 838c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A9 0x0003 848c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1 0x0005 858c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8 0x0006 868c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A7 0x0007 878c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10 0x0008 888c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12 0x8008 898c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1 0x0009 908c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2 0x8009 918c2ecf20Sopenharmony_ci#define TG3PCI_SUBVENDOR_ID_3COM PCI_VENDOR_ID_3COM 928c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_3COM_3C996T 0x1000 938c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_3COM_3C996BT 0x1006 948c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_3COM_3C996SX 0x1004 958c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_3COM_3C1000T 0x1007 968c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_3COM_3C940BR01 0x1008 978c2ecf20Sopenharmony_ci#define TG3PCI_SUBVENDOR_ID_DELL PCI_VENDOR_ID_DELL 988c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_DELL_VIPER 0x00d1 998c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_DELL_JAGUAR 0x0106 1008c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_DELL_MERLOT 0x0109 1018c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT 0x010a 1028c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_DELL_5762 0x07f0 1038c2ecf20Sopenharmony_ci#define TG3PCI_SUBVENDOR_ID_COMPAQ PCI_VENDOR_ID_COMPAQ 1048c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE 0x007c 1058c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2 0x009a 1068c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_COMPAQ_CHANGELING 0x007d 1078c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780 0x0085 1088c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2 0x0099 1098c2ecf20Sopenharmony_ci#define TG3PCI_SUBVENDOR_ID_IBM PCI_VENDOR_ID_IBM 1108c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_IBM_5703SAX2 0x0281 1118c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_ACER_57780_A 0x0601 1128c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_ACER_57780_B 0x0612 1138c2ecf20Sopenharmony_ci#define TG3PCI_SUBDEVICE_ID_LENOVO_5787M 0x3056 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci/* 0x30 --> 0x64 unused */ 1168c2ecf20Sopenharmony_ci#define TG3PCI_MSI_DATA 0x00000064 1178c2ecf20Sopenharmony_ci/* 0x66 --> 0x68 unused */ 1188c2ecf20Sopenharmony_ci#define TG3PCI_MISC_HOST_CTRL 0x00000068 1198c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_CLEAR_INT 0x00000001 1208c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_MASK_PCI_INT 0x00000002 1218c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_BYTE_SWAP 0x00000004 1228c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_WORD_SWAP 0x00000008 1238c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_PCISTATE_RW 0x00000010 1248c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_CLKREG_RW 0x00000020 1258c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_REGWORD_SWAP 0x00000040 1268c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_INDIR_ACCESS 0x00000080 1278c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_IRQ_MASK_MODE 0x00000100 1288c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_TAGGED_STATUS 0x00000200 1298c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_CHIPREV 0xffff0000 1308c2ecf20Sopenharmony_ci#define MISC_HOST_CTRL_CHIPREV_SHIFT 16 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_A0 0x7000 1338c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_A1 0x7001 1348c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_B0 0x7100 1358c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_B1 0x7101 1368c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_B3 0x7102 1378c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_ALTIMA 0x7104 1388c2ecf20Sopenharmony_ci#define CHIPREV_ID_5700_C0 0x7200 1398c2ecf20Sopenharmony_ci#define CHIPREV_ID_5701_A0 0x0000 1408c2ecf20Sopenharmony_ci#define CHIPREV_ID_5701_B0 0x0100 1418c2ecf20Sopenharmony_ci#define CHIPREV_ID_5701_B2 0x0102 1428c2ecf20Sopenharmony_ci#define CHIPREV_ID_5701_B5 0x0105 1438c2ecf20Sopenharmony_ci#define CHIPREV_ID_5703_A0 0x1000 1448c2ecf20Sopenharmony_ci#define CHIPREV_ID_5703_A1 0x1001 1458c2ecf20Sopenharmony_ci#define CHIPREV_ID_5703_A2 0x1002 1468c2ecf20Sopenharmony_ci#define CHIPREV_ID_5703_A3 0x1003 1478c2ecf20Sopenharmony_ci#define CHIPREV_ID_5704_A0 0x2000 1488c2ecf20Sopenharmony_ci#define CHIPREV_ID_5704_A1 0x2001 1498c2ecf20Sopenharmony_ci#define CHIPREV_ID_5704_A2 0x2002 1508c2ecf20Sopenharmony_ci#define CHIPREV_ID_5704_A3 0x2003 1518c2ecf20Sopenharmony_ci#define CHIPREV_ID_5705_A0 0x3000 1528c2ecf20Sopenharmony_ci#define CHIPREV_ID_5705_A1 0x3001 1538c2ecf20Sopenharmony_ci#define CHIPREV_ID_5705_A2 0x3002 1548c2ecf20Sopenharmony_ci#define CHIPREV_ID_5705_A3 0x3003 1558c2ecf20Sopenharmony_ci#define CHIPREV_ID_5750_A0 0x4000 1568c2ecf20Sopenharmony_ci#define CHIPREV_ID_5750_A1 0x4001 1578c2ecf20Sopenharmony_ci#define CHIPREV_ID_5750_A3 0x4003 1588c2ecf20Sopenharmony_ci#define CHIPREV_ID_5750_C2 0x4202 1598c2ecf20Sopenharmony_ci#define CHIPREV_ID_5752_A0_HW 0x5000 1608c2ecf20Sopenharmony_ci#define CHIPREV_ID_5752_A0 0x6000 1618c2ecf20Sopenharmony_ci#define CHIPREV_ID_5752_A1 0x6001 1628c2ecf20Sopenharmony_ci#define CHIPREV_ID_5714_A2 0x9002 1638c2ecf20Sopenharmony_ci#define CHIPREV_ID_5906_A1 0xc001 1648c2ecf20Sopenharmony_ci#define CHIPREV_ID_57780_A0 0x57780000 1658c2ecf20Sopenharmony_ci#define CHIPREV_ID_57780_A1 0x57780001 1668c2ecf20Sopenharmony_ci#define CHIPREV_ID_5717_A0 0x05717000 1678c2ecf20Sopenharmony_ci#define CHIPREV_ID_5717_C0 0x05717200 1688c2ecf20Sopenharmony_ci#define CHIPREV_ID_57765_A0 0x57785000 1698c2ecf20Sopenharmony_ci#define CHIPREV_ID_5719_A0 0x05719000 1708c2ecf20Sopenharmony_ci#define CHIPREV_ID_5720_A0 0x05720000 1718c2ecf20Sopenharmony_ci#define CHIPREV_ID_5762_A0 0x05762000 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci#define ASIC_REV_5700 0x07 1748c2ecf20Sopenharmony_ci#define ASIC_REV_5701 0x00 1758c2ecf20Sopenharmony_ci#define ASIC_REV_5703 0x01 1768c2ecf20Sopenharmony_ci#define ASIC_REV_5704 0x02 1778c2ecf20Sopenharmony_ci#define ASIC_REV_5705 0x03 1788c2ecf20Sopenharmony_ci#define ASIC_REV_5750 0x04 1798c2ecf20Sopenharmony_ci#define ASIC_REV_5752 0x06 1808c2ecf20Sopenharmony_ci#define ASIC_REV_5780 0x08 1818c2ecf20Sopenharmony_ci#define ASIC_REV_5714 0x09 1828c2ecf20Sopenharmony_ci#define ASIC_REV_5755 0x0a 1838c2ecf20Sopenharmony_ci#define ASIC_REV_5787 0x0b 1848c2ecf20Sopenharmony_ci#define ASIC_REV_5906 0x0c 1858c2ecf20Sopenharmony_ci#define ASIC_REV_USE_PROD_ID_REG 0x0f 1868c2ecf20Sopenharmony_ci#define ASIC_REV_5784 0x5784 1878c2ecf20Sopenharmony_ci#define ASIC_REV_5761 0x5761 1888c2ecf20Sopenharmony_ci#define ASIC_REV_5785 0x5785 1898c2ecf20Sopenharmony_ci#define ASIC_REV_57780 0x57780 1908c2ecf20Sopenharmony_ci#define ASIC_REV_5717 0x5717 1918c2ecf20Sopenharmony_ci#define ASIC_REV_57765 0x57785 1928c2ecf20Sopenharmony_ci#define ASIC_REV_5719 0x5719 1938c2ecf20Sopenharmony_ci#define ASIC_REV_5720 0x5720 1948c2ecf20Sopenharmony_ci#define ASIC_REV_57766 0x57766 1958c2ecf20Sopenharmony_ci#define ASIC_REV_5762 0x5762 1968c2ecf20Sopenharmony_ci#define CHIPREV_5700_AX 0x70 1978c2ecf20Sopenharmony_ci#define CHIPREV_5700_BX 0x71 1988c2ecf20Sopenharmony_ci#define CHIPREV_5700_CX 0x72 1998c2ecf20Sopenharmony_ci#define CHIPREV_5701_AX 0x00 2008c2ecf20Sopenharmony_ci#define CHIPREV_5703_AX 0x10 2018c2ecf20Sopenharmony_ci#define CHIPREV_5704_AX 0x20 2028c2ecf20Sopenharmony_ci#define CHIPREV_5704_BX 0x21 2038c2ecf20Sopenharmony_ci#define CHIPREV_5750_AX 0x40 2048c2ecf20Sopenharmony_ci#define CHIPREV_5750_BX 0x41 2058c2ecf20Sopenharmony_ci#define CHIPREV_5784_AX 0x57840 2068c2ecf20Sopenharmony_ci#define CHIPREV_5761_AX 0x57610 2078c2ecf20Sopenharmony_ci#define CHIPREV_57765_AX 0x577650 2088c2ecf20Sopenharmony_ci#define METAL_REV_A0 0x00 2098c2ecf20Sopenharmony_ci#define METAL_REV_A1 0x01 2108c2ecf20Sopenharmony_ci#define METAL_REV_B0 0x00 2118c2ecf20Sopenharmony_ci#define METAL_REV_B1 0x01 2128c2ecf20Sopenharmony_ci#define METAL_REV_B2 0x02 2138c2ecf20Sopenharmony_ci#define TG3PCI_DMA_RW_CTRL 0x0000006c 2148c2ecf20Sopenharmony_ci#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001 2158c2ecf20Sopenharmony_ci#define DMA_RWCTRL_TAGGED_STAT_WA 0x00000080 2168c2ecf20Sopenharmony_ci#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380 2178c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700 2188c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000 2198c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_16 0x00000100 2208c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_128_PCIX 0x00000100 2218c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_32 0x00000200 2228c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_256_PCIX 0x00000200 2238c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_64 0x00000300 2248c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_384_PCIX 0x00000300 2258c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_128 0x00000400 2268c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_256 0x00000500 2278c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_512 0x00000600 2288c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_BNDRY_1024 0x00000700 2298c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_MASK 0x00003800 2308c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_DISAB 0x00000000 2318c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_16 0x00000800 2328c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_128_PCIX 0x00000800 2338c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_32 0x00001000 2348c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_256_PCIX 0x00001000 2358c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_64 0x00001800 2368c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_384_PCIX 0x00001800 2378c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_128 0x00002000 2388c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_256 0x00002800 2398c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_512 0x00003000 2408c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_1024 0x00003800 2418c2ecf20Sopenharmony_ci#define DMA_RWCTRL_ONE_DMA 0x00004000 2428c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_WATER 0x00070000 2438c2ecf20Sopenharmony_ci#define DMA_RWCTRL_READ_WATER_SHIFT 16 2448c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_WATER 0x00380000 2458c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_WATER_SHIFT 19 2468c2ecf20Sopenharmony_ci#define DMA_RWCTRL_USE_MEM_READ_MULT 0x00400000 2478c2ecf20Sopenharmony_ci#define DMA_RWCTRL_ASSERT_ALL_BE 0x00800000 2488c2ecf20Sopenharmony_ci#define DMA_RWCTRL_PCI_READ_CMD 0x0f000000 2498c2ecf20Sopenharmony_ci#define DMA_RWCTRL_PCI_READ_CMD_SHIFT 24 2508c2ecf20Sopenharmony_ci#define DMA_RWCTRL_PCI_WRITE_CMD 0xf0000000 2518c2ecf20Sopenharmony_ci#define DMA_RWCTRL_PCI_WRITE_CMD_SHIFT 28 2528c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_64_PCIE 0x10000000 2538c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_128_PCIE 0x30000000 2548c2ecf20Sopenharmony_ci#define DMA_RWCTRL_WRITE_BNDRY_DISAB_PCIE 0x70000000 2558c2ecf20Sopenharmony_ci#define TG3PCI_PCISTATE 0x00000070 2568c2ecf20Sopenharmony_ci#define PCISTATE_FORCE_RESET 0x00000001 2578c2ecf20Sopenharmony_ci#define PCISTATE_INT_NOT_ACTIVE 0x00000002 2588c2ecf20Sopenharmony_ci#define PCISTATE_CONV_PCI_MODE 0x00000004 2598c2ecf20Sopenharmony_ci#define PCISTATE_BUS_SPEED_HIGH 0x00000008 2608c2ecf20Sopenharmony_ci#define PCISTATE_BUS_32BIT 0x00000010 2618c2ecf20Sopenharmony_ci#define PCISTATE_ROM_ENABLE 0x00000020 2628c2ecf20Sopenharmony_ci#define PCISTATE_ROM_RETRY_ENABLE 0x00000040 2638c2ecf20Sopenharmony_ci#define PCISTATE_FLAT_VIEW 0x00000100 2648c2ecf20Sopenharmony_ci#define PCISTATE_RETRY_SAME_DMA 0x00002000 2658c2ecf20Sopenharmony_ci#define PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000 2668c2ecf20Sopenharmony_ci#define PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000 2678c2ecf20Sopenharmony_ci#define PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000 2688c2ecf20Sopenharmony_ci#define TG3PCI_CLOCK_CTRL 0x00000074 2698c2ecf20Sopenharmony_ci#define CLOCK_CTRL_CORECLK_DISABLE 0x00000200 2708c2ecf20Sopenharmony_ci#define CLOCK_CTRL_RXCLK_DISABLE 0x00000400 2718c2ecf20Sopenharmony_ci#define CLOCK_CTRL_TXCLK_DISABLE 0x00000800 2728c2ecf20Sopenharmony_ci#define CLOCK_CTRL_ALTCLK 0x00001000 2738c2ecf20Sopenharmony_ci#define CLOCK_CTRL_PWRDOWN_PLL133 0x00008000 2748c2ecf20Sopenharmony_ci#define CLOCK_CTRL_44MHZ_CORE 0x00040000 2758c2ecf20Sopenharmony_ci#define CLOCK_CTRL_625_CORE 0x00100000 2768c2ecf20Sopenharmony_ci#define CLOCK_CTRL_FORCE_CLKRUN 0x00200000 2778c2ecf20Sopenharmony_ci#define CLOCK_CTRL_CLKRUN_OENABLE 0x00400000 2788c2ecf20Sopenharmony_ci#define CLOCK_CTRL_DELAY_PCI_GRANT 0x80000000 2798c2ecf20Sopenharmony_ci#define TG3PCI_REG_BASE_ADDR 0x00000078 2808c2ecf20Sopenharmony_ci#define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c 2818c2ecf20Sopenharmony_ci#define TG3PCI_REG_DATA 0x00000080 2828c2ecf20Sopenharmony_ci#define TG3PCI_MEM_WIN_DATA 0x00000084 2838c2ecf20Sopenharmony_ci#define TG3PCI_MISC_LOCAL_CTRL 0x00000090 2848c2ecf20Sopenharmony_ci/* 0x94 --> 0x98 unused */ 2858c2ecf20Sopenharmony_ci#define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */ 2868c2ecf20Sopenharmony_ci#define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */ 2878c2ecf20Sopenharmony_ci/* 0xa8 --> 0xb8 unused */ 2888c2ecf20Sopenharmony_ci#define TG3PCI_DEV_STATUS_CTRL 0x000000b4 2898c2ecf20Sopenharmony_ci#define MAX_READ_REQ_SIZE_2048 0x00004000 2908c2ecf20Sopenharmony_ci#define MAX_READ_REQ_MASK 0x00007000 2918c2ecf20Sopenharmony_ci#define TG3PCI_DUAL_MAC_CTRL 0x000000b8 2928c2ecf20Sopenharmony_ci#define DUAL_MAC_CTRL_CH_MASK 0x00000003 2938c2ecf20Sopenharmony_ci#define DUAL_MAC_CTRL_ID 0x00000004 2948c2ecf20Sopenharmony_ci#define TG3PCI_PRODID_ASICREV 0x000000bc 2958c2ecf20Sopenharmony_ci#define PROD_ID_ASIC_REV_MASK 0x0fffffff 2968c2ecf20Sopenharmony_ci/* 0xc0 --> 0xf4 unused */ 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci#define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4 2998c2ecf20Sopenharmony_ci#define TG3PCI_GEN15_PRODID_ASICREV 0x000000fc 3008c2ecf20Sopenharmony_ci/* 0xf8 --> 0x200 unused */ 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci#define TG3_CORR_ERR_STAT 0x00000110 3038c2ecf20Sopenharmony_ci#define TG3_CORR_ERR_STAT_CLEAR 0xffffffff 3048c2ecf20Sopenharmony_ci/* 0x114 --> 0x200 unused */ 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci/* Mailbox registers */ 3078c2ecf20Sopenharmony_ci#define MAILBOX_INTERRUPT_0 0x00000200 /* 64-bit */ 3088c2ecf20Sopenharmony_ci#define MAILBOX_INTERRUPT_1 0x00000208 /* 64-bit */ 3098c2ecf20Sopenharmony_ci#define MAILBOX_INTERRUPT_2 0x00000210 /* 64-bit */ 3108c2ecf20Sopenharmony_ci#define MAILBOX_INTERRUPT_3 0x00000218 /* 64-bit */ 3118c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_0 0x00000220 /* 64-bit */ 3128c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_1 0x00000228 /* 64-bit */ 3138c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_2 0x00000230 /* 64-bit */ 3148c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_3 0x00000238 /* 64-bit */ 3158c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_4 0x00000240 /* 64-bit */ 3168c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_5 0x00000248 /* 64-bit */ 3178c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_6 0x00000250 /* 64-bit */ 3188c2ecf20Sopenharmony_ci#define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */ 3198c2ecf20Sopenharmony_ci#define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */ 3208c2ecf20Sopenharmony_ci#define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */ 3218c2ecf20Sopenharmony_ci#define TG3_RX_STD_PROD_IDX_REG (MAILBOX_RCV_STD_PROD_IDX + \ 3228c2ecf20Sopenharmony_ci TG3_64BIT_REG_LOW) 3238c2ecf20Sopenharmony_ci#define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */ 3248c2ecf20Sopenharmony_ci#define TG3_RX_JMB_PROD_IDX_REG (MAILBOX_RCV_JUMBO_PROD_IDX + \ 3258c2ecf20Sopenharmony_ci TG3_64BIT_REG_LOW) 3268c2ecf20Sopenharmony_ci#define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */ 3278c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */ 3288c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */ 3298c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_2 0x00000290 /* 64-bit */ 3308c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_3 0x00000298 /* 64-bit */ 3318c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_4 0x000002a0 /* 64-bit */ 3328c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_5 0x000002a8 /* 64-bit */ 3338c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_6 0x000002b0 /* 64-bit */ 3348c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_7 0x000002b8 /* 64-bit */ 3358c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_8 0x000002c0 /* 64-bit */ 3368c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_9 0x000002c8 /* 64-bit */ 3378c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_10 0x000002d0 /* 64-bit */ 3388c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_11 0x000002d8 /* 64-bit */ 3398c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_12 0x000002e0 /* 64-bit */ 3408c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_13 0x000002e8 /* 64-bit */ 3418c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_14 0x000002f0 /* 64-bit */ 3428c2ecf20Sopenharmony_ci#define MAILBOX_RCVRET_CON_IDX_15 0x000002f8 /* 64-bit */ 3438c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_0 0x00000300 /* 64-bit */ 3448c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_1 0x00000308 /* 64-bit */ 3458c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_2 0x00000310 /* 64-bit */ 3468c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_3 0x00000318 /* 64-bit */ 3478c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_4 0x00000320 /* 64-bit */ 3488c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_5 0x00000328 /* 64-bit */ 3498c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_6 0x00000330 /* 64-bit */ 3508c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_7 0x00000338 /* 64-bit */ 3518c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_8 0x00000340 /* 64-bit */ 3528c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_9 0x00000348 /* 64-bit */ 3538c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_10 0x00000350 /* 64-bit */ 3548c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_11 0x00000358 /* 64-bit */ 3558c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_12 0x00000360 /* 64-bit */ 3568c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_13 0x00000368 /* 64-bit */ 3578c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_14 0x00000370 /* 64-bit */ 3588c2ecf20Sopenharmony_ci#define MAILBOX_SNDHOST_PROD_IDX_15 0x00000378 /* 64-bit */ 3598c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_0 0x00000380 /* 64-bit */ 3608c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_1 0x00000388 /* 64-bit */ 3618c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_2 0x00000390 /* 64-bit */ 3628c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_3 0x00000398 /* 64-bit */ 3638c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_4 0x000003a0 /* 64-bit */ 3648c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_5 0x000003a8 /* 64-bit */ 3658c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_6 0x000003b0 /* 64-bit */ 3668c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_7 0x000003b8 /* 64-bit */ 3678c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_8 0x000003c0 /* 64-bit */ 3688c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_9 0x000003c8 /* 64-bit */ 3698c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_10 0x000003d0 /* 64-bit */ 3708c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_11 0x000003d8 /* 64-bit */ 3718c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_12 0x000003e0 /* 64-bit */ 3728c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_13 0x000003e8 /* 64-bit */ 3738c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_14 0x000003f0 /* 64-bit */ 3748c2ecf20Sopenharmony_ci#define MAILBOX_SNDNIC_PROD_IDX_15 0x000003f8 /* 64-bit */ 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci/* MAC control registers */ 3778c2ecf20Sopenharmony_ci#define MAC_MODE 0x00000400 3788c2ecf20Sopenharmony_ci#define MAC_MODE_RESET 0x00000001 3798c2ecf20Sopenharmony_ci#define MAC_MODE_HALF_DUPLEX 0x00000002 3808c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_MODE_MASK 0x0000000c 3818c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_MODE_TBI 0x0000000c 3828c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_MODE_GMII 0x00000008 3838c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_MODE_MII 0x00000004 3848c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_MODE_NONE 0x00000000 3858c2ecf20Sopenharmony_ci#define MAC_MODE_PORT_INT_LPBACK 0x00000010 3868c2ecf20Sopenharmony_ci#define MAC_MODE_TAGGED_MAC_CTRL 0x00000080 3878c2ecf20Sopenharmony_ci#define MAC_MODE_TX_BURSTING 0x00000100 3888c2ecf20Sopenharmony_ci#define MAC_MODE_MAX_DEFER 0x00000200 3898c2ecf20Sopenharmony_ci#define MAC_MODE_LINK_POLARITY 0x00000400 3908c2ecf20Sopenharmony_ci#define MAC_MODE_RXSTAT_ENABLE 0x00000800 3918c2ecf20Sopenharmony_ci#define MAC_MODE_RXSTAT_CLEAR 0x00001000 3928c2ecf20Sopenharmony_ci#define MAC_MODE_RXSTAT_FLUSH 0x00002000 3938c2ecf20Sopenharmony_ci#define MAC_MODE_TXSTAT_ENABLE 0x00004000 3948c2ecf20Sopenharmony_ci#define MAC_MODE_TXSTAT_CLEAR 0x00008000 3958c2ecf20Sopenharmony_ci#define MAC_MODE_TXSTAT_FLUSH 0x00010000 3968c2ecf20Sopenharmony_ci#define MAC_MODE_SEND_CONFIGS 0x00020000 3978c2ecf20Sopenharmony_ci#define MAC_MODE_MAGIC_PKT_ENABLE 0x00040000 3988c2ecf20Sopenharmony_ci#define MAC_MODE_ACPI_ENABLE 0x00080000 3998c2ecf20Sopenharmony_ci#define MAC_MODE_MIP_ENABLE 0x00100000 4008c2ecf20Sopenharmony_ci#define MAC_MODE_TDE_ENABLE 0x00200000 4018c2ecf20Sopenharmony_ci#define MAC_MODE_RDE_ENABLE 0x00400000 4028c2ecf20Sopenharmony_ci#define MAC_MODE_FHDE_ENABLE 0x00800000 4038c2ecf20Sopenharmony_ci#define MAC_MODE_KEEP_FRAME_IN_WOL 0x01000000 4048c2ecf20Sopenharmony_ci#define MAC_MODE_APE_RX_EN 0x08000000 4058c2ecf20Sopenharmony_ci#define MAC_MODE_APE_TX_EN 0x10000000 4068c2ecf20Sopenharmony_ci#define MAC_STATUS 0x00000404 4078c2ecf20Sopenharmony_ci#define MAC_STATUS_PCS_SYNCED 0x00000001 4088c2ecf20Sopenharmony_ci#define MAC_STATUS_SIGNAL_DET 0x00000002 4098c2ecf20Sopenharmony_ci#define MAC_STATUS_RCVD_CFG 0x00000004 4108c2ecf20Sopenharmony_ci#define MAC_STATUS_CFG_CHANGED 0x00000008 4118c2ecf20Sopenharmony_ci#define MAC_STATUS_SYNC_CHANGED 0x00000010 4128c2ecf20Sopenharmony_ci#define MAC_STATUS_PORT_DEC_ERR 0x00000400 4138c2ecf20Sopenharmony_ci#define MAC_STATUS_LNKSTATE_CHANGED 0x00001000 4148c2ecf20Sopenharmony_ci#define MAC_STATUS_MI_COMPLETION 0x00400000 4158c2ecf20Sopenharmony_ci#define MAC_STATUS_MI_INTERRUPT 0x00800000 4168c2ecf20Sopenharmony_ci#define MAC_STATUS_AP_ERROR 0x01000000 4178c2ecf20Sopenharmony_ci#define MAC_STATUS_ODI_ERROR 0x02000000 4188c2ecf20Sopenharmony_ci#define MAC_STATUS_RXSTAT_OVERRUN 0x04000000 4198c2ecf20Sopenharmony_ci#define MAC_STATUS_TXSTAT_OVERRUN 0x08000000 4208c2ecf20Sopenharmony_ci#define MAC_EVENT 0x00000408 4218c2ecf20Sopenharmony_ci#define MAC_EVENT_PORT_DECODE_ERR 0x00000400 4228c2ecf20Sopenharmony_ci#define MAC_EVENT_LNKSTATE_CHANGED 0x00001000 4238c2ecf20Sopenharmony_ci#define MAC_EVENT_MI_COMPLETION 0x00400000 4248c2ecf20Sopenharmony_ci#define MAC_EVENT_MI_INTERRUPT 0x00800000 4258c2ecf20Sopenharmony_ci#define MAC_EVENT_AP_ERROR 0x01000000 4268c2ecf20Sopenharmony_ci#define MAC_EVENT_ODI_ERROR 0x02000000 4278c2ecf20Sopenharmony_ci#define MAC_EVENT_RXSTAT_OVERRUN 0x04000000 4288c2ecf20Sopenharmony_ci#define MAC_EVENT_TXSTAT_OVERRUN 0x08000000 4298c2ecf20Sopenharmony_ci#define MAC_LED_CTRL 0x0000040c 4308c2ecf20Sopenharmony_ci#define LED_CTRL_LNKLED_OVERRIDE 0x00000001 4318c2ecf20Sopenharmony_ci#define LED_CTRL_1000MBPS_ON 0x00000002 4328c2ecf20Sopenharmony_ci#define LED_CTRL_100MBPS_ON 0x00000004 4338c2ecf20Sopenharmony_ci#define LED_CTRL_10MBPS_ON 0x00000008 4348c2ecf20Sopenharmony_ci#define LED_CTRL_TRAFFIC_OVERRIDE 0x00000010 4358c2ecf20Sopenharmony_ci#define LED_CTRL_TRAFFIC_BLINK 0x00000020 4368c2ecf20Sopenharmony_ci#define LED_CTRL_TRAFFIC_LED 0x00000040 4378c2ecf20Sopenharmony_ci#define LED_CTRL_1000MBPS_STATUS 0x00000080 4388c2ecf20Sopenharmony_ci#define LED_CTRL_100MBPS_STATUS 0x00000100 4398c2ecf20Sopenharmony_ci#define LED_CTRL_10MBPS_STATUS 0x00000200 4408c2ecf20Sopenharmony_ci#define LED_CTRL_TRAFFIC_STATUS 0x00000400 4418c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_MAC 0x00000000 4428c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_PHY_1 0x00000800 4438c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_PHY_2 0x00001000 4448c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_SHASTA_MAC 0x00002000 4458c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_SHARED 0x00004000 4468c2ecf20Sopenharmony_ci#define LED_CTRL_MODE_COMBO 0x00008000 4478c2ecf20Sopenharmony_ci#define LED_CTRL_BLINK_RATE_MASK 0x7ff80000 4488c2ecf20Sopenharmony_ci#define LED_CTRL_BLINK_RATE_SHIFT 19 4498c2ecf20Sopenharmony_ci#define LED_CTRL_BLINK_PER_OVERRIDE 0x00080000 4508c2ecf20Sopenharmony_ci#define LED_CTRL_BLINK_RATE_OVERRIDE 0x80000000 4518c2ecf20Sopenharmony_ci#define MAC_ADDR_0_HIGH 0x00000410 /* upper 2 bytes */ 4528c2ecf20Sopenharmony_ci#define MAC_ADDR_0_LOW 0x00000414 /* lower 4 bytes */ 4538c2ecf20Sopenharmony_ci#define MAC_ADDR_1_HIGH 0x00000418 /* upper 2 bytes */ 4548c2ecf20Sopenharmony_ci#define MAC_ADDR_1_LOW 0x0000041c /* lower 4 bytes */ 4558c2ecf20Sopenharmony_ci#define MAC_ADDR_2_HIGH 0x00000420 /* upper 2 bytes */ 4568c2ecf20Sopenharmony_ci#define MAC_ADDR_2_LOW 0x00000424 /* lower 4 bytes */ 4578c2ecf20Sopenharmony_ci#define MAC_ADDR_3_HIGH 0x00000428 /* upper 2 bytes */ 4588c2ecf20Sopenharmony_ci#define MAC_ADDR_3_LOW 0x0000042c /* lower 4 bytes */ 4598c2ecf20Sopenharmony_ci#define MAC_ACPI_MBUF_PTR 0x00000430 4608c2ecf20Sopenharmony_ci#define MAC_ACPI_LEN_OFFSET 0x00000434 4618c2ecf20Sopenharmony_ci#define ACPI_LENOFF_LEN_MASK 0x0000ffff 4628c2ecf20Sopenharmony_ci#define ACPI_LENOFF_LEN_SHIFT 0 4638c2ecf20Sopenharmony_ci#define ACPI_LENOFF_OFF_MASK 0x0fff0000 4648c2ecf20Sopenharmony_ci#define ACPI_LENOFF_OFF_SHIFT 16 4658c2ecf20Sopenharmony_ci#define MAC_TX_BACKOFF_SEED 0x00000438 4668c2ecf20Sopenharmony_ci#define TX_BACKOFF_SEED_MASK 0x000003ff 4678c2ecf20Sopenharmony_ci#define MAC_RX_MTU_SIZE 0x0000043c 4688c2ecf20Sopenharmony_ci#define RX_MTU_SIZE_MASK 0x0000ffff 4698c2ecf20Sopenharmony_ci#define MAC_PCS_TEST 0x00000440 4708c2ecf20Sopenharmony_ci#define PCS_TEST_PATTERN_MASK 0x000fffff 4718c2ecf20Sopenharmony_ci#define PCS_TEST_PATTERN_SHIFT 0 4728c2ecf20Sopenharmony_ci#define PCS_TEST_ENABLE 0x00100000 4738c2ecf20Sopenharmony_ci#define MAC_TX_AUTO_NEG 0x00000444 4748c2ecf20Sopenharmony_ci#define TX_AUTO_NEG_MASK 0x0000ffff 4758c2ecf20Sopenharmony_ci#define TX_AUTO_NEG_SHIFT 0 4768c2ecf20Sopenharmony_ci#define MAC_RX_AUTO_NEG 0x00000448 4778c2ecf20Sopenharmony_ci#define RX_AUTO_NEG_MASK 0x0000ffff 4788c2ecf20Sopenharmony_ci#define RX_AUTO_NEG_SHIFT 0 4798c2ecf20Sopenharmony_ci#define MAC_MI_COM 0x0000044c 4808c2ecf20Sopenharmony_ci#define MI_COM_CMD_MASK 0x0c000000 4818c2ecf20Sopenharmony_ci#define MI_COM_CMD_WRITE 0x04000000 4828c2ecf20Sopenharmony_ci#define MI_COM_CMD_READ 0x08000000 4838c2ecf20Sopenharmony_ci#define MI_COM_READ_FAILED 0x10000000 4848c2ecf20Sopenharmony_ci#define MI_COM_START 0x20000000 4858c2ecf20Sopenharmony_ci#define MI_COM_BUSY 0x20000000 4868c2ecf20Sopenharmony_ci#define MI_COM_PHY_ADDR_MASK 0x03e00000 4878c2ecf20Sopenharmony_ci#define MI_COM_PHY_ADDR_SHIFT 21 4888c2ecf20Sopenharmony_ci#define MI_COM_REG_ADDR_MASK 0x001f0000 4898c2ecf20Sopenharmony_ci#define MI_COM_REG_ADDR_SHIFT 16 4908c2ecf20Sopenharmony_ci#define MI_COM_DATA_MASK 0x0000ffff 4918c2ecf20Sopenharmony_ci#define MAC_MI_STAT 0x00000450 4928c2ecf20Sopenharmony_ci#define MAC_MI_STAT_LNKSTAT_ATTN_ENAB 0x00000001 4938c2ecf20Sopenharmony_ci#define MAC_MI_STAT_10MBPS_MODE 0x00000002 4948c2ecf20Sopenharmony_ci#define MAC_MI_MODE 0x00000454 4958c2ecf20Sopenharmony_ci#define MAC_MI_MODE_CLK_10MHZ 0x00000001 4968c2ecf20Sopenharmony_ci#define MAC_MI_MODE_SHORT_PREAMBLE 0x00000002 4978c2ecf20Sopenharmony_ci#define MAC_MI_MODE_AUTO_POLL 0x00000010 4988c2ecf20Sopenharmony_ci#define MAC_MI_MODE_500KHZ_CONST 0x00008000 4998c2ecf20Sopenharmony_ci#define MAC_MI_MODE_BASE 0x000c0000 /* XXX magic values XXX */ 5008c2ecf20Sopenharmony_ci#define MAC_AUTO_POLL_STATUS 0x00000458 5018c2ecf20Sopenharmony_ci#define MAC_AUTO_POLL_ERROR 0x00000001 5028c2ecf20Sopenharmony_ci#define MAC_TX_MODE 0x0000045c 5038c2ecf20Sopenharmony_ci#define TX_MODE_RESET 0x00000001 5048c2ecf20Sopenharmony_ci#define TX_MODE_ENABLE 0x00000002 5058c2ecf20Sopenharmony_ci#define TX_MODE_FLOW_CTRL_ENABLE 0x00000010 5068c2ecf20Sopenharmony_ci#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020 5078c2ecf20Sopenharmony_ci#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040 5088c2ecf20Sopenharmony_ci#define TX_MODE_MBUF_LOCKUP_FIX 0x00000100 5098c2ecf20Sopenharmony_ci#define TX_MODE_JMB_FRM_LEN 0x00400000 5108c2ecf20Sopenharmony_ci#define TX_MODE_CNT_DN_MODE 0x00800000 5118c2ecf20Sopenharmony_ci#define MAC_TX_STATUS 0x00000460 5128c2ecf20Sopenharmony_ci#define TX_STATUS_XOFFED 0x00000001 5138c2ecf20Sopenharmony_ci#define TX_STATUS_SENT_XOFF 0x00000002 5148c2ecf20Sopenharmony_ci#define TX_STATUS_SENT_XON 0x00000004 5158c2ecf20Sopenharmony_ci#define TX_STATUS_LINK_UP 0x00000008 5168c2ecf20Sopenharmony_ci#define TX_STATUS_ODI_UNDERRUN 0x00000010 5178c2ecf20Sopenharmony_ci#define TX_STATUS_ODI_OVERRUN 0x00000020 5188c2ecf20Sopenharmony_ci#define MAC_TX_LENGTHS 0x00000464 5198c2ecf20Sopenharmony_ci#define TX_LENGTHS_SLOT_TIME_MASK 0x000000ff 5208c2ecf20Sopenharmony_ci#define TX_LENGTHS_SLOT_TIME_SHIFT 0 5218c2ecf20Sopenharmony_ci#define TX_LENGTHS_IPG_MASK 0x00000f00 5228c2ecf20Sopenharmony_ci#define TX_LENGTHS_IPG_SHIFT 8 5238c2ecf20Sopenharmony_ci#define TX_LENGTHS_IPG_CRS_MASK 0x00003000 5248c2ecf20Sopenharmony_ci#define TX_LENGTHS_IPG_CRS_SHIFT 12 5258c2ecf20Sopenharmony_ci#define TX_LENGTHS_JMB_FRM_LEN_MSK 0x00ff0000 5268c2ecf20Sopenharmony_ci#define TX_LENGTHS_CNT_DWN_VAL_MSK 0xff000000 5278c2ecf20Sopenharmony_ci#define MAC_RX_MODE 0x00000468 5288c2ecf20Sopenharmony_ci#define RX_MODE_RESET 0x00000001 5298c2ecf20Sopenharmony_ci#define RX_MODE_ENABLE 0x00000002 5308c2ecf20Sopenharmony_ci#define RX_MODE_FLOW_CTRL_ENABLE 0x00000004 5318c2ecf20Sopenharmony_ci#define RX_MODE_KEEP_MAC_CTRL 0x00000008 5328c2ecf20Sopenharmony_ci#define RX_MODE_KEEP_PAUSE 0x00000010 5338c2ecf20Sopenharmony_ci#define RX_MODE_ACCEPT_OVERSIZED 0x00000020 5348c2ecf20Sopenharmony_ci#define RX_MODE_ACCEPT_RUNTS 0x00000040 5358c2ecf20Sopenharmony_ci#define RX_MODE_LEN_CHECK 0x00000080 5368c2ecf20Sopenharmony_ci#define RX_MODE_PROMISC 0x00000100 5378c2ecf20Sopenharmony_ci#define RX_MODE_NO_CRC_CHECK 0x00000200 5388c2ecf20Sopenharmony_ci#define RX_MODE_KEEP_VLAN_TAG 0x00000400 5398c2ecf20Sopenharmony_ci#define RX_MODE_RSS_IPV4_HASH_EN 0x00010000 5408c2ecf20Sopenharmony_ci#define RX_MODE_RSS_TCP_IPV4_HASH_EN 0x00020000 5418c2ecf20Sopenharmony_ci#define RX_MODE_RSS_IPV6_HASH_EN 0x00040000 5428c2ecf20Sopenharmony_ci#define RX_MODE_RSS_TCP_IPV6_HASH_EN 0x00080000 5438c2ecf20Sopenharmony_ci#define RX_MODE_RSS_ITBL_HASH_BITS_7 0x00700000 5448c2ecf20Sopenharmony_ci#define RX_MODE_RSS_ENABLE 0x00800000 5458c2ecf20Sopenharmony_ci#define RX_MODE_IPV6_CSUM_ENABLE 0x01000000 5468c2ecf20Sopenharmony_ci#define RX_MODE_IPV4_FRAG_FIX 0x02000000 5478c2ecf20Sopenharmony_ci#define MAC_RX_STATUS 0x0000046c 5488c2ecf20Sopenharmony_ci#define RX_STATUS_REMOTE_TX_XOFFED 0x00000001 5498c2ecf20Sopenharmony_ci#define RX_STATUS_XOFF_RCVD 0x00000002 5508c2ecf20Sopenharmony_ci#define RX_STATUS_XON_RCVD 0x00000004 5518c2ecf20Sopenharmony_ci#define MAC_HASH_REG_0 0x00000470 5528c2ecf20Sopenharmony_ci#define MAC_HASH_REG_1 0x00000474 5538c2ecf20Sopenharmony_ci#define MAC_HASH_REG_2 0x00000478 5548c2ecf20Sopenharmony_ci#define MAC_HASH_REG_3 0x0000047c 5558c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_0 0x00000480 5568c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_0 0x00000484 5578c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_1 0x00000488 5588c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_1 0x0000048c 5598c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_2 0x00000490 5608c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_2 0x00000494 5618c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_3 0x00000498 5628c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_3 0x0000049c 5638c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_4 0x000004a0 5648c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_4 0x000004a4 5658c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_5 0x000004a8 5668c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_5 0x000004ac 5678c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_6 0x000004b0 5688c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_6 0x000004b4 5698c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_7 0x000004b8 5708c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_7 0x000004bc 5718c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_8 0x000004c0 5728c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_8 0x000004c4 5738c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_9 0x000004c8 5748c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_9 0x000004cc 5758c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_10 0x000004d0 5768c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_10 0x000004d4 5778c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_11 0x000004d8 5788c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_11 0x000004dc 5798c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_12 0x000004e0 5808c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_12 0x000004e4 5818c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_13 0x000004e8 5828c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_13 0x000004ec 5838c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_14 0x000004f0 5848c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_14 0x000004f4 5858c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_15 0x000004f8 5868c2ecf20Sopenharmony_ci#define MAC_RCV_VALUE_15 0x000004fc 5878c2ecf20Sopenharmony_ci#define RCV_RULE_DISABLE_MASK 0x7fffffff 5888c2ecf20Sopenharmony_ci#define MAC_RCV_RULE_CFG 0x00000500 5898c2ecf20Sopenharmony_ci#define RCV_RULE_CFG_DEFAULT_CLASS 0x00000008 5908c2ecf20Sopenharmony_ci#define MAC_LOW_WMARK_MAX_RX_FRAME 0x00000504 5918c2ecf20Sopenharmony_ci/* 0x508 --> 0x520 unused */ 5928c2ecf20Sopenharmony_ci#define MAC_HASHREGU_0 0x00000520 5938c2ecf20Sopenharmony_ci#define MAC_HASHREGU_1 0x00000524 5948c2ecf20Sopenharmony_ci#define MAC_HASHREGU_2 0x00000528 5958c2ecf20Sopenharmony_ci#define MAC_HASHREGU_3 0x0000052c 5968c2ecf20Sopenharmony_ci#define MAC_EXTADDR_0_HIGH 0x00000530 5978c2ecf20Sopenharmony_ci#define MAC_EXTADDR_0_LOW 0x00000534 5988c2ecf20Sopenharmony_ci#define MAC_EXTADDR_1_HIGH 0x00000538 5998c2ecf20Sopenharmony_ci#define MAC_EXTADDR_1_LOW 0x0000053c 6008c2ecf20Sopenharmony_ci#define MAC_EXTADDR_2_HIGH 0x00000540 6018c2ecf20Sopenharmony_ci#define MAC_EXTADDR_2_LOW 0x00000544 6028c2ecf20Sopenharmony_ci#define MAC_EXTADDR_3_HIGH 0x00000548 6038c2ecf20Sopenharmony_ci#define MAC_EXTADDR_3_LOW 0x0000054c 6048c2ecf20Sopenharmony_ci#define MAC_EXTADDR_4_HIGH 0x00000550 6058c2ecf20Sopenharmony_ci#define MAC_EXTADDR_4_LOW 0x00000554 6068c2ecf20Sopenharmony_ci#define MAC_EXTADDR_5_HIGH 0x00000558 6078c2ecf20Sopenharmony_ci#define MAC_EXTADDR_5_LOW 0x0000055c 6088c2ecf20Sopenharmony_ci#define MAC_EXTADDR_6_HIGH 0x00000560 6098c2ecf20Sopenharmony_ci#define MAC_EXTADDR_6_LOW 0x00000564 6108c2ecf20Sopenharmony_ci#define MAC_EXTADDR_7_HIGH 0x00000568 6118c2ecf20Sopenharmony_ci#define MAC_EXTADDR_7_LOW 0x0000056c 6128c2ecf20Sopenharmony_ci#define MAC_EXTADDR_8_HIGH 0x00000570 6138c2ecf20Sopenharmony_ci#define MAC_EXTADDR_8_LOW 0x00000574 6148c2ecf20Sopenharmony_ci#define MAC_EXTADDR_9_HIGH 0x00000578 6158c2ecf20Sopenharmony_ci#define MAC_EXTADDR_9_LOW 0x0000057c 6168c2ecf20Sopenharmony_ci#define MAC_EXTADDR_10_HIGH 0x00000580 6178c2ecf20Sopenharmony_ci#define MAC_EXTADDR_10_LOW 0x00000584 6188c2ecf20Sopenharmony_ci#define MAC_EXTADDR_11_HIGH 0x00000588 6198c2ecf20Sopenharmony_ci#define MAC_EXTADDR_11_LOW 0x0000058c 6208c2ecf20Sopenharmony_ci#define MAC_SERDES_CFG 0x00000590 6218c2ecf20Sopenharmony_ci#define MAC_SERDES_CFG_EDGE_SELECT 0x00001000 6228c2ecf20Sopenharmony_ci#define MAC_SERDES_STAT 0x00000594 6238c2ecf20Sopenharmony_ci/* 0x598 --> 0x5a0 unused */ 6248c2ecf20Sopenharmony_ci#define MAC_PHYCFG1 0x000005a0 6258c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_RGMII_INT 0x00000001 6268c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_RXCLK_TO_MASK 0x00001ff0 6278c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_RXCLK_TIMEOUT 0x00001000 6288c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_TXCLK_TO_MASK 0x01ff0000 6298c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_TXCLK_TIMEOUT 0x01000000 6308c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_RGMII_EXT_RX_DEC 0x02000000 6318c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_RGMII_SND_STAT_EN 0x04000000 6328c2ecf20Sopenharmony_ci#define MAC_PHYCFG1_TXC_DRV 0x20000000 6338c2ecf20Sopenharmony_ci#define MAC_PHYCFG2 0x000005a4 6348c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_INBAND_ENABLE 0x00000001 6358c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_MASK_MASK 0x000001c0 6368c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_MASK_AC131 0x000000c0 6378c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_MASK_50610 0x00000100 6388c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_MASK_RT8211 0x00000000 6398c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_MASK_RT8201 0x000001c0 6408c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_COMP_MASK 0x00000e00 6418c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_COMP_AC131 0x00000600 6428c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_COMP_50610 0x00000400 6438c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_COMP_RT8211 0x00000800 6448c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_EMODE_COMP_RT8201 0x00000000 6458c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_MASK_MASK 0x00007000 6468c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_MASK_AC131 0x00006000 6478c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_MASK_50610 0x00004000 6488c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_MASK_RT8211 0x00000000 6498c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_MASK_RT8201 0x00007000 6508c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_COMP_MASK 0x00038000 6518c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_COMP_AC131 0x00030000 6528c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_COMP_50610 0x00008000 6538c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_COMP_RT8211 0x00038000 6548c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_FMODE_COMP_RT8201 0x00000000 6558c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_MASK_MASK 0x001c0000 6568c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_MASK_AC131 0x001c0000 6578c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_MASK_50610 0x00100000 6588c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_MASK_RT8211 0x00000000 6598c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_MASK_RT8201 0x001c0000 6608c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_COMP_MASK 0x00e00000 6618c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_COMP_AC131 0x00e00000 6628c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_COMP_50610 0x00000000 6638c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_COMP_RT8211 0x00200000 6648c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_GMODE_COMP_RT8201 0x00000000 6658c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_MASK_MASK 0x03000000 6668c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_MASK_AC131 0x03000000 6678c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_MASK_50610 0x01000000 6688c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_MASK_RT8211 0x03000000 6698c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_MASK_RT8201 0x01000000 6708c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_COMP_MASK 0x0c000000 6718c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_COMP_AC131 0x00000000 6728c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_COMP_50610 0x00000000 6738c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_COMP_RT8211 0x00000000 6748c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_ACT_COMP_RT8201 0x08000000 6758c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_MASK_MASK 0x30000000 6768c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_MASK_AC131 0x30000000 6778c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_MASK_50610 0x30000000 6788c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_MASK_RT8211 0x30000000 6798c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_MASK_RT8201 0x30000000 6808c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_COMP_MASK 0xc0000000 6818c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_COMP_AC131 0x00000000 6828c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_COMP_50610 0x00000000 6838c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_COMP_RT8211 0x00000000 6848c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_QUAL_COMP_RT8201 0x00000000 6858c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_50610_LED_MODES \ 6868c2ecf20Sopenharmony_ci (MAC_PHYCFG2_EMODE_MASK_50610 | \ 6878c2ecf20Sopenharmony_ci MAC_PHYCFG2_EMODE_COMP_50610 | \ 6888c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_MASK_50610 | \ 6898c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_COMP_50610 | \ 6908c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_MASK_50610 | \ 6918c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_COMP_50610 | \ 6928c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_MASK_50610 | \ 6938c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_COMP_50610 | \ 6948c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_MASK_50610 | \ 6958c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_COMP_50610) 6968c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_AC131_LED_MODES \ 6978c2ecf20Sopenharmony_ci (MAC_PHYCFG2_EMODE_MASK_AC131 | \ 6988c2ecf20Sopenharmony_ci MAC_PHYCFG2_EMODE_COMP_AC131 | \ 6998c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_MASK_AC131 | \ 7008c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_COMP_AC131 | \ 7018c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_MASK_AC131 | \ 7028c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_COMP_AC131 | \ 7038c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_MASK_AC131 | \ 7048c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_COMP_AC131 | \ 7058c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_MASK_AC131 | \ 7068c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_COMP_AC131) 7078c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_RTL8211C_LED_MODES \ 7088c2ecf20Sopenharmony_ci (MAC_PHYCFG2_EMODE_MASK_RT8211 | \ 7098c2ecf20Sopenharmony_ci MAC_PHYCFG2_EMODE_COMP_RT8211 | \ 7108c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_MASK_RT8211 | \ 7118c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_COMP_RT8211 | \ 7128c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_MASK_RT8211 | \ 7138c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_COMP_RT8211 | \ 7148c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_MASK_RT8211 | \ 7158c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_COMP_RT8211 | \ 7168c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_MASK_RT8211 | \ 7178c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_COMP_RT8211) 7188c2ecf20Sopenharmony_ci#define MAC_PHYCFG2_RTL8201E_LED_MODES \ 7198c2ecf20Sopenharmony_ci (MAC_PHYCFG2_EMODE_MASK_RT8201 | \ 7208c2ecf20Sopenharmony_ci MAC_PHYCFG2_EMODE_COMP_RT8201 | \ 7218c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_MASK_RT8201 | \ 7228c2ecf20Sopenharmony_ci MAC_PHYCFG2_FMODE_COMP_RT8201 | \ 7238c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_MASK_RT8201 | \ 7248c2ecf20Sopenharmony_ci MAC_PHYCFG2_GMODE_COMP_RT8201 | \ 7258c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_MASK_RT8201 | \ 7268c2ecf20Sopenharmony_ci MAC_PHYCFG2_ACT_COMP_RT8201 | \ 7278c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_MASK_RT8201 | \ 7288c2ecf20Sopenharmony_ci MAC_PHYCFG2_QUAL_COMP_RT8201) 7298c2ecf20Sopenharmony_ci#define MAC_EXT_RGMII_MODE 0x000005a8 7308c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_TX_ENABLE 0x00000001 7318c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_TX_LOWPWR 0x00000002 7328c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_TX_RESET 0x00000004 7338c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_RX_INT_B 0x00000100 7348c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_RX_QUALITY 0x00000200 7358c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_RX_ACTIVITY 0x00000400 7368c2ecf20Sopenharmony_ci#define MAC_RGMII_MODE_RX_ENG_DET 0x00000800 7378c2ecf20Sopenharmony_ci/* 0x5ac --> 0x5b0 unused */ 7388c2ecf20Sopenharmony_ci#define SERDES_RX_CTRL 0x000005b0 /* 5780/5714 only */ 7398c2ecf20Sopenharmony_ci#define SERDES_RX_SIG_DETECT 0x00000400 7408c2ecf20Sopenharmony_ci#define SG_DIG_CTRL 0x000005b0 7418c2ecf20Sopenharmony_ci#define SG_DIG_USING_HW_AUTONEG 0x80000000 7428c2ecf20Sopenharmony_ci#define SG_DIG_SOFT_RESET 0x40000000 7438c2ecf20Sopenharmony_ci#define SG_DIG_DISABLE_LINKRDY 0x20000000 7448c2ecf20Sopenharmony_ci#define SG_DIG_CRC16_CLEAR_N 0x01000000 7458c2ecf20Sopenharmony_ci#define SG_DIG_EN10B 0x00800000 7468c2ecf20Sopenharmony_ci#define SG_DIG_CLEAR_STATUS 0x00400000 7478c2ecf20Sopenharmony_ci#define SG_DIG_LOCAL_DUPLEX_STATUS 0x00200000 7488c2ecf20Sopenharmony_ci#define SG_DIG_LOCAL_LINK_STATUS 0x00100000 7498c2ecf20Sopenharmony_ci#define SG_DIG_SPEED_STATUS_MASK 0x000c0000 7508c2ecf20Sopenharmony_ci#define SG_DIG_SPEED_STATUS_SHIFT 18 7518c2ecf20Sopenharmony_ci#define SG_DIG_JUMBO_PACKET_DISABLE 0x00020000 7528c2ecf20Sopenharmony_ci#define SG_DIG_RESTART_AUTONEG 0x00010000 7538c2ecf20Sopenharmony_ci#define SG_DIG_FIBER_MODE 0x00008000 7548c2ecf20Sopenharmony_ci#define SG_DIG_REMOTE_FAULT_MASK 0x00006000 7558c2ecf20Sopenharmony_ci#define SG_DIG_PAUSE_MASK 0x00001800 7568c2ecf20Sopenharmony_ci#define SG_DIG_PAUSE_CAP 0x00000800 7578c2ecf20Sopenharmony_ci#define SG_DIG_ASYM_PAUSE 0x00001000 7588c2ecf20Sopenharmony_ci#define SG_DIG_GBIC_ENABLE 0x00000400 7598c2ecf20Sopenharmony_ci#define SG_DIG_CHECK_END_ENABLE 0x00000200 7608c2ecf20Sopenharmony_ci#define SG_DIG_SGMII_AUTONEG_TIMER 0x00000100 7618c2ecf20Sopenharmony_ci#define SG_DIG_CLOCK_PHASE_SELECT 0x00000080 7628c2ecf20Sopenharmony_ci#define SG_DIG_GMII_INPUT_SELECT 0x00000040 7638c2ecf20Sopenharmony_ci#define SG_DIG_MRADV_CRC16_SELECT 0x00000020 7648c2ecf20Sopenharmony_ci#define SG_DIG_COMMA_DETECT_ENABLE 0x00000010 7658c2ecf20Sopenharmony_ci#define SG_DIG_AUTONEG_TIMER_REDUCE 0x00000008 7668c2ecf20Sopenharmony_ci#define SG_DIG_AUTONEG_LOW_ENABLE 0x00000004 7678c2ecf20Sopenharmony_ci#define SG_DIG_REMOTE_LOOPBACK 0x00000002 7688c2ecf20Sopenharmony_ci#define SG_DIG_LOOPBACK 0x00000001 7698c2ecf20Sopenharmony_ci#define SG_DIG_COMMON_SETUP (SG_DIG_CRC16_CLEAR_N | \ 7708c2ecf20Sopenharmony_ci SG_DIG_LOCAL_DUPLEX_STATUS | \ 7718c2ecf20Sopenharmony_ci SG_DIG_LOCAL_LINK_STATUS | \ 7728c2ecf20Sopenharmony_ci (0x2 << SG_DIG_SPEED_STATUS_SHIFT) | \ 7738c2ecf20Sopenharmony_ci SG_DIG_FIBER_MODE | SG_DIG_GBIC_ENABLE) 7748c2ecf20Sopenharmony_ci#define SG_DIG_STATUS 0x000005b4 7758c2ecf20Sopenharmony_ci#define SG_DIG_CRC16_BUS_MASK 0xffff0000 7768c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_FAULT_MASK 0x00600000 /* If !MRADV_CRC16_SELECT */ 7778c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_ASYM_PAUSE 0x00100000 /* If !MRADV_CRC16_SELECT */ 7788c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_PAUSE_CAPABLE 0x00080000 /* If !MRADV_CRC16_SELECT */ 7798c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_HALF_DUPLEX 0x00040000 /* If !MRADV_CRC16_SELECT */ 7808c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_FULL_DUPLEX 0x00020000 /* If !MRADV_CRC16_SELECT */ 7818c2ecf20Sopenharmony_ci#define SG_DIG_PARTNER_NEXT_PAGE 0x00010000 /* If !MRADV_CRC16_SELECT */ 7828c2ecf20Sopenharmony_ci#define SG_DIG_AUTONEG_STATE_MASK 0x00000ff0 7838c2ecf20Sopenharmony_ci#define SG_DIG_IS_SERDES 0x00000100 7848c2ecf20Sopenharmony_ci#define SG_DIG_COMMA_DETECTOR 0x00000008 7858c2ecf20Sopenharmony_ci#define SG_DIG_MAC_ACK_STATUS 0x00000004 7868c2ecf20Sopenharmony_ci#define SG_DIG_AUTONEG_COMPLETE 0x00000002 7878c2ecf20Sopenharmony_ci#define SG_DIG_AUTONEG_ERROR 0x00000001 7888c2ecf20Sopenharmony_ci#define TG3_TX_TSTAMP_LSB 0x000005c0 7898c2ecf20Sopenharmony_ci#define TG3_TX_TSTAMP_MSB 0x000005c4 7908c2ecf20Sopenharmony_ci#define TG3_TSTAMP_MASK 0x7fffffffffffffffLL 7918c2ecf20Sopenharmony_ci/* 0x5c8 --> 0x600 unused */ 7928c2ecf20Sopenharmony_ci#define MAC_TX_MAC_STATE_BASE 0x00000600 /* 16 bytes */ 7938c2ecf20Sopenharmony_ci#define MAC_RX_MAC_STATE_BASE 0x00000610 /* 20 bytes */ 7948c2ecf20Sopenharmony_ci/* 0x624 --> 0x670 unused */ 7958c2ecf20Sopenharmony_ci 7968c2ecf20Sopenharmony_ci#define MAC_RSS_INDIR_TBL_0 0x00000630 7978c2ecf20Sopenharmony_ci 7988c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_0 0x00000670 7998c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_1 0x00000674 8008c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_2 0x00000678 8018c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_3 0x0000067c 8028c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_4 0x00000680 8038c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_5 0x00000684 8048c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_6 0x00000688 8058c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_7 0x0000068c 8068c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_8 0x00000690 8078c2ecf20Sopenharmony_ci#define MAC_RSS_HASH_KEY_9 0x00000694 8088c2ecf20Sopenharmony_ci/* 0x698 --> 0x6b0 unused */ 8098c2ecf20Sopenharmony_ci 8108c2ecf20Sopenharmony_ci#define TG3_RX_TSTAMP_LSB 0x000006b0 8118c2ecf20Sopenharmony_ci#define TG3_RX_TSTAMP_MSB 0x000006b4 8128c2ecf20Sopenharmony_ci/* 0x6b8 --> 0x6c8 unused */ 8138c2ecf20Sopenharmony_ci 8148c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL 0x000006c8 8158c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_SYNC_EVNT 0x00000001 8168c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_DELAY_REQ 0x00000002 8178c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_PDLAY_REQ 0x00000004 8188c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_PDLAY_RES 0x00000008 8198c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_ALL_V1_EVENTS (TG3_RX_PTP_CTL_SYNC_EVNT | \ 8208c2ecf20Sopenharmony_ci TG3_RX_PTP_CTL_DELAY_REQ) 8218c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_ALL_V2_EVENTS (TG3_RX_PTP_CTL_SYNC_EVNT | \ 8228c2ecf20Sopenharmony_ci TG3_RX_PTP_CTL_DELAY_REQ | \ 8238c2ecf20Sopenharmony_ci TG3_RX_PTP_CTL_PDLAY_REQ | \ 8248c2ecf20Sopenharmony_ci TG3_RX_PTP_CTL_PDLAY_RES) 8258c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_FOLLOW_UP 0x00000100 8268c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_DELAY_RES 0x00000200 8278c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_PDRES_FLW_UP 0x00000400 8288c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_ANNOUNCE 0x00000800 8298c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_SIGNALING 0x00001000 8308c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_MANAGEMENT 0x00002000 8318c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_RX_PTP_V2_L2_EN 0x00800000 8328c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_RX_PTP_V2_L4_EN 0x01000000 8338c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_RX_PTP_V2_EN (TG3_RX_PTP_CTL_RX_PTP_V2_L2_EN | \ 8348c2ecf20Sopenharmony_ci TG3_RX_PTP_CTL_RX_PTP_V2_L4_EN) 8358c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_RX_PTP_V1_EN 0x02000000 8368c2ecf20Sopenharmony_ci#define TG3_RX_PTP_CTL_HWTS_INTERLOCK 0x04000000 8378c2ecf20Sopenharmony_ci/* 0x6cc --> 0x800 unused */ 8388c2ecf20Sopenharmony_ci 8398c2ecf20Sopenharmony_ci#define MAC_TX_STATS_OCTETS 0x00000800 8408c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV1 0x00000804 8418c2ecf20Sopenharmony_ci#define MAC_TX_STATS_COLLISIONS 0x00000808 8428c2ecf20Sopenharmony_ci#define MAC_TX_STATS_XON_SENT 0x0000080c 8438c2ecf20Sopenharmony_ci#define MAC_TX_STATS_XOFF_SENT 0x00000810 8448c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV2 0x00000814 8458c2ecf20Sopenharmony_ci#define MAC_TX_STATS_MAC_ERRORS 0x00000818 8468c2ecf20Sopenharmony_ci#define MAC_TX_STATS_SINGLE_COLLISIONS 0x0000081c 8478c2ecf20Sopenharmony_ci#define MAC_TX_STATS_MULT_COLLISIONS 0x00000820 8488c2ecf20Sopenharmony_ci#define MAC_TX_STATS_DEFERRED 0x00000824 8498c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV3 0x00000828 8508c2ecf20Sopenharmony_ci#define MAC_TX_STATS_EXCESSIVE_COL 0x0000082c 8518c2ecf20Sopenharmony_ci#define MAC_TX_STATS_LATE_COL 0x00000830 8528c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_1 0x00000834 8538c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_2 0x00000838 8548c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_3 0x0000083c 8558c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_4 0x00000840 8568c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_5 0x00000844 8578c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_6 0x00000848 8588c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_7 0x0000084c 8598c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_8 0x00000850 8608c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_9 0x00000854 8618c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_10 0x00000858 8628c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_11 0x0000085c 8638c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_12 0x00000860 8648c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_13 0x00000864 8658c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV4_14 0x00000868 8668c2ecf20Sopenharmony_ci#define MAC_TX_STATS_UCAST 0x0000086c 8678c2ecf20Sopenharmony_ci#define MAC_TX_STATS_MCAST 0x00000870 8688c2ecf20Sopenharmony_ci#define MAC_TX_STATS_BCAST 0x00000874 8698c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV5_1 0x00000878 8708c2ecf20Sopenharmony_ci#define MAC_TX_STATS_RESV5_2 0x0000087c 8718c2ecf20Sopenharmony_ci#define MAC_RX_STATS_OCTETS 0x00000880 8728c2ecf20Sopenharmony_ci#define MAC_RX_STATS_RESV1 0x00000884 8738c2ecf20Sopenharmony_ci#define MAC_RX_STATS_FRAGMENTS 0x00000888 8748c2ecf20Sopenharmony_ci#define MAC_RX_STATS_UCAST 0x0000088c 8758c2ecf20Sopenharmony_ci#define MAC_RX_STATS_MCAST 0x00000890 8768c2ecf20Sopenharmony_ci#define MAC_RX_STATS_BCAST 0x00000894 8778c2ecf20Sopenharmony_ci#define MAC_RX_STATS_FCS_ERRORS 0x00000898 8788c2ecf20Sopenharmony_ci#define MAC_RX_STATS_ALIGN_ERRORS 0x0000089c 8798c2ecf20Sopenharmony_ci#define MAC_RX_STATS_XON_PAUSE_RECVD 0x000008a0 8808c2ecf20Sopenharmony_ci#define MAC_RX_STATS_XOFF_PAUSE_RECVD 0x000008a4 8818c2ecf20Sopenharmony_ci#define MAC_RX_STATS_MAC_CTRL_RECVD 0x000008a8 8828c2ecf20Sopenharmony_ci#define MAC_RX_STATS_XOFF_ENTERED 0x000008ac 8838c2ecf20Sopenharmony_ci#define MAC_RX_STATS_FRAME_TOO_LONG 0x000008b0 8848c2ecf20Sopenharmony_ci#define MAC_RX_STATS_JABBERS 0x000008b4 8858c2ecf20Sopenharmony_ci#define MAC_RX_STATS_UNDERSIZE 0x000008b8 8868c2ecf20Sopenharmony_ci/* 0x8bc --> 0xc00 unused */ 8878c2ecf20Sopenharmony_ci 8888c2ecf20Sopenharmony_ci/* Send data initiator control registers */ 8898c2ecf20Sopenharmony_ci#define SNDDATAI_MODE 0x00000c00 8908c2ecf20Sopenharmony_ci#define SNDDATAI_MODE_RESET 0x00000001 8918c2ecf20Sopenharmony_ci#define SNDDATAI_MODE_ENABLE 0x00000002 8928c2ecf20Sopenharmony_ci#define SNDDATAI_MODE_STAT_OFLOW_ENAB 0x00000004 8938c2ecf20Sopenharmony_ci#define SNDDATAI_STATUS 0x00000c04 8948c2ecf20Sopenharmony_ci#define SNDDATAI_STATUS_STAT_OFLOW 0x00000004 8958c2ecf20Sopenharmony_ci#define SNDDATAI_STATSCTRL 0x00000c08 8968c2ecf20Sopenharmony_ci#define SNDDATAI_SCTRL_ENABLE 0x00000001 8978c2ecf20Sopenharmony_ci#define SNDDATAI_SCTRL_FASTUPD 0x00000002 8988c2ecf20Sopenharmony_ci#define SNDDATAI_SCTRL_CLEAR 0x00000004 8998c2ecf20Sopenharmony_ci#define SNDDATAI_SCTRL_FLUSH 0x00000008 9008c2ecf20Sopenharmony_ci#define SNDDATAI_SCTRL_FORCE_ZERO 0x00000010 9018c2ecf20Sopenharmony_ci#define SNDDATAI_STATSENAB 0x00000c0c 9028c2ecf20Sopenharmony_ci#define SNDDATAI_STATSINCMASK 0x00000c10 9038c2ecf20Sopenharmony_ci#define ISO_PKT_TX 0x00000c20 9048c2ecf20Sopenharmony_ci/* 0xc24 --> 0xc80 unused */ 9058c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_0 0x00000c80 9068c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_1 0x00000c84 9078c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_2 0x00000c88 9088c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_3 0x00000c8c 9098c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_4 0x00000c90 9108c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_5 0x00000c94 9118c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_6 0x00000c98 9128c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_7 0x00000c9c 9138c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_8 0x00000ca0 9148c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_9 0x00000ca4 9158c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_10 0x00000ca8 9168c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_11 0x00000cac 9178c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_12 0x00000cb0 9188c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_13 0x00000cb4 9198c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_14 0x00000cb8 9208c2ecf20Sopenharmony_ci#define SNDDATAI_COS_CNT_15 0x00000cbc 9218c2ecf20Sopenharmony_ci#define SNDDATAI_DMA_RDQ_FULL_CNT 0x00000cc0 9228c2ecf20Sopenharmony_ci#define SNDDATAI_DMA_PRIO_RDQ_FULL_CNT 0x00000cc4 9238c2ecf20Sopenharmony_ci#define SNDDATAI_SDCQ_FULL_CNT 0x00000cc8 9248c2ecf20Sopenharmony_ci#define SNDDATAI_NICRNG_SSND_PIDX_CNT 0x00000ccc 9258c2ecf20Sopenharmony_ci#define SNDDATAI_STATS_UPDATED_CNT 0x00000cd0 9268c2ecf20Sopenharmony_ci#define SNDDATAI_INTERRUPTS_CNT 0x00000cd4 9278c2ecf20Sopenharmony_ci#define SNDDATAI_AVOID_INTERRUPTS_CNT 0x00000cd8 9288c2ecf20Sopenharmony_ci#define SNDDATAI_SND_THRESH_HIT_CNT 0x00000cdc 9298c2ecf20Sopenharmony_ci/* 0xce0 --> 0x1000 unused */ 9308c2ecf20Sopenharmony_ci 9318c2ecf20Sopenharmony_ci/* Send data completion control registers */ 9328c2ecf20Sopenharmony_ci#define SNDDATAC_MODE 0x00001000 9338c2ecf20Sopenharmony_ci#define SNDDATAC_MODE_RESET 0x00000001 9348c2ecf20Sopenharmony_ci#define SNDDATAC_MODE_ENABLE 0x00000002 9358c2ecf20Sopenharmony_ci#define SNDDATAC_MODE_CDELAY 0x00000010 9368c2ecf20Sopenharmony_ci/* 0x1004 --> 0x1400 unused */ 9378c2ecf20Sopenharmony_ci 9388c2ecf20Sopenharmony_ci/* Send BD ring selector */ 9398c2ecf20Sopenharmony_ci#define SNDBDS_MODE 0x00001400 9408c2ecf20Sopenharmony_ci#define SNDBDS_MODE_RESET 0x00000001 9418c2ecf20Sopenharmony_ci#define SNDBDS_MODE_ENABLE 0x00000002 9428c2ecf20Sopenharmony_ci#define SNDBDS_MODE_ATTN_ENABLE 0x00000004 9438c2ecf20Sopenharmony_ci#define SNDBDS_STATUS 0x00001404 9448c2ecf20Sopenharmony_ci#define SNDBDS_STATUS_ERROR_ATTN 0x00000004 9458c2ecf20Sopenharmony_ci#define SNDBDS_HWDIAG 0x00001408 9468c2ecf20Sopenharmony_ci/* 0x140c --> 0x1440 */ 9478c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_0 0x00001440 9488c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_1 0x00001444 9498c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_2 0x00001448 9508c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_3 0x0000144c 9518c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_4 0x00001450 9528c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_5 0x00001454 9538c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_6 0x00001458 9548c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_7 0x0000145c 9558c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_8 0x00001460 9568c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_9 0x00001464 9578c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_10 0x00001468 9588c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_11 0x0000146c 9598c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_12 0x00001470 9608c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_13 0x00001474 9618c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_14 0x00001478 9628c2ecf20Sopenharmony_ci#define SNDBDS_SEL_CON_IDX_15 0x0000147c 9638c2ecf20Sopenharmony_ci/* 0x1480 --> 0x1800 unused */ 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ci/* Send BD initiator control registers */ 9668c2ecf20Sopenharmony_ci#define SNDBDI_MODE 0x00001800 9678c2ecf20Sopenharmony_ci#define SNDBDI_MODE_RESET 0x00000001 9688c2ecf20Sopenharmony_ci#define SNDBDI_MODE_ENABLE 0x00000002 9698c2ecf20Sopenharmony_ci#define SNDBDI_MODE_ATTN_ENABLE 0x00000004 9708c2ecf20Sopenharmony_ci#define SNDBDI_MODE_MULTI_TXQ_EN 0x00000020 9718c2ecf20Sopenharmony_ci#define SNDBDI_STATUS 0x00001804 9728c2ecf20Sopenharmony_ci#define SNDBDI_STATUS_ERROR_ATTN 0x00000004 9738c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_0 0x00001808 9748c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_1 0x0000180c 9758c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_2 0x00001810 9768c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_3 0x00001814 9778c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_4 0x00001818 9788c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_5 0x0000181c 9798c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_6 0x00001820 9808c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_7 0x00001824 9818c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_8 0x00001828 9828c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_9 0x0000182c 9838c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_10 0x00001830 9848c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_11 0x00001834 9858c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_12 0x00001838 9868c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_13 0x0000183c 9878c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_14 0x00001840 9888c2ecf20Sopenharmony_ci#define SNDBDI_IN_PROD_IDX_15 0x00001844 9898c2ecf20Sopenharmony_ci/* 0x1848 --> 0x1c00 unused */ 9908c2ecf20Sopenharmony_ci 9918c2ecf20Sopenharmony_ci/* Send BD completion control registers */ 9928c2ecf20Sopenharmony_ci#define SNDBDC_MODE 0x00001c00 9938c2ecf20Sopenharmony_ci#define SNDBDC_MODE_RESET 0x00000001 9948c2ecf20Sopenharmony_ci#define SNDBDC_MODE_ENABLE 0x00000002 9958c2ecf20Sopenharmony_ci#define SNDBDC_MODE_ATTN_ENABLE 0x00000004 9968c2ecf20Sopenharmony_ci/* 0x1c04 --> 0x2000 unused */ 9978c2ecf20Sopenharmony_ci 9988c2ecf20Sopenharmony_ci/* Receive list placement control registers */ 9998c2ecf20Sopenharmony_ci#define RCVLPC_MODE 0x00002000 10008c2ecf20Sopenharmony_ci#define RCVLPC_MODE_RESET 0x00000001 10018c2ecf20Sopenharmony_ci#define RCVLPC_MODE_ENABLE 0x00000002 10028c2ecf20Sopenharmony_ci#define RCVLPC_MODE_CLASS0_ATTN_ENAB 0x00000004 10038c2ecf20Sopenharmony_ci#define RCVLPC_MODE_MAPOOR_AATTN_ENAB 0x00000008 10048c2ecf20Sopenharmony_ci#define RCVLPC_MODE_STAT_OFLOW_ENAB 0x00000010 10058c2ecf20Sopenharmony_ci#define RCVLPC_STATUS 0x00002004 10068c2ecf20Sopenharmony_ci#define RCVLPC_STATUS_CLASS0 0x00000004 10078c2ecf20Sopenharmony_ci#define RCVLPC_STATUS_MAPOOR 0x00000008 10088c2ecf20Sopenharmony_ci#define RCVLPC_STATUS_STAT_OFLOW 0x00000010 10098c2ecf20Sopenharmony_ci#define RCVLPC_LOCK 0x00002008 10108c2ecf20Sopenharmony_ci#define RCVLPC_LOCK_REQ_MASK 0x0000ffff 10118c2ecf20Sopenharmony_ci#define RCVLPC_LOCK_REQ_SHIFT 0 10128c2ecf20Sopenharmony_ci#define RCVLPC_LOCK_GRANT_MASK 0xffff0000 10138c2ecf20Sopenharmony_ci#define RCVLPC_LOCK_GRANT_SHIFT 16 10148c2ecf20Sopenharmony_ci#define RCVLPC_NON_EMPTY_BITS 0x0000200c 10158c2ecf20Sopenharmony_ci#define RCVLPC_NON_EMPTY_BITS_MASK 0x0000ffff 10168c2ecf20Sopenharmony_ci#define RCVLPC_CONFIG 0x00002010 10178c2ecf20Sopenharmony_ci#define RCVLPC_STATSCTRL 0x00002014 10188c2ecf20Sopenharmony_ci#define RCVLPC_STATSCTRL_ENABLE 0x00000001 10198c2ecf20Sopenharmony_ci#define RCVLPC_STATSCTRL_FASTUPD 0x00000002 10208c2ecf20Sopenharmony_ci#define RCVLPC_STATS_ENABLE 0x00002018 10218c2ecf20Sopenharmony_ci#define RCVLPC_STATSENAB_ASF_FIX 0x00000002 10228c2ecf20Sopenharmony_ci#define RCVLPC_STATSENAB_DACK_FIX 0x00040000 10238c2ecf20Sopenharmony_ci#define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000 10248c2ecf20Sopenharmony_ci#define RCVLPC_STATS_INCMASK 0x0000201c 10258c2ecf20Sopenharmony_ci/* 0x2020 --> 0x2100 unused */ 10268c2ecf20Sopenharmony_ci#define RCVLPC_SELLST_BASE 0x00002100 /* 16 16-byte entries */ 10278c2ecf20Sopenharmony_ci#define SELLST_TAIL 0x00000004 10288c2ecf20Sopenharmony_ci#define SELLST_CONT 0x00000008 10298c2ecf20Sopenharmony_ci#define SELLST_UNUSED 0x0000000c 10308c2ecf20Sopenharmony_ci#define RCVLPC_COS_CNTL_BASE 0x00002200 /* 16 4-byte entries */ 10318c2ecf20Sopenharmony_ci#define RCVLPC_DROP_FILTER_CNT 0x00002240 10328c2ecf20Sopenharmony_ci#define RCVLPC_DMA_WQ_FULL_CNT 0x00002244 10338c2ecf20Sopenharmony_ci#define RCVLPC_DMA_HIPRIO_WQ_FULL_CNT 0x00002248 10348c2ecf20Sopenharmony_ci#define RCVLPC_NO_RCV_BD_CNT 0x0000224c 10358c2ecf20Sopenharmony_ci#define RCVLPC_IN_DISCARDS_CNT 0x00002250 10368c2ecf20Sopenharmony_ci#define RCVLPC_IN_ERRORS_CNT 0x00002254 10378c2ecf20Sopenharmony_ci#define RCVLPC_RCV_THRESH_HIT_CNT 0x00002258 10388c2ecf20Sopenharmony_ci/* 0x225c --> 0x2400 unused */ 10398c2ecf20Sopenharmony_ci 10408c2ecf20Sopenharmony_ci/* Receive Data and Receive BD Initiator Control */ 10418c2ecf20Sopenharmony_ci#define RCVDBDI_MODE 0x00002400 10428c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_RESET 0x00000001 10438c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_ENABLE 0x00000002 10448c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004 10458c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008 10468c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_INV_RING_SZ 0x00000010 10478c2ecf20Sopenharmony_ci#define RCVDBDI_MODE_LRG_RING_SZ 0x00010000 10488c2ecf20Sopenharmony_ci#define RCVDBDI_STATUS 0x00002404 10498c2ecf20Sopenharmony_ci#define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004 10508c2ecf20Sopenharmony_ci#define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008 10518c2ecf20Sopenharmony_ci#define RCVDBDI_STATUS_INV_RING_SZ 0x00000010 10528c2ecf20Sopenharmony_ci#define RCVDBDI_SPLIT_FRAME_MINSZ 0x00002408 10538c2ecf20Sopenharmony_ci/* 0x240c --> 0x2440 unused */ 10548c2ecf20Sopenharmony_ci#define RCVDBDI_JUMBO_BD 0x00002440 /* TG3_BDINFO_... */ 10558c2ecf20Sopenharmony_ci#define RCVDBDI_STD_BD 0x00002450 /* TG3_BDINFO_... */ 10568c2ecf20Sopenharmony_ci#define RCVDBDI_MINI_BD 0x00002460 /* TG3_BDINFO_... */ 10578c2ecf20Sopenharmony_ci#define RCVDBDI_JUMBO_CON_IDX 0x00002470 10588c2ecf20Sopenharmony_ci#define RCVDBDI_STD_CON_IDX 0x00002474 10598c2ecf20Sopenharmony_ci#define RCVDBDI_MINI_CON_IDX 0x00002478 10608c2ecf20Sopenharmony_ci/* 0x247c --> 0x2480 unused */ 10618c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_0 0x00002480 10628c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_1 0x00002484 10638c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_2 0x00002488 10648c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_3 0x0000248c 10658c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_4 0x00002490 10668c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_5 0x00002494 10678c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_6 0x00002498 10688c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_7 0x0000249c 10698c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_8 0x000024a0 10708c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_9 0x000024a4 10718c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_10 0x000024a8 10728c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_11 0x000024ac 10738c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_12 0x000024b0 10748c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_13 0x000024b4 10758c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_14 0x000024b8 10768c2ecf20Sopenharmony_ci#define RCVDBDI_BD_PROD_IDX_15 0x000024bc 10778c2ecf20Sopenharmony_ci#define RCVDBDI_HWDIAG 0x000024c0 10788c2ecf20Sopenharmony_ci/* 0x24c4 --> 0x2800 unused */ 10798c2ecf20Sopenharmony_ci 10808c2ecf20Sopenharmony_ci/* Receive Data Completion Control */ 10818c2ecf20Sopenharmony_ci#define RCVDCC_MODE 0x00002800 10828c2ecf20Sopenharmony_ci#define RCVDCC_MODE_RESET 0x00000001 10838c2ecf20Sopenharmony_ci#define RCVDCC_MODE_ENABLE 0x00000002 10848c2ecf20Sopenharmony_ci#define RCVDCC_MODE_ATTN_ENABLE 0x00000004 10858c2ecf20Sopenharmony_ci/* 0x2804 --> 0x2c00 unused */ 10868c2ecf20Sopenharmony_ci 10878c2ecf20Sopenharmony_ci/* Receive BD Initiator Control Registers */ 10888c2ecf20Sopenharmony_ci#define RCVBDI_MODE 0x00002c00 10898c2ecf20Sopenharmony_ci#define RCVBDI_MODE_RESET 0x00000001 10908c2ecf20Sopenharmony_ci#define RCVBDI_MODE_ENABLE 0x00000002 10918c2ecf20Sopenharmony_ci#define RCVBDI_MODE_RCB_ATTN_ENAB 0x00000004 10928c2ecf20Sopenharmony_ci#define RCVBDI_STATUS 0x00002c04 10938c2ecf20Sopenharmony_ci#define RCVBDI_STATUS_RCB_ATTN 0x00000004 10948c2ecf20Sopenharmony_ci#define RCVBDI_JUMBO_PROD_IDX 0x00002c08 10958c2ecf20Sopenharmony_ci#define RCVBDI_STD_PROD_IDX 0x00002c0c 10968c2ecf20Sopenharmony_ci#define RCVBDI_MINI_PROD_IDX 0x00002c10 10978c2ecf20Sopenharmony_ci#define RCVBDI_MINI_THRESH 0x00002c14 10988c2ecf20Sopenharmony_ci#define RCVBDI_STD_THRESH 0x00002c18 10998c2ecf20Sopenharmony_ci#define RCVBDI_JUMBO_THRESH 0x00002c1c 11008c2ecf20Sopenharmony_ci/* 0x2c20 --> 0x2d00 unused */ 11018c2ecf20Sopenharmony_ci 11028c2ecf20Sopenharmony_ci#define STD_REPLENISH_LWM 0x00002d00 11038c2ecf20Sopenharmony_ci#define JMB_REPLENISH_LWM 0x00002d04 11048c2ecf20Sopenharmony_ci/* 0x2d08 --> 0x3000 unused */ 11058c2ecf20Sopenharmony_ci 11068c2ecf20Sopenharmony_ci/* Receive BD Completion Control Registers */ 11078c2ecf20Sopenharmony_ci#define RCVCC_MODE 0x00003000 11088c2ecf20Sopenharmony_ci#define RCVCC_MODE_RESET 0x00000001 11098c2ecf20Sopenharmony_ci#define RCVCC_MODE_ENABLE 0x00000002 11108c2ecf20Sopenharmony_ci#define RCVCC_MODE_ATTN_ENABLE 0x00000004 11118c2ecf20Sopenharmony_ci#define RCVCC_STATUS 0x00003004 11128c2ecf20Sopenharmony_ci#define RCVCC_STATUS_ERROR_ATTN 0x00000004 11138c2ecf20Sopenharmony_ci#define RCVCC_JUMP_PROD_IDX 0x00003008 11148c2ecf20Sopenharmony_ci#define RCVCC_STD_PROD_IDX 0x0000300c 11158c2ecf20Sopenharmony_ci#define RCVCC_MINI_PROD_IDX 0x00003010 11168c2ecf20Sopenharmony_ci/* 0x3014 --> 0x3400 unused */ 11178c2ecf20Sopenharmony_ci 11188c2ecf20Sopenharmony_ci/* Receive list selector control registers */ 11198c2ecf20Sopenharmony_ci#define RCVLSC_MODE 0x00003400 11208c2ecf20Sopenharmony_ci#define RCVLSC_MODE_RESET 0x00000001 11218c2ecf20Sopenharmony_ci#define RCVLSC_MODE_ENABLE 0x00000002 11228c2ecf20Sopenharmony_ci#define RCVLSC_MODE_ATTN_ENABLE 0x00000004 11238c2ecf20Sopenharmony_ci#define RCVLSC_STATUS 0x00003404 11248c2ecf20Sopenharmony_ci#define RCVLSC_STATUS_ERROR_ATTN 0x00000004 11258c2ecf20Sopenharmony_ci/* 0x3408 --> 0x3600 unused */ 11268c2ecf20Sopenharmony_ci 11278c2ecf20Sopenharmony_ci#define TG3_CPMU_DRV_STATUS 0x0000344c 11288c2ecf20Sopenharmony_ci 11298c2ecf20Sopenharmony_ci/* CPMU registers */ 11308c2ecf20Sopenharmony_ci#define TG3_CPMU_CTRL 0x00003600 11318c2ecf20Sopenharmony_ci#define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 11328c2ecf20Sopenharmony_ci#define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 11338c2ecf20Sopenharmony_ci#define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 11348c2ecf20Sopenharmony_ci#define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000 11358c2ecf20Sopenharmony_ci#define TG3_CPMU_LSPD_10MB_CLK 0x00003604 11368c2ecf20Sopenharmony_ci#define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 11378c2ecf20Sopenharmony_ci#define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 11388c2ecf20Sopenharmony_ci/* 0x3608 --> 0x360c unused */ 11398c2ecf20Sopenharmony_ci 11408c2ecf20Sopenharmony_ci#define TG3_CPMU_LSPD_1000MB_CLK 0x0000360c 11418c2ecf20Sopenharmony_ci#define CPMU_LSPD_1000MB_MACCLK_62_5 0x00000000 11428c2ecf20Sopenharmony_ci#define CPMU_LSPD_1000MB_MACCLK_12_5 0x00110000 11438c2ecf20Sopenharmony_ci#define CPMU_LSPD_1000MB_MACCLK_MASK 0x001f0000 11448c2ecf20Sopenharmony_ci#define TG3_CPMU_LNK_AWARE_PWRMD 0x00003610 11458c2ecf20Sopenharmony_ci#define CPMU_LNK_AWARE_MACCLK_MASK 0x001f0000 11468c2ecf20Sopenharmony_ci#define CPMU_LNK_AWARE_MACCLK_6_25 0x00130000 11478c2ecf20Sopenharmony_ci/* 0x3614 --> 0x361c unused */ 11488c2ecf20Sopenharmony_ci 11498c2ecf20Sopenharmony_ci#define TG3_CPMU_HST_ACC 0x0000361c 11508c2ecf20Sopenharmony_ci#define CPMU_HST_ACC_MACCLK_MASK 0x001f0000 11518c2ecf20Sopenharmony_ci#define CPMU_HST_ACC_MACCLK_6_25 0x00130000 11528c2ecf20Sopenharmony_ci/* 0x3620 --> 0x3630 unused */ 11538c2ecf20Sopenharmony_ci 11548c2ecf20Sopenharmony_ci#define TG3_CPMU_CLCK_ORIDE 0x00003624 11558c2ecf20Sopenharmony_ci#define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000 11568c2ecf20Sopenharmony_ci 11578c2ecf20Sopenharmony_ci#define TG3_CPMU_CLCK_ORIDE_ENABLE 0x00003628 11588c2ecf20Sopenharmony_ci#define TG3_CPMU_MAC_ORIDE_ENABLE (1 << 13) 11598c2ecf20Sopenharmony_ci 11608c2ecf20Sopenharmony_ci#define TG3_CPMU_STATUS 0x0000362c 11618c2ecf20Sopenharmony_ci#define TG3_CPMU_STATUS_FMSK_5717 0x20000000 11628c2ecf20Sopenharmony_ci#define TG3_CPMU_STATUS_FMSK_5719 0xc0000000 11638c2ecf20Sopenharmony_ci#define TG3_CPMU_STATUS_FSHFT_5719 30 11648c2ecf20Sopenharmony_ci#define TG3_CPMU_STATUS_LINK_MASK 0x180000 11658c2ecf20Sopenharmony_ci 11668c2ecf20Sopenharmony_ci#define TG3_CPMU_CLCK_STAT 0x00003630 11678c2ecf20Sopenharmony_ci#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 11688c2ecf20Sopenharmony_ci#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 11698c2ecf20Sopenharmony_ci#define CPMU_CLCK_STAT_MAC_CLCK_12_5 0x00110000 11708c2ecf20Sopenharmony_ci#define CPMU_CLCK_STAT_MAC_CLCK_6_25 0x00130000 11718c2ecf20Sopenharmony_ci/* 0x3634 --> 0x365c unused */ 11728c2ecf20Sopenharmony_ci 11738c2ecf20Sopenharmony_ci#define TG3_CPMU_MUTEX_REQ 0x0000365c 11748c2ecf20Sopenharmony_ci#define CPMU_MUTEX_REQ_DRIVER 0x00001000 11758c2ecf20Sopenharmony_ci#define TG3_CPMU_MUTEX_GNT 0x00003660 11768c2ecf20Sopenharmony_ci#define CPMU_MUTEX_GNT_DRIVER 0x00001000 11778c2ecf20Sopenharmony_ci#define TG3_CPMU_PHY_STRAP 0x00003664 11788c2ecf20Sopenharmony_ci#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 11798c2ecf20Sopenharmony_ci#define TG3_CPMU_PADRNG_CTL 0x00003668 11808c2ecf20Sopenharmony_ci#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000 11818c2ecf20Sopenharmony_ci/* 0x3664 --> 0x36b0 unused */ 11828c2ecf20Sopenharmony_ci 11838c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_MODE 0x000036b0 11848c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_APE_TX_DET_EN 0x00000004 11858c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008 11868c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_SND_IDX_DET_EN 0x00000040 11878c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080 11888c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100 11898c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200 11908c2ecf20Sopenharmony_ci#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000 11918c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_DBTMR1 0x000036b4 11928c2ecf20Sopenharmony_ci#define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000 11938c2ecf20Sopenharmony_ci#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000007ff 11948c2ecf20Sopenharmony_ci#define TG3_CPMU_DBTMR1_LNKIDLE_MAX 0x0000ffff 11958c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_DBTMR2 0x000036b8 11968c2ecf20Sopenharmony_ci#define TG3_CPMU_DBTMR2_APE_TX_2047US 0x07ff0000 11978c2ecf20Sopenharmony_ci#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000007ff 11988c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc 11998c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000 12008c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004 12018c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_LNKIDL_APE_TX_MT 0x00000002 12028c2ecf20Sopenharmony_ci/* 0x36c0 --> 0x36d0 unused */ 12038c2ecf20Sopenharmony_ci 12048c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_CTRL 0x000036d0 12058c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_CTRL_EXIT_16_5_US 0x0000019d 12068c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_CTRL_EXIT_36_US 0x00000384 12078c2ecf20Sopenharmony_ci#define TG3_CPMU_EEE_CTRL_EXIT_20_1_US 0x000001f8 12088c2ecf20Sopenharmony_ci/* 0x36d4 --> 0x3800 unused */ 12098c2ecf20Sopenharmony_ci 12108c2ecf20Sopenharmony_ci/* Mbuf cluster free registers */ 12118c2ecf20Sopenharmony_ci#define MBFREE_MODE 0x00003800 12128c2ecf20Sopenharmony_ci#define MBFREE_MODE_RESET 0x00000001 12138c2ecf20Sopenharmony_ci#define MBFREE_MODE_ENABLE 0x00000002 12148c2ecf20Sopenharmony_ci#define MBFREE_STATUS 0x00003804 12158c2ecf20Sopenharmony_ci/* 0x3808 --> 0x3c00 unused */ 12168c2ecf20Sopenharmony_ci 12178c2ecf20Sopenharmony_ci/* Host coalescing control registers */ 12188c2ecf20Sopenharmony_ci#define HOSTCC_MODE 0x00003c00 12198c2ecf20Sopenharmony_ci#define HOSTCC_MODE_RESET 0x00000001 12208c2ecf20Sopenharmony_ci#define HOSTCC_MODE_ENABLE 0x00000002 12218c2ecf20Sopenharmony_ci#define HOSTCC_MODE_ATTN 0x00000004 12228c2ecf20Sopenharmony_ci#define HOSTCC_MODE_NOW 0x00000008 12238c2ecf20Sopenharmony_ci#define HOSTCC_MODE_FULL_STATUS 0x00000000 12248c2ecf20Sopenharmony_ci#define HOSTCC_MODE_64BYTE 0x00000080 12258c2ecf20Sopenharmony_ci#define HOSTCC_MODE_32BYTE 0x00000100 12268c2ecf20Sopenharmony_ci#define HOSTCC_MODE_CLRTICK_RXBD 0x00000200 12278c2ecf20Sopenharmony_ci#define HOSTCC_MODE_CLRTICK_TXBD 0x00000400 12288c2ecf20Sopenharmony_ci#define HOSTCC_MODE_NOINT_ON_NOW 0x00000800 12298c2ecf20Sopenharmony_ci#define HOSTCC_MODE_NOINT_ON_FORCE 0x00001000 12308c2ecf20Sopenharmony_ci#define HOSTCC_MODE_COAL_VEC1_NOW 0x00002000 12318c2ecf20Sopenharmony_ci#define HOSTCC_STATUS 0x00003c04 12328c2ecf20Sopenharmony_ci#define HOSTCC_STATUS_ERROR_ATTN 0x00000004 12338c2ecf20Sopenharmony_ci#define HOSTCC_RXCOL_TICKS 0x00003c08 12348c2ecf20Sopenharmony_ci#define LOW_RXCOL_TICKS 0x00000032 12358c2ecf20Sopenharmony_ci#define LOW_RXCOL_TICKS_CLRTCKS 0x00000014 12368c2ecf20Sopenharmony_ci#define DEFAULT_RXCOL_TICKS 0x00000048 12378c2ecf20Sopenharmony_ci#define HIGH_RXCOL_TICKS 0x00000096 12388c2ecf20Sopenharmony_ci#define MAX_RXCOL_TICKS 0x000003ff 12398c2ecf20Sopenharmony_ci#define HOSTCC_TXCOL_TICKS 0x00003c0c 12408c2ecf20Sopenharmony_ci#define LOW_TXCOL_TICKS 0x00000096 12418c2ecf20Sopenharmony_ci#define LOW_TXCOL_TICKS_CLRTCKS 0x00000048 12428c2ecf20Sopenharmony_ci#define DEFAULT_TXCOL_TICKS 0x0000012c 12438c2ecf20Sopenharmony_ci#define HIGH_TXCOL_TICKS 0x00000145 12448c2ecf20Sopenharmony_ci#define MAX_TXCOL_TICKS 0x000003ff 12458c2ecf20Sopenharmony_ci#define HOSTCC_RXMAX_FRAMES 0x00003c10 12468c2ecf20Sopenharmony_ci#define LOW_RXMAX_FRAMES 0x00000005 12478c2ecf20Sopenharmony_ci#define DEFAULT_RXMAX_FRAMES 0x00000008 12488c2ecf20Sopenharmony_ci#define HIGH_RXMAX_FRAMES 0x00000012 12498c2ecf20Sopenharmony_ci#define MAX_RXMAX_FRAMES 0x000000ff 12508c2ecf20Sopenharmony_ci#define HOSTCC_TXMAX_FRAMES 0x00003c14 12518c2ecf20Sopenharmony_ci#define LOW_TXMAX_FRAMES 0x00000035 12528c2ecf20Sopenharmony_ci#define DEFAULT_TXMAX_FRAMES 0x0000004b 12538c2ecf20Sopenharmony_ci#define HIGH_TXMAX_FRAMES 0x00000052 12548c2ecf20Sopenharmony_ci#define MAX_TXMAX_FRAMES 0x000000ff 12558c2ecf20Sopenharmony_ci#define HOSTCC_RXCOAL_TICK_INT 0x00003c18 12568c2ecf20Sopenharmony_ci#define DEFAULT_RXCOAL_TICK_INT 0x00000019 12578c2ecf20Sopenharmony_ci#define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014 12588c2ecf20Sopenharmony_ci#define MAX_RXCOAL_TICK_INT 0x000003ff 12598c2ecf20Sopenharmony_ci#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c 12608c2ecf20Sopenharmony_ci#define DEFAULT_TXCOAL_TICK_INT 0x00000019 12618c2ecf20Sopenharmony_ci#define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014 12628c2ecf20Sopenharmony_ci#define MAX_TXCOAL_TICK_INT 0x000003ff 12638c2ecf20Sopenharmony_ci#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 12648c2ecf20Sopenharmony_ci#define DEFAULT_RXCOAL_MAXF_INT 0x00000005 12658c2ecf20Sopenharmony_ci#define MAX_RXCOAL_MAXF_INT 0x000000ff 12668c2ecf20Sopenharmony_ci#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 12678c2ecf20Sopenharmony_ci#define DEFAULT_TXCOAL_MAXF_INT 0x00000005 12688c2ecf20Sopenharmony_ci#define MAX_TXCOAL_MAXF_INT 0x000000ff 12698c2ecf20Sopenharmony_ci#define HOSTCC_STAT_COAL_TICKS 0x00003c28 12708c2ecf20Sopenharmony_ci#define DEFAULT_STAT_COAL_TICKS 0x000f4240 12718c2ecf20Sopenharmony_ci#define MAX_STAT_COAL_TICKS 0xd693d400 12728c2ecf20Sopenharmony_ci#define MIN_STAT_COAL_TICKS 0x00000064 12738c2ecf20Sopenharmony_ci/* 0x3c2c --> 0x3c30 unused */ 12748c2ecf20Sopenharmony_ci#define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ 12758c2ecf20Sopenharmony_ci#define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ 12768c2ecf20Sopenharmony_ci#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40 12778c2ecf20Sopenharmony_ci#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44 12788c2ecf20Sopenharmony_ci#define HOSTCC_FLOW_ATTN 0x00003c48 12798c2ecf20Sopenharmony_ci#define HOSTCC_FLOW_ATTN_MBUF_LWM 0x00000040 12808c2ecf20Sopenharmony_ci/* 0x3c4c --> 0x3c50 unused */ 12818c2ecf20Sopenharmony_ci#define HOSTCC_JUMBO_CON_IDX 0x00003c50 12828c2ecf20Sopenharmony_ci#define HOSTCC_STD_CON_IDX 0x00003c54 12838c2ecf20Sopenharmony_ci#define HOSTCC_MINI_CON_IDX 0x00003c58 12848c2ecf20Sopenharmony_ci/* 0x3c5c --> 0x3c80 unused */ 12858c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_0 0x00003c80 12868c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_1 0x00003c84 12878c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_2 0x00003c88 12888c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_3 0x00003c8c 12898c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_4 0x00003c90 12908c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_5 0x00003c94 12918c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_6 0x00003c98 12928c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_7 0x00003c9c 12938c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_8 0x00003ca0 12948c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_9 0x00003ca4 12958c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_10 0x00003ca8 12968c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_11 0x00003cac 12978c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_12 0x00003cb0 12988c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_13 0x00003cb4 12998c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_14 0x00003cb8 13008c2ecf20Sopenharmony_ci#define HOSTCC_RET_PROD_IDX_15 0x00003cbc 13018c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_0 0x00003cc0 13028c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_1 0x00003cc4 13038c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_2 0x00003cc8 13048c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_3 0x00003ccc 13058c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_4 0x00003cd0 13068c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_5 0x00003cd4 13078c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_6 0x00003cd8 13088c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_7 0x00003cdc 13098c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_8 0x00003ce0 13108c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_9 0x00003ce4 13118c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_10 0x00003ce8 13128c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_11 0x00003cec 13138c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_12 0x00003cf0 13148c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_13 0x00003cf4 13158c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_14 0x00003cf8 13168c2ecf20Sopenharmony_ci#define HOSTCC_SND_CON_IDX_15 0x00003cfc 13178c2ecf20Sopenharmony_ci#define HOSTCC_STATBLCK_RING1 0x00003d00 13188c2ecf20Sopenharmony_ci/* 0x3d00 --> 0x3d80 unused */ 13198c2ecf20Sopenharmony_ci 13208c2ecf20Sopenharmony_ci#define HOSTCC_RXCOL_TICKS_VEC1 0x00003d80 13218c2ecf20Sopenharmony_ci#define HOSTCC_TXCOL_TICKS_VEC1 0x00003d84 13228c2ecf20Sopenharmony_ci#define HOSTCC_RXMAX_FRAMES_VEC1 0x00003d88 13238c2ecf20Sopenharmony_ci#define HOSTCC_TXMAX_FRAMES_VEC1 0x00003d8c 13248c2ecf20Sopenharmony_ci#define HOSTCC_RXCOAL_MAXF_INT_VEC1 0x00003d90 13258c2ecf20Sopenharmony_ci#define HOSTCC_TXCOAL_MAXF_INT_VEC1 0x00003d94 13268c2ecf20Sopenharmony_ci/* 0x3d98 --> 0x4000 unused */ 13278c2ecf20Sopenharmony_ci 13288c2ecf20Sopenharmony_ci/* Memory arbiter control registers */ 13298c2ecf20Sopenharmony_ci#define MEMARB_MODE 0x00004000 13308c2ecf20Sopenharmony_ci#define MEMARB_MODE_RESET 0x00000001 13318c2ecf20Sopenharmony_ci#define MEMARB_MODE_ENABLE 0x00000002 13328c2ecf20Sopenharmony_ci#define MEMARB_STATUS 0x00004004 13338c2ecf20Sopenharmony_ci#define MEMARB_TRAP_ADDR_LOW 0x00004008 13348c2ecf20Sopenharmony_ci#define MEMARB_TRAP_ADDR_HIGH 0x0000400c 13358c2ecf20Sopenharmony_ci/* 0x4010 --> 0x4400 unused */ 13368c2ecf20Sopenharmony_ci 13378c2ecf20Sopenharmony_ci/* Buffer manager control registers */ 13388c2ecf20Sopenharmony_ci#define BUFMGR_MODE 0x00004400 13398c2ecf20Sopenharmony_ci#define BUFMGR_MODE_RESET 0x00000001 13408c2ecf20Sopenharmony_ci#define BUFMGR_MODE_ENABLE 0x00000002 13418c2ecf20Sopenharmony_ci#define BUFMGR_MODE_ATTN_ENABLE 0x00000004 13428c2ecf20Sopenharmony_ci#define BUFMGR_MODE_BM_TEST 0x00000008 13438c2ecf20Sopenharmony_ci#define BUFMGR_MODE_MBLOW_ATTN_ENAB 0x00000010 13448c2ecf20Sopenharmony_ci#define BUFMGR_MODE_NO_TX_UNDERRUN 0x80000000 13458c2ecf20Sopenharmony_ci#define BUFMGR_STATUS 0x00004404 13468c2ecf20Sopenharmony_ci#define BUFMGR_STATUS_ERROR 0x00000004 13478c2ecf20Sopenharmony_ci#define BUFMGR_STATUS_MBLOW 0x00000010 13488c2ecf20Sopenharmony_ci#define BUFMGR_MB_POOL_ADDR 0x00004408 13498c2ecf20Sopenharmony_ci#define BUFMGR_MB_POOL_SIZE 0x0000440c 13508c2ecf20Sopenharmony_ci#define BUFMGR_MB_RDMA_LOW_WATER 0x00004410 13518c2ecf20Sopenharmony_ci#define DEFAULT_MB_RDMA_LOW_WATER 0x00000050 13528c2ecf20Sopenharmony_ci#define DEFAULT_MB_RDMA_LOW_WATER_5705 0x00000000 13538c2ecf20Sopenharmony_ci#define DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130 13548c2ecf20Sopenharmony_ci#define DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780 0x00000000 13558c2ecf20Sopenharmony_ci#define BUFMGR_MB_MACRX_LOW_WATER 0x00004414 13568c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER 0x00000020 13578c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010 13588c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_5906 0x00000004 13598c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_57765 0x0000002a 13608c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098 13618c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b 13628c2ecf20Sopenharmony_ci#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_57765 0x0000007e 13638c2ecf20Sopenharmony_ci#define BUFMGR_MB_HIGH_WATER 0x00004418 13648c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER 0x00000060 13658c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_5705 0x00000060 13668c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_5906 0x00000010 13678c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_57765 0x000000a0 13688c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c 13698c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096 13708c2ecf20Sopenharmony_ci#define DEFAULT_MB_HIGH_WATER_JUMBO_57765 0x000000ea 13718c2ecf20Sopenharmony_ci#define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c 13728c2ecf20Sopenharmony_ci#define BUFMGR_MB_ALLOC_BIT 0x10000000 13738c2ecf20Sopenharmony_ci#define BUFMGR_RX_MB_ALLOC_RESP 0x00004420 13748c2ecf20Sopenharmony_ci#define BUFMGR_TX_MB_ALLOC_REQ 0x00004424 13758c2ecf20Sopenharmony_ci#define BUFMGR_TX_MB_ALLOC_RESP 0x00004428 13768c2ecf20Sopenharmony_ci#define BUFMGR_DMA_DESC_POOL_ADDR 0x0000442c 13778c2ecf20Sopenharmony_ci#define BUFMGR_DMA_DESC_POOL_SIZE 0x00004430 13788c2ecf20Sopenharmony_ci#define BUFMGR_DMA_LOW_WATER 0x00004434 13798c2ecf20Sopenharmony_ci#define DEFAULT_DMA_LOW_WATER 0x00000005 13808c2ecf20Sopenharmony_ci#define BUFMGR_DMA_HIGH_WATER 0x00004438 13818c2ecf20Sopenharmony_ci#define DEFAULT_DMA_HIGH_WATER 0x0000000a 13828c2ecf20Sopenharmony_ci#define BUFMGR_RX_DMA_ALLOC_REQ 0x0000443c 13838c2ecf20Sopenharmony_ci#define BUFMGR_RX_DMA_ALLOC_RESP 0x00004440 13848c2ecf20Sopenharmony_ci#define BUFMGR_TX_DMA_ALLOC_REQ 0x00004444 13858c2ecf20Sopenharmony_ci#define BUFMGR_TX_DMA_ALLOC_RESP 0x00004448 13868c2ecf20Sopenharmony_ci#define BUFMGR_HWDIAG_0 0x0000444c 13878c2ecf20Sopenharmony_ci#define BUFMGR_HWDIAG_1 0x00004450 13888c2ecf20Sopenharmony_ci#define BUFMGR_HWDIAG_2 0x00004454 13898c2ecf20Sopenharmony_ci/* 0x4458 --> 0x4800 unused */ 13908c2ecf20Sopenharmony_ci 13918c2ecf20Sopenharmony_ci/* Read DMA control registers */ 13928c2ecf20Sopenharmony_ci#define RDMAC_MODE 0x00004800 13938c2ecf20Sopenharmony_ci#define RDMAC_MODE_RESET 0x00000001 13948c2ecf20Sopenharmony_ci#define RDMAC_MODE_ENABLE 0x00000002 13958c2ecf20Sopenharmony_ci#define RDMAC_MODE_TGTABORT_ENAB 0x00000004 13968c2ecf20Sopenharmony_ci#define RDMAC_MODE_MSTABORT_ENAB 0x00000008 13978c2ecf20Sopenharmony_ci#define RDMAC_MODE_PARITYERR_ENAB 0x00000010 13988c2ecf20Sopenharmony_ci#define RDMAC_MODE_ADDROFLOW_ENAB 0x00000020 13998c2ecf20Sopenharmony_ci#define RDMAC_MODE_FIFOOFLOW_ENAB 0x00000040 14008c2ecf20Sopenharmony_ci#define RDMAC_MODE_FIFOURUN_ENAB 0x00000080 14018c2ecf20Sopenharmony_ci#define RDMAC_MODE_FIFOOREAD_ENAB 0x00000100 14028c2ecf20Sopenharmony_ci#define RDMAC_MODE_LNGREAD_ENAB 0x00000200 14038c2ecf20Sopenharmony_ci#define RDMAC_MODE_SPLIT_ENABLE 0x00000800 14048c2ecf20Sopenharmony_ci#define RDMAC_MODE_BD_SBD_CRPT_ENAB 0x00000800 14058c2ecf20Sopenharmony_ci#define RDMAC_MODE_SPLIT_RESET 0x00001000 14068c2ecf20Sopenharmony_ci#define RDMAC_MODE_MBUF_RBD_CRPT_ENAB 0x00001000 14078c2ecf20Sopenharmony_ci#define RDMAC_MODE_MBUF_SBD_CRPT_ENAB 0x00002000 14088c2ecf20Sopenharmony_ci#define RDMAC_MODE_FIFO_SIZE_128 0x00020000 14098c2ecf20Sopenharmony_ci#define RDMAC_MODE_FIFO_LONG_BURST 0x00030000 14108c2ecf20Sopenharmony_ci#define RDMAC_MODE_JMB_2K_MMRR 0x00800000 14118c2ecf20Sopenharmony_ci#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000 14128c2ecf20Sopenharmony_ci#define RDMAC_MODE_IPV4_LSO_EN 0x08000000 14138c2ecf20Sopenharmony_ci#define RDMAC_MODE_IPV6_LSO_EN 0x10000000 14148c2ecf20Sopenharmony_ci#define RDMAC_MODE_H2BNC_VLAN_DET 0x20000000 14158c2ecf20Sopenharmony_ci#define RDMAC_STATUS 0x00004804 14168c2ecf20Sopenharmony_ci#define RDMAC_STATUS_TGTABORT 0x00000004 14178c2ecf20Sopenharmony_ci#define RDMAC_STATUS_MSTABORT 0x00000008 14188c2ecf20Sopenharmony_ci#define RDMAC_STATUS_PARITYERR 0x00000010 14198c2ecf20Sopenharmony_ci#define RDMAC_STATUS_ADDROFLOW 0x00000020 14208c2ecf20Sopenharmony_ci#define RDMAC_STATUS_FIFOOFLOW 0x00000040 14218c2ecf20Sopenharmony_ci#define RDMAC_STATUS_FIFOURUN 0x00000080 14228c2ecf20Sopenharmony_ci#define RDMAC_STATUS_FIFOOREAD 0x00000100 14238c2ecf20Sopenharmony_ci#define RDMAC_STATUS_LNGREAD 0x00000200 14248c2ecf20Sopenharmony_ci/* 0x4808 --> 0x4890 unused */ 14258c2ecf20Sopenharmony_ci 14268c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_REG2 0x00004890 14278c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_CRPTEN_CTRL2 0x000048a0 14288c2ecf20Sopenharmony_ci 14298c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_REG 0x00004900 14308c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 14318c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000c00 14328c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000ff0 14338c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000c0000 14348c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000ff000 14358c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000 14368c2ecf20Sopenharmony_ci#define TG3_RDMA_RSRVCTRL_TXMRGN_MASK 0xffe00000 14378c2ecf20Sopenharmony_ci/* 0x4904 --> 0x4910 unused */ 14388c2ecf20Sopenharmony_ci 14398c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910 14408c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 14418c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000 14428c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_TX_LENGTH_WA_5719 0x02000000 14438c2ecf20Sopenharmony_ci#define TG3_LSO_RD_DMA_TX_LENGTH_WA_5720 0x00200000 14448c2ecf20Sopenharmony_ci/* 0x4914 --> 0x4be0 unused */ 14458c2ecf20Sopenharmony_ci 14468c2ecf20Sopenharmony_ci#define TG3_NUM_RDMA_CHANNELS 4 14478c2ecf20Sopenharmony_ci#define TG3_RDMA_LENGTH 0x00004be0 14488c2ecf20Sopenharmony_ci 14498c2ecf20Sopenharmony_ci/* Write DMA control registers */ 14508c2ecf20Sopenharmony_ci#define WDMAC_MODE 0x00004c00 14518c2ecf20Sopenharmony_ci#define WDMAC_MODE_RESET 0x00000001 14528c2ecf20Sopenharmony_ci#define WDMAC_MODE_ENABLE 0x00000002 14538c2ecf20Sopenharmony_ci#define WDMAC_MODE_TGTABORT_ENAB 0x00000004 14548c2ecf20Sopenharmony_ci#define WDMAC_MODE_MSTABORT_ENAB 0x00000008 14558c2ecf20Sopenharmony_ci#define WDMAC_MODE_PARITYERR_ENAB 0x00000010 14568c2ecf20Sopenharmony_ci#define WDMAC_MODE_ADDROFLOW_ENAB 0x00000020 14578c2ecf20Sopenharmony_ci#define WDMAC_MODE_FIFOOFLOW_ENAB 0x00000040 14588c2ecf20Sopenharmony_ci#define WDMAC_MODE_FIFOURUN_ENAB 0x00000080 14598c2ecf20Sopenharmony_ci#define WDMAC_MODE_FIFOOREAD_ENAB 0x00000100 14608c2ecf20Sopenharmony_ci#define WDMAC_MODE_LNGREAD_ENAB 0x00000200 14618c2ecf20Sopenharmony_ci#define WDMAC_MODE_RX_ACCEL 0x00000400 14628c2ecf20Sopenharmony_ci#define WDMAC_MODE_STATUS_TAG_FIX 0x20000000 14638c2ecf20Sopenharmony_ci#define WDMAC_MODE_BURST_ALL_DATA 0xc0000000 14648c2ecf20Sopenharmony_ci#define WDMAC_STATUS 0x00004c04 14658c2ecf20Sopenharmony_ci#define WDMAC_STATUS_TGTABORT 0x00000004 14668c2ecf20Sopenharmony_ci#define WDMAC_STATUS_MSTABORT 0x00000008 14678c2ecf20Sopenharmony_ci#define WDMAC_STATUS_PARITYERR 0x00000010 14688c2ecf20Sopenharmony_ci#define WDMAC_STATUS_ADDROFLOW 0x00000020 14698c2ecf20Sopenharmony_ci#define WDMAC_STATUS_FIFOOFLOW 0x00000040 14708c2ecf20Sopenharmony_ci#define WDMAC_STATUS_FIFOURUN 0x00000080 14718c2ecf20Sopenharmony_ci#define WDMAC_STATUS_FIFOOREAD 0x00000100 14728c2ecf20Sopenharmony_ci#define WDMAC_STATUS_LNGREAD 0x00000200 14738c2ecf20Sopenharmony_ci/* 0x4c08 --> 0x5000 unused */ 14748c2ecf20Sopenharmony_ci 14758c2ecf20Sopenharmony_ci/* Per-cpu register offsets (arm9) */ 14768c2ecf20Sopenharmony_ci#define CPU_MODE 0x00000000 14778c2ecf20Sopenharmony_ci#define CPU_MODE_RESET 0x00000001 14788c2ecf20Sopenharmony_ci#define CPU_MODE_HALT 0x00000400 14798c2ecf20Sopenharmony_ci#define CPU_STATE 0x00000004 14808c2ecf20Sopenharmony_ci#define CPU_EVTMASK 0x00000008 14818c2ecf20Sopenharmony_ci/* 0xc --> 0x1c reserved */ 14828c2ecf20Sopenharmony_ci#define CPU_PC 0x0000001c 14838c2ecf20Sopenharmony_ci#define CPU_INSN 0x00000020 14848c2ecf20Sopenharmony_ci#define CPU_SPAD_UFLOW 0x00000024 14858c2ecf20Sopenharmony_ci#define CPU_WDOG_CLEAR 0x00000028 14868c2ecf20Sopenharmony_ci#define CPU_WDOG_VECTOR 0x0000002c 14878c2ecf20Sopenharmony_ci#define CPU_WDOG_PC 0x00000030 14888c2ecf20Sopenharmony_ci#define CPU_HW_BP 0x00000034 14898c2ecf20Sopenharmony_ci/* 0x38 --> 0x44 unused */ 14908c2ecf20Sopenharmony_ci#define CPU_WDOG_SAVED_STATE 0x00000044 14918c2ecf20Sopenharmony_ci#define CPU_LAST_BRANCH_ADDR 0x00000048 14928c2ecf20Sopenharmony_ci#define CPU_SPAD_UFLOW_SET 0x0000004c 14938c2ecf20Sopenharmony_ci/* 0x50 --> 0x200 unused */ 14948c2ecf20Sopenharmony_ci#define CPU_R0 0x00000200 14958c2ecf20Sopenharmony_ci#define CPU_R1 0x00000204 14968c2ecf20Sopenharmony_ci#define CPU_R2 0x00000208 14978c2ecf20Sopenharmony_ci#define CPU_R3 0x0000020c 14988c2ecf20Sopenharmony_ci#define CPU_R4 0x00000210 14998c2ecf20Sopenharmony_ci#define CPU_R5 0x00000214 15008c2ecf20Sopenharmony_ci#define CPU_R6 0x00000218 15018c2ecf20Sopenharmony_ci#define CPU_R7 0x0000021c 15028c2ecf20Sopenharmony_ci#define CPU_R8 0x00000220 15038c2ecf20Sopenharmony_ci#define CPU_R9 0x00000224 15048c2ecf20Sopenharmony_ci#define CPU_R10 0x00000228 15058c2ecf20Sopenharmony_ci#define CPU_R11 0x0000022c 15068c2ecf20Sopenharmony_ci#define CPU_R12 0x00000230 15078c2ecf20Sopenharmony_ci#define CPU_R13 0x00000234 15088c2ecf20Sopenharmony_ci#define CPU_R14 0x00000238 15098c2ecf20Sopenharmony_ci#define CPU_R15 0x0000023c 15108c2ecf20Sopenharmony_ci#define CPU_R16 0x00000240 15118c2ecf20Sopenharmony_ci#define CPU_R17 0x00000244 15128c2ecf20Sopenharmony_ci#define CPU_R18 0x00000248 15138c2ecf20Sopenharmony_ci#define CPU_R19 0x0000024c 15148c2ecf20Sopenharmony_ci#define CPU_R20 0x00000250 15158c2ecf20Sopenharmony_ci#define CPU_R21 0x00000254 15168c2ecf20Sopenharmony_ci#define CPU_R22 0x00000258 15178c2ecf20Sopenharmony_ci#define CPU_R23 0x0000025c 15188c2ecf20Sopenharmony_ci#define CPU_R24 0x00000260 15198c2ecf20Sopenharmony_ci#define CPU_R25 0x00000264 15208c2ecf20Sopenharmony_ci#define CPU_R26 0x00000268 15218c2ecf20Sopenharmony_ci#define CPU_R27 0x0000026c 15228c2ecf20Sopenharmony_ci#define CPU_R28 0x00000270 15238c2ecf20Sopenharmony_ci#define CPU_R29 0x00000274 15248c2ecf20Sopenharmony_ci#define CPU_R30 0x00000278 15258c2ecf20Sopenharmony_ci#define CPU_R31 0x0000027c 15268c2ecf20Sopenharmony_ci/* 0x280 --> 0x400 unused */ 15278c2ecf20Sopenharmony_ci 15288c2ecf20Sopenharmony_ci#define RX_CPU_BASE 0x00005000 15298c2ecf20Sopenharmony_ci#define RX_CPU_MODE 0x00005000 15308c2ecf20Sopenharmony_ci#define RX_CPU_STATE 0x00005004 15318c2ecf20Sopenharmony_ci#define RX_CPU_PGMCTR 0x0000501c 15328c2ecf20Sopenharmony_ci#define RX_CPU_HWBKPT 0x00005034 15338c2ecf20Sopenharmony_ci#define TX_CPU_BASE 0x00005400 15348c2ecf20Sopenharmony_ci#define TX_CPU_MODE 0x00005400 15358c2ecf20Sopenharmony_ci#define TX_CPU_STATE 0x00005404 15368c2ecf20Sopenharmony_ci#define TX_CPU_PGMCTR 0x0000541c 15378c2ecf20Sopenharmony_ci 15388c2ecf20Sopenharmony_ci#define VCPU_STATUS 0x00005100 15398c2ecf20Sopenharmony_ci#define VCPU_STATUS_INIT_DONE 0x04000000 15408c2ecf20Sopenharmony_ci#define VCPU_STATUS_DRV_RESET 0x08000000 15418c2ecf20Sopenharmony_ci 15428c2ecf20Sopenharmony_ci#define VCPU_CFGSHDW 0x00005104 15438c2ecf20Sopenharmony_ci#define VCPU_CFGSHDW_WOL_ENABLE 0x00000001 15448c2ecf20Sopenharmony_ci#define VCPU_CFGSHDW_WOL_MAGPKT 0x00000004 15458c2ecf20Sopenharmony_ci#define VCPU_CFGSHDW_ASPM_DBNC 0x00001000 15468c2ecf20Sopenharmony_ci 15478c2ecf20Sopenharmony_ci/* Mailboxes */ 15488c2ecf20Sopenharmony_ci#define GRCMBOX_BASE 0x00005600 15498c2ecf20Sopenharmony_ci#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ 15508c2ecf20Sopenharmony_ci#define GRCMBOX_INTERRUPT_1 0x00005808 /* 64-bit */ 15518c2ecf20Sopenharmony_ci#define GRCMBOX_INTERRUPT_2 0x00005810 /* 64-bit */ 15528c2ecf20Sopenharmony_ci#define GRCMBOX_INTERRUPT_3 0x00005818 /* 64-bit */ 15538c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_0 0x00005820 /* 64-bit */ 15548c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_1 0x00005828 /* 64-bit */ 15558c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_2 0x00005830 /* 64-bit */ 15568c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_3 0x00005838 /* 64-bit */ 15578c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_4 0x00005840 /* 64-bit */ 15588c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_5 0x00005848 /* 64-bit */ 15598c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_6 0x00005850 /* 64-bit */ 15608c2ecf20Sopenharmony_ci#define GRCMBOX_GENERAL_7 0x00005858 /* 64-bit */ 15618c2ecf20Sopenharmony_ci#define GRCMBOX_RELOAD_STAT 0x00005860 /* 64-bit */ 15628c2ecf20Sopenharmony_ci#define GRCMBOX_RCVSTD_PROD_IDX 0x00005868 /* 64-bit */ 15638c2ecf20Sopenharmony_ci#define GRCMBOX_RCVJUMBO_PROD_IDX 0x00005870 /* 64-bit */ 15648c2ecf20Sopenharmony_ci#define GRCMBOX_RCVMINI_PROD_IDX 0x00005878 /* 64-bit */ 15658c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_0 0x00005880 /* 64-bit */ 15668c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_1 0x00005888 /* 64-bit */ 15678c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_2 0x00005890 /* 64-bit */ 15688c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_3 0x00005898 /* 64-bit */ 15698c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_4 0x000058a0 /* 64-bit */ 15708c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_5 0x000058a8 /* 64-bit */ 15718c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_6 0x000058b0 /* 64-bit */ 15728c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_7 0x000058b8 /* 64-bit */ 15738c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_8 0x000058c0 /* 64-bit */ 15748c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_9 0x000058c8 /* 64-bit */ 15758c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_10 0x000058d0 /* 64-bit */ 15768c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_11 0x000058d8 /* 64-bit */ 15778c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_12 0x000058e0 /* 64-bit */ 15788c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_13 0x000058e8 /* 64-bit */ 15798c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_14 0x000058f0 /* 64-bit */ 15808c2ecf20Sopenharmony_ci#define GRCMBOX_RCVRET_CON_IDX_15 0x000058f8 /* 64-bit */ 15818c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_0 0x00005900 /* 64-bit */ 15828c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_1 0x00005908 /* 64-bit */ 15838c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_2 0x00005910 /* 64-bit */ 15848c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_3 0x00005918 /* 64-bit */ 15858c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_4 0x00005920 /* 64-bit */ 15868c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_5 0x00005928 /* 64-bit */ 15878c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_6 0x00005930 /* 64-bit */ 15888c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_7 0x00005938 /* 64-bit */ 15898c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_8 0x00005940 /* 64-bit */ 15908c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_9 0x00005948 /* 64-bit */ 15918c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_10 0x00005950 /* 64-bit */ 15928c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_11 0x00005958 /* 64-bit */ 15938c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_12 0x00005960 /* 64-bit */ 15948c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_13 0x00005968 /* 64-bit */ 15958c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_14 0x00005970 /* 64-bit */ 15968c2ecf20Sopenharmony_ci#define GRCMBOX_SNDHOST_PROD_IDX_15 0x00005978 /* 64-bit */ 15978c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_0 0x00005980 /* 64-bit */ 15988c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_1 0x00005988 /* 64-bit */ 15998c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_2 0x00005990 /* 64-bit */ 16008c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_3 0x00005998 /* 64-bit */ 16018c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_4 0x000059a0 /* 64-bit */ 16028c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_5 0x000059a8 /* 64-bit */ 16038c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_6 0x000059b0 /* 64-bit */ 16048c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_7 0x000059b8 /* 64-bit */ 16058c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_8 0x000059c0 /* 64-bit */ 16068c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_9 0x000059c8 /* 64-bit */ 16078c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_10 0x000059d0 /* 64-bit */ 16088c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_11 0x000059d8 /* 64-bit */ 16098c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_12 0x000059e0 /* 64-bit */ 16108c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_13 0x000059e8 /* 64-bit */ 16118c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_14 0x000059f0 /* 64-bit */ 16128c2ecf20Sopenharmony_ci#define GRCMBOX_SNDNIC_PROD_IDX_15 0x000059f8 /* 64-bit */ 16138c2ecf20Sopenharmony_ci#define GRCMBOX_HIGH_PRIO_EV_VECTOR 0x00005a00 16148c2ecf20Sopenharmony_ci#define GRCMBOX_HIGH_PRIO_EV_MASK 0x00005a04 16158c2ecf20Sopenharmony_ci#define GRCMBOX_LOW_PRIO_EV_VEC 0x00005a08 16168c2ecf20Sopenharmony_ci#define GRCMBOX_LOW_PRIO_EV_MASK 0x00005a0c 16178c2ecf20Sopenharmony_ci/* 0x5a10 --> 0x5c00 */ 16188c2ecf20Sopenharmony_ci 16198c2ecf20Sopenharmony_ci/* Flow Through queues */ 16208c2ecf20Sopenharmony_ci#define FTQ_RESET 0x00005c00 16218c2ecf20Sopenharmony_ci/* 0x5c04 --> 0x5c10 unused */ 16228c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_READ_CTL 0x00005c10 16238c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_READ_FULL_CNT 0x00005c14 16248c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_READ_FIFO_ENQDEQ 0x00005c18 16258c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_READ_WRITE_PEEK 0x00005c1c 16268c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_READ_CTL 0x00005c20 16278c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_READ_FULL_CNT 0x00005c24 16288c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_READ_FIFO_ENQDEQ 0x00005c28 16298c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_READ_WRITE_PEEK 0x00005c2c 16308c2ecf20Sopenharmony_ci#define FTQ_DMA_COMP_DISC_CTL 0x00005c30 16318c2ecf20Sopenharmony_ci#define FTQ_DMA_COMP_DISC_FULL_CNT 0x00005c34 16328c2ecf20Sopenharmony_ci#define FTQ_DMA_COMP_DISC_FIFO_ENQDEQ 0x00005c38 16338c2ecf20Sopenharmony_ci#define FTQ_DMA_COMP_DISC_WRITE_PEEK 0x00005c3c 16348c2ecf20Sopenharmony_ci#define FTQ_SEND_BD_COMP_CTL 0x00005c40 16358c2ecf20Sopenharmony_ci#define FTQ_SEND_BD_COMP_FULL_CNT 0x00005c44 16368c2ecf20Sopenharmony_ci#define FTQ_SEND_BD_COMP_FIFO_ENQDEQ 0x00005c48 16378c2ecf20Sopenharmony_ci#define FTQ_SEND_BD_COMP_WRITE_PEEK 0x00005c4c 16388c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_INIT_CTL 0x00005c50 16398c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_INIT_FULL_CNT 0x00005c54 16408c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_INIT_FIFO_ENQDEQ 0x00005c58 16418c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_INIT_WRITE_PEEK 0x00005c5c 16428c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_WRITE_CTL 0x00005c60 16438c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_WRITE_FULL_CNT 0x00005c64 16448c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_WRITE_FIFO_ENQDEQ 0x00005c68 16458c2ecf20Sopenharmony_ci#define FTQ_DMA_NORM_WRITE_WRITE_PEEK 0x00005c6c 16468c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_WRITE_CTL 0x00005c70 16478c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_WRITE_FULL_CNT 0x00005c74 16488c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_WRITE_FIFO_ENQDEQ 0x00005c78 16498c2ecf20Sopenharmony_ci#define FTQ_DMA_HIGH_WRITE_WRITE_PEEK 0x00005c7c 16508c2ecf20Sopenharmony_ci#define FTQ_SWTYPE1_CTL 0x00005c80 16518c2ecf20Sopenharmony_ci#define FTQ_SWTYPE1_FULL_CNT 0x00005c84 16528c2ecf20Sopenharmony_ci#define FTQ_SWTYPE1_FIFO_ENQDEQ 0x00005c88 16538c2ecf20Sopenharmony_ci#define FTQ_SWTYPE1_WRITE_PEEK 0x00005c8c 16548c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_COMP_CTL 0x00005c90 16558c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_COMP_FULL_CNT 0x00005c94 16568c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_COMP_FIFO_ENQDEQ 0x00005c98 16578c2ecf20Sopenharmony_ci#define FTQ_SEND_DATA_COMP_WRITE_PEEK 0x00005c9c 16588c2ecf20Sopenharmony_ci#define FTQ_HOST_COAL_CTL 0x00005ca0 16598c2ecf20Sopenharmony_ci#define FTQ_HOST_COAL_FULL_CNT 0x00005ca4 16608c2ecf20Sopenharmony_ci#define FTQ_HOST_COAL_FIFO_ENQDEQ 0x00005ca8 16618c2ecf20Sopenharmony_ci#define FTQ_HOST_COAL_WRITE_PEEK 0x00005cac 16628c2ecf20Sopenharmony_ci#define FTQ_MAC_TX_CTL 0x00005cb0 16638c2ecf20Sopenharmony_ci#define FTQ_MAC_TX_FULL_CNT 0x00005cb4 16648c2ecf20Sopenharmony_ci#define FTQ_MAC_TX_FIFO_ENQDEQ 0x00005cb8 16658c2ecf20Sopenharmony_ci#define FTQ_MAC_TX_WRITE_PEEK 0x00005cbc 16668c2ecf20Sopenharmony_ci#define FTQ_MB_FREE_CTL 0x00005cc0 16678c2ecf20Sopenharmony_ci#define FTQ_MB_FREE_FULL_CNT 0x00005cc4 16688c2ecf20Sopenharmony_ci#define FTQ_MB_FREE_FIFO_ENQDEQ 0x00005cc8 16698c2ecf20Sopenharmony_ci#define FTQ_MB_FREE_WRITE_PEEK 0x00005ccc 16708c2ecf20Sopenharmony_ci#define FTQ_RCVBD_COMP_CTL 0x00005cd0 16718c2ecf20Sopenharmony_ci#define FTQ_RCVBD_COMP_FULL_CNT 0x00005cd4 16728c2ecf20Sopenharmony_ci#define FTQ_RCVBD_COMP_FIFO_ENQDEQ 0x00005cd8 16738c2ecf20Sopenharmony_ci#define FTQ_RCVBD_COMP_WRITE_PEEK 0x00005cdc 16748c2ecf20Sopenharmony_ci#define FTQ_RCVLST_PLMT_CTL 0x00005ce0 16758c2ecf20Sopenharmony_ci#define FTQ_RCVLST_PLMT_FULL_CNT 0x00005ce4 16768c2ecf20Sopenharmony_ci#define FTQ_RCVLST_PLMT_FIFO_ENQDEQ 0x00005ce8 16778c2ecf20Sopenharmony_ci#define FTQ_RCVLST_PLMT_WRITE_PEEK 0x00005cec 16788c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_INI_CTL 0x00005cf0 16798c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_INI_FULL_CNT 0x00005cf4 16808c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_INI_FIFO_ENQDEQ 0x00005cf8 16818c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_INI_WRITE_PEEK 0x00005cfc 16828c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_COMP_CTL 0x00005d00 16838c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_COMP_FULL_CNT 0x00005d04 16848c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_COMP_FIFO_ENQDEQ 0x00005d08 16858c2ecf20Sopenharmony_ci#define FTQ_RCVDATA_COMP_WRITE_PEEK 0x00005d0c 16868c2ecf20Sopenharmony_ci#define FTQ_SWTYPE2_CTL 0x00005d10 16878c2ecf20Sopenharmony_ci#define FTQ_SWTYPE2_FULL_CNT 0x00005d14 16888c2ecf20Sopenharmony_ci#define FTQ_SWTYPE2_FIFO_ENQDEQ 0x00005d18 16898c2ecf20Sopenharmony_ci#define FTQ_SWTYPE2_WRITE_PEEK 0x00005d1c 16908c2ecf20Sopenharmony_ci/* 0x5d20 --> 0x6000 unused */ 16918c2ecf20Sopenharmony_ci 16928c2ecf20Sopenharmony_ci/* Message signaled interrupt registers */ 16938c2ecf20Sopenharmony_ci#define MSGINT_MODE 0x00006000 16948c2ecf20Sopenharmony_ci#define MSGINT_MODE_RESET 0x00000001 16958c2ecf20Sopenharmony_ci#define MSGINT_MODE_ENABLE 0x00000002 16968c2ecf20Sopenharmony_ci#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020 16978c2ecf20Sopenharmony_ci#define MSGINT_MODE_MULTIVEC_EN 0x00000080 16988c2ecf20Sopenharmony_ci#define MSGINT_STATUS 0x00006004 16998c2ecf20Sopenharmony_ci#define MSGINT_STATUS_MSI_REQ 0x00000001 17008c2ecf20Sopenharmony_ci#define MSGINT_FIFO 0x00006008 17018c2ecf20Sopenharmony_ci/* 0x600c --> 0x6400 unused */ 17028c2ecf20Sopenharmony_ci 17038c2ecf20Sopenharmony_ci/* DMA completion registers */ 17048c2ecf20Sopenharmony_ci#define DMAC_MODE 0x00006400 17058c2ecf20Sopenharmony_ci#define DMAC_MODE_RESET 0x00000001 17068c2ecf20Sopenharmony_ci#define DMAC_MODE_ENABLE 0x00000002 17078c2ecf20Sopenharmony_ci/* 0x6404 --> 0x6800 unused */ 17088c2ecf20Sopenharmony_ci 17098c2ecf20Sopenharmony_ci/* GRC registers */ 17108c2ecf20Sopenharmony_ci#define GRC_MODE 0x00006800 17118c2ecf20Sopenharmony_ci#define GRC_MODE_UPD_ON_COAL 0x00000001 17128c2ecf20Sopenharmony_ci#define GRC_MODE_BSWAP_NONFRM_DATA 0x00000002 17138c2ecf20Sopenharmony_ci#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004 17148c2ecf20Sopenharmony_ci#define GRC_MODE_BSWAP_DATA 0x00000010 17158c2ecf20Sopenharmony_ci#define GRC_MODE_WSWAP_DATA 0x00000020 17168c2ecf20Sopenharmony_ci#define GRC_MODE_BYTE_SWAP_B2HRX_DATA 0x00000040 17178c2ecf20Sopenharmony_ci#define GRC_MODE_WORD_SWAP_B2HRX_DATA 0x00000080 17188c2ecf20Sopenharmony_ci#define GRC_MODE_SPLITHDR 0x00000100 17198c2ecf20Sopenharmony_ci#define GRC_MODE_NOFRM_CRACKING 0x00000200 17208c2ecf20Sopenharmony_ci#define GRC_MODE_INCL_CRC 0x00000400 17218c2ecf20Sopenharmony_ci#define GRC_MODE_ALLOW_BAD_FRMS 0x00000800 17228c2ecf20Sopenharmony_ci#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000 17238c2ecf20Sopenharmony_ci#define GRC_MODE_NOIRQ_ON_RCV 0x00004000 17248c2ecf20Sopenharmony_ci#define GRC_MODE_FORCE_PCI32BIT 0x00008000 17258c2ecf20Sopenharmony_ci#define GRC_MODE_B2HRX_ENABLE 0x00008000 17268c2ecf20Sopenharmony_ci#define GRC_MODE_HOST_STACKUP 0x00010000 17278c2ecf20Sopenharmony_ci#define GRC_MODE_HOST_SENDBDS 0x00020000 17288c2ecf20Sopenharmony_ci#define GRC_MODE_HTX2B_ENABLE 0x00040000 17298c2ecf20Sopenharmony_ci#define GRC_MODE_TIME_SYNC_ENABLE 0x00080000 17308c2ecf20Sopenharmony_ci#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000 17318c2ecf20Sopenharmony_ci#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000 17328c2ecf20Sopenharmony_ci#define GRC_MODE_PCIE_TL_SEL 0x00000000 17338c2ecf20Sopenharmony_ci#define GRC_MODE_PCIE_PL_SEL 0x00400000 17348c2ecf20Sopenharmony_ci#define GRC_MODE_NO_RX_PHDR_CSUM 0x00800000 17358c2ecf20Sopenharmony_ci#define GRC_MODE_IRQ_ON_TX_CPU_ATTN 0x01000000 17368c2ecf20Sopenharmony_ci#define GRC_MODE_IRQ_ON_RX_CPU_ATTN 0x02000000 17378c2ecf20Sopenharmony_ci#define GRC_MODE_IRQ_ON_MAC_ATTN 0x04000000 17388c2ecf20Sopenharmony_ci#define GRC_MODE_IRQ_ON_DMA_ATTN 0x08000000 17398c2ecf20Sopenharmony_ci#define GRC_MODE_IRQ_ON_FLOW_ATTN 0x10000000 17408c2ecf20Sopenharmony_ci#define GRC_MODE_4X_NIC_SEND_RINGS 0x20000000 17418c2ecf20Sopenharmony_ci#define GRC_MODE_PCIE_DL_SEL 0x20000000 17428c2ecf20Sopenharmony_ci#define GRC_MODE_MCAST_FRM_ENABLE 0x40000000 17438c2ecf20Sopenharmony_ci#define GRC_MODE_PCIE_HI_1K_EN 0x80000000 17448c2ecf20Sopenharmony_ci#define GRC_MODE_PCIE_PORT_MASK (GRC_MODE_PCIE_TL_SEL | \ 17458c2ecf20Sopenharmony_ci GRC_MODE_PCIE_PL_SEL | \ 17468c2ecf20Sopenharmony_ci GRC_MODE_PCIE_DL_SEL | \ 17478c2ecf20Sopenharmony_ci GRC_MODE_PCIE_HI_1K_EN) 17488c2ecf20Sopenharmony_ci#define GRC_MISC_CFG 0x00006804 17498c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_CORECLK_RESET 0x00000001 17508c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_PRESCALAR_MASK 0x000000fe 17518c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_PRESCALAR_SHIFT 1 17528c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_MASK 0x0001e000 17538c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5700 0x0001e000 17548c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5701 0x00000000 17558c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5702FE 0x00004000 17568c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5703 0x00000000 17578c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5703S 0x00002000 17588c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5704 0x00000000 17598c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5704CIOBE 0x00004000 17608c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5704_A2 0x00008000 17618c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5788 0x00010000 17628c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_5788M 0x00018000 17638c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_BOARD_ID_AC91002A1 0x00018000 17648c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_EPHY_IDDQ 0x00200000 17658c2ecf20Sopenharmony_ci#define GRC_MISC_CFG_KEEP_GPHY_POWER 0x04000000 17668c2ecf20Sopenharmony_ci#define GRC_LOCAL_CTRL 0x00006808 17678c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_INT_ACTIVE 0x00000001 17688c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_CLEARINT 0x00000002 17698c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_SETINT 0x00000004 17708c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_INT_ON_ATTN 0x00000008 17718c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_UART_SEL 0x00000010 /* 5755 only */ 17728c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_USE_SIG_DETECT 0x00000010 /* 5714/5780 only */ 17738c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_USE_EXT_SIG_DETECT 0x00000020 /* 5714/5780 only */ 17748c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_INPUT3 0x00000020 17758c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OE3 0x00000040 17768c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OUTPUT3 0x00000080 17778c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_INPUT0 0x00000100 17788c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_INPUT1 0x00000200 17798c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_INPUT2 0x00000400 17808c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OE0 0x00000800 17818c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OE1 0x00001000 17828c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OE2 0x00002000 17838c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OUTPUT0 0x00004000 17848c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OUTPUT1 0x00008000 17858c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_GPIO_OUTPUT2 0x00010000 17868c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_EXTMEM_ENABLE 0x00020000 17878c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_MASK 0x001c0000 17888c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_256K 0x00000000 17898c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_512K 0x00040000 17908c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_1M 0x00080000 17918c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_2M 0x000c0000 17928c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_4M 0x00100000 17938c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_8M 0x00140000 17948c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_MEMSZ_16M 0x00180000 17958c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_BANK_SELECT 0x00200000 17968c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_SSRAM_TYPE 0x00400000 17978c2ecf20Sopenharmony_ci#define GRC_LCLCTRL_AUTO_SEEPROM 0x01000000 17988c2ecf20Sopenharmony_ci#define GRC_TIMER 0x0000680c 17998c2ecf20Sopenharmony_ci#define GRC_RX_CPU_EVENT 0x00006810 18008c2ecf20Sopenharmony_ci#define GRC_RX_CPU_DRIVER_EVENT 0x00004000 18018c2ecf20Sopenharmony_ci#define GRC_RX_TIMER_REF 0x00006814 18028c2ecf20Sopenharmony_ci#define GRC_RX_CPU_SEM 0x00006818 18038c2ecf20Sopenharmony_ci#define GRC_REMOTE_RX_CPU_ATTN 0x0000681c 18048c2ecf20Sopenharmony_ci#define GRC_TX_CPU_EVENT 0x00006820 18058c2ecf20Sopenharmony_ci#define GRC_TX_TIMER_REF 0x00006824 18068c2ecf20Sopenharmony_ci#define GRC_TX_CPU_SEM 0x00006828 18078c2ecf20Sopenharmony_ci#define GRC_REMOTE_TX_CPU_ATTN 0x0000682c 18088c2ecf20Sopenharmony_ci#define GRC_MEM_POWER_UP 0x00006830 /* 64-bit */ 18098c2ecf20Sopenharmony_ci#define GRC_EEPROM_ADDR 0x00006838 18108c2ecf20Sopenharmony_ci#define EEPROM_ADDR_WRITE 0x00000000 18118c2ecf20Sopenharmony_ci#define EEPROM_ADDR_READ 0x80000000 18128c2ecf20Sopenharmony_ci#define EEPROM_ADDR_COMPLETE 0x40000000 18138c2ecf20Sopenharmony_ci#define EEPROM_ADDR_FSM_RESET 0x20000000 18148c2ecf20Sopenharmony_ci#define EEPROM_ADDR_DEVID_MASK 0x1c000000 18158c2ecf20Sopenharmony_ci#define EEPROM_ADDR_DEVID_SHIFT 26 18168c2ecf20Sopenharmony_ci#define EEPROM_ADDR_START 0x02000000 18178c2ecf20Sopenharmony_ci#define EEPROM_ADDR_CLKPERD_SHIFT 16 18188c2ecf20Sopenharmony_ci#define EEPROM_ADDR_ADDR_MASK 0x0000ffff 18198c2ecf20Sopenharmony_ci#define EEPROM_ADDR_ADDR_SHIFT 0 18208c2ecf20Sopenharmony_ci#define EEPROM_DEFAULT_CLOCK_PERIOD 0x60 18218c2ecf20Sopenharmony_ci#define EEPROM_CHIP_SIZE (64 * 1024) 18228c2ecf20Sopenharmony_ci#define GRC_EEPROM_DATA 0x0000683c 18238c2ecf20Sopenharmony_ci#define GRC_EEPROM_CTRL 0x00006840 18248c2ecf20Sopenharmony_ci#define GRC_MDI_CTRL 0x00006844 18258c2ecf20Sopenharmony_ci#define GRC_SEEPROM_DELAY 0x00006848 18268c2ecf20Sopenharmony_ci/* 0x684c --> 0x6890 unused */ 18278c2ecf20Sopenharmony_ci#define GRC_VCPU_EXT_CTRL 0x00006890 18288c2ecf20Sopenharmony_ci#define GRC_VCPU_EXT_CTRL_HALT_CPU 0x00400000 18298c2ecf20Sopenharmony_ci#define GRC_VCPU_EXT_CTRL_DISABLE_WOL 0x20000000 18308c2ecf20Sopenharmony_ci#define GRC_FASTBOOT_PC 0x00006894 /* 5752, 5755, 5787 */ 18318c2ecf20Sopenharmony_ci 18328c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLCK_LSB 0x00006900 18338c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLCK_MSB 0x00006904 18348c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLCK_CTL 0x00006908 18358c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLCK_CTL_STOP 0x00000002 18368c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLCK_CTL_RESUME 0x00000004 18378c2ecf20Sopenharmony_ci#define TG3_EAV_CTL_TSYNC_GPIO_MASK (0x3 << 16) 18388c2ecf20Sopenharmony_ci#define TG3_EAV_CTL_TSYNC_WDOG0 (1 << 17) 18398c2ecf20Sopenharmony_ci 18408c2ecf20Sopenharmony_ci#define TG3_EAV_WATCHDOG0_LSB 0x00006918 18418c2ecf20Sopenharmony_ci#define TG3_EAV_WATCHDOG0_MSB 0x0000691c 18428c2ecf20Sopenharmony_ci#define TG3_EAV_WATCHDOG0_EN (1 << 31) 18438c2ecf20Sopenharmony_ci#define TG3_EAV_WATCHDOG_MSB_MASK 0x7fffffff 18448c2ecf20Sopenharmony_ci 18458c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLK_CORRECT_CTL 0x00006928 18468c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLK_CORRECT_EN (1 << 31) 18478c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLK_CORRECT_NEG (1 << 30) 18488c2ecf20Sopenharmony_ci 18498c2ecf20Sopenharmony_ci#define TG3_EAV_REF_CLK_CORRECT_MASK 0xffffff 18508c2ecf20Sopenharmony_ci 18518c2ecf20Sopenharmony_ci/* 0x692c --> 0x7000 unused */ 18528c2ecf20Sopenharmony_ci 18538c2ecf20Sopenharmony_ci/* NVRAM Control registers */ 18548c2ecf20Sopenharmony_ci#define NVRAM_CMD 0x00007000 18558c2ecf20Sopenharmony_ci#define NVRAM_CMD_RESET 0x00000001 18568c2ecf20Sopenharmony_ci#define NVRAM_CMD_DONE 0x00000008 18578c2ecf20Sopenharmony_ci#define NVRAM_CMD_GO 0x00000010 18588c2ecf20Sopenharmony_ci#define NVRAM_CMD_WR 0x00000020 18598c2ecf20Sopenharmony_ci#define NVRAM_CMD_RD 0x00000000 18608c2ecf20Sopenharmony_ci#define NVRAM_CMD_ERASE 0x00000040 18618c2ecf20Sopenharmony_ci#define NVRAM_CMD_FIRST 0x00000080 18628c2ecf20Sopenharmony_ci#define NVRAM_CMD_LAST 0x00000100 18638c2ecf20Sopenharmony_ci#define NVRAM_CMD_WREN 0x00010000 18648c2ecf20Sopenharmony_ci#define NVRAM_CMD_WRDI 0x00020000 18658c2ecf20Sopenharmony_ci#define NVRAM_STAT 0x00007004 18668c2ecf20Sopenharmony_ci#define NVRAM_WRDATA 0x00007008 18678c2ecf20Sopenharmony_ci#define NVRAM_ADDR 0x0000700c 18688c2ecf20Sopenharmony_ci#define NVRAM_ADDR_MSK 0x07ffffff 18698c2ecf20Sopenharmony_ci#define NVRAM_RDDATA 0x00007010 18708c2ecf20Sopenharmony_ci#define NVRAM_CFG1 0x00007014 18718c2ecf20Sopenharmony_ci#define NVRAM_CFG1_FLASHIF_ENAB 0x00000001 18728c2ecf20Sopenharmony_ci#define NVRAM_CFG1_BUFFERED_MODE 0x00000002 18738c2ecf20Sopenharmony_ci#define NVRAM_CFG1_PASS_THRU 0x00000004 18748c2ecf20Sopenharmony_ci#define NVRAM_CFG1_STATUS_BITS 0x00000070 18758c2ecf20Sopenharmony_ci#define NVRAM_CFG1_BIT_BANG 0x00000008 18768c2ecf20Sopenharmony_ci#define NVRAM_CFG1_FLASH_SIZE 0x02000000 18778c2ecf20Sopenharmony_ci#define NVRAM_CFG1_COMPAT_BYPASS 0x80000000 18788c2ecf20Sopenharmony_ci#define NVRAM_CFG1_VENDOR_MASK 0x03000003 18798c2ecf20Sopenharmony_ci#define FLASH_VENDOR_ATMEL_EEPROM 0x02000000 18808c2ecf20Sopenharmony_ci#define FLASH_VENDOR_ATMEL_FLASH_BUFFERED 0x02000003 18818c2ecf20Sopenharmony_ci#define FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED 0x00000003 18828c2ecf20Sopenharmony_ci#define FLASH_VENDOR_ST 0x03000001 18838c2ecf20Sopenharmony_ci#define FLASH_VENDOR_SAIFUN 0x01000003 18848c2ecf20Sopenharmony_ci#define FLASH_VENDOR_SST_SMALL 0x00000001 18858c2ecf20Sopenharmony_ci#define FLASH_VENDOR_SST_LARGE 0x02000001 18868c2ecf20Sopenharmony_ci#define NVRAM_CFG1_5752VENDOR_MASK 0x03c00003 18878c2ecf20Sopenharmony_ci#define NVRAM_CFG1_5762VENDOR_MASK 0x03e00003 18888c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ATMEL_EEPROM_64KHZ 0x00000000 18898c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ATMEL_EEPROM_376KHZ 0x02000000 18908c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ATMEL_FLASH_BUFFERED 0x02000003 18918c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ST_M45PE10 0x02400000 18928c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ST_M45PE20 0x02400002 18938c2ecf20Sopenharmony_ci#define FLASH_5752VENDOR_ST_M45PE40 0x02400001 18948c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_FLASH_1 0x03400001 18958c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_FLASH_2 0x03400002 18968c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_FLASH_3 0x03400000 18978c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_FLASH_4 0x00000003 18988c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_FLASH_5 0x02000003 18998c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ 0x03c00003 19008c2ecf20Sopenharmony_ci#define FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ 0x03c00002 19018c2ecf20Sopenharmony_ci#define FLASH_5787VENDOR_ATMEL_EEPROM_64KHZ 0x03000003 19028c2ecf20Sopenharmony_ci#define FLASH_5787VENDOR_ATMEL_EEPROM_376KHZ 0x03000002 19038c2ecf20Sopenharmony_ci#define FLASH_5787VENDOR_MICRO_EEPROM_64KHZ 0x03000000 19048c2ecf20Sopenharmony_ci#define FLASH_5787VENDOR_MICRO_EEPROM_376KHZ 0x02000000 19058c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_MDB021D 0x00800003 19068c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_MDB041D 0x00800000 19078c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_MDB081D 0x00800002 19088c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_MDB161D 0x00800001 19098c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_ADB021D 0x00000003 19108c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_ADB041D 0x00000000 19118c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_ADB081D 0x00000002 19128c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ATMEL_ADB161D 0x00000001 19138c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_M_M45PE20 0x02800001 19148c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_M_M45PE40 0x02800000 19158c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_M_M45PE80 0x02800002 19168c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_M_M45PE16 0x02800003 19178c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_A_M45PE20 0x02000001 19188c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_A_M45PE40 0x02000000 19198c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_A_M45PE80 0x02000002 19208c2ecf20Sopenharmony_ci#define FLASH_5761VENDOR_ST_A_M45PE16 0x02000003 19218c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB011D 0x00400000 19228c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB011B 0x03400000 19238c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB021D 0x00400002 19248c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002 19258c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001 19268c2ecf20Sopenharmony_ci#define FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001 19278c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_EEPROM 0x02000001 19288c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_MICRO_EEPROM 0x02000003 19298c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_MDB011D 0x01000001 19308c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_MDB021D 0x01000003 19318c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_M_M25PE10 0x02000000 19328c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_M_M25PE20 0x02000002 19338c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_M_M45PE10 0x00000001 19348c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_M_M45PE20 0x00000003 19358c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_ADB011B 0x01400000 19368c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_ADB021B 0x01400002 19378c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_ADB011D 0x01400001 19388c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_ADB021D 0x01400003 19398c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_A_M25PE10 0x02400000 19408c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_A_M25PE20 0x02400002 19418c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_A_M45PE10 0x02400001 19428c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_A_M45PE20 0x02400003 19438c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000 19448c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_25USPT 0x03400002 19458c2ecf20Sopenharmony_ci#define FLASH_5717VENDOR_ST_45USPT 0x03400001 19468c2ecf20Sopenharmony_ci#define FLASH_5720_EEPROM_HD 0x00000001 19478c2ecf20Sopenharmony_ci#define FLASH_5720_EEPROM_LD 0x00000003 19488c2ecf20Sopenharmony_ci#define FLASH_5762_EEPROM_HD 0x02000001 19498c2ecf20Sopenharmony_ci#define FLASH_5762_EEPROM_LD 0x02000003 19508c2ecf20Sopenharmony_ci#define FLASH_5762_MX25L_100 0x00800000 19518c2ecf20Sopenharmony_ci#define FLASH_5762_MX25L_200 0x00800002 19528c2ecf20Sopenharmony_ci#define FLASH_5762_MX25L_400 0x00800001 19538c2ecf20Sopenharmony_ci#define FLASH_5762_MX25L_800 0x00800003 19548c2ecf20Sopenharmony_ci#define FLASH_5762_MX25L_160_320 0x03800002 19558c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ATMEL_DB011D 0x01000000 19568c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ATMEL_DB021D 0x01000002 19578c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ATMEL_DB041D 0x01000001 19588c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ATMEL_DB081D 0x01000003 19598c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M25PE10 0x02000000 19608c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M25PE20 0x02000002 19618c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M25PE40 0x02000001 19628c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M25PE80 0x02000003 19638c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M45PE10 0x03000000 19648c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M45PE20 0x03000002 19658c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M45PE40 0x03000001 19668c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_M_ST_M45PE80 0x03000003 19678c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB011B 0x01800000 19688c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB021B 0x01800002 19698c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB041B 0x01800001 19708c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB011D 0x01c00000 19718c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB021D 0x01c00002 19728c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB041D 0x01c00001 19738c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ATMEL_DB081D 0x01c00003 19748c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M25PE10 0x02800000 19758c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M25PE20 0x02800002 19768c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M25PE40 0x02800001 19778c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M25PE80 0x02800003 19788c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M45PE10 0x02c00000 19798c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M45PE20 0x02c00002 19808c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M45PE40 0x02c00001 19818c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_A_ST_M45PE80 0x02c00003 19828c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_ATMEL_45USPT 0x03c00000 19838c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_ST_25USPT 0x03c00002 19848c2ecf20Sopenharmony_ci#define FLASH_5720VENDOR_ST_45USPT 0x03c00001 19858c2ecf20Sopenharmony_ci#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000 19868c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_256 0x00000000 19878c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_512 0x10000000 19888c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_1K 0x20000000 19898c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_2K 0x30000000 19908c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_4K 0x40000000 19918c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_264 0x50000000 19928c2ecf20Sopenharmony_ci#define FLASH_5752PAGE_SIZE_528 0x60000000 19938c2ecf20Sopenharmony_ci#define NVRAM_CFG2 0x00007018 19948c2ecf20Sopenharmony_ci#define NVRAM_CFG3 0x0000701c 19958c2ecf20Sopenharmony_ci#define NVRAM_SWARB 0x00007020 19968c2ecf20Sopenharmony_ci#define SWARB_REQ_SET0 0x00000001 19978c2ecf20Sopenharmony_ci#define SWARB_REQ_SET1 0x00000002 19988c2ecf20Sopenharmony_ci#define SWARB_REQ_SET2 0x00000004 19998c2ecf20Sopenharmony_ci#define SWARB_REQ_SET3 0x00000008 20008c2ecf20Sopenharmony_ci#define SWARB_REQ_CLR0 0x00000010 20018c2ecf20Sopenharmony_ci#define SWARB_REQ_CLR1 0x00000020 20028c2ecf20Sopenharmony_ci#define SWARB_REQ_CLR2 0x00000040 20038c2ecf20Sopenharmony_ci#define SWARB_REQ_CLR3 0x00000080 20048c2ecf20Sopenharmony_ci#define SWARB_GNT0 0x00000100 20058c2ecf20Sopenharmony_ci#define SWARB_GNT1 0x00000200 20068c2ecf20Sopenharmony_ci#define SWARB_GNT2 0x00000400 20078c2ecf20Sopenharmony_ci#define SWARB_GNT3 0x00000800 20088c2ecf20Sopenharmony_ci#define SWARB_REQ0 0x00001000 20098c2ecf20Sopenharmony_ci#define SWARB_REQ1 0x00002000 20108c2ecf20Sopenharmony_ci#define SWARB_REQ2 0x00004000 20118c2ecf20Sopenharmony_ci#define SWARB_REQ3 0x00008000 20128c2ecf20Sopenharmony_ci#define NVRAM_ACCESS 0x00007024 20138c2ecf20Sopenharmony_ci#define ACCESS_ENABLE 0x00000001 20148c2ecf20Sopenharmony_ci#define ACCESS_WR_ENABLE 0x00000002 20158c2ecf20Sopenharmony_ci#define NVRAM_WRITE1 0x00007028 20168c2ecf20Sopenharmony_ci/* 0x702c unused */ 20178c2ecf20Sopenharmony_ci 20188c2ecf20Sopenharmony_ci#define NVRAM_ADDR_LOCKOUT 0x00007030 20198c2ecf20Sopenharmony_ci#define NVRAM_AUTOSENSE_STATUS 0x00007038 20208c2ecf20Sopenharmony_ci#define AUTOSENSE_DEVID 0x00000010 20218c2ecf20Sopenharmony_ci#define AUTOSENSE_DEVID_MASK 0x00000007 20228c2ecf20Sopenharmony_ci#define AUTOSENSE_SIZE_IN_MB 17 20238c2ecf20Sopenharmony_ci/* 0x703c --> 0x7500 unused */ 20248c2ecf20Sopenharmony_ci 20258c2ecf20Sopenharmony_ci#define OTP_MODE 0x00007500 20268c2ecf20Sopenharmony_ci#define OTP_MODE_OTP_THRU_GRC 0x00000001 20278c2ecf20Sopenharmony_ci#define OTP_CTRL 0x00007504 20288c2ecf20Sopenharmony_ci#define OTP_CTRL_OTP_PROG_ENABLE 0x00200000 20298c2ecf20Sopenharmony_ci#define OTP_CTRL_OTP_CMD_READ 0x00000000 20308c2ecf20Sopenharmony_ci#define OTP_CTRL_OTP_CMD_INIT 0x00000008 20318c2ecf20Sopenharmony_ci#define OTP_CTRL_OTP_CMD_START 0x00000001 20328c2ecf20Sopenharmony_ci#define OTP_STATUS 0x00007508 20338c2ecf20Sopenharmony_ci#define OTP_STATUS_CMD_DONE 0x00000001 20348c2ecf20Sopenharmony_ci#define OTP_ADDRESS 0x0000750c 20358c2ecf20Sopenharmony_ci#define OTP_ADDRESS_MAGIC1 0x000000a0 20368c2ecf20Sopenharmony_ci#define OTP_ADDRESS_MAGIC2 0x00000080 20378c2ecf20Sopenharmony_ci/* 0x7510 unused */ 20388c2ecf20Sopenharmony_ci 20398c2ecf20Sopenharmony_ci#define OTP_READ_DATA 0x00007514 20408c2ecf20Sopenharmony_ci/* 0x7518 --> 0x7c04 unused */ 20418c2ecf20Sopenharmony_ci 20428c2ecf20Sopenharmony_ci#define PCIE_TRANSACTION_CFG 0x00007c04 20438c2ecf20Sopenharmony_ci#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 20448c2ecf20Sopenharmony_ci#define PCIE_TRANS_CFG_LOM 0x00000020 20458c2ecf20Sopenharmony_ci/* 0x7c08 --> 0x7d28 unused */ 20468c2ecf20Sopenharmony_ci 20478c2ecf20Sopenharmony_ci#define PCIE_PWR_MGMT_THRESH 0x00007d28 20488c2ecf20Sopenharmony_ci#define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 20498c2ecf20Sopenharmony_ci#define PCIE_PWR_MGMT_L1_THRESH_4MS 0x0000ff00 20508c2ecf20Sopenharmony_ci#define PCIE_PWR_MGMT_EXT_ASPM_TMR_EN 0x01000000 20518c2ecf20Sopenharmony_ci/* 0x7d2c --> 0x7d54 unused */ 20528c2ecf20Sopenharmony_ci 20538c2ecf20Sopenharmony_ci#define TG3_PCIE_LNKCTL 0x00007d54 20548c2ecf20Sopenharmony_ci#define TG3_PCIE_LNKCTL_L1_PLL_PD_EN 0x00000008 20558c2ecf20Sopenharmony_ci#define TG3_PCIE_LNKCTL_L1_PLL_PD_DIS 0x00000080 20568c2ecf20Sopenharmony_ci/* 0x7d58 --> 0x7e70 unused */ 20578c2ecf20Sopenharmony_ci 20588c2ecf20Sopenharmony_ci#define TG3_PCIE_PHY_TSTCTL 0x00007e2c 20598c2ecf20Sopenharmony_ci#define TG3_PCIE_PHY_TSTCTL_PCIE10 0x00000040 20608c2ecf20Sopenharmony_ci#define TG3_PCIE_PHY_TSTCTL_PSCRAM 0x00000020 20618c2ecf20Sopenharmony_ci 20628c2ecf20Sopenharmony_ci#define TG3_PCIE_EIDLE_DELAY 0x00007e70 20638c2ecf20Sopenharmony_ci#define TG3_PCIE_EIDLE_DELAY_MASK 0x0000001f 20648c2ecf20Sopenharmony_ci#define TG3_PCIE_EIDLE_DELAY_13_CLKS 0x0000000c 20658c2ecf20Sopenharmony_ci/* 0x7e74 --> 0x8000 unused */ 20668c2ecf20Sopenharmony_ci 20678c2ecf20Sopenharmony_ci 20688c2ecf20Sopenharmony_ci/* Alternate PCIE definitions */ 20698c2ecf20Sopenharmony_ci#define TG3_PCIE_TLDLPL_PORT 0x00007c00 20708c2ecf20Sopenharmony_ci#define TG3_PCIE_DL_LO_FTSMAX 0x0000000c 20718c2ecf20Sopenharmony_ci#define TG3_PCIE_DL_LO_FTSMAX_MSK 0x000000ff 20728c2ecf20Sopenharmony_ci#define TG3_PCIE_DL_LO_FTSMAX_VAL 0x0000002c 20738c2ecf20Sopenharmony_ci#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004 20748c2ecf20Sopenharmony_ci#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000 20758c2ecf20Sopenharmony_ci#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014 20768c2ecf20Sopenharmony_ci#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000 20778c2ecf20Sopenharmony_ci 20788c2ecf20Sopenharmony_ci#define TG3_REG_BLK_SIZE 0x00008000 20798c2ecf20Sopenharmony_ci 20808c2ecf20Sopenharmony_ci/* OTP bit definitions */ 20818c2ecf20Sopenharmony_ci#define TG3_OTP_AGCTGT_MASK 0x000000e0 20828c2ecf20Sopenharmony_ci#define TG3_OTP_AGCTGT_SHIFT 1 20838c2ecf20Sopenharmony_ci#define TG3_OTP_HPFFLTR_MASK 0x00000300 20848c2ecf20Sopenharmony_ci#define TG3_OTP_HPFFLTR_SHIFT 1 20858c2ecf20Sopenharmony_ci#define TG3_OTP_HPFOVER_MASK 0x00000400 20868c2ecf20Sopenharmony_ci#define TG3_OTP_HPFOVER_SHIFT 1 20878c2ecf20Sopenharmony_ci#define TG3_OTP_LPFDIS_MASK 0x00000800 20888c2ecf20Sopenharmony_ci#define TG3_OTP_LPFDIS_SHIFT 11 20898c2ecf20Sopenharmony_ci#define TG3_OTP_VDAC_MASK 0xff000000 20908c2ecf20Sopenharmony_ci#define TG3_OTP_VDAC_SHIFT 24 20918c2ecf20Sopenharmony_ci#define TG3_OTP_10BTAMP_MASK 0x0000f000 20928c2ecf20Sopenharmony_ci#define TG3_OTP_10BTAMP_SHIFT 8 20938c2ecf20Sopenharmony_ci#define TG3_OTP_ROFF_MASK 0x00e00000 20948c2ecf20Sopenharmony_ci#define TG3_OTP_ROFF_SHIFT 11 20958c2ecf20Sopenharmony_ci#define TG3_OTP_RCOFF_MASK 0x001c0000 20968c2ecf20Sopenharmony_ci#define TG3_OTP_RCOFF_SHIFT 16 20978c2ecf20Sopenharmony_ci 20988c2ecf20Sopenharmony_ci#define TG3_OTP_DEFAULT 0x286c1640 20998c2ecf20Sopenharmony_ci 21008c2ecf20Sopenharmony_ci 21018c2ecf20Sopenharmony_ci/* Hardware Legacy NVRAM layout */ 21028c2ecf20Sopenharmony_ci#define TG3_NVM_VPD_OFF 0x100 21038c2ecf20Sopenharmony_ci#define TG3_NVM_VPD_LEN 256 21048c2ecf20Sopenharmony_ci 21058c2ecf20Sopenharmony_ci/* Hardware Selfboot NVRAM layout */ 21068c2ecf20Sopenharmony_ci#define TG3_NVM_HWSB_CFG1 0x00000004 21078c2ecf20Sopenharmony_ci#define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000 21088c2ecf20Sopenharmony_ci#define TG3_NVM_HWSB_CFG1_MAJSFT 27 21098c2ecf20Sopenharmony_ci#define TG3_NVM_HWSB_CFG1_MINMSK 0x07c00000 21108c2ecf20Sopenharmony_ci#define TG3_NVM_HWSB_CFG1_MINSFT 22 21118c2ecf20Sopenharmony_ci 21128c2ecf20Sopenharmony_ci#define TG3_EEPROM_MAGIC 0x669955aa 21138c2ecf20Sopenharmony_ci#define TG3_EEPROM_MAGIC_FW 0xa5000000 21148c2ecf20Sopenharmony_ci#define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 21158c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_FORMAT_MASK 0x00e00000 21168c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_FORMAT_1 0x00200000 21178c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_MASK 0x001f0000 21188c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_0 0x00000000 21198c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_2 0x00020000 21208c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_3 0x00030000 21218c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_4 0x00040000 21228c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_5 0x00050000 21238c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_REVISION_6 0x00060000 21248c2ecf20Sopenharmony_ci#define TG3_EEPROM_MAGIC_HW 0xabcd 21258c2ecf20Sopenharmony_ci#define TG3_EEPROM_MAGIC_HW_MSK 0xffff 21268c2ecf20Sopenharmony_ci 21278c2ecf20Sopenharmony_ci#define TG3_NVM_DIR_START 0x18 21288c2ecf20Sopenharmony_ci#define TG3_NVM_DIR_END 0x78 21298c2ecf20Sopenharmony_ci#define TG3_NVM_DIRENT_SIZE 0xc 21308c2ecf20Sopenharmony_ci#define TG3_NVM_DIRTYPE_SHIFT 24 21318c2ecf20Sopenharmony_ci#define TG3_NVM_DIRTYPE_LENMSK 0x003fffff 21328c2ecf20Sopenharmony_ci#define TG3_NVM_DIRTYPE_ASFINI 1 21338c2ecf20Sopenharmony_ci#define TG3_NVM_DIRTYPE_EXTVPD 20 21348c2ecf20Sopenharmony_ci#define TG3_NVM_PTREV_BCVER 0x94 21358c2ecf20Sopenharmony_ci#define TG3_NVM_BCVER_MAJMSK 0x0000ff00 21368c2ecf20Sopenharmony_ci#define TG3_NVM_BCVER_MAJSFT 8 21378c2ecf20Sopenharmony_ci#define TG3_NVM_BCVER_MINMSK 0x000000ff 21388c2ecf20Sopenharmony_ci 21398c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R0_EDH_OFF 0x10 21408c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R2_EDH_OFF 0x14 21418c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R2_MBA_OFF 0x10 21428c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R3_EDH_OFF 0x18 21438c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R4_EDH_OFF 0x1c 21448c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R5_EDH_OFF 0x20 21458c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R6_EDH_OFF 0x4c 21468c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_EDH_MAJ_MASK 0x00000700 21478c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_EDH_MAJ_SHFT 8 21488c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_EDH_MIN_MASK 0x000000ff 21498c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_EDH_BLD_MASK 0x0000f800 21508c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_EDH_BLD_SHFT 11 21518c2ecf20Sopenharmony_ci 21528c2ecf20Sopenharmony_ci 21538c2ecf20Sopenharmony_ci/* 32K Window into NIC internal memory */ 21548c2ecf20Sopenharmony_ci#define NIC_SRAM_WIN_BASE 0x00008000 21558c2ecf20Sopenharmony_ci 21568c2ecf20Sopenharmony_ci/* Offsets into first 32k of NIC internal memory. */ 21578c2ecf20Sopenharmony_ci#define NIC_SRAM_PAGE_ZERO 0x00000000 21588c2ecf20Sopenharmony_ci#define NIC_SRAM_SEND_RCB 0x00000100 /* 16 * TG3_BDINFO_... */ 21598c2ecf20Sopenharmony_ci#define NIC_SRAM_RCV_RET_RCB 0x00000200 /* 16 * TG3_BDINFO_... */ 21608c2ecf20Sopenharmony_ci#define NIC_SRAM_STATS_BLK 0x00000300 21618c2ecf20Sopenharmony_ci#define NIC_SRAM_STATUS_BLK 0x00000b00 21628c2ecf20Sopenharmony_ci 21638c2ecf20Sopenharmony_ci#define NIC_SRAM_FIRMWARE_MBOX 0x00000b50 21648c2ecf20Sopenharmony_ci#define NIC_SRAM_FIRMWARE_MBOX_MAGIC1 0x4B657654 21658c2ecf20Sopenharmony_ci#define NIC_SRAM_FIRMWARE_MBOX_MAGIC2 0x4861764b /* !dma on linkchg */ 21668c2ecf20Sopenharmony_ci 21678c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_SIG 0x00000b54 21688c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_SIG_MAGIC 0x4b657654 /* ascii for 'KevT' */ 21698c2ecf20Sopenharmony_ci 21708c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG 0x00000b58 21718c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_LED_MODE_MASK 0x0000000c 21728c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_LED_MODE_MAC 0x00000000 21738c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_LED_MODE_PHY_1 0x00000004 21748c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_LED_MODE_PHY_2 0x00000008 21758c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_PHY_TYPE_MASK 0x00000030 21768c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_PHY_TYPE_UNKNOWN 0x00000000 21778c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_PHY_TYPE_COPPER 0x00000010 21788c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER 0x00000020 21798c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_WOL_ENABLE 0x00000040 21808c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_ASF_ENABLE 0x00000080 21818c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_EEPROM_WP 0x00000100 21828c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_MINI_PCI 0x00001000 21838c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_FIBER_WOL 0x00004000 21848c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_NO_GPIO2 0x00100000 21858c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_APE_ENABLE 0x00200000 21868c2ecf20Sopenharmony_ci 21878c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_VER 0x00000b5c 21888c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_VER_SHIFT 16 21898c2ecf20Sopenharmony_ci 21908c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_PHY_ID 0x00000b74 21918c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_PHY_ID1_MASK 0xffff0000 21928c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_PHY_ID2_MASK 0x0000ffff 21938c2ecf20Sopenharmony_ci 21948c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_CMD_MBOX 0x00000b78 21958c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_ALIVE 0x00000001 21968c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_PAUSE_FW 0x00000002 21978c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_IPV4ADDR_CHG 0x00000003 21988c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_IPV6ADDR_CHG 0x00000004 21998c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_FIX_DMAR 0x00000005 22008c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_FIX_DMAW 0x00000006 22018c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_LINK_UPDATE 0x0000000c 22028c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_ALIVE2 0x0000000d 22038c2ecf20Sopenharmony_ci#define FWCMD_NICDRV_ALIVE3 0x0000000e 22048c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c 22058c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_CMD_DATA_MBOX 0x00000b80 22068c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_ASF_STATUS_MBOX 0x00000c00 22078c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_DRV_STATE_MBOX 0x00000c04 22088c2ecf20Sopenharmony_ci#define DRV_STATE_START 0x00000001 22098c2ecf20Sopenharmony_ci#define DRV_STATE_START_DONE 0x80000001 22108c2ecf20Sopenharmony_ci#define DRV_STATE_UNLOAD 0x00000002 22118c2ecf20Sopenharmony_ci#define DRV_STATE_UNLOAD_DONE 0x80000002 22128c2ecf20Sopenharmony_ci#define DRV_STATE_WOL 0x00000003 22138c2ecf20Sopenharmony_ci#define DRV_STATE_SUSPEND 0x00000004 22148c2ecf20Sopenharmony_ci 22158c2ecf20Sopenharmony_ci#define NIC_SRAM_FW_RESET_TYPE_MBOX 0x00000c08 22168c2ecf20Sopenharmony_ci 22178c2ecf20Sopenharmony_ci#define NIC_SRAM_MAC_ADDR_HIGH_MBOX 0x00000c14 22188c2ecf20Sopenharmony_ci#define NIC_SRAM_MAC_ADDR_LOW_MBOX 0x00000c18 22198c2ecf20Sopenharmony_ci 22208c2ecf20Sopenharmony_ci#define NIC_SRAM_WOL_MBOX 0x00000d30 22218c2ecf20Sopenharmony_ci#define WOL_SIGNATURE 0x474c0000 22228c2ecf20Sopenharmony_ci#define WOL_DRV_STATE_SHUTDOWN 0x00000001 22238c2ecf20Sopenharmony_ci#define WOL_DRV_WOL 0x00000002 22248c2ecf20Sopenharmony_ci#define WOL_SET_MAGIC_PKT 0x00000004 22258c2ecf20Sopenharmony_ci 22268c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_2 0x00000d38 22278c2ecf20Sopenharmony_ci 22288c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_2_APD_EN 0x00004000 22298c2ecf20Sopenharmony_ci#define SHASTA_EXT_LED_MODE_MASK 0x00018000 22308c2ecf20Sopenharmony_ci#define SHASTA_EXT_LED_LEGACY 0x00000000 22318c2ecf20Sopenharmony_ci#define SHASTA_EXT_LED_SHARED 0x00008000 22328c2ecf20Sopenharmony_ci#define SHASTA_EXT_LED_MAC 0x00010000 22338c2ecf20Sopenharmony_ci#define SHASTA_EXT_LED_COMBO 0x00018000 22348c2ecf20Sopenharmony_ci 22358c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_3 0x00000d3c 22368c2ecf20Sopenharmony_ci#define NIC_SRAM_ASPM_DEBOUNCE 0x00000002 22378c2ecf20Sopenharmony_ci#define NIC_SRAM_LNK_FLAP_AVOID 0x00400000 22388c2ecf20Sopenharmony_ci#define NIC_SRAM_1G_ON_VAUX_OK 0x00800000 22398c2ecf20Sopenharmony_ci 22408c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_4 0x00000d60 22418c2ecf20Sopenharmony_ci#define NIC_SRAM_GMII_MODE 0x00000002 22428c2ecf20Sopenharmony_ci#define NIC_SRAM_RGMII_INBAND_DISABLE 0x00000004 22438c2ecf20Sopenharmony_ci#define NIC_SRAM_RGMII_EXT_IBND_RX_EN 0x00000008 22448c2ecf20Sopenharmony_ci#define NIC_SRAM_RGMII_EXT_IBND_TX_EN 0x00000010 22458c2ecf20Sopenharmony_ci 22468c2ecf20Sopenharmony_ci#define NIC_SRAM_CPMU_STATUS 0x00000e00 22478c2ecf20Sopenharmony_ci#define NIC_SRAM_CPMUSTAT_SIG 0x0000362c 22488c2ecf20Sopenharmony_ci#define NIC_SRAM_CPMUSTAT_SIG_MSK 0x0000ffff 22498c2ecf20Sopenharmony_ci 22508c2ecf20Sopenharmony_ci#define NIC_SRAM_DATA_CFG_5 0x00000e0c 22518c2ecf20Sopenharmony_ci#define NIC_SRAM_DISABLE_1G_HALF_ADV 0x00000002 22528c2ecf20Sopenharmony_ci 22538c2ecf20Sopenharmony_ci#define NIC_SRAM_RX_MINI_BUFFER_DESC 0x00001000 22548c2ecf20Sopenharmony_ci 22558c2ecf20Sopenharmony_ci#define NIC_SRAM_DMA_DESC_POOL_BASE 0x00002000 22568c2ecf20Sopenharmony_ci#define NIC_SRAM_DMA_DESC_POOL_SIZE 0x00002000 22578c2ecf20Sopenharmony_ci#define NIC_SRAM_TX_BUFFER_DESC 0x00004000 /* 512 entries */ 22588c2ecf20Sopenharmony_ci#define NIC_SRAM_RX_BUFFER_DESC 0x00006000 /* 256 entries */ 22598c2ecf20Sopenharmony_ci#define NIC_SRAM_RX_JUMBO_BUFFER_DESC 0x00007000 /* 256 entries */ 22608c2ecf20Sopenharmony_ci#define NIC_SRAM_MBUF_POOL_BASE 0x00008000 22618c2ecf20Sopenharmony_ci#define NIC_SRAM_MBUF_POOL_SIZE96 0x00018000 22628c2ecf20Sopenharmony_ci#define NIC_SRAM_MBUF_POOL_SIZE64 0x00010000 22638c2ecf20Sopenharmony_ci#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000 22648c2ecf20Sopenharmony_ci#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000 22658c2ecf20Sopenharmony_ci 22668c2ecf20Sopenharmony_ci#define TG3_SRAM_RXCPU_SCRATCH_BASE_57766 0x00030000 22678c2ecf20Sopenharmony_ci#define TG3_SRAM_RXCPU_SCRATCH_SIZE_57766 0x00010000 22688c2ecf20Sopenharmony_ci#define TG3_57766_FW_BASE_ADDR 0x00030000 22698c2ecf20Sopenharmony_ci#define TG3_57766_FW_HANDSHAKE 0x0003fccc 22708c2ecf20Sopenharmony_ci#define TG3_SBROM_IN_SERVICE_LOOP 0x51 22718c2ecf20Sopenharmony_ci 22728c2ecf20Sopenharmony_ci#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5700 128 22738c2ecf20Sopenharmony_ci#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5755 64 22748c2ecf20Sopenharmony_ci#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5906 32 22758c2ecf20Sopenharmony_ci 22768c2ecf20Sopenharmony_ci#define TG3_SRAM_RX_JMB_BDCACHE_SIZE_5700 64 22778c2ecf20Sopenharmony_ci#define TG3_SRAM_RX_JMB_BDCACHE_SIZE_5717 16 22788c2ecf20Sopenharmony_ci 22798c2ecf20Sopenharmony_ci 22808c2ecf20Sopenharmony_ci/* Currently this is fixed. */ 22818c2ecf20Sopenharmony_ci#define TG3_PHY_MII_ADDR 0x01 22828c2ecf20Sopenharmony_ci 22838c2ecf20Sopenharmony_ci 22848c2ecf20Sopenharmony_ci/*** Tigon3 specific PHY MII registers. ***/ 22858c2ecf20Sopenharmony_ci#define MII_TG3_MMD_CTRL 0x0d /* MMD Access Control register */ 22868c2ecf20Sopenharmony_ci#define MII_TG3_MMD_CTRL_DATA_NOINC 0x4000 22878c2ecf20Sopenharmony_ci#define MII_TG3_MMD_ADDRESS 0x0e /* MMD Address Data register */ 22888c2ecf20Sopenharmony_ci 22898c2ecf20Sopenharmony_ci#define MII_TG3_EXT_CTRL 0x10 /* Extended control register */ 22908c2ecf20Sopenharmony_ci#define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001 22918c2ecf20Sopenharmony_ci#define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002 22928c2ecf20Sopenharmony_ci#define MII_TG3_EXT_CTRL_FORCE_LED_OFF 0x0008 22938c2ecf20Sopenharmony_ci#define MII_TG3_EXT_CTRL_TBI 0x8000 22948c2ecf20Sopenharmony_ci 22958c2ecf20Sopenharmony_ci#define MII_TG3_EXT_STAT 0x11 /* Extended status register */ 22968c2ecf20Sopenharmony_ci#define MII_TG3_EXT_STAT_MDIX 0x2000 22978c2ecf20Sopenharmony_ci#define MII_TG3_EXT_STAT_LPASS 0x0100 22988c2ecf20Sopenharmony_ci 22998c2ecf20Sopenharmony_ci#define MII_TG3_RXR_COUNTERS 0x14 /* Local/Remote Receiver Counts */ 23008c2ecf20Sopenharmony_ci#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ 23018c2ecf20Sopenharmony_ci#define MII_TG3_DSP_CONTROL 0x16 /* DSP control register */ 23028c2ecf20Sopenharmony_ci#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ 23038c2ecf20Sopenharmony_ci 23048c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP1 0x0001 23058c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007 23068c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP26 0x001a 23078c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP26_ALNOKO 0x0001 23088c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP26_RMRXSTO 0x0002 23098c2ecf20Sopenharmony_ci#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004 23108c2ecf20Sopenharmony_ci#define MII_TG3_DSP_AADJ1CH0 0x001f 23118c2ecf20Sopenharmony_ci#define MII_TG3_DSP_CH34TP2 0x4022 23128c2ecf20Sopenharmony_ci#define MII_TG3_DSP_CH34TP2_HIBW01 0x01ff 23138c2ecf20Sopenharmony_ci#define MII_TG3_DSP_AADJ1CH3 0x601f 23148c2ecf20Sopenharmony_ci#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002 23158c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01 23168c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP8 0x0f08 23178c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP8_REJ2MHz 0x0001 23188c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP8_AEDW 0x0200 23198c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP75 0x0f75 23208c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP96 0x0f96 23218c2ecf20Sopenharmony_ci#define MII_TG3_DSP_EXP97 0x0f97 23228c2ecf20Sopenharmony_ci 23238c2ecf20Sopenharmony_ci#define MII_TG3_AUX_CTRL 0x18 /* auxiliary control register */ 23248c2ecf20Sopenharmony_ci 23258c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000 23268c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400 23278c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800 23288c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_ACTL_EXTPKTLEN 0x4000 23298c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_ACTL_EXTLOOPBK 0x8000 23308c2ecf20Sopenharmony_ci 23318c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_SHDWSEL_PWRCTL 0x0002 23328c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_PCTL_WOL_EN 0x0008 23338c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010 23348c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE 0x0020 23358c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_PCTL_CL_AB_TXDAC 0x0040 23368c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_PCTL_VREG_11V 0x0180 23378c2ecf20Sopenharmony_ci 23388c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_SHDWSEL_MISCTEST 0x0004 23398c2ecf20Sopenharmony_ci 23408c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 23418c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_MISC_WIRESPD_EN 0x0010 23428c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 23438c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_MISC_RDSEL_SHIFT 12 23448c2ecf20Sopenharmony_ci#define MII_TG3_AUXCTL_MISC_WREN 0x8000 23458c2ecf20Sopenharmony_ci 23468c2ecf20Sopenharmony_ci 23478c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT 0x19 /* auxiliary status register */ 23488c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_LPASS 0x0004 23498c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_SPDMASK 0x0700 23508c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_10HALF 0x0100 23518c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_10FULL 0x0200 23528c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_100HALF 0x0300 23538c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_100_4 0x0400 23548c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_100FULL 0x0500 23558c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_1000HALF 0x0600 23568c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_1000FULL 0x0700 23578c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_100 0x0008 23588c2ecf20Sopenharmony_ci#define MII_TG3_AUX_STAT_FULL 0x0001 23598c2ecf20Sopenharmony_ci 23608c2ecf20Sopenharmony_ci#define MII_TG3_ISTAT 0x1a /* IRQ status register */ 23618c2ecf20Sopenharmony_ci#define MII_TG3_IMASK 0x1b /* IRQ mask register */ 23628c2ecf20Sopenharmony_ci 23638c2ecf20Sopenharmony_ci/* ISTAT/IMASK event bits */ 23648c2ecf20Sopenharmony_ci#define MII_TG3_INT_LINKCHG 0x0002 23658c2ecf20Sopenharmony_ci#define MII_TG3_INT_SPEEDCHG 0x0004 23668c2ecf20Sopenharmony_ci#define MII_TG3_INT_DUPLEXCHG 0x0008 23678c2ecf20Sopenharmony_ci#define MII_TG3_INT_ANEG_PAGE_RX 0x0400 23688c2ecf20Sopenharmony_ci 23698c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW 0x1c 23708c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_WREN 0x8000 23718c2ecf20Sopenharmony_ci 23728c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_APD_WKTM_84MS 0x0001 23738c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_APD_ENABLE 0x0020 23748c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_APD_SEL 0x2800 23758c2ecf20Sopenharmony_ci 23768c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_C125OE 0x0001 23778c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_DLLAPD 0x0002 23788c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_SDTL 0x0004 23798c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_DLPTLM 0x0008 23808c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_LPED 0x0010 23818c2ecf20Sopenharmony_ci#define MII_TG3_MISC_SHDW_SCR5_SEL 0x1400 23828c2ecf20Sopenharmony_ci 23838c2ecf20Sopenharmony_ci#define MII_TG3_TEST1 0x1e 23848c2ecf20Sopenharmony_ci#define MII_TG3_TEST1_TRIM_EN 0x0010 23858c2ecf20Sopenharmony_ci#define MII_TG3_TEST1_CRC_EN 0x8000 23868c2ecf20Sopenharmony_ci 23878c2ecf20Sopenharmony_ci/* Clause 45 expansion registers */ 23888c2ecf20Sopenharmony_ci#define TG3_CL45_D7_EEERES_STAT 0x803e 23898c2ecf20Sopenharmony_ci#define TG3_CL45_D7_EEERES_STAT_LP_100TX 0x0002 23908c2ecf20Sopenharmony_ci#define TG3_CL45_D7_EEERES_STAT_LP_1000T 0x0004 23918c2ecf20Sopenharmony_ci 23928c2ecf20Sopenharmony_ci 23938c2ecf20Sopenharmony_ci/* Fast Ethernet Tranceiver definitions */ 23948c2ecf20Sopenharmony_ci#define MII_TG3_FET_PTEST 0x17 23958c2ecf20Sopenharmony_ci#define MII_TG3_FET_PTEST_TRIM_SEL 0x0010 23968c2ecf20Sopenharmony_ci#define MII_TG3_FET_PTEST_TRIM_2 0x0002 23978c2ecf20Sopenharmony_ci#define MII_TG3_FET_PTEST_FRC_TX_LINK 0x1000 23988c2ecf20Sopenharmony_ci#define MII_TG3_FET_PTEST_FRC_TX_LOCK 0x0800 23998c2ecf20Sopenharmony_ci 24008c2ecf20Sopenharmony_ci#define MII_TG3_FET_GEN_STAT 0x1c 24018c2ecf20Sopenharmony_ci#define MII_TG3_FET_GEN_STAT_MDIXSTAT 0x2000 24028c2ecf20Sopenharmony_ci 24038c2ecf20Sopenharmony_ci#define MII_TG3_FET_TEST 0x1f 24048c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHADOW_EN 0x0080 24058c2ecf20Sopenharmony_ci 24068c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_MISCCTRL 0x10 24078c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_MISCCTRL_MDIX 0x4000 24088c2ecf20Sopenharmony_ci 24098c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_AUXMODE4 0x1a 24108c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_AUXMODE4_SBPD 0x0008 24118c2ecf20Sopenharmony_ci 24128c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_AUXSTAT2 0x1b 24138c2ecf20Sopenharmony_ci#define MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020 24148c2ecf20Sopenharmony_ci 24158c2ecf20Sopenharmony_ci/* Serdes PHY Register Definitions */ 24168c2ecf20Sopenharmony_ci#define SERDES_TG3_1000X_STATUS 0x14 24178c2ecf20Sopenharmony_ci#define SERDES_TG3_SGMII_MODE 0x0001 24188c2ecf20Sopenharmony_ci#define SERDES_TG3_LINK_UP 0x0002 24198c2ecf20Sopenharmony_ci#define SERDES_TG3_FULL_DUPLEX 0x0004 24208c2ecf20Sopenharmony_ci#define SERDES_TG3_SPEED_100 0x0008 24218c2ecf20Sopenharmony_ci#define SERDES_TG3_SPEED_1000 0x0010 24228c2ecf20Sopenharmony_ci 24238c2ecf20Sopenharmony_ci/* APE registers. Accessible through BAR1 */ 24248c2ecf20Sopenharmony_ci#define TG3_APE_GPIO_MSG 0x0008 24258c2ecf20Sopenharmony_ci#define TG3_APE_GPIO_MSG_SHIFT 4 24268c2ecf20Sopenharmony_ci#define TG3_APE_EVENT 0x000c 24278c2ecf20Sopenharmony_ci#define APE_EVENT_1 0x00000001 24288c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_REQ 0x002c 24298c2ecf20Sopenharmony_ci#define APE_LOCK_REQ_DRIVER 0x00001000 24308c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_GRANT 0x004c 24318c2ecf20Sopenharmony_ci#define APE_LOCK_GRANT_DRIVER 0x00001000 24328c2ecf20Sopenharmony_ci#define TG3_APE_OTP_CTRL 0x00e8 24338c2ecf20Sopenharmony_ci#define APE_OTP_CTRL_PROG_EN 0x200000 24348c2ecf20Sopenharmony_ci#define APE_OTP_CTRL_CMD_RD 0x000000 24358c2ecf20Sopenharmony_ci#define APE_OTP_CTRL_START 0x000001 24368c2ecf20Sopenharmony_ci#define TG3_APE_OTP_STATUS 0x00ec 24378c2ecf20Sopenharmony_ci#define APE_OTP_STATUS_CMD_DONE 0x000001 24388c2ecf20Sopenharmony_ci#define TG3_APE_OTP_ADDR 0x00f0 24398c2ecf20Sopenharmony_ci#define APE_OTP_ADDR_CPU_ENABLE 0x80000000 24408c2ecf20Sopenharmony_ci#define TG3_APE_OTP_RD_DATA 0x00f8 24418c2ecf20Sopenharmony_ci 24428c2ecf20Sopenharmony_ci#define OTP_ADDRESS_MAGIC0 0x00000050 24438c2ecf20Sopenharmony_ci#define TG3_OTP_MAGIC0_VALID(val) \ 24448c2ecf20Sopenharmony_ci ((((val) & 0xf0000000) == 0xa0000000) ||\ 24458c2ecf20Sopenharmony_ci (((val) & 0x0f000000) == 0x0a000000)) 24468c2ecf20Sopenharmony_ci 24478c2ecf20Sopenharmony_ci/* APE shared memory. Accessible through BAR1 */ 24488c2ecf20Sopenharmony_ci#define TG3_APE_SHMEM_BASE 0x4000 24498c2ecf20Sopenharmony_ci#define TG3_APE_SEG_SIG 0x4000 24508c2ecf20Sopenharmony_ci#define APE_SEG_SIG_MAGIC 0x41504521 24518c2ecf20Sopenharmony_ci#define TG3_APE_FW_STATUS 0x400c 24528c2ecf20Sopenharmony_ci#define APE_FW_STATUS_READY 0x00000100 24538c2ecf20Sopenharmony_ci#define TG3_APE_FW_FEATURES 0x4010 24548c2ecf20Sopenharmony_ci#define TG3_APE_FW_FEATURE_NCSI 0x00000002 24558c2ecf20Sopenharmony_ci#define TG3_APE_FW_VERSION 0x4018 24568c2ecf20Sopenharmony_ci#define APE_FW_VERSION_MAJMSK 0xff000000 24578c2ecf20Sopenharmony_ci#define APE_FW_VERSION_MAJSFT 24 24588c2ecf20Sopenharmony_ci#define APE_FW_VERSION_MINMSK 0x00ff0000 24598c2ecf20Sopenharmony_ci#define APE_FW_VERSION_MINSFT 16 24608c2ecf20Sopenharmony_ci#define APE_FW_VERSION_REVMSK 0x0000ff00 24618c2ecf20Sopenharmony_ci#define APE_FW_VERSION_REVSFT 8 24628c2ecf20Sopenharmony_ci#define APE_FW_VERSION_BLDMSK 0x000000ff 24638c2ecf20Sopenharmony_ci#define TG3_APE_SEG_MSG_BUF_OFF 0x401c 24648c2ecf20Sopenharmony_ci#define TG3_APE_SEG_MSG_BUF_LEN 0x4020 24658c2ecf20Sopenharmony_ci#define TG3_APE_HOST_SEG_SIG 0x4200 24668c2ecf20Sopenharmony_ci#define APE_HOST_SEG_SIG_MAGIC 0x484f5354 24678c2ecf20Sopenharmony_ci#define TG3_APE_HOST_SEG_LEN 0x4204 24688c2ecf20Sopenharmony_ci#define APE_HOST_SEG_LEN_MAGIC 0x00000020 24698c2ecf20Sopenharmony_ci#define TG3_APE_HOST_INIT_COUNT 0x4208 24708c2ecf20Sopenharmony_ci#define TG3_APE_HOST_DRIVER_ID 0x420c 24718c2ecf20Sopenharmony_ci#define APE_HOST_DRIVER_ID_LINUX 0xf0000000 24728c2ecf20Sopenharmony_ci#define APE_HOST_DRIVER_ID_MAGIC(maj, min) \ 24738c2ecf20Sopenharmony_ci (APE_HOST_DRIVER_ID_LINUX | (maj & 0xff) << 16 | (min & 0xff) << 8) 24748c2ecf20Sopenharmony_ci#define TG3_APE_HOST_BEHAVIOR 0x4210 24758c2ecf20Sopenharmony_ci#define APE_HOST_BEHAV_NO_PHYLOCK 0x00000001 24768c2ecf20Sopenharmony_ci#define TG3_APE_HOST_HEARTBEAT_INT_MS 0x4214 24778c2ecf20Sopenharmony_ci#define APE_HOST_HEARTBEAT_INT_DISABLE 0 24788c2ecf20Sopenharmony_ci#define APE_HOST_HEARTBEAT_INT_5SEC 5000 24798c2ecf20Sopenharmony_ci#define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218 24808c2ecf20Sopenharmony_ci#define TG3_APE_HOST_DRVR_STATE 0x421c 24818c2ecf20Sopenharmony_ci#define TG3_APE_HOST_DRVR_STATE_START 0x00000001 24828c2ecf20Sopenharmony_ci#define TG3_APE_HOST_DRVR_STATE_UNLOAD 0x00000002 24838c2ecf20Sopenharmony_ci#define TG3_APE_HOST_DRVR_STATE_WOL 0x00000003 24848c2ecf20Sopenharmony_ci#define TG3_APE_HOST_WOL_SPEED 0x4224 24858c2ecf20Sopenharmony_ci#define TG3_APE_HOST_WOL_SPEED_AUTO 0x00008000 24868c2ecf20Sopenharmony_ci 24878c2ecf20Sopenharmony_ci#define TG3_APE_EVENT_STATUS 0x4300 24888c2ecf20Sopenharmony_ci 24898c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_DRIVER_EVNT 0x00000010 24908c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_STATE_CHNGE 0x00000500 24918c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_SCRTCHPD_READ 0x00001600 24928c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_SCRTCHPD_WRITE 0x00001700 24938c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_STATE_START 0x00010000 24948c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_STATE_UNLOAD 0x00020000 24958c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_STATE_WOL 0x00030000 24968c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_STATE_SUSPEND 0x00040000 24978c2ecf20Sopenharmony_ci#define APE_EVENT_STATUS_EVENT_PENDING 0x80000000 24988c2ecf20Sopenharmony_ci 24998c2ecf20Sopenharmony_ci#define TG3_APE_PER_LOCK_REQ 0x8400 25008c2ecf20Sopenharmony_ci#define APE_LOCK_PER_REQ_DRIVER 0x00001000 25018c2ecf20Sopenharmony_ci#define TG3_APE_PER_LOCK_GRANT 0x8420 25028c2ecf20Sopenharmony_ci#define APE_PER_LOCK_GRANT_DRIVER 0x00001000 25038c2ecf20Sopenharmony_ci 25048c2ecf20Sopenharmony_ci/* APE convenience enumerations. */ 25058c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_PHY0 0 25068c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_GRC 1 25078c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_PHY1 2 25088c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_PHY2 3 25098c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_MEM 4 25108c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_PHY3 5 25118c2ecf20Sopenharmony_ci#define TG3_APE_LOCK_GPIO 7 25128c2ecf20Sopenharmony_ci 25138c2ecf20Sopenharmony_ci#define TG3_APE_HB_INTERVAL (tp->ape_hb_interval) 25148c2ecf20Sopenharmony_ci#define TG3_EEPROM_SB_F1R2_MBA_OFF 0x10 25158c2ecf20Sopenharmony_ci 25168c2ecf20Sopenharmony_ci 25178c2ecf20Sopenharmony_ci/* There are two ways to manage the TX descriptors on the tigon3. 25188c2ecf20Sopenharmony_ci * Either the descriptors are in host DMA'able memory, or they 25198c2ecf20Sopenharmony_ci * exist only in the cards on-chip SRAM. All 16 send bds are under 25208c2ecf20Sopenharmony_ci * the same mode, they may not be configured individually. 25218c2ecf20Sopenharmony_ci * 25228c2ecf20Sopenharmony_ci * This driver always uses host memory TX descriptors. 25238c2ecf20Sopenharmony_ci * 25248c2ecf20Sopenharmony_ci * To use host memory TX descriptors: 25258c2ecf20Sopenharmony_ci * 1) Set GRC_MODE_HOST_SENDBDS in GRC_MODE register. 25268c2ecf20Sopenharmony_ci * Make sure GRC_MODE_4X_NIC_SEND_RINGS is clear. 25278c2ecf20Sopenharmony_ci * 2) Allocate DMA'able memory. 25288c2ecf20Sopenharmony_ci * 3) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM: 25298c2ecf20Sopenharmony_ci * a) Set TG3_BDINFO_HOST_ADDR to DMA address of memory 25308c2ecf20Sopenharmony_ci * obtained in step 2 25318c2ecf20Sopenharmony_ci * b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC. 25328c2ecf20Sopenharmony_ci * c) Set len field of TG3_BDINFO_MAXLEN_FLAGS to number 25338c2ecf20Sopenharmony_ci * of TX descriptors. Leave flags field clear. 25348c2ecf20Sopenharmony_ci * 4) Access TX descriptors via host memory. The chip 25358c2ecf20Sopenharmony_ci * will refetch into local SRAM as needed when producer 25368c2ecf20Sopenharmony_ci * index mailboxes are updated. 25378c2ecf20Sopenharmony_ci * 25388c2ecf20Sopenharmony_ci * To use on-chip TX descriptors: 25398c2ecf20Sopenharmony_ci * 1) Set GRC_MODE_4X_NIC_SEND_RINGS in GRC_MODE register. 25408c2ecf20Sopenharmony_ci * Make sure GRC_MODE_HOST_SENDBDS is clear. 25418c2ecf20Sopenharmony_ci * 2) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM: 25428c2ecf20Sopenharmony_ci * a) Set TG3_BDINFO_HOST_ADDR to zero. 25438c2ecf20Sopenharmony_ci * b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC 25448c2ecf20Sopenharmony_ci * c) TG3_BDINFO_MAXLEN_FLAGS is don't care. 25458c2ecf20Sopenharmony_ci * 3) Access TX descriptors directly in on-chip SRAM 25468c2ecf20Sopenharmony_ci * using normal {read,write}l(). (and not using 25478c2ecf20Sopenharmony_ci * pointer dereferencing of ioremap()'d memory like 25488c2ecf20Sopenharmony_ci * the broken Broadcom driver does) 25498c2ecf20Sopenharmony_ci * 25508c2ecf20Sopenharmony_ci * Note that BDINFO_FLAGS_DISABLED should be set in the flags field of 25518c2ecf20Sopenharmony_ci * TG3_BDINFO_MAXLEN_FLAGS of all unused SEND_RCB indices. 25528c2ecf20Sopenharmony_ci */ 25538c2ecf20Sopenharmony_cistruct tg3_tx_buffer_desc { 25548c2ecf20Sopenharmony_ci u32 addr_hi; 25558c2ecf20Sopenharmony_ci u32 addr_lo; 25568c2ecf20Sopenharmony_ci 25578c2ecf20Sopenharmony_ci u32 len_flags; 25588c2ecf20Sopenharmony_ci#define TXD_FLAG_TCPUDP_CSUM 0x0001 25598c2ecf20Sopenharmony_ci#define TXD_FLAG_IP_CSUM 0x0002 25608c2ecf20Sopenharmony_ci#define TXD_FLAG_END 0x0004 25618c2ecf20Sopenharmony_ci#define TXD_FLAG_IP_FRAG 0x0008 25628c2ecf20Sopenharmony_ci#define TXD_FLAG_JMB_PKT 0x0008 25638c2ecf20Sopenharmony_ci#define TXD_FLAG_IP_FRAG_END 0x0010 25648c2ecf20Sopenharmony_ci#define TXD_FLAG_HWTSTAMP 0x0020 25658c2ecf20Sopenharmony_ci#define TXD_FLAG_VLAN 0x0040 25668c2ecf20Sopenharmony_ci#define TXD_FLAG_COAL_NOW 0x0080 25678c2ecf20Sopenharmony_ci#define TXD_FLAG_CPU_PRE_DMA 0x0100 25688c2ecf20Sopenharmony_ci#define TXD_FLAG_CPU_POST_DMA 0x0200 25698c2ecf20Sopenharmony_ci#define TXD_FLAG_ADD_SRC_ADDR 0x1000 25708c2ecf20Sopenharmony_ci#define TXD_FLAG_CHOOSE_SRC_ADDR 0x6000 25718c2ecf20Sopenharmony_ci#define TXD_FLAG_NO_CRC 0x8000 25728c2ecf20Sopenharmony_ci#define TXD_LEN_SHIFT 16 25738c2ecf20Sopenharmony_ci 25748c2ecf20Sopenharmony_ci u32 vlan_tag; 25758c2ecf20Sopenharmony_ci#define TXD_VLAN_TAG_SHIFT 0 25768c2ecf20Sopenharmony_ci#define TXD_MSS_SHIFT 16 25778c2ecf20Sopenharmony_ci}; 25788c2ecf20Sopenharmony_ci 25798c2ecf20Sopenharmony_ci#define TXD_ADDR 0x00UL /* 64-bit */ 25808c2ecf20Sopenharmony_ci#define TXD_LEN_FLAGS 0x08UL /* 32-bit (upper 16-bits are len) */ 25818c2ecf20Sopenharmony_ci#define TXD_VLAN_TAG 0x0cUL /* 32-bit (upper 16-bits are tag) */ 25828c2ecf20Sopenharmony_ci#define TXD_SIZE 0x10UL 25838c2ecf20Sopenharmony_ci 25848c2ecf20Sopenharmony_cistruct tg3_rx_buffer_desc { 25858c2ecf20Sopenharmony_ci u32 addr_hi; 25868c2ecf20Sopenharmony_ci u32 addr_lo; 25878c2ecf20Sopenharmony_ci 25888c2ecf20Sopenharmony_ci u32 idx_len; 25898c2ecf20Sopenharmony_ci#define RXD_IDX_MASK 0xffff0000 25908c2ecf20Sopenharmony_ci#define RXD_IDX_SHIFT 16 25918c2ecf20Sopenharmony_ci#define RXD_LEN_MASK 0x0000ffff 25928c2ecf20Sopenharmony_ci#define RXD_LEN_SHIFT 0 25938c2ecf20Sopenharmony_ci 25948c2ecf20Sopenharmony_ci u32 type_flags; 25958c2ecf20Sopenharmony_ci#define RXD_TYPE_SHIFT 16 25968c2ecf20Sopenharmony_ci#define RXD_FLAGS_SHIFT 0 25978c2ecf20Sopenharmony_ci 25988c2ecf20Sopenharmony_ci#define RXD_FLAG_END 0x0004 25998c2ecf20Sopenharmony_ci#define RXD_FLAG_MINI 0x0800 26008c2ecf20Sopenharmony_ci#define RXD_FLAG_JUMBO 0x0020 26018c2ecf20Sopenharmony_ci#define RXD_FLAG_VLAN 0x0040 26028c2ecf20Sopenharmony_ci#define RXD_FLAG_ERROR 0x0400 26038c2ecf20Sopenharmony_ci#define RXD_FLAG_IP_CSUM 0x1000 26048c2ecf20Sopenharmony_ci#define RXD_FLAG_TCPUDP_CSUM 0x2000 26058c2ecf20Sopenharmony_ci#define RXD_FLAG_IS_TCP 0x4000 26068c2ecf20Sopenharmony_ci#define RXD_FLAG_PTPSTAT_MASK 0x0210 26078c2ecf20Sopenharmony_ci#define RXD_FLAG_PTPSTAT_PTPV1 0x0010 26088c2ecf20Sopenharmony_ci#define RXD_FLAG_PTPSTAT_PTPV2 0x0200 26098c2ecf20Sopenharmony_ci 26108c2ecf20Sopenharmony_ci u32 ip_tcp_csum; 26118c2ecf20Sopenharmony_ci#define RXD_IPCSUM_MASK 0xffff0000 26128c2ecf20Sopenharmony_ci#define RXD_IPCSUM_SHIFT 16 26138c2ecf20Sopenharmony_ci#define RXD_TCPCSUM_MASK 0x0000ffff 26148c2ecf20Sopenharmony_ci#define RXD_TCPCSUM_SHIFT 0 26158c2ecf20Sopenharmony_ci 26168c2ecf20Sopenharmony_ci u32 err_vlan; 26178c2ecf20Sopenharmony_ci 26188c2ecf20Sopenharmony_ci#define RXD_VLAN_MASK 0x0000ffff 26198c2ecf20Sopenharmony_ci 26208c2ecf20Sopenharmony_ci#define RXD_ERR_BAD_CRC 0x00010000 26218c2ecf20Sopenharmony_ci#define RXD_ERR_COLLISION 0x00020000 26228c2ecf20Sopenharmony_ci#define RXD_ERR_LINK_LOST 0x00040000 26238c2ecf20Sopenharmony_ci#define RXD_ERR_PHY_DECODE 0x00080000 26248c2ecf20Sopenharmony_ci#define RXD_ERR_ODD_NIBBLE_RCVD_MII 0x00100000 26258c2ecf20Sopenharmony_ci#define RXD_ERR_MAC_ABRT 0x00200000 26268c2ecf20Sopenharmony_ci#define RXD_ERR_TOO_SMALL 0x00400000 26278c2ecf20Sopenharmony_ci#define RXD_ERR_NO_RESOURCES 0x00800000 26288c2ecf20Sopenharmony_ci#define RXD_ERR_HUGE_FRAME 0x01000000 26298c2ecf20Sopenharmony_ci 26308c2ecf20Sopenharmony_ci#define RXD_ERR_MASK (RXD_ERR_BAD_CRC | RXD_ERR_COLLISION | \ 26318c2ecf20Sopenharmony_ci RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE | \ 26328c2ecf20Sopenharmony_ci RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL | \ 26338c2ecf20Sopenharmony_ci RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME) 26348c2ecf20Sopenharmony_ci 26358c2ecf20Sopenharmony_ci u32 reserved; 26368c2ecf20Sopenharmony_ci u32 opaque; 26378c2ecf20Sopenharmony_ci#define RXD_OPAQUE_INDEX_MASK 0x0000ffff 26388c2ecf20Sopenharmony_ci#define RXD_OPAQUE_INDEX_SHIFT 0 26398c2ecf20Sopenharmony_ci#define RXD_OPAQUE_RING_STD 0x00010000 26408c2ecf20Sopenharmony_ci#define RXD_OPAQUE_RING_JUMBO 0x00020000 26418c2ecf20Sopenharmony_ci#define RXD_OPAQUE_RING_MINI 0x00040000 26428c2ecf20Sopenharmony_ci#define RXD_OPAQUE_RING_MASK 0x00070000 26438c2ecf20Sopenharmony_ci}; 26448c2ecf20Sopenharmony_ci 26458c2ecf20Sopenharmony_cistruct tg3_ext_rx_buffer_desc { 26468c2ecf20Sopenharmony_ci struct { 26478c2ecf20Sopenharmony_ci u32 addr_hi; 26488c2ecf20Sopenharmony_ci u32 addr_lo; 26498c2ecf20Sopenharmony_ci } addrlist[3]; 26508c2ecf20Sopenharmony_ci u32 len2_len1; 26518c2ecf20Sopenharmony_ci u32 resv_len3; 26528c2ecf20Sopenharmony_ci struct tg3_rx_buffer_desc std; 26538c2ecf20Sopenharmony_ci}; 26548c2ecf20Sopenharmony_ci 26558c2ecf20Sopenharmony_ci/* We only use this when testing out the DMA engine 26568c2ecf20Sopenharmony_ci * at probe time. This is the internal format of buffer 26578c2ecf20Sopenharmony_ci * descriptors used by the chip at NIC_SRAM_DMA_DESCS. 26588c2ecf20Sopenharmony_ci */ 26598c2ecf20Sopenharmony_cistruct tg3_internal_buffer_desc { 26608c2ecf20Sopenharmony_ci u32 addr_hi; 26618c2ecf20Sopenharmony_ci u32 addr_lo; 26628c2ecf20Sopenharmony_ci u32 nic_mbuf; 26638c2ecf20Sopenharmony_ci /* XXX FIX THIS */ 26648c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN 26658c2ecf20Sopenharmony_ci u16 cqid_sqid; 26668c2ecf20Sopenharmony_ci u16 len; 26678c2ecf20Sopenharmony_ci#else 26688c2ecf20Sopenharmony_ci u16 len; 26698c2ecf20Sopenharmony_ci u16 cqid_sqid; 26708c2ecf20Sopenharmony_ci#endif 26718c2ecf20Sopenharmony_ci u32 flags; 26728c2ecf20Sopenharmony_ci u32 __cookie1; 26738c2ecf20Sopenharmony_ci u32 __cookie2; 26748c2ecf20Sopenharmony_ci u32 __cookie3; 26758c2ecf20Sopenharmony_ci}; 26768c2ecf20Sopenharmony_ci 26778c2ecf20Sopenharmony_ci#define TG3_HW_STATUS_SIZE 0x50 26788c2ecf20Sopenharmony_cistruct tg3_hw_status { 26798c2ecf20Sopenharmony_ci u32 status; 26808c2ecf20Sopenharmony_ci#define SD_STATUS_UPDATED 0x00000001 26818c2ecf20Sopenharmony_ci#define SD_STATUS_LINK_CHG 0x00000002 26828c2ecf20Sopenharmony_ci#define SD_STATUS_ERROR 0x00000004 26838c2ecf20Sopenharmony_ci 26848c2ecf20Sopenharmony_ci u32 status_tag; 26858c2ecf20Sopenharmony_ci 26868c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN 26878c2ecf20Sopenharmony_ci u16 rx_consumer; 26888c2ecf20Sopenharmony_ci u16 rx_jumbo_consumer; 26898c2ecf20Sopenharmony_ci#else 26908c2ecf20Sopenharmony_ci u16 rx_jumbo_consumer; 26918c2ecf20Sopenharmony_ci u16 rx_consumer; 26928c2ecf20Sopenharmony_ci#endif 26938c2ecf20Sopenharmony_ci 26948c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN 26958c2ecf20Sopenharmony_ci u16 reserved; 26968c2ecf20Sopenharmony_ci u16 rx_mini_consumer; 26978c2ecf20Sopenharmony_ci#else 26988c2ecf20Sopenharmony_ci u16 rx_mini_consumer; 26998c2ecf20Sopenharmony_ci u16 reserved; 27008c2ecf20Sopenharmony_ci#endif 27018c2ecf20Sopenharmony_ci struct { 27028c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN 27038c2ecf20Sopenharmony_ci u16 tx_consumer; 27048c2ecf20Sopenharmony_ci u16 rx_producer; 27058c2ecf20Sopenharmony_ci#else 27068c2ecf20Sopenharmony_ci u16 rx_producer; 27078c2ecf20Sopenharmony_ci u16 tx_consumer; 27088c2ecf20Sopenharmony_ci#endif 27098c2ecf20Sopenharmony_ci } idx[16]; 27108c2ecf20Sopenharmony_ci}; 27118c2ecf20Sopenharmony_ci 27128c2ecf20Sopenharmony_citypedef struct { 27138c2ecf20Sopenharmony_ci u32 high, low; 27148c2ecf20Sopenharmony_ci} tg3_stat64_t; 27158c2ecf20Sopenharmony_ci 27168c2ecf20Sopenharmony_cistruct tg3_hw_stats { 27178c2ecf20Sopenharmony_ci u8 __reserved0[0x400-0x300]; 27188c2ecf20Sopenharmony_ci 27198c2ecf20Sopenharmony_ci /* Statistics maintained by Receive MAC. */ 27208c2ecf20Sopenharmony_ci tg3_stat64_t rx_octets; 27218c2ecf20Sopenharmony_ci u64 __reserved1; 27228c2ecf20Sopenharmony_ci tg3_stat64_t rx_fragments; 27238c2ecf20Sopenharmony_ci tg3_stat64_t rx_ucast_packets; 27248c2ecf20Sopenharmony_ci tg3_stat64_t rx_mcast_packets; 27258c2ecf20Sopenharmony_ci tg3_stat64_t rx_bcast_packets; 27268c2ecf20Sopenharmony_ci tg3_stat64_t rx_fcs_errors; 27278c2ecf20Sopenharmony_ci tg3_stat64_t rx_align_errors; 27288c2ecf20Sopenharmony_ci tg3_stat64_t rx_xon_pause_rcvd; 27298c2ecf20Sopenharmony_ci tg3_stat64_t rx_xoff_pause_rcvd; 27308c2ecf20Sopenharmony_ci tg3_stat64_t rx_mac_ctrl_rcvd; 27318c2ecf20Sopenharmony_ci tg3_stat64_t rx_xoff_entered; 27328c2ecf20Sopenharmony_ci tg3_stat64_t rx_frame_too_long_errors; 27338c2ecf20Sopenharmony_ci tg3_stat64_t rx_jabbers; 27348c2ecf20Sopenharmony_ci tg3_stat64_t rx_undersize_packets; 27358c2ecf20Sopenharmony_ci tg3_stat64_t rx_in_length_errors; 27368c2ecf20Sopenharmony_ci tg3_stat64_t rx_out_length_errors; 27378c2ecf20Sopenharmony_ci tg3_stat64_t rx_64_or_less_octet_packets; 27388c2ecf20Sopenharmony_ci tg3_stat64_t rx_65_to_127_octet_packets; 27398c2ecf20Sopenharmony_ci tg3_stat64_t rx_128_to_255_octet_packets; 27408c2ecf20Sopenharmony_ci tg3_stat64_t rx_256_to_511_octet_packets; 27418c2ecf20Sopenharmony_ci tg3_stat64_t rx_512_to_1023_octet_packets; 27428c2ecf20Sopenharmony_ci tg3_stat64_t rx_1024_to_1522_octet_packets; 27438c2ecf20Sopenharmony_ci tg3_stat64_t rx_1523_to_2047_octet_packets; 27448c2ecf20Sopenharmony_ci tg3_stat64_t rx_2048_to_4095_octet_packets; 27458c2ecf20Sopenharmony_ci tg3_stat64_t rx_4096_to_8191_octet_packets; 27468c2ecf20Sopenharmony_ci tg3_stat64_t rx_8192_to_9022_octet_packets; 27478c2ecf20Sopenharmony_ci 27488c2ecf20Sopenharmony_ci u64 __unused0[37]; 27498c2ecf20Sopenharmony_ci 27508c2ecf20Sopenharmony_ci /* Statistics maintained by Transmit MAC. */ 27518c2ecf20Sopenharmony_ci tg3_stat64_t tx_octets; 27528c2ecf20Sopenharmony_ci u64 __reserved2; 27538c2ecf20Sopenharmony_ci tg3_stat64_t tx_collisions; 27548c2ecf20Sopenharmony_ci tg3_stat64_t tx_xon_sent; 27558c2ecf20Sopenharmony_ci tg3_stat64_t tx_xoff_sent; 27568c2ecf20Sopenharmony_ci tg3_stat64_t tx_flow_control; 27578c2ecf20Sopenharmony_ci tg3_stat64_t tx_mac_errors; 27588c2ecf20Sopenharmony_ci tg3_stat64_t tx_single_collisions; 27598c2ecf20Sopenharmony_ci tg3_stat64_t tx_mult_collisions; 27608c2ecf20Sopenharmony_ci tg3_stat64_t tx_deferred; 27618c2ecf20Sopenharmony_ci u64 __reserved3; 27628c2ecf20Sopenharmony_ci tg3_stat64_t tx_excessive_collisions; 27638c2ecf20Sopenharmony_ci tg3_stat64_t tx_late_collisions; 27648c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_2times; 27658c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_3times; 27668c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_4times; 27678c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_5times; 27688c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_6times; 27698c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_7times; 27708c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_8times; 27718c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_9times; 27728c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_10times; 27738c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_11times; 27748c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_12times; 27758c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_13times; 27768c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_14times; 27778c2ecf20Sopenharmony_ci tg3_stat64_t tx_collide_15times; 27788c2ecf20Sopenharmony_ci tg3_stat64_t tx_ucast_packets; 27798c2ecf20Sopenharmony_ci tg3_stat64_t tx_mcast_packets; 27808c2ecf20Sopenharmony_ci tg3_stat64_t tx_bcast_packets; 27818c2ecf20Sopenharmony_ci tg3_stat64_t tx_carrier_sense_errors; 27828c2ecf20Sopenharmony_ci tg3_stat64_t tx_discards; 27838c2ecf20Sopenharmony_ci tg3_stat64_t tx_errors; 27848c2ecf20Sopenharmony_ci 27858c2ecf20Sopenharmony_ci u64 __unused1[31]; 27868c2ecf20Sopenharmony_ci 27878c2ecf20Sopenharmony_ci /* Statistics maintained by Receive List Placement. */ 27888c2ecf20Sopenharmony_ci tg3_stat64_t COS_rx_packets[16]; 27898c2ecf20Sopenharmony_ci tg3_stat64_t COS_rx_filter_dropped; 27908c2ecf20Sopenharmony_ci tg3_stat64_t dma_writeq_full; 27918c2ecf20Sopenharmony_ci tg3_stat64_t dma_write_prioq_full; 27928c2ecf20Sopenharmony_ci tg3_stat64_t rxbds_empty; 27938c2ecf20Sopenharmony_ci tg3_stat64_t rx_discards; 27948c2ecf20Sopenharmony_ci tg3_stat64_t rx_errors; 27958c2ecf20Sopenharmony_ci tg3_stat64_t rx_threshold_hit; 27968c2ecf20Sopenharmony_ci 27978c2ecf20Sopenharmony_ci u64 __unused2[9]; 27988c2ecf20Sopenharmony_ci 27998c2ecf20Sopenharmony_ci /* Statistics maintained by Send Data Initiator. */ 28008c2ecf20Sopenharmony_ci tg3_stat64_t COS_out_packets[16]; 28018c2ecf20Sopenharmony_ci tg3_stat64_t dma_readq_full; 28028c2ecf20Sopenharmony_ci tg3_stat64_t dma_read_prioq_full; 28038c2ecf20Sopenharmony_ci tg3_stat64_t tx_comp_queue_full; 28048c2ecf20Sopenharmony_ci 28058c2ecf20Sopenharmony_ci /* Statistics maintained by Host Coalescing. */ 28068c2ecf20Sopenharmony_ci tg3_stat64_t ring_set_send_prod_index; 28078c2ecf20Sopenharmony_ci tg3_stat64_t ring_status_update; 28088c2ecf20Sopenharmony_ci tg3_stat64_t nic_irqs; 28098c2ecf20Sopenharmony_ci tg3_stat64_t nic_avoided_irqs; 28108c2ecf20Sopenharmony_ci tg3_stat64_t nic_tx_threshold_hit; 28118c2ecf20Sopenharmony_ci 28128c2ecf20Sopenharmony_ci /* NOT a part of the hardware statistics block format. 28138c2ecf20Sopenharmony_ci * These stats are here as storage for tg3_periodic_fetch_stats(). 28148c2ecf20Sopenharmony_ci */ 28158c2ecf20Sopenharmony_ci tg3_stat64_t mbuf_lwm_thresh_hit; 28168c2ecf20Sopenharmony_ci 28178c2ecf20Sopenharmony_ci u8 __reserved4[0xb00-0x9c8]; 28188c2ecf20Sopenharmony_ci}; 28198c2ecf20Sopenharmony_ci 28208c2ecf20Sopenharmony_ci#define TG3_SD_NUM_RECS 3 28218c2ecf20Sopenharmony_ci#define TG3_OCIR_LEN (sizeof(struct tg3_ocir)) 28228c2ecf20Sopenharmony_ci#define TG3_OCIR_SIG_MAGIC 0x5253434f 28238c2ecf20Sopenharmony_ci#define TG3_OCIR_FLAG_ACTIVE 0x00000001 28248c2ecf20Sopenharmony_ci 28258c2ecf20Sopenharmony_ci#define TG3_TEMP_CAUTION_OFFSET 0xc8 28268c2ecf20Sopenharmony_ci#define TG3_TEMP_MAX_OFFSET 0xcc 28278c2ecf20Sopenharmony_ci#define TG3_TEMP_SENSOR_OFFSET 0xd4 28288c2ecf20Sopenharmony_ci 28298c2ecf20Sopenharmony_ci 28308c2ecf20Sopenharmony_cistruct tg3_ocir { 28318c2ecf20Sopenharmony_ci u32 signature; 28328c2ecf20Sopenharmony_ci u16 version_flags; 28338c2ecf20Sopenharmony_ci u16 refresh_int; 28348c2ecf20Sopenharmony_ci u32 refresh_tmr; 28358c2ecf20Sopenharmony_ci u32 update_tmr; 28368c2ecf20Sopenharmony_ci u32 dst_base_addr; 28378c2ecf20Sopenharmony_ci u16 src_hdr_offset; 28388c2ecf20Sopenharmony_ci u16 src_hdr_length; 28398c2ecf20Sopenharmony_ci u16 src_data_offset; 28408c2ecf20Sopenharmony_ci u16 src_data_length; 28418c2ecf20Sopenharmony_ci u16 dst_hdr_offset; 28428c2ecf20Sopenharmony_ci u16 dst_data_offset; 28438c2ecf20Sopenharmony_ci u16 dst_reg_upd_offset; 28448c2ecf20Sopenharmony_ci u16 dst_sem_offset; 28458c2ecf20Sopenharmony_ci u32 reserved1[2]; 28468c2ecf20Sopenharmony_ci u32 port0_flags; 28478c2ecf20Sopenharmony_ci u32 port1_flags; 28488c2ecf20Sopenharmony_ci u32 port2_flags; 28498c2ecf20Sopenharmony_ci u32 port3_flags; 28508c2ecf20Sopenharmony_ci u32 reserved2; 28518c2ecf20Sopenharmony_ci}; 28528c2ecf20Sopenharmony_ci 28538c2ecf20Sopenharmony_ci 28548c2ecf20Sopenharmony_ci/* 'mapping' is superfluous as the chip does not write into 28558c2ecf20Sopenharmony_ci * the tx/rx post rings so we could just fetch it from there. 28568c2ecf20Sopenharmony_ci * But the cache behavior is better how we are doing it now. 28578c2ecf20Sopenharmony_ci * 28588c2ecf20Sopenharmony_ci * This driver uses new build_skb() API : 28598c2ecf20Sopenharmony_ci * RX ring buffer contains pointer to kmalloc() data only, 28608c2ecf20Sopenharmony_ci * skb are built only after Hardware filled the frame. 28618c2ecf20Sopenharmony_ci */ 28628c2ecf20Sopenharmony_cistruct ring_info { 28638c2ecf20Sopenharmony_ci u8 *data; 28648c2ecf20Sopenharmony_ci DEFINE_DMA_UNMAP_ADDR(mapping); 28658c2ecf20Sopenharmony_ci}; 28668c2ecf20Sopenharmony_ci 28678c2ecf20Sopenharmony_cistruct tg3_tx_ring_info { 28688c2ecf20Sopenharmony_ci struct sk_buff *skb; 28698c2ecf20Sopenharmony_ci DEFINE_DMA_UNMAP_ADDR(mapping); 28708c2ecf20Sopenharmony_ci bool fragmented; 28718c2ecf20Sopenharmony_ci}; 28728c2ecf20Sopenharmony_ci 28738c2ecf20Sopenharmony_cistruct tg3_link_config { 28748c2ecf20Sopenharmony_ci /* Describes what we're trying to get. */ 28758c2ecf20Sopenharmony_ci u32 advertising; 28768c2ecf20Sopenharmony_ci u32 speed; 28778c2ecf20Sopenharmony_ci u8 duplex; 28788c2ecf20Sopenharmony_ci u8 autoneg; 28798c2ecf20Sopenharmony_ci u8 flowctrl; 28808c2ecf20Sopenharmony_ci 28818c2ecf20Sopenharmony_ci /* Describes what we actually have. */ 28828c2ecf20Sopenharmony_ci u8 active_flowctrl; 28838c2ecf20Sopenharmony_ci 28848c2ecf20Sopenharmony_ci u8 active_duplex; 28858c2ecf20Sopenharmony_ci u32 active_speed; 28868c2ecf20Sopenharmony_ci u32 rmt_adv; 28878c2ecf20Sopenharmony_ci}; 28888c2ecf20Sopenharmony_ci 28898c2ecf20Sopenharmony_cistruct tg3_bufmgr_config { 28908c2ecf20Sopenharmony_ci u32 mbuf_read_dma_low_water; 28918c2ecf20Sopenharmony_ci u32 mbuf_mac_rx_low_water; 28928c2ecf20Sopenharmony_ci u32 mbuf_high_water; 28938c2ecf20Sopenharmony_ci 28948c2ecf20Sopenharmony_ci u32 mbuf_read_dma_low_water_jumbo; 28958c2ecf20Sopenharmony_ci u32 mbuf_mac_rx_low_water_jumbo; 28968c2ecf20Sopenharmony_ci u32 mbuf_high_water_jumbo; 28978c2ecf20Sopenharmony_ci 28988c2ecf20Sopenharmony_ci u32 dma_low_water; 28998c2ecf20Sopenharmony_ci u32 dma_high_water; 29008c2ecf20Sopenharmony_ci}; 29018c2ecf20Sopenharmony_ci 29028c2ecf20Sopenharmony_cistruct tg3_ethtool_stats { 29038c2ecf20Sopenharmony_ci /* Statistics maintained by Receive MAC. */ 29048c2ecf20Sopenharmony_ci u64 rx_octets; 29058c2ecf20Sopenharmony_ci u64 rx_fragments; 29068c2ecf20Sopenharmony_ci u64 rx_ucast_packets; 29078c2ecf20Sopenharmony_ci u64 rx_mcast_packets; 29088c2ecf20Sopenharmony_ci u64 rx_bcast_packets; 29098c2ecf20Sopenharmony_ci u64 rx_fcs_errors; 29108c2ecf20Sopenharmony_ci u64 rx_align_errors; 29118c2ecf20Sopenharmony_ci u64 rx_xon_pause_rcvd; 29128c2ecf20Sopenharmony_ci u64 rx_xoff_pause_rcvd; 29138c2ecf20Sopenharmony_ci u64 rx_mac_ctrl_rcvd; 29148c2ecf20Sopenharmony_ci u64 rx_xoff_entered; 29158c2ecf20Sopenharmony_ci u64 rx_frame_too_long_errors; 29168c2ecf20Sopenharmony_ci u64 rx_jabbers; 29178c2ecf20Sopenharmony_ci u64 rx_undersize_packets; 29188c2ecf20Sopenharmony_ci u64 rx_in_length_errors; 29198c2ecf20Sopenharmony_ci u64 rx_out_length_errors; 29208c2ecf20Sopenharmony_ci u64 rx_64_or_less_octet_packets; 29218c2ecf20Sopenharmony_ci u64 rx_65_to_127_octet_packets; 29228c2ecf20Sopenharmony_ci u64 rx_128_to_255_octet_packets; 29238c2ecf20Sopenharmony_ci u64 rx_256_to_511_octet_packets; 29248c2ecf20Sopenharmony_ci u64 rx_512_to_1023_octet_packets; 29258c2ecf20Sopenharmony_ci u64 rx_1024_to_1522_octet_packets; 29268c2ecf20Sopenharmony_ci u64 rx_1523_to_2047_octet_packets; 29278c2ecf20Sopenharmony_ci u64 rx_2048_to_4095_octet_packets; 29288c2ecf20Sopenharmony_ci u64 rx_4096_to_8191_octet_packets; 29298c2ecf20Sopenharmony_ci u64 rx_8192_to_9022_octet_packets; 29308c2ecf20Sopenharmony_ci 29318c2ecf20Sopenharmony_ci /* Statistics maintained by Transmit MAC. */ 29328c2ecf20Sopenharmony_ci u64 tx_octets; 29338c2ecf20Sopenharmony_ci u64 tx_collisions; 29348c2ecf20Sopenharmony_ci u64 tx_xon_sent; 29358c2ecf20Sopenharmony_ci u64 tx_xoff_sent; 29368c2ecf20Sopenharmony_ci u64 tx_flow_control; 29378c2ecf20Sopenharmony_ci u64 tx_mac_errors; 29388c2ecf20Sopenharmony_ci u64 tx_single_collisions; 29398c2ecf20Sopenharmony_ci u64 tx_mult_collisions; 29408c2ecf20Sopenharmony_ci u64 tx_deferred; 29418c2ecf20Sopenharmony_ci u64 tx_excessive_collisions; 29428c2ecf20Sopenharmony_ci u64 tx_late_collisions; 29438c2ecf20Sopenharmony_ci u64 tx_collide_2times; 29448c2ecf20Sopenharmony_ci u64 tx_collide_3times; 29458c2ecf20Sopenharmony_ci u64 tx_collide_4times; 29468c2ecf20Sopenharmony_ci u64 tx_collide_5times; 29478c2ecf20Sopenharmony_ci u64 tx_collide_6times; 29488c2ecf20Sopenharmony_ci u64 tx_collide_7times; 29498c2ecf20Sopenharmony_ci u64 tx_collide_8times; 29508c2ecf20Sopenharmony_ci u64 tx_collide_9times; 29518c2ecf20Sopenharmony_ci u64 tx_collide_10times; 29528c2ecf20Sopenharmony_ci u64 tx_collide_11times; 29538c2ecf20Sopenharmony_ci u64 tx_collide_12times; 29548c2ecf20Sopenharmony_ci u64 tx_collide_13times; 29558c2ecf20Sopenharmony_ci u64 tx_collide_14times; 29568c2ecf20Sopenharmony_ci u64 tx_collide_15times; 29578c2ecf20Sopenharmony_ci u64 tx_ucast_packets; 29588c2ecf20Sopenharmony_ci u64 tx_mcast_packets; 29598c2ecf20Sopenharmony_ci u64 tx_bcast_packets; 29608c2ecf20Sopenharmony_ci u64 tx_carrier_sense_errors; 29618c2ecf20Sopenharmony_ci u64 tx_discards; 29628c2ecf20Sopenharmony_ci u64 tx_errors; 29638c2ecf20Sopenharmony_ci 29648c2ecf20Sopenharmony_ci /* Statistics maintained by Receive List Placement. */ 29658c2ecf20Sopenharmony_ci u64 dma_writeq_full; 29668c2ecf20Sopenharmony_ci u64 dma_write_prioq_full; 29678c2ecf20Sopenharmony_ci u64 rxbds_empty; 29688c2ecf20Sopenharmony_ci u64 rx_discards; 29698c2ecf20Sopenharmony_ci u64 rx_errors; 29708c2ecf20Sopenharmony_ci u64 rx_threshold_hit; 29718c2ecf20Sopenharmony_ci 29728c2ecf20Sopenharmony_ci /* Statistics maintained by Send Data Initiator. */ 29738c2ecf20Sopenharmony_ci u64 dma_readq_full; 29748c2ecf20Sopenharmony_ci u64 dma_read_prioq_full; 29758c2ecf20Sopenharmony_ci u64 tx_comp_queue_full; 29768c2ecf20Sopenharmony_ci 29778c2ecf20Sopenharmony_ci /* Statistics maintained by Host Coalescing. */ 29788c2ecf20Sopenharmony_ci u64 ring_set_send_prod_index; 29798c2ecf20Sopenharmony_ci u64 ring_status_update; 29808c2ecf20Sopenharmony_ci u64 nic_irqs; 29818c2ecf20Sopenharmony_ci u64 nic_avoided_irqs; 29828c2ecf20Sopenharmony_ci u64 nic_tx_threshold_hit; 29838c2ecf20Sopenharmony_ci 29848c2ecf20Sopenharmony_ci u64 mbuf_lwm_thresh_hit; 29858c2ecf20Sopenharmony_ci}; 29868c2ecf20Sopenharmony_ci 29878c2ecf20Sopenharmony_cistruct tg3_rx_prodring_set { 29888c2ecf20Sopenharmony_ci u32 rx_std_prod_idx; 29898c2ecf20Sopenharmony_ci u32 rx_std_cons_idx; 29908c2ecf20Sopenharmony_ci u32 rx_jmb_prod_idx; 29918c2ecf20Sopenharmony_ci u32 rx_jmb_cons_idx; 29928c2ecf20Sopenharmony_ci struct tg3_rx_buffer_desc *rx_std; 29938c2ecf20Sopenharmony_ci struct tg3_ext_rx_buffer_desc *rx_jmb; 29948c2ecf20Sopenharmony_ci struct ring_info *rx_std_buffers; 29958c2ecf20Sopenharmony_ci struct ring_info *rx_jmb_buffers; 29968c2ecf20Sopenharmony_ci dma_addr_t rx_std_mapping; 29978c2ecf20Sopenharmony_ci dma_addr_t rx_jmb_mapping; 29988c2ecf20Sopenharmony_ci}; 29998c2ecf20Sopenharmony_ci 30008c2ecf20Sopenharmony_ci#define TG3_RSS_MAX_NUM_QS 4 30018c2ecf20Sopenharmony_ci#define TG3_IRQ_MAX_VECS_RSS (TG3_RSS_MAX_NUM_QS + 1) 30028c2ecf20Sopenharmony_ci#define TG3_IRQ_MAX_VECS TG3_IRQ_MAX_VECS_RSS 30038c2ecf20Sopenharmony_ci 30048c2ecf20Sopenharmony_cistruct tg3_napi { 30058c2ecf20Sopenharmony_ci struct napi_struct napi ____cacheline_aligned; 30068c2ecf20Sopenharmony_ci struct tg3 *tp; 30078c2ecf20Sopenharmony_ci struct tg3_hw_status *hw_status; 30088c2ecf20Sopenharmony_ci 30098c2ecf20Sopenharmony_ci u32 chk_msi_cnt; 30108c2ecf20Sopenharmony_ci u32 last_tag; 30118c2ecf20Sopenharmony_ci u32 last_irq_tag; 30128c2ecf20Sopenharmony_ci u32 int_mbox; 30138c2ecf20Sopenharmony_ci u32 coal_now; 30148c2ecf20Sopenharmony_ci 30158c2ecf20Sopenharmony_ci u32 consmbox ____cacheline_aligned; 30168c2ecf20Sopenharmony_ci u32 rx_rcb_ptr; 30178c2ecf20Sopenharmony_ci u32 last_rx_cons; 30188c2ecf20Sopenharmony_ci u16 *rx_rcb_prod_idx; 30198c2ecf20Sopenharmony_ci struct tg3_rx_prodring_set prodring; 30208c2ecf20Sopenharmony_ci struct tg3_rx_buffer_desc *rx_rcb; 30218c2ecf20Sopenharmony_ci unsigned long rx_dropped; 30228c2ecf20Sopenharmony_ci 30238c2ecf20Sopenharmony_ci u32 tx_prod ____cacheline_aligned; 30248c2ecf20Sopenharmony_ci u32 tx_cons; 30258c2ecf20Sopenharmony_ci u32 tx_pending; 30268c2ecf20Sopenharmony_ci u32 last_tx_cons; 30278c2ecf20Sopenharmony_ci u32 prodmbox; 30288c2ecf20Sopenharmony_ci struct tg3_tx_buffer_desc *tx_ring; 30298c2ecf20Sopenharmony_ci struct tg3_tx_ring_info *tx_buffers; 30308c2ecf20Sopenharmony_ci unsigned long tx_dropped; 30318c2ecf20Sopenharmony_ci 30328c2ecf20Sopenharmony_ci dma_addr_t status_mapping; 30338c2ecf20Sopenharmony_ci dma_addr_t rx_rcb_mapping; 30348c2ecf20Sopenharmony_ci dma_addr_t tx_desc_mapping; 30358c2ecf20Sopenharmony_ci 30368c2ecf20Sopenharmony_ci char irq_lbl[IFNAMSIZ]; 30378c2ecf20Sopenharmony_ci unsigned int irq_vec; 30388c2ecf20Sopenharmony_ci}; 30398c2ecf20Sopenharmony_ci 30408c2ecf20Sopenharmony_cienum TG3_FLAGS { 30418c2ecf20Sopenharmony_ci TG3_FLAG_TAGGED_STATUS = 0, 30428c2ecf20Sopenharmony_ci TG3_FLAG_TXD_MBOX_HWBUG, 30438c2ecf20Sopenharmony_ci TG3_FLAG_USE_LINKCHG_REG, 30448c2ecf20Sopenharmony_ci TG3_FLAG_ERROR_PROCESSED, 30458c2ecf20Sopenharmony_ci TG3_FLAG_ENABLE_ASF, 30468c2ecf20Sopenharmony_ci TG3_FLAG_ASPM_WORKAROUND, 30478c2ecf20Sopenharmony_ci TG3_FLAG_POLL_SERDES, 30488c2ecf20Sopenharmony_ci TG3_FLAG_POLL_CPMU_LINK, 30498c2ecf20Sopenharmony_ci TG3_FLAG_MBOX_WRITE_REORDER, 30508c2ecf20Sopenharmony_ci TG3_FLAG_PCIX_TARGET_HWBUG, 30518c2ecf20Sopenharmony_ci TG3_FLAG_WOL_SPEED_100MB, 30528c2ecf20Sopenharmony_ci TG3_FLAG_WOL_ENABLE, 30538c2ecf20Sopenharmony_ci TG3_FLAG_EEPROM_WRITE_PROT, 30548c2ecf20Sopenharmony_ci TG3_FLAG_NVRAM, 30558c2ecf20Sopenharmony_ci TG3_FLAG_NVRAM_BUFFERED, 30568c2ecf20Sopenharmony_ci TG3_FLAG_SUPPORT_MSI, 30578c2ecf20Sopenharmony_ci TG3_FLAG_SUPPORT_MSIX, 30588c2ecf20Sopenharmony_ci TG3_FLAG_USING_MSI, 30598c2ecf20Sopenharmony_ci TG3_FLAG_USING_MSIX, 30608c2ecf20Sopenharmony_ci TG3_FLAG_PCIX_MODE, 30618c2ecf20Sopenharmony_ci TG3_FLAG_PCI_HIGH_SPEED, 30628c2ecf20Sopenharmony_ci TG3_FLAG_PCI_32BIT, 30638c2ecf20Sopenharmony_ci TG3_FLAG_SRAM_USE_CONFIG, 30648c2ecf20Sopenharmony_ci TG3_FLAG_TX_RECOVERY_PENDING, 30658c2ecf20Sopenharmony_ci TG3_FLAG_WOL_CAP, 30668c2ecf20Sopenharmony_ci TG3_FLAG_JUMBO_RING_ENABLE, 30678c2ecf20Sopenharmony_ci TG3_FLAG_PAUSE_AUTONEG, 30688c2ecf20Sopenharmony_ci TG3_FLAG_CPMU_PRESENT, 30698c2ecf20Sopenharmony_ci TG3_FLAG_40BIT_DMA_BUG, 30708c2ecf20Sopenharmony_ci TG3_FLAG_BROKEN_CHECKSUMS, 30718c2ecf20Sopenharmony_ci TG3_FLAG_JUMBO_CAPABLE, 30728c2ecf20Sopenharmony_ci TG3_FLAG_CHIP_RESETTING, 30738c2ecf20Sopenharmony_ci TG3_FLAG_INIT_COMPLETE, 30748c2ecf20Sopenharmony_ci TG3_FLAG_MAX_RXPEND_64, 30758c2ecf20Sopenharmony_ci TG3_FLAG_PCI_EXPRESS, /* BCM5785 + pci_is_pcie() */ 30768c2ecf20Sopenharmony_ci TG3_FLAG_ASF_NEW_HANDSHAKE, 30778c2ecf20Sopenharmony_ci TG3_FLAG_HW_AUTONEG, 30788c2ecf20Sopenharmony_ci TG3_FLAG_IS_NIC, 30798c2ecf20Sopenharmony_ci TG3_FLAG_FLASH, 30808c2ecf20Sopenharmony_ci TG3_FLAG_FW_TSO, 30818c2ecf20Sopenharmony_ci TG3_FLAG_HW_TSO_1, 30828c2ecf20Sopenharmony_ci TG3_FLAG_HW_TSO_2, 30838c2ecf20Sopenharmony_ci TG3_FLAG_HW_TSO_3, 30848c2ecf20Sopenharmony_ci TG3_FLAG_TSO_CAPABLE, 30858c2ecf20Sopenharmony_ci TG3_FLAG_TSO_BUG, 30868c2ecf20Sopenharmony_ci TG3_FLAG_ICH_WORKAROUND, 30878c2ecf20Sopenharmony_ci TG3_FLAG_1SHOT_MSI, 30888c2ecf20Sopenharmony_ci TG3_FLAG_NO_FWARE_REPORTED, 30898c2ecf20Sopenharmony_ci TG3_FLAG_NO_NVRAM_ADDR_TRANS, 30908c2ecf20Sopenharmony_ci TG3_FLAG_ENABLE_APE, 30918c2ecf20Sopenharmony_ci TG3_FLAG_PROTECTED_NVRAM, 30928c2ecf20Sopenharmony_ci TG3_FLAG_5701_DMA_BUG, 30938c2ecf20Sopenharmony_ci TG3_FLAG_USE_PHYLIB, 30948c2ecf20Sopenharmony_ci TG3_FLAG_MDIOBUS_INITED, 30958c2ecf20Sopenharmony_ci TG3_FLAG_LRG_PROD_RING_CAP, 30968c2ecf20Sopenharmony_ci TG3_FLAG_RGMII_INBAND_DISABLE, 30978c2ecf20Sopenharmony_ci TG3_FLAG_RGMII_EXT_IBND_RX_EN, 30988c2ecf20Sopenharmony_ci TG3_FLAG_RGMII_EXT_IBND_TX_EN, 30998c2ecf20Sopenharmony_ci TG3_FLAG_CLKREQ_BUG, 31008c2ecf20Sopenharmony_ci TG3_FLAG_NO_NVRAM, 31018c2ecf20Sopenharmony_ci TG3_FLAG_ENABLE_RSS, 31028c2ecf20Sopenharmony_ci TG3_FLAG_ENABLE_TSS, 31038c2ecf20Sopenharmony_ci TG3_FLAG_SHORT_DMA_BUG, 31048c2ecf20Sopenharmony_ci TG3_FLAG_USE_JUMBO_BDFLAG, 31058c2ecf20Sopenharmony_ci TG3_FLAG_L1PLLPD_EN, 31068c2ecf20Sopenharmony_ci TG3_FLAG_APE_HAS_NCSI, 31078c2ecf20Sopenharmony_ci TG3_FLAG_TX_TSTAMP_EN, 31088c2ecf20Sopenharmony_ci TG3_FLAG_4K_FIFO_LIMIT, 31098c2ecf20Sopenharmony_ci TG3_FLAG_5719_5720_RDMA_BUG, 31108c2ecf20Sopenharmony_ci TG3_FLAG_RESET_TASK_PENDING, 31118c2ecf20Sopenharmony_ci TG3_FLAG_PTP_CAPABLE, 31128c2ecf20Sopenharmony_ci TG3_FLAG_5705_PLUS, 31138c2ecf20Sopenharmony_ci TG3_FLAG_IS_5788, 31148c2ecf20Sopenharmony_ci TG3_FLAG_5750_PLUS, 31158c2ecf20Sopenharmony_ci TG3_FLAG_5780_CLASS, 31168c2ecf20Sopenharmony_ci TG3_FLAG_5755_PLUS, 31178c2ecf20Sopenharmony_ci TG3_FLAG_57765_PLUS, 31188c2ecf20Sopenharmony_ci TG3_FLAG_57765_CLASS, 31198c2ecf20Sopenharmony_ci TG3_FLAG_5717_PLUS, 31208c2ecf20Sopenharmony_ci TG3_FLAG_IS_SSB_CORE, 31218c2ecf20Sopenharmony_ci TG3_FLAG_FLUSH_POSTED_WRITES, 31228c2ecf20Sopenharmony_ci TG3_FLAG_ROBOSWITCH, 31238c2ecf20Sopenharmony_ci TG3_FLAG_ONE_DMA_AT_ONCE, 31248c2ecf20Sopenharmony_ci TG3_FLAG_RGMII_MODE, 31258c2ecf20Sopenharmony_ci 31268c2ecf20Sopenharmony_ci /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */ 31278c2ecf20Sopenharmony_ci TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */ 31288c2ecf20Sopenharmony_ci}; 31298c2ecf20Sopenharmony_ci 31308c2ecf20Sopenharmony_cistruct tg3_firmware_hdr { 31318c2ecf20Sopenharmony_ci __be32 version; /* unused for fragments */ 31328c2ecf20Sopenharmony_ci __be32 base_addr; 31338c2ecf20Sopenharmony_ci __be32 len; 31348c2ecf20Sopenharmony_ci}; 31358c2ecf20Sopenharmony_ci#define TG3_FW_HDR_LEN (sizeof(struct tg3_firmware_hdr)) 31368c2ecf20Sopenharmony_ci 31378c2ecf20Sopenharmony_cistruct tg3 { 31388c2ecf20Sopenharmony_ci /* begin "general, frequently-used members" cacheline section */ 31398c2ecf20Sopenharmony_ci 31408c2ecf20Sopenharmony_ci /* If the IRQ handler (which runs lockless) needs to be 31418c2ecf20Sopenharmony_ci * quiesced, the following bitmask state is used. The 31428c2ecf20Sopenharmony_ci * SYNC flag is set by non-IRQ context code to initiate 31438c2ecf20Sopenharmony_ci * the quiescence. 31448c2ecf20Sopenharmony_ci * 31458c2ecf20Sopenharmony_ci * When the IRQ handler notices that SYNC is set, it 31468c2ecf20Sopenharmony_ci * disables interrupts and returns. 31478c2ecf20Sopenharmony_ci * 31488c2ecf20Sopenharmony_ci * When all outstanding IRQ handlers have returned after 31498c2ecf20Sopenharmony_ci * the SYNC flag has been set, the setter can be assured 31508c2ecf20Sopenharmony_ci * that interrupts will no longer get run. 31518c2ecf20Sopenharmony_ci * 31528c2ecf20Sopenharmony_ci * In this way all SMP driver locks are never acquired 31538c2ecf20Sopenharmony_ci * in hw IRQ context, only sw IRQ context or lower. 31548c2ecf20Sopenharmony_ci */ 31558c2ecf20Sopenharmony_ci unsigned int irq_sync; 31568c2ecf20Sopenharmony_ci 31578c2ecf20Sopenharmony_ci /* SMP locking strategy: 31588c2ecf20Sopenharmony_ci * 31598c2ecf20Sopenharmony_ci * lock: Held during reset, PHY access, timer, and when 31608c2ecf20Sopenharmony_ci * updating tg3_flags. 31618c2ecf20Sopenharmony_ci * 31628c2ecf20Sopenharmony_ci * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds 31638c2ecf20Sopenharmony_ci * netif_tx_lock when it needs to call 31648c2ecf20Sopenharmony_ci * netif_wake_queue. 31658c2ecf20Sopenharmony_ci * 31668c2ecf20Sopenharmony_ci * Both of these locks are to be held with BH safety. 31678c2ecf20Sopenharmony_ci * 31688c2ecf20Sopenharmony_ci * Because the IRQ handler, tg3_poll, and tg3_start_xmit 31698c2ecf20Sopenharmony_ci * are running lockless, it is necessary to completely 31708c2ecf20Sopenharmony_ci * quiesce the chip with tg3_netif_stop and tg3_full_lock 31718c2ecf20Sopenharmony_ci * before reconfiguring the device. 31728c2ecf20Sopenharmony_ci * 31738c2ecf20Sopenharmony_ci * indirect_lock: Held when accessing registers indirectly 31748c2ecf20Sopenharmony_ci * with IRQ disabling. 31758c2ecf20Sopenharmony_ci */ 31768c2ecf20Sopenharmony_ci spinlock_t lock; 31778c2ecf20Sopenharmony_ci spinlock_t indirect_lock; 31788c2ecf20Sopenharmony_ci 31798c2ecf20Sopenharmony_ci u32 (*read32) (struct tg3 *, u32); 31808c2ecf20Sopenharmony_ci void (*write32) (struct tg3 *, u32, u32); 31818c2ecf20Sopenharmony_ci u32 (*read32_mbox) (struct tg3 *, u32); 31828c2ecf20Sopenharmony_ci void (*write32_mbox) (struct tg3 *, u32, 31838c2ecf20Sopenharmony_ci u32); 31848c2ecf20Sopenharmony_ci void __iomem *regs; 31858c2ecf20Sopenharmony_ci void __iomem *aperegs; 31868c2ecf20Sopenharmony_ci struct net_device *dev; 31878c2ecf20Sopenharmony_ci struct pci_dev *pdev; 31888c2ecf20Sopenharmony_ci 31898c2ecf20Sopenharmony_ci u32 coal_now; 31908c2ecf20Sopenharmony_ci u32 msg_enable; 31918c2ecf20Sopenharmony_ci 31928c2ecf20Sopenharmony_ci struct ptp_clock_info ptp_info; 31938c2ecf20Sopenharmony_ci struct ptp_clock *ptp_clock; 31948c2ecf20Sopenharmony_ci s64 ptp_adjust; 31958c2ecf20Sopenharmony_ci 31968c2ecf20Sopenharmony_ci /* begin "tx thread" cacheline section */ 31978c2ecf20Sopenharmony_ci void (*write32_tx_mbox) (struct tg3 *, u32, 31988c2ecf20Sopenharmony_ci u32); 31998c2ecf20Sopenharmony_ci u32 dma_limit; 32008c2ecf20Sopenharmony_ci u32 txq_req; 32018c2ecf20Sopenharmony_ci u32 txq_cnt; 32028c2ecf20Sopenharmony_ci u32 txq_max; 32038c2ecf20Sopenharmony_ci 32048c2ecf20Sopenharmony_ci /* begin "rx thread" cacheline section */ 32058c2ecf20Sopenharmony_ci struct tg3_napi napi[TG3_IRQ_MAX_VECS]; 32068c2ecf20Sopenharmony_ci void (*write32_rx_mbox) (struct tg3 *, u32, 32078c2ecf20Sopenharmony_ci u32); 32088c2ecf20Sopenharmony_ci u32 rx_copy_thresh; 32098c2ecf20Sopenharmony_ci u32 rx_std_ring_mask; 32108c2ecf20Sopenharmony_ci u32 rx_jmb_ring_mask; 32118c2ecf20Sopenharmony_ci u32 rx_ret_ring_mask; 32128c2ecf20Sopenharmony_ci u32 rx_pending; 32138c2ecf20Sopenharmony_ci u32 rx_jumbo_pending; 32148c2ecf20Sopenharmony_ci u32 rx_std_max_post; 32158c2ecf20Sopenharmony_ci u32 rx_offset; 32168c2ecf20Sopenharmony_ci u32 rx_pkt_map_sz; 32178c2ecf20Sopenharmony_ci u32 rxq_req; 32188c2ecf20Sopenharmony_ci u32 rxq_cnt; 32198c2ecf20Sopenharmony_ci u32 rxq_max; 32208c2ecf20Sopenharmony_ci bool rx_refill; 32218c2ecf20Sopenharmony_ci 32228c2ecf20Sopenharmony_ci 32238c2ecf20Sopenharmony_ci /* begin "everything else" cacheline(s) section */ 32248c2ecf20Sopenharmony_ci struct rtnl_link_stats64 net_stats_prev; 32258c2ecf20Sopenharmony_ci struct tg3_ethtool_stats estats_prev; 32268c2ecf20Sopenharmony_ci 32278c2ecf20Sopenharmony_ci DECLARE_BITMAP(tg3_flags, TG3_FLAG_NUMBER_OF_FLAGS); 32288c2ecf20Sopenharmony_ci 32298c2ecf20Sopenharmony_ci union { 32308c2ecf20Sopenharmony_ci unsigned long phy_crc_errors; 32318c2ecf20Sopenharmony_ci unsigned long last_event_jiffies; 32328c2ecf20Sopenharmony_ci }; 32338c2ecf20Sopenharmony_ci 32348c2ecf20Sopenharmony_ci struct timer_list timer; 32358c2ecf20Sopenharmony_ci u16 timer_counter; 32368c2ecf20Sopenharmony_ci u16 timer_multiplier; 32378c2ecf20Sopenharmony_ci u32 timer_offset; 32388c2ecf20Sopenharmony_ci u16 asf_counter; 32398c2ecf20Sopenharmony_ci u16 asf_multiplier; 32408c2ecf20Sopenharmony_ci 32418c2ecf20Sopenharmony_ci /* 1 second counter for transient serdes link events */ 32428c2ecf20Sopenharmony_ci u32 serdes_counter; 32438c2ecf20Sopenharmony_ci#define SERDES_AN_TIMEOUT_5704S 2 32448c2ecf20Sopenharmony_ci#define SERDES_PARALLEL_DET_TIMEOUT 1 32458c2ecf20Sopenharmony_ci#define SERDES_AN_TIMEOUT_5714S 1 32468c2ecf20Sopenharmony_ci 32478c2ecf20Sopenharmony_ci struct tg3_link_config link_config; 32488c2ecf20Sopenharmony_ci struct tg3_bufmgr_config bufmgr_config; 32498c2ecf20Sopenharmony_ci 32508c2ecf20Sopenharmony_ci /* cache h/w values, often passed straight to h/w */ 32518c2ecf20Sopenharmony_ci u32 rx_mode; 32528c2ecf20Sopenharmony_ci u32 tx_mode; 32538c2ecf20Sopenharmony_ci u32 mac_mode; 32548c2ecf20Sopenharmony_ci u32 mi_mode; 32558c2ecf20Sopenharmony_ci u32 misc_host_ctrl; 32568c2ecf20Sopenharmony_ci u32 grc_mode; 32578c2ecf20Sopenharmony_ci u32 grc_local_ctrl; 32588c2ecf20Sopenharmony_ci u32 dma_rwctrl; 32598c2ecf20Sopenharmony_ci u32 coalesce_mode; 32608c2ecf20Sopenharmony_ci u32 pwrmgmt_thresh; 32618c2ecf20Sopenharmony_ci u32 rxptpctl; 32628c2ecf20Sopenharmony_ci 32638c2ecf20Sopenharmony_ci /* PCI block */ 32648c2ecf20Sopenharmony_ci u32 pci_chip_rev_id; 32658c2ecf20Sopenharmony_ci u16 pci_cmd; 32668c2ecf20Sopenharmony_ci u8 pci_cacheline_sz; 32678c2ecf20Sopenharmony_ci u8 pci_lat_timer; 32688c2ecf20Sopenharmony_ci 32698c2ecf20Sopenharmony_ci int pci_fn; 32708c2ecf20Sopenharmony_ci int msi_cap; 32718c2ecf20Sopenharmony_ci int pcix_cap; 32728c2ecf20Sopenharmony_ci int pcie_readrq; 32738c2ecf20Sopenharmony_ci 32748c2ecf20Sopenharmony_ci struct mii_bus *mdio_bus; 32758c2ecf20Sopenharmony_ci int old_link; 32768c2ecf20Sopenharmony_ci 32778c2ecf20Sopenharmony_ci u8 phy_addr; 32788c2ecf20Sopenharmony_ci u8 phy_ape_lock; 32798c2ecf20Sopenharmony_ci 32808c2ecf20Sopenharmony_ci /* PHY info */ 32818c2ecf20Sopenharmony_ci u32 phy_id; 32828c2ecf20Sopenharmony_ci#define TG3_PHY_ID_MASK 0xfffffff0 32838c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5400 0x60008040 32848c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5401 0x60008050 32858c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5411 0x60008070 32868c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5701 0x60008110 32878c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5703 0x60008160 32888c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5704 0x60008190 32898c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5705 0x600081a0 32908c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5750 0x60008180 32918c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5752 0x60008100 32928c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5714 0x60008340 32938c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5780 0x60008350 32948c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5755 0xbc050cc0 32958c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5787 0xbc050ce0 32968c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5756 0xbc050ed0 32978c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5784 0xbc050fa0 32988c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5761 0xbc050fd0 32998c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5718C 0x5c0d8a00 33008c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5718S 0xbc050ff0 33018c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM57765 0x5c0d8a40 33028c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5719C 0x5c0d8a20 33038c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5720C 0x5c0d8b60 33048c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5762 0x85803780 33058c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM5906 0xdc00ac40 33068c2ecf20Sopenharmony_ci#define TG3_PHY_ID_BCM8002 0x60010140 33078c2ecf20Sopenharmony_ci#define TG3_PHY_ID_INVALID 0xffffffff 33088c2ecf20Sopenharmony_ci 33098c2ecf20Sopenharmony_ci#define PHY_ID_RTL8211C 0x001cc910 33108c2ecf20Sopenharmony_ci#define PHY_ID_RTL8201E 0x00008200 33118c2ecf20Sopenharmony_ci 33128c2ecf20Sopenharmony_ci#define TG3_PHY_ID_REV_MASK 0x0000000f 33138c2ecf20Sopenharmony_ci#define TG3_PHY_REV_BCM5401_B0 0x1 33148c2ecf20Sopenharmony_ci 33158c2ecf20Sopenharmony_ci /* This macro assumes the passed PHY ID is 33168c2ecf20Sopenharmony_ci * already masked with TG3_PHY_ID_MASK. 33178c2ecf20Sopenharmony_ci */ 33188c2ecf20Sopenharmony_ci#define TG3_KNOWN_PHY_ID(X) \ 33198c2ecf20Sopenharmony_ci ((X) == TG3_PHY_ID_BCM5400 || (X) == TG3_PHY_ID_BCM5401 || \ 33208c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5411 || (X) == TG3_PHY_ID_BCM5701 || \ 33218c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5703 || (X) == TG3_PHY_ID_BCM5704 || \ 33228c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5705 || (X) == TG3_PHY_ID_BCM5750 || \ 33238c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5752 || (X) == TG3_PHY_ID_BCM5714 || \ 33248c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5780 || (X) == TG3_PHY_ID_BCM5787 || \ 33258c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5755 || (X) == TG3_PHY_ID_BCM5756 || \ 33268c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \ 33278c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \ 33288c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \ 33298c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM5720C || (X) == TG3_PHY_ID_BCM5762 || \ 33308c2ecf20Sopenharmony_ci (X) == TG3_PHY_ID_BCM8002) 33318c2ecf20Sopenharmony_ci 33328c2ecf20Sopenharmony_ci u32 phy_flags; 33338c2ecf20Sopenharmony_ci#define TG3_PHYFLG_IS_LOW_POWER 0x00000001 33348c2ecf20Sopenharmony_ci#define TG3_PHYFLG_IS_CONNECTED 0x00000002 33358c2ecf20Sopenharmony_ci#define TG3_PHYFLG_USE_MI_INTERRUPT 0x00000004 33368c2ecf20Sopenharmony_ci#define TG3_PHYFLG_USER_CONFIGURED 0x00000008 33378c2ecf20Sopenharmony_ci#define TG3_PHYFLG_PHY_SERDES 0x00000010 33388c2ecf20Sopenharmony_ci#define TG3_PHYFLG_MII_SERDES 0x00000020 33398c2ecf20Sopenharmony_ci#define TG3_PHYFLG_ANY_SERDES (TG3_PHYFLG_PHY_SERDES | \ 33408c2ecf20Sopenharmony_ci TG3_PHYFLG_MII_SERDES) 33418c2ecf20Sopenharmony_ci#define TG3_PHYFLG_IS_FET 0x00000040 33428c2ecf20Sopenharmony_ci#define TG3_PHYFLG_10_100_ONLY 0x00000080 33438c2ecf20Sopenharmony_ci#define TG3_PHYFLG_ENABLE_APD 0x00000100 33448c2ecf20Sopenharmony_ci#define TG3_PHYFLG_CAPACITIVE_COUPLING 0x00000200 33458c2ecf20Sopenharmony_ci#define TG3_PHYFLG_NO_ETH_WIRE_SPEED 0x00000400 33468c2ecf20Sopenharmony_ci#define TG3_PHYFLG_JITTER_BUG 0x00000800 33478c2ecf20Sopenharmony_ci#define TG3_PHYFLG_ADJUST_TRIM 0x00001000 33488c2ecf20Sopenharmony_ci#define TG3_PHYFLG_ADC_BUG 0x00002000 33498c2ecf20Sopenharmony_ci#define TG3_PHYFLG_5704_A0_BUG 0x00004000 33508c2ecf20Sopenharmony_ci#define TG3_PHYFLG_BER_BUG 0x00008000 33518c2ecf20Sopenharmony_ci#define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000 33528c2ecf20Sopenharmony_ci#define TG3_PHYFLG_PARALLEL_DETECT 0x00020000 33538c2ecf20Sopenharmony_ci#define TG3_PHYFLG_EEE_CAP 0x00040000 33548c2ecf20Sopenharmony_ci#define TG3_PHYFLG_1G_ON_VAUX_OK 0x00080000 33558c2ecf20Sopenharmony_ci#define TG3_PHYFLG_KEEP_LINK_ON_PWRDN 0x00100000 33568c2ecf20Sopenharmony_ci#define TG3_PHYFLG_MDIX_STATE 0x00200000 33578c2ecf20Sopenharmony_ci#define TG3_PHYFLG_DISABLE_1G_HD_ADV 0x00400000 33588c2ecf20Sopenharmony_ci 33598c2ecf20Sopenharmony_ci u32 led_ctrl; 33608c2ecf20Sopenharmony_ci u32 phy_otp; 33618c2ecf20Sopenharmony_ci u32 setlpicnt; 33628c2ecf20Sopenharmony_ci u8 rss_ind_tbl[TG3_RSS_INDIR_TBL_SIZE]; 33638c2ecf20Sopenharmony_ci 33648c2ecf20Sopenharmony_ci#define TG3_BPN_SIZE 24 33658c2ecf20Sopenharmony_ci char board_part_number[TG3_BPN_SIZE]; 33668c2ecf20Sopenharmony_ci#define TG3_VER_SIZE ETHTOOL_FWVERS_LEN 33678c2ecf20Sopenharmony_ci char fw_ver[TG3_VER_SIZE]; 33688c2ecf20Sopenharmony_ci u32 nic_sram_data_cfg; 33698c2ecf20Sopenharmony_ci u32 pci_clock_ctrl; 33708c2ecf20Sopenharmony_ci struct pci_dev *pdev_peer; 33718c2ecf20Sopenharmony_ci 33728c2ecf20Sopenharmony_ci struct tg3_hw_stats *hw_stats; 33738c2ecf20Sopenharmony_ci dma_addr_t stats_mapping; 33748c2ecf20Sopenharmony_ci struct work_struct reset_task; 33758c2ecf20Sopenharmony_ci 33768c2ecf20Sopenharmony_ci int nvram_lock_cnt; 33778c2ecf20Sopenharmony_ci u32 nvram_size; 33788c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_2KB 0x00000800 33798c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_64KB 0x00010000 33808c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_128KB 0x00020000 33818c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_256KB 0x00040000 33828c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_512KB 0x00080000 33838c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_1MB 0x00100000 33848c2ecf20Sopenharmony_ci#define TG3_NVRAM_SIZE_2MB 0x00200000 33858c2ecf20Sopenharmony_ci 33868c2ecf20Sopenharmony_ci u32 nvram_pagesize; 33878c2ecf20Sopenharmony_ci u32 nvram_jedecnum; 33888c2ecf20Sopenharmony_ci 33898c2ecf20Sopenharmony_ci#define JEDEC_ATMEL 0x1f 33908c2ecf20Sopenharmony_ci#define JEDEC_ST 0x20 33918c2ecf20Sopenharmony_ci#define JEDEC_SAIFUN 0x4f 33928c2ecf20Sopenharmony_ci#define JEDEC_SST 0xbf 33938c2ecf20Sopenharmony_ci#define JEDEC_MACRONIX 0xc2 33948c2ecf20Sopenharmony_ci 33958c2ecf20Sopenharmony_ci#define ATMEL_AT24C02_CHIP_SIZE TG3_NVRAM_SIZE_2KB 33968c2ecf20Sopenharmony_ci#define ATMEL_AT24C02_PAGE_SIZE (8) 33978c2ecf20Sopenharmony_ci 33988c2ecf20Sopenharmony_ci#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB 33998c2ecf20Sopenharmony_ci#define ATMEL_AT24C64_PAGE_SIZE (32) 34008c2ecf20Sopenharmony_ci 34018c2ecf20Sopenharmony_ci#define ATMEL_AT24C512_CHIP_SIZE TG3_NVRAM_SIZE_512KB 34028c2ecf20Sopenharmony_ci#define ATMEL_AT24C512_PAGE_SIZE (128) 34038c2ecf20Sopenharmony_ci 34048c2ecf20Sopenharmony_ci#define ATMEL_AT45DB0X1B_PAGE_POS 9 34058c2ecf20Sopenharmony_ci#define ATMEL_AT45DB0X1B_PAGE_SIZE 264 34068c2ecf20Sopenharmony_ci 34078c2ecf20Sopenharmony_ci#define ATMEL_AT25F512_PAGE_SIZE 256 34088c2ecf20Sopenharmony_ci 34098c2ecf20Sopenharmony_ci#define ST_M45PEX0_PAGE_SIZE 256 34108c2ecf20Sopenharmony_ci 34118c2ecf20Sopenharmony_ci#define SAIFUN_SA25F0XX_PAGE_SIZE 256 34128c2ecf20Sopenharmony_ci 34138c2ecf20Sopenharmony_ci#define SST_25VF0X0_PAGE_SIZE 4098 34148c2ecf20Sopenharmony_ci 34158c2ecf20Sopenharmony_ci unsigned int irq_max; 34168c2ecf20Sopenharmony_ci unsigned int irq_cnt; 34178c2ecf20Sopenharmony_ci 34188c2ecf20Sopenharmony_ci struct ethtool_coalesce coal; 34198c2ecf20Sopenharmony_ci struct ethtool_eee eee; 34208c2ecf20Sopenharmony_ci 34218c2ecf20Sopenharmony_ci /* firmware info */ 34228c2ecf20Sopenharmony_ci const char *fw_needed; 34238c2ecf20Sopenharmony_ci const struct firmware *fw; 34248c2ecf20Sopenharmony_ci u32 fw_len; /* includes BSS */ 34258c2ecf20Sopenharmony_ci 34268c2ecf20Sopenharmony_ci struct device *hwmon_dev; 34278c2ecf20Sopenharmony_ci bool link_up; 34288c2ecf20Sopenharmony_ci bool pcierr_recovery; 34298c2ecf20Sopenharmony_ci 34308c2ecf20Sopenharmony_ci u32 ape_hb; 34318c2ecf20Sopenharmony_ci unsigned long ape_hb_interval; 34328c2ecf20Sopenharmony_ci unsigned long ape_hb_jiffies; 34338c2ecf20Sopenharmony_ci}; 34348c2ecf20Sopenharmony_ci 34358c2ecf20Sopenharmony_ci/* Accessor macros for chip and asic attributes 34368c2ecf20Sopenharmony_ci * 34378c2ecf20Sopenharmony_ci * nb: Using static inlines equivalent to the accessor macros generates 34388c2ecf20Sopenharmony_ci * larger object code with gcc 4.7. 34398c2ecf20Sopenharmony_ci * Using statement expression macros to check tp with 34408c2ecf20Sopenharmony_ci * typecheck(struct tg3 *, tp) also creates larger objects. 34418c2ecf20Sopenharmony_ci */ 34428c2ecf20Sopenharmony_ci#define tg3_chip_rev_id(tp) \ 34438c2ecf20Sopenharmony_ci ((tp)->pci_chip_rev_id) 34448c2ecf20Sopenharmony_ci#define tg3_asic_rev(tp) \ 34458c2ecf20Sopenharmony_ci ((tp)->pci_chip_rev_id >> 12) 34468c2ecf20Sopenharmony_ci#define tg3_chip_rev(tp) \ 34478c2ecf20Sopenharmony_ci ((tp)->pci_chip_rev_id >> 8) 34488c2ecf20Sopenharmony_ci 34498c2ecf20Sopenharmony_ci#endif /* !(_T3_H) */ 3450