16f3e57acSmx205022 /* 247693af9Smx205022 * CDDL HEADER START 347693af9Smx205022 * 447693af9Smx205022 * The contents of this file are subject to the terms of the 547693af9Smx205022 * Common Development and Distribution License (the "License"). 647693af9Smx205022 * You may not use this file except in compliance with the License. 747693af9Smx205022 * 847693af9Smx205022 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 947693af9Smx205022 * or http://www.opensolaris.org/os/licensing. 1047693af9Smx205022 * See the License for the specific language governing permissions 1147693af9Smx205022 * and limitations under the License. 1247693af9Smx205022 * 1347693af9Smx205022 * When distributing Covered Code, include this CDDL HEADER in each 1447693af9Smx205022 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1547693af9Smx205022 * If applicable, add the following below this CDDL HEADER, with the 1647693af9Smx205022 * fields enclosed by brackets "[]" replaced with your own identifying 1747693af9Smx205022 * information: Portions Copyright [yyyy] [name of copyright owner] 1847693af9Smx205022 * 1947693af9Smx205022 * CDDL HEADER END 206f3e57acSmx205022 */ 216f3e57acSmx205022 226f3e57acSmx205022 /* 23d635b452SWinson Wang - Sun Microsystems - Beijing China * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2447693af9Smx205022 * Use is subject to license terms. 256f3e57acSmx205022 */ 266f3e57acSmx205022 276f3e57acSmx205022 #ifndef _SYS_NGE_CHIP_H 286f3e57acSmx205022 #define _SYS_NGE_CHIP_H 296f3e57acSmx205022 306f3e57acSmx205022 #ifdef __cplusplus 316f3e57acSmx205022 extern "C" { 326f3e57acSmx205022 #endif 336f3e57acSmx205022 346f3e57acSmx205022 #include "nge.h" 356f3e57acSmx205022 366f3e57acSmx205022 #define VENDOR_ID_NVIDIA 0x10de 376f3e57acSmx205022 386f3e57acSmx205022 #define DEVICE_ID_MCP04_37 0x37 396f3e57acSmx205022 #define DEVICE_ID_MCP04_38 0x38 406f3e57acSmx205022 #define DEVICE_ID_CK804_56 0x56 416f3e57acSmx205022 #define DEVICE_ID_CK804_57 0x57 426f3e57acSmx205022 #define DEVICE_ID_MCP51_269 0x269 436f3e57acSmx205022 #define DEVICE_ID_MCP51_268 0x268 446f3e57acSmx205022 #define DEVICE_ID_MCP55_373 0x373 456f3e57acSmx205022 #define DEVICE_ID_MCP55_372 0x372 466f3e57acSmx205022 #define DEVICE_ID_MCP61_3EE 0x3ee 476f3e57acSmx205022 #define DEVICE_ID_MCP61_3EF 0x3ef 48a01a4735SWinson Wang - Sun Microsystems - Beijing China #define DEVICE_ID_MCP77_760 0x760 49*9fa05d92SWinson Wang - Sun Microsystems - Beijing China #define DEVICE_ID_MCP79_AB0 0xab0 506f3e57acSmx205022 #define DEVICE_ID_NF3_E6 0xe6 516f3e57acSmx205022 #define DEVICE_ID_NF3_DF 0xdf 526f3e57acSmx205022 536f3e57acSmx205022 /* Private PCI configuration register for bus config of ck804/mcp55 */ 546f3e57acSmx205022 #define PCI_CONF_HT_INTERNAL 0x4c 556f3e57acSmx205022 566f3e57acSmx205022 typedef union _nge_interbus_conf { 576f3e57acSmx205022 uint32_t conf_val; 586f3e57acSmx205022 struct { 596f3e57acSmx205022 uint32_t unit_id:5; 606f3e57acSmx205022 uint32_t resv5_23:19; 616f3e57acSmx205022 uint32_t aux_val:3; 626f3e57acSmx205022 uint32_t resv27:1; 636f3e57acSmx205022 uint32_t msi_off:1; 646f3e57acSmx205022 uint32_t msix_off:1; /* mcp55 only */ 656f3e57acSmx205022 uint32_t resv30_31:2; 666f3e57acSmx205022 } conf_bits; 676f3e57acSmx205022 } nge_interbus_conf; 686f3e57acSmx205022 696f3e57acSmx205022 /* Private PCI configuration register for MSI mask of mcp55 */ 706f3e57acSmx205022 #define PCI_CONF_HT_MSI_MASK 0x60 716f3e57acSmx205022 726f3e57acSmx205022 typedef union _nge_msi_mask_conf { 736f3e57acSmx205022 uint32_t msi_mask_conf_val; 746f3e57acSmx205022 struct { 756f3e57acSmx205022 uint32_t vec0_off:1; 766f3e57acSmx205022 uint32_t vec1_off:1; 776f3e57acSmx205022 uint32_t vec2_off:1; 786f3e57acSmx205022 uint32_t vec3_off:1; 796f3e57acSmx205022 uint32_t vec4_off:1; 806f3e57acSmx205022 uint32_t vec5_off:1; 816f3e57acSmx205022 uint32_t vec6_off:1; 826f3e57acSmx205022 uint32_t vec7_off:1; 836f3e57acSmx205022 uint32_t resv8_31:24; 846f3e57acSmx205022 } msi_mask_bits; 856f3e57acSmx205022 } nge_msi_mask_conf; 866f3e57acSmx205022 876f3e57acSmx205022 /* Private PCI configuration register for MSI map capability of mcp55 */ 886f3e57acSmx205022 #define PCI_CONF_HT_MSI_MAP_CAP 0x6c 896f3e57acSmx205022 906f3e57acSmx205022 typedef union _nge_msi_map_cap_conf { 916f3e57acSmx205022 uint32_t msi_map_cap_conf_val; 926f3e57acSmx205022 struct { 936f3e57acSmx205022 uint32_t cap_id:8; 946f3e57acSmx205022 uint32_t next_ptr:8; 956f3e57acSmx205022 uint32_t map_en:1; 966f3e57acSmx205022 uint32_t map_fixed:1; 976f3e57acSmx205022 uint32_t resv18_26:9; 986f3e57acSmx205022 uint32_t cap_type:5; 996f3e57acSmx205022 } map_cap_conf_bits; 1006f3e57acSmx205022 } nge_msi_map_cap_conf; 1016f3e57acSmx205022 1026f3e57acSmx205022 /* 1036f3e57acSmx205022 * Master interrupt 1046f3e57acSmx205022 */ 1056f3e57acSmx205022 #define NGE_INTR_SRC 0x000 1066f3e57acSmx205022 #define INTR_SRC_ALL 0x00007fff 1076f3e57acSmx205022 typedef union _nge_intr_src { 1086f3e57acSmx205022 uint32_t intr_val; 1096f3e57acSmx205022 struct { 1106f3e57acSmx205022 uint32_t reint:1; 1116f3e57acSmx205022 uint32_t rcint:1; 1126f3e57acSmx205022 uint32_t miss:1; 1136f3e57acSmx205022 uint32_t teint:1; 1146f3e57acSmx205022 uint32_t tcint:1; 1156f3e57acSmx205022 uint32_t stint:1; 1166f3e57acSmx205022 uint32_t mint:1; 1176f3e57acSmx205022 uint32_t rfint:1; 1186f3e57acSmx205022 uint32_t tfint:1; 1196f3e57acSmx205022 uint32_t feint:1; 1206f3e57acSmx205022 uint32_t resv10:1; 1216f3e57acSmx205022 uint32_t resv11:1; 1226f3e57acSmx205022 uint32_t resv12:1; 1236f3e57acSmx205022 uint32_t resv13:1; 1246f3e57acSmx205022 uint32_t phyint:1; 1256f3e57acSmx205022 uint32_t resv15_31:17; 1266f3e57acSmx205022 } int_bits; 1276f3e57acSmx205022 } nge_intr_src; 1286f3e57acSmx205022 1296f3e57acSmx205022 /* 1306f3e57acSmx205022 * Master interrupt Mask 1316f3e57acSmx205022 */ 1326f3e57acSmx205022 #define NGE_INTR_MASK 0x004 1336f3e57acSmx205022 #define NGE_INTR_ALL_EN 0x00007fff 1346f3e57acSmx205022 typedef union _nge_intr_mask { 1356f3e57acSmx205022 uint32_t mask_val; 1366f3e57acSmx205022 struct { 1376f3e57acSmx205022 uint32_t reint:1; 1386f3e57acSmx205022 uint32_t rcint:1; 1396f3e57acSmx205022 uint32_t miss:1; 1406f3e57acSmx205022 uint32_t teint:1; 1416f3e57acSmx205022 uint32_t tcint:1; 1426f3e57acSmx205022 uint32_t stint:1; 1436f3e57acSmx205022 uint32_t mint:1; 1446f3e57acSmx205022 uint32_t rfint:1; 1456f3e57acSmx205022 uint32_t tfint:1; 1466f3e57acSmx205022 uint32_t feint:1; 1476f3e57acSmx205022 uint32_t resv10:1; 1486f3e57acSmx205022 uint32_t resv11:1; 1496f3e57acSmx205022 uint32_t resv12:1; 1506f3e57acSmx205022 uint32_t resv13:1; 1516f3e57acSmx205022 uint32_t phyint:1; 1526f3e57acSmx205022 uint32_t resv15_31:17; 1536f3e57acSmx205022 } mask_bits; 1546f3e57acSmx205022 } nge_intr_mask; 1556f3e57acSmx205022 1566f3e57acSmx205022 /* 1576f3e57acSmx205022 * Software timer control register 1586f3e57acSmx205022 */ 1596f3e57acSmx205022 #define NGE_SWTR_CNTL 0x008 1606f3e57acSmx205022 typedef union _nge_swtr_cntl { 1616f3e57acSmx205022 uint8_t ctrl_val; 1626f3e57acSmx205022 struct { 1636f3e57acSmx205022 uint8_t stren:1; 1646f3e57acSmx205022 uint8_t sten:1; 1656f3e57acSmx205022 uint8_t resv2_7:6; 1666f3e57acSmx205022 } cntl_bits; 1676f3e57acSmx205022 } nge_swtr_cntl; 1686f3e57acSmx205022 1696f3e57acSmx205022 /* 1706f3e57acSmx205022 * Software Timer Interval 1716f3e57acSmx205022 */ 1726f3e57acSmx205022 #define NGE_SWTR_ITC 0x00c 17302d51d0dSjj146644 17402d51d0dSjj146644 /* Default timer interval, 97 would mean 1 ms */ 17502d51d0dSjj146644 #define SWTR_ITC 0x8 1766f3e57acSmx205022 typedef union _nge_itc { 1776f3e57acSmx205022 uint32_t itc_val; 1786f3e57acSmx205022 struct { 1796f3e57acSmx205022 uint32_t sw_intv:16; 1806f3e57acSmx205022 uint32_t sw_cur_val:16; 1816f3e57acSmx205022 } itc_bits; 1826f3e57acSmx205022 } nge_itc; 1836f3e57acSmx205022 1846f3e57acSmx205022 /* 1856f3e57acSmx205022 * Fatal error register 1866f3e57acSmx205022 */ 1876f3e57acSmx205022 #define NGE_REG010 0x010 1886f3e57acSmx205022 typedef union _nge_reg010 { 1896f3e57acSmx205022 uint32_t reg010_val; 1906f3e57acSmx205022 struct { 1916f3e57acSmx205022 uint32_t resv0:1; 1926f3e57acSmx205022 uint32_t resv1:1; 1936f3e57acSmx205022 uint32_t resv2:1; 1946f3e57acSmx205022 uint32_t resv3:1; 1956f3e57acSmx205022 uint32_t resv4:1; 1966f3e57acSmx205022 uint32_t resv5:1; 1976f3e57acSmx205022 uint32_t resv6:1; 1986f3e57acSmx205022 uint32_t resv7:1; 1996f3e57acSmx205022 uint32_t resv8:1; 2006f3e57acSmx205022 uint32_t resv9:1; 2016f3e57acSmx205022 uint32_t resv10:1; 2026f3e57acSmx205022 uint32_t resv11_31:21; 2036f3e57acSmx205022 } reg010_bits; 2046f3e57acSmx205022 } nge_reg010; 2056f3e57acSmx205022 2066f3e57acSmx205022 /* 2076f3e57acSmx205022 * MSI vector map register 0 2086f3e57acSmx205022 */ 2096f3e57acSmx205022 #define NGE_MSI_MAP0 0x020 2106f3e57acSmx205022 typedef union _nge_msi_map0_vec { 2116f3e57acSmx205022 uint32_t msi_map0_val; 2126f3e57acSmx205022 struct { 2136f3e57acSmx205022 uint32_t reint_vec:4; 2146f3e57acSmx205022 uint32_t rcint_vec:4; 2156f3e57acSmx205022 uint32_t miss_vec:4; 2166f3e57acSmx205022 uint32_t teint_vec:4; 2176f3e57acSmx205022 uint32_t tcint_vec:4; 2186f3e57acSmx205022 uint32_t stint_vec:4; 2196f3e57acSmx205022 uint32_t mint_vec:4; 2206f3e57acSmx205022 uint32_t rfint_vec:4; 2216f3e57acSmx205022 } vecs_bits; 2226f3e57acSmx205022 } nge_msi_map0_vec; 2236f3e57acSmx205022 2246f3e57acSmx205022 /* 2256f3e57acSmx205022 * MSI vector map register 1 2266f3e57acSmx205022 */ 2276f3e57acSmx205022 #define NGE_MSI_MAP1 0x024 2286f3e57acSmx205022 typedef union _nge_msi_map1_vec { 2296f3e57acSmx205022 uint32_t msi_map1_val; 2306f3e57acSmx205022 struct { 2316f3e57acSmx205022 uint32_t tfint_vec:4; 2326f3e57acSmx205022 uint32_t feint_vec:4; 2336f3e57acSmx205022 uint32_t resv8_11:4; 2346f3e57acSmx205022 uint32_t resv12_15:4; 2356f3e57acSmx205022 uint32_t resv16_19:4; 2366f3e57acSmx205022 uint32_t resv20_23:4; 2376f3e57acSmx205022 uint32_t resv24_31:8; 2386f3e57acSmx205022 } vecs_bits; 2396f3e57acSmx205022 } nge_msi_map1_vec; 2406f3e57acSmx205022 2416f3e57acSmx205022 2426f3e57acSmx205022 /* 2436f3e57acSmx205022 * MSI vector map register 2 2446f3e57acSmx205022 */ 2456f3e57acSmx205022 #define NGE_MSI_MAP2 0x028 2466f3e57acSmx205022 2476f3e57acSmx205022 /* 2486f3e57acSmx205022 * MSI vector map register 2 2496f3e57acSmx205022 */ 2506f3e57acSmx205022 #define NGE_MSI_MAP3 0x02c 2516f3e57acSmx205022 2526f3e57acSmx205022 /* 2536f3e57acSmx205022 * MSI mask register for mcp55 2546f3e57acSmx205022 */ 2556f3e57acSmx205022 #define NGE_MSI_MASK 0x30 2566f3e57acSmx205022 typedef union _nge_msi_mask { 2576f3e57acSmx205022 uint32_t msi_mask_val; 2586f3e57acSmx205022 struct { 2596f3e57acSmx205022 uint32_t vec0:1; 2606f3e57acSmx205022 uint32_t vec1:1; 2616f3e57acSmx205022 uint32_t vec2:1; 2626f3e57acSmx205022 uint32_t vec3:1; 2636f3e57acSmx205022 uint32_t vec4:1; 2646f3e57acSmx205022 uint32_t vec5:1; 2656f3e57acSmx205022 uint32_t vec6:1; 2666f3e57acSmx205022 uint32_t vec7:1; 2676f3e57acSmx205022 uint32_t resv8_31:24; 2686f3e57acSmx205022 }msi_msk_bits; 2696f3e57acSmx205022 }nge_msi_mask; 2706f3e57acSmx205022 2716f3e57acSmx205022 /* 2726f3e57acSmx205022 * Software misc register for mcp51 2736f3e57acSmx205022 */ 2746f3e57acSmx205022 #define NGE_SOFT_MISC 0x034 2756f3e57acSmx205022 typedef union _nge_soft_misc { 2766f3e57acSmx205022 uint32_t misc_val; 2776f3e57acSmx205022 struct { 2786f3e57acSmx205022 uint32_t rx_clk_vx_rst:1; 2796f3e57acSmx205022 uint32_t tx_clk_vx_rst:1; 2806f3e57acSmx205022 uint32_t clk12m_vx_rst:1; 2816f3e57acSmx205022 uint32_t fpci_clk_vx_rst:1; 2826f3e57acSmx205022 uint32_t rx_clk_vc_rst:1; 2836f3e57acSmx205022 uint32_t tx_clk_vc_rst:1; 2846f3e57acSmx205022 uint32_t fs_clk_vc_rst:1; 2856f3e57acSmx205022 uint32_t rst_ex_m2pintf:1; 2866f3e57acSmx205022 uint32_t resv8_31:24; 2876f3e57acSmx205022 } misc_bits; 2886f3e57acSmx205022 } nge_soft_misc; 2896f3e57acSmx205022 2906f3e57acSmx205022 /* 2916f3e57acSmx205022 * DMA configuration 2926f3e57acSmx205022 */ 2936f3e57acSmx205022 #define NGE_DMA_CFG 0x040 2946f3e57acSmx205022 typedef union _nge_dma_cfg { 2956f3e57acSmx205022 uint32_t cfg_val; 2966f3e57acSmx205022 struct { 2976f3e57acSmx205022 uint32_t tx_start_pri:3; 2986f3e57acSmx205022 uint32_t tx_start_pri_flag:1; 2996f3e57acSmx205022 uint32_t tx_prd_rpri:3; 3006f3e57acSmx205022 uint32_t tx_prd_rpri_flag:1; 3016f3e57acSmx205022 uint32_t tx_prd_wpri:3; 3026f3e57acSmx205022 uint32_t tx_prd_wpri_flag:1; 3036f3e57acSmx205022 uint32_t rx_start_pri:3; 3046f3e57acSmx205022 uint32_t rx_start_pri_flag:1; 3056f3e57acSmx205022 uint32_t rx_prd_rpri:3; 3066f3e57acSmx205022 uint32_t rx_prd_rpri_flag:1; 3076f3e57acSmx205022 uint32_t rx_prd_wpri:3; 3086f3e57acSmx205022 uint32_t rx_prd_wpri_flag:1; 3096f3e57acSmx205022 uint32_t dma_max_pri:3; 3106f3e57acSmx205022 uint32_t dma_wrr_disable:1; 3116f3e57acSmx205022 uint32_t dma_pri_disable:1; 3126f3e57acSmx205022 } cfg_bits; 3136f3e57acSmx205022 } nge_dma_cfg; 3146f3e57acSmx205022 3156f3e57acSmx205022 /* 3166f3e57acSmx205022 * Request DMA configuration 3176f3e57acSmx205022 */ 3186f3e57acSmx205022 #define NGE_DMA_RCFG 0x044 3196f3e57acSmx205022 typedef union _nge_dma_rcfg { 3206f3e57acSmx205022 uint32_t dma_rcfg_val; 3216f3e57acSmx205022 struct { 3226f3e57acSmx205022 uint32_t tx_prd_coh_state:2; 3236f3e57acSmx205022 uint32_t tx_data_coh_state:2; 3246f3e57acSmx205022 uint32_t rx_prd_coh_state:2; 3256f3e57acSmx205022 uint32_t rx_data_coh_state:2; 3266f3e57acSmx205022 uint32_t max_roffset:5; 3276f3e57acSmx205022 uint32_t resv13_31:19; 3286f3e57acSmx205022 } rcfg_bis; 3296f3e57acSmx205022 } nge_dma_rcfg; 3306f3e57acSmx205022 3316f3e57acSmx205022 /* 3326f3e57acSmx205022 * Hot DMA configuration 3336f3e57acSmx205022 */ 3346f3e57acSmx205022 #define NGE_DMA_HOT_CFG 0x048 3356f3e57acSmx205022 typedef union _nge_dma_hcfg { 3366f3e57acSmx205022 uint32_t dma_hcfg_val; 3376f3e57acSmx205022 struct { 3386f3e57acSmx205022 uint32_t resv0_3:4; 3396f3e57acSmx205022 uint32_t noti_wstart_pri:3; 3406f3e57acSmx205022 uint32_t noti_wstart_pri_flag:1; 3416f3e57acSmx205022 uint32_t cmd_rstart_pri:3; 3426f3e57acSmx205022 uint32_t cmd_rstart_pri_flag:1; 3436f3e57acSmx205022 uint32_t cmd_wstart_pri:3; 3446f3e57acSmx205022 uint32_t cmd_wstart_pri_flag:1; 3456f3e57acSmx205022 uint32_t resv16_31:16; 3466f3e57acSmx205022 } hcfg_bits; 3476f3e57acSmx205022 } nge_dma_hcfg; 3486f3e57acSmx205022 3496f3e57acSmx205022 /* 3506f3e57acSmx205022 * PMU control register 0 for mcp51 3516f3e57acSmx205022 */ 3526f3e57acSmx205022 #define NGE_PMU_CNTL0 0x060 3536f3e57acSmx205022 #define NGE_PMU_CORE_SPD10_BUSY 0x8 3546f3e57acSmx205022 #define NGE_PMU_CORE_SPD10_IDLE 0xB 3556f3e57acSmx205022 #define NGE_PMU_CORE_SPD100_BUSY 0x4 3566f3e57acSmx205022 #define NGE_PMU_CORE_SPD100_IDLE 0x7 3576f3e57acSmx205022 #define NGE_PMU_CORE_SPD1000_BUSY 0x0 3586f3e57acSmx205022 #define NGE_PMU_CORE_SPD1000_IDLE 0x3 3596f3e57acSmx205022 3606f3e57acSmx205022 typedef union _nge_pmu_cntl0 { 3616f3e57acSmx205022 uint32_t cntl0_val; 3626f3e57acSmx205022 struct { 3636f3e57acSmx205022 uint32_t core_spd10_fp:4; 3646f3e57acSmx205022 uint32_t core_spd10_idle:4; 3656f3e57acSmx205022 uint32_t core_spd100_fp:4; 3666f3e57acSmx205022 uint32_t core_spd100_idle:4; 3676f3e57acSmx205022 uint32_t core_spd1000_fp:4; 3686f3e57acSmx205022 uint32_t core_spd1000_idle:4; 3696f3e57acSmx205022 uint32_t core_sts_cur:8; 3706f3e57acSmx205022 } cntl0_bits; 3716f3e57acSmx205022 } nge_pmu_cntl0; 3726f3e57acSmx205022 3736f3e57acSmx205022 /* 3746f3e57acSmx205022 * PMU control register 1 for mcp51 3756f3e57acSmx205022 */ 3766f3e57acSmx205022 #define NGE_PMU_CNTL1 0x064 3776f3e57acSmx205022 typedef union _nge_pmu_cntl1 { 3786f3e57acSmx205022 uint32_t cntl1_val; 3796f3e57acSmx205022 struct { 3806f3e57acSmx205022 uint32_t dev_fp:4; 3816f3e57acSmx205022 uint32_t dev_idle:4; 3826f3e57acSmx205022 uint32_t resv8_27:20; 3836f3e57acSmx205022 uint32_t dev_sts_cur:4; 3846f3e57acSmx205022 } cntl1_bits; 3856f3e57acSmx205022 } nge_pmu_cntl1; 3866f3e57acSmx205022 3876f3e57acSmx205022 /* 3886f3e57acSmx205022 * PMU control register 2 for mcp51 3896f3e57acSmx205022 */ 3906f3e57acSmx205022 #define NGE_PMU_CNTL2 0x068 3916f3e57acSmx205022 typedef union _nge_pmu_cntl2 { 3926f3e57acSmx205022 uint32_t cntl2_val; 3936f3e57acSmx205022 struct { 3946f3e57acSmx205022 uint32_t core_override:4; 3956f3e57acSmx205022 uint32_t resv4_7:4; 3966f3e57acSmx205022 uint32_t dev_override:4; 3976f3e57acSmx205022 uint32_t resv12_15:4; 3986f3e57acSmx205022 uint32_t core_override_en:1; 3996f3e57acSmx205022 uint32_t dev_override_en:1; 4006f3e57acSmx205022 uint32_t core_enable:1; 4016f3e57acSmx205022 uint32_t dev_enable:1; 4026f3e57acSmx205022 uint32_t rx_wake_dis:1; 4036f3e57acSmx205022 uint32_t cidle_timer:1; 4046f3e57acSmx205022 uint32_t didle_timer:1; 4056f3e57acSmx205022 uint32_t resv23_31:9; 4066f3e57acSmx205022 } cntl2_bits; 4076f3e57acSmx205022 } nge_pmu_cntl2; 4086f3e57acSmx205022 4096f3e57acSmx205022 /* 4106f3e57acSmx205022 * PMU core idle limit register for mcp51 4116f3e57acSmx205022 */ 4126f3e57acSmx205022 #define NGE_PMU_CIDLE_LIMIT 0x06c 4136f3e57acSmx205022 #define NGE_PMU_CIDLE_LIMIT_DEF 0xffff 4146f3e57acSmx205022 4156f3e57acSmx205022 /* 4166f3e57acSmx205022 * PMU device idle limit register for mcp51 4176f3e57acSmx205022 */ 4186f3e57acSmx205022 #define NGE_PMU_DIDLE_LIMIT 0x070 4196f3e57acSmx205022 #define NGE_PMU_DIDLE_LIMIT_DEF 0xffff 4206f3e57acSmx205022 4216f3e57acSmx205022 /* 4226f3e57acSmx205022 * PMU core idle count value register for mcp51 4236f3e57acSmx205022 */ 4246f3e57acSmx205022 #define NGE_PMU_CIDLE_COUNT 0x074 4256f3e57acSmx205022 #define NGE_PMU_CIDEL_COUNT_DEF 0xffff 4266f3e57acSmx205022 4276f3e57acSmx205022 /* 4286f3e57acSmx205022 * PMU device idle count value register for mcp51 4296f3e57acSmx205022 */ 4306f3e57acSmx205022 #define NGE_PMU_DIDLE_COUNT 0x078 4316f3e57acSmx205022 #define NGE_PMU_DIDEL_COUNT_DEF 0xffff 4326f3e57acSmx205022 4336f3e57acSmx205022 /* 4346f3e57acSmx205022 * Transmit control 4356f3e57acSmx205022 */ 4366f3e57acSmx205022 #define NGE_TX_CNTL 0x080 4376f3e57acSmx205022 typedef union _nge_tx_cntl { 4386f3e57acSmx205022 uint32_t cntl_val; 4396f3e57acSmx205022 struct { 4406f3e57acSmx205022 uint32_t paen:1; /* only for mcp55, otherwise reserve */ 4416f3e57acSmx205022 uint32_t resv1:1; 4426f3e57acSmx205022 uint32_t retry_en:1; 4436f3e57acSmx205022 uint32_t pad_en:1; 4446f3e57acSmx205022 uint32_t fappend_en:1; 4456f3e57acSmx205022 uint32_t two_def_en:1; 4466f3e57acSmx205022 uint32_t resv6_7:2; 4476f3e57acSmx205022 uint32_t max_retry:4; 4486f3e57acSmx205022 uint32_t burst_en:1; 4496f3e57acSmx205022 uint32_t resv13_15:3; 4506f3e57acSmx205022 uint32_t retry_emask:1; 4516f3e57acSmx205022 uint32_t exdef_mask:1; 4526f3e57acSmx205022 uint32_t def_mask:1; 4536f3e57acSmx205022 uint32_t lcar_mask:1; 4546f3e57acSmx205022 uint32_t tlcol_mask:1; 4556f3e57acSmx205022 uint32_t uflo_err_mask:1; 4566f3e57acSmx205022 uint32_t resv22_23:2; 4576f3e57acSmx205022 uint32_t jam_seq_en:1; 4586f3e57acSmx205022 uint32_t resv25_31:7; 4596f3e57acSmx205022 } cntl_bits; 4606f3e57acSmx205022 } nge_tx_cntl; 4616f3e57acSmx205022 4626f3e57acSmx205022 /* 4636f3e57acSmx205022 * Transmit enable 4646f3e57acSmx205022 * Note: for ck804 or mcp51, this is 8-bit register; 4656f3e57acSmx205022 * for mcp55, it is a 32-bit register. 4666f3e57acSmx205022 */ 4676f3e57acSmx205022 #define NGE_TX_EN 0x084 468d635b452SWinson Wang - Sun Microsystems - Beijing China #define NGE_SMU_FREE 0x0 469d635b452SWinson Wang - Sun Microsystems - Beijing China #define NGE_SMU_GET 0xf 4706f3e57acSmx205022 typedef union _nge_tx_en { 471d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t val; 4726f3e57acSmx205022 struct { 473d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t tx_en:1; 474d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t resv1_7:7; 475d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t smu2mac:4; 476d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t mac2smu:4; 477d635b452SWinson Wang - Sun Microsystems - Beijing China uint32_t resv16_31:16; 4786f3e57acSmx205022 } bits; 4796f3e57acSmx205022 } nge_tx_en; 4806f3e57acSmx205022 4816f3e57acSmx205022 /* 4826f3e57acSmx205022 * Transmit status 4836f3e57acSmx205022 */ 4846f3e57acSmx205022 #define NGE_TX_STA 0x088 4856f3e57acSmx205022 typedef union _nge_tx_sta { 4866f3e57acSmx205022 uint32_t sta_val; 4876f3e57acSmx205022 struct { 4886f3e57acSmx205022 uint32_t tx_chan_sta:1; 4896f3e57acSmx205022 uint32_t resv1_15:15; 4906f3e57acSmx205022 uint32_t retry_err:1; 4916f3e57acSmx205022 uint32_t exdef:1; 4926f3e57acSmx205022 uint32_t def:1; 4936f3e57acSmx205022 uint32_t lcar:1; 4946f3e57acSmx205022 uint32_t tlcol:1; 4956f3e57acSmx205022 uint32_t uflo:1; 4966f3e57acSmx205022 uint32_t resv22_31:10; 4976f3e57acSmx205022 } sta_bits; 4986f3e57acSmx205022 } nge_tx_sta; 4996f3e57acSmx205022 5006f3e57acSmx205022 /* 5016f3e57acSmx205022 * Receive control 5026f3e57acSmx205022 */ 5036f3e57acSmx205022 #define NGE_RX_CNTL0 0x08c 5046f3e57acSmx205022 typedef union _nge_rx_cntrl0 { 5056f3e57acSmx205022 uint32_t cntl_val; 5066f3e57acSmx205022 struct { 5076f3e57acSmx205022 uint32_t resv0:1; 5086f3e57acSmx205022 uint32_t padsen:1; 5096f3e57acSmx205022 uint32_t fcsren:1; 5106f3e57acSmx205022 uint32_t paen:1; 5116f3e57acSmx205022 uint32_t lben:1; 5126f3e57acSmx205022 uint32_t afen:1; 5136f3e57acSmx205022 uint32_t runten:1; 5146f3e57acSmx205022 uint32_t brdis:1; 5156f3e57acSmx205022 uint32_t rdfen:1; 5166f3e57acSmx205022 uint32_t slfb:1; 5176f3e57acSmx205022 uint32_t resv10_15:6; 5186f3e57acSmx205022 uint32_t runtm:1; 5196f3e57acSmx205022 uint32_t rlcolm:1; 5206f3e57acSmx205022 uint32_t maxerm:1; 5216f3e57acSmx205022 uint32_t lferm:1; 5226f3e57acSmx205022 uint32_t crcm:1; 5236f3e57acSmx205022 uint32_t ofolm:1; 5246f3e57acSmx205022 uint32_t framerm:1; 5256f3e57acSmx205022 uint32_t resv23_31:9; 5266f3e57acSmx205022 } cntl_bits; 5276f3e57acSmx205022 } nge_rx_cntrl0; 5286f3e57acSmx205022 5296f3e57acSmx205022 /* 5306f3e57acSmx205022 * Maximum receive Frame size 5316f3e57acSmx205022 */ 5326f3e57acSmx205022 #define NGE_RX_CNTL1 0x090 5336f3e57acSmx205022 typedef union _nge_rx_cntl1 { 5346f3e57acSmx205022 uint32_t cntl_val; 5356f3e57acSmx205022 struct { 5366f3e57acSmx205022 uint32_t length:14; 5376f3e57acSmx205022 uint32_t resv14_31:18; 5386f3e57acSmx205022 } cntl_bits; 5396f3e57acSmx205022 } nge_rx_cntl1; 5406f3e57acSmx205022 5416f3e57acSmx205022 /* 5426f3e57acSmx205022 * Receive enable register 5436f3e57acSmx205022 * Note: for ck804 and mcp51, this is a 8-bit register; 5446f3e57acSmx205022 * for mcp55, it is a 32-bit register. 5456f3e57acSmx205022 */ 5466f3e57acSmx205022 #define NGE_RX_EN 0x094 5476f3e57acSmx205022 typedef union _nge_rx_en { 5486f3e57acSmx205022 uint8_t val; 5496f3e57acSmx205022 struct { 5506f3e57acSmx205022 uint8_t rx_en:1; 5516f3e57acSmx205022 uint8_t resv1_7:7; 5526f3e57acSmx205022 } bits; 5536f3e57acSmx205022 } nge_rx_en; 5546f3e57acSmx205022 5556f3e57acSmx205022 /* 5566f3e57acSmx205022 * Receive status register 5576f3e57acSmx205022 */ 5586f3e57acSmx205022 #define NGE_RX_STA 0x098 5596f3e57acSmx205022 typedef union _nge_rx_sta { 5606f3e57acSmx205022 uint32_t sta_val; 5616f3e57acSmx205022 struct { 5626f3e57acSmx205022 uint32_t rx_chan_sta:1; 5636f3e57acSmx205022 uint32_t resv1_15:15; 5646f3e57acSmx205022 uint32_t runt_sta:1; 5656f3e57acSmx205022 uint32_t rlcol_sta:1; 5666f3e57acSmx205022 uint32_t mlen_err:1; 5676f3e57acSmx205022 uint32_t lf_err:1; 5686f3e57acSmx205022 uint32_t crc_err:1; 5696f3e57acSmx205022 uint32_t ofol_err:1; 5706f3e57acSmx205022 uint32_t fram_err:1; 5716f3e57acSmx205022 uint32_t resv23_31:9; 5726f3e57acSmx205022 } sta_bits; 5736f3e57acSmx205022 } nge_rx_sta; 5746f3e57acSmx205022 5756f3e57acSmx205022 /* 5766f3e57acSmx205022 * Backoff Control 5776f3e57acSmx205022 */ 5786f3e57acSmx205022 #define NGE_BKOFF_CNTL 0x09c 5796f3e57acSmx205022 #define BKOFF_RSEED 0x8 5806f3e57acSmx205022 #define BKOFF_SLIM_GMII 0x3ff 5816f3e57acSmx205022 #define BKOFF_SLIM_MII 0x7f 5826f3e57acSmx205022 typedef union _nge_bkoff_cntl { 5836f3e57acSmx205022 uint32_t cntl_val; 5846f3e57acSmx205022 struct { 5856f3e57acSmx205022 uint32_t rseed:8; 5866f3e57acSmx205022 uint32_t sltm:10; 5876f3e57acSmx205022 uint32_t resv18_30:13; 5886f3e57acSmx205022 uint32_t leg_bk_en:1; 5896f3e57acSmx205022 } bkoff_bits; 5906f3e57acSmx205022 } nge_bkoff_cntl; 5916f3e57acSmx205022 5926f3e57acSmx205022 /* 5936f3e57acSmx205022 * Transmit defferral timing 5946f3e57acSmx205022 */ 5956f3e57acSmx205022 #define NGE_TX_DEF 0x0a0 5966f3e57acSmx205022 #define TX_TIFG_MII 0x15 5976f3e57acSmx205022 #define TX_IFG_RGMII_1000_FD 0x14 5986f3e57acSmx205022 #define TX_IFG_RGMII_OTHER 0x16 5996f3e57acSmx205022 #define TX_IFG2_MII 0x5 6006f3e57acSmx205022 #define TX_IFG2_RGMII_10_100 0x7 6016f3e57acSmx205022 #define TX_IFG2_RGMII_1000 0x5 6026f3e57acSmx205022 #define TX_IFG2_DEFAULT 0X0 6036f3e57acSmx205022 #define TX_IFG1_DEFAULT 0xf 6046f3e57acSmx205022 typedef union _nge_tx_def { 6056f3e57acSmx205022 uint32_t def_val; 6066f3e57acSmx205022 struct { 6076f3e57acSmx205022 uint32_t ifg1_def:8; 6086f3e57acSmx205022 uint32_t ifg2_def:8; 6096f3e57acSmx205022 uint32_t if_def:8; 6106f3e57acSmx205022 uint32_t resv24_31:8; 6116f3e57acSmx205022 } def_bits; 6126f3e57acSmx205022 } nge_tx_def; 6136f3e57acSmx205022 6146f3e57acSmx205022 /* 6156f3e57acSmx205022 * Receive defferral timing 6166f3e57acSmx205022 */ 6176f3e57acSmx205022 #define NGE_RX_DEf 0x0a4 6186f3e57acSmx205022 #define RX_DEF_DEFAULT 0x16 6196f3e57acSmx205022 typedef union _nge_rx_def { 6206f3e57acSmx205022 uint8_t def_val; 6216f3e57acSmx205022 struct { 6226f3e57acSmx205022 uint8_t rifg; 6236f3e57acSmx205022 } def_bits; 6246f3e57acSmx205022 } nge_rx_def; 6256f3e57acSmx205022 6266f3e57acSmx205022 /* 6276f3e57acSmx205022 * Low 32 bit unicast address 6286f3e57acSmx205022 */ 6296f3e57acSmx205022 #define NGE_UNI_ADDR0 0x0a8 6306f3e57acSmx205022 union { 6316f3e57acSmx205022 uint32_t addr_val; 6326f3e57acSmx205022 struct { 6336f3e57acSmx205022 uint32_t addr; 6346f3e57acSmx205022 } addr_bits; 6356f3e57acSmx205022 } nge_uni_addr0; 6366f3e57acSmx205022 6376f3e57acSmx205022 /* 6386f3e57acSmx205022 * High 32 bit unicast address 6396f3e57acSmx205022 */ 6406f3e57acSmx205022 #define NGE_UNI_ADDR1 0x0ac 6416f3e57acSmx205022 typedef union _nge_uni_addr1 { 6426f3e57acSmx205022 uint32_t addr_val; 6436f3e57acSmx205022 struct { 6446f3e57acSmx205022 uint32_t addr:16; 6456f3e57acSmx205022 uint32_t resv16_31:16; 6466f3e57acSmx205022 } addr_bits; 6476f3e57acSmx205022 } nge_uni_addr1; 6486f3e57acSmx205022 649d27d4a13SMiles Xu, Sun Microsystems #define LOW_24BITS_MASK 0xffffffULL 650d27d4a13SMiles Xu, Sun Microsystems #define REVERSE_MAC_ELITE 0x211900ULL 651d27d4a13SMiles Xu, Sun Microsystems #define REVERSE_MAC_GIGABYTE 0xe61600ULL 652d27d4a13SMiles Xu, Sun Microsystems #define REVERSE_MAC_ASUS 0x601d00ULL 653d27d4a13SMiles Xu, Sun Microsystems 6546f3e57acSmx205022 /* 6556f3e57acSmx205022 * Low 32 bit multicast address 6566f3e57acSmx205022 */ 6576f3e57acSmx205022 #define NGE_MUL_ADDR0 0x0b0 6586f3e57acSmx205022 union { 6596f3e57acSmx205022 uint32_t addr_val; 6606f3e57acSmx205022 struct { 6616f3e57acSmx205022 uint32_t addr; 6626f3e57acSmx205022 }addr_bits; 6636f3e57acSmx205022 }nge_mul_addr0; 6646f3e57acSmx205022 6656f3e57acSmx205022 /* 6666f3e57acSmx205022 * High 32 bit multicast address 6676f3e57acSmx205022 */ 6686f3e57acSmx205022 #define NGE_MUL_ADDR1 0x0b4 6696f3e57acSmx205022 typedef union _nge_mul_addr1 { 6706f3e57acSmx205022 uint32_t addr_val; 6716f3e57acSmx205022 struct { 6726f3e57acSmx205022 uint32_t addr:16; 6736f3e57acSmx205022 uint32_t resv16_31:16; 6746f3e57acSmx205022 }addr_bits; 6756f3e57acSmx205022 }nge_mul_addr1; 6766f3e57acSmx205022 6776f3e57acSmx205022 /* 6786f3e57acSmx205022 * Low 32 bit multicast mask 6796f3e57acSmx205022 */ 6806f3e57acSmx205022 #define NGE_MUL_MASK 0x0b8 6816f3e57acSmx205022 union { 6826f3e57acSmx205022 uint32_t mask_val; 6836f3e57acSmx205022 struct { 6846f3e57acSmx205022 uint32_t mask; 6856f3e57acSmx205022 } mask_bits; 6866f3e57acSmx205022 } nge_mul_mask0; 6876f3e57acSmx205022 6886f3e57acSmx205022 /* 6896f3e57acSmx205022 * High 32 bit multicast mask 6906f3e57acSmx205022 */ 6916f3e57acSmx205022 #define NGE_MUL_MASK1 0x0bc 6926f3e57acSmx205022 union { 6936f3e57acSmx205022 uint32_t mask_val; 6946f3e57acSmx205022 struct { 6956f3e57acSmx205022 uint32_t mask:16; 6966f3e57acSmx205022 uint32_t resv16_31:16; 6976f3e57acSmx205022 } mask_bits; 6986f3e57acSmx205022 } nge_mul_mask1; 6996f3e57acSmx205022 7006f3e57acSmx205022 /* 7016f3e57acSmx205022 * Mac-to Phy Interface 7026f3e57acSmx205022 */ 7036f3e57acSmx205022 #define NGE_MAC2PHY 0x0c0 7046f3e57acSmx205022 #define low_speed 0x0 7056f3e57acSmx205022 #define fast_speed 0x1 7066f3e57acSmx205022 #define giga_speed 0x2 7076f3e57acSmx205022 #define err_speed 0x4 7086f3e57acSmx205022 #define MII_IN 0x0 7096f3e57acSmx205022 #define RGMII_IN 0x1 7106f3e57acSmx205022 #define ERR_IN1 0x3 7116f3e57acSmx205022 #define ERR_IN2 0x4 7126f3e57acSmx205022 typedef union _nge_mac2phy { 7136f3e57acSmx205022 uint32_t m2p_val; 7146f3e57acSmx205022 struct { 7156f3e57acSmx205022 uint32_t speed:2; 7166f3e57acSmx205022 uint32_t resv2_7:6; 7176f3e57acSmx205022 uint32_t hdup_en:1; 7186f3e57acSmx205022 uint32_t resv9:1; 7196f3e57acSmx205022 uint32_t phyintr:1; /* for mcp55 only */ 7206f3e57acSmx205022 uint32_t phyintrlvl:1; /* for mcp55 only */ 7216f3e57acSmx205022 uint32_t resv12_27:16; 7226f3e57acSmx205022 uint32_t in_type:2; 7236f3e57acSmx205022 uint32_t resv30_31:2; 7246f3e57acSmx205022 } m2p_bits; 7256f3e57acSmx205022 } nge_mac2phy; 7266f3e57acSmx205022 7276f3e57acSmx205022 /* 7286f3e57acSmx205022 * Transmit Descriptor Ring address 7296f3e57acSmx205022 */ 7306f3e57acSmx205022 #define NGE_TX_DADR 0x100 7316f3e57acSmx205022 typedef union _nge_tx_addr { 7326f3e57acSmx205022 uint32_t addr_val; 7336f3e57acSmx205022 struct { 7346f3e57acSmx205022 uint32_t resv0_2:3; 7356f3e57acSmx205022 uint32_t addr:29; 7366f3e57acSmx205022 } addr_bits; 7376f3e57acSmx205022 } nge_tx_addr; 7386f3e57acSmx205022 7396f3e57acSmx205022 /* 7406f3e57acSmx205022 * Receive Descriptor Ring address 7416f3e57acSmx205022 */ 7426f3e57acSmx205022 #define NGE_RX_DADR 0x104 7436f3e57acSmx205022 typedef union _nge_rx_addr { 7446f3e57acSmx205022 uint32_t addr_val; 7456f3e57acSmx205022 struct { 7466f3e57acSmx205022 uint32_t resv0_2:3; 7476f3e57acSmx205022 uint32_t addr:29; 7486f3e57acSmx205022 } addr_bits; 7496f3e57acSmx205022 } nge_rx_addr; 7506f3e57acSmx205022 7516f3e57acSmx205022 /* 7526f3e57acSmx205022 * Rx/tx descriptor ring leng 7536f3e57acSmx205022 * Note: for mcp55, tdlen/rdlen are 14 bit. 7546f3e57acSmx205022 */ 7556f3e57acSmx205022 #define NGE_RXTX_DLEN 0x108 7566f3e57acSmx205022 typedef union _nge_rxtx_dlen { 7576f3e57acSmx205022 uint32_t dlen_val; 7586f3e57acSmx205022 struct { 7596f3e57acSmx205022 uint32_t tdlen:14; 7606f3e57acSmx205022 uint32_t resv14_15:2; 7616f3e57acSmx205022 uint32_t rdlen:14; 7626f3e57acSmx205022 uint32_t resv30_31:2; 7636f3e57acSmx205022 } dlen_bits; 7646f3e57acSmx205022 } nge_rxtx_dlen; 7656f3e57acSmx205022 7666f3e57acSmx205022 /* 7676f3e57acSmx205022 * Transmit polling register 7686f3e57acSmx205022 */ 7696f3e57acSmx205022 #define NGE_TX_POLL 0x10c 7706f3e57acSmx205022 #define TX_POLL_INTV_1G 10 7716f3e57acSmx205022 #define TX_POLL_INTV_100M 100 7726f3e57acSmx205022 #define TX_POLL_INTV_10M 1000 7736f3e57acSmx205022 7746f3e57acSmx205022 typedef union _nge_tx_poll { 7756f3e57acSmx205022 uint32_t poll_val; 7766f3e57acSmx205022 struct { 7776f3e57acSmx205022 uint32_t tpi:16; 7786f3e57acSmx205022 uint32_t tpen:1; 7796f3e57acSmx205022 uint32_t resv17_31:15; 7806f3e57acSmx205022 } poll_bits; 7816f3e57acSmx205022 } nge_tx_poll; 7826f3e57acSmx205022 7836f3e57acSmx205022 /* 7846f3e57acSmx205022 * Receive polling register 7856f3e57acSmx205022 */ 7866f3e57acSmx205022 #define NGE_RX_POLL 0x110 7876f3e57acSmx205022 #define RX_POLL_INTV_1G 10 7886f3e57acSmx205022 #define RX_POLL_INTV_100M 100 7896f3e57acSmx205022 #define RX_POLL_INTV_10M 1000 7906f3e57acSmx205022 typedef union _nge_rx_poll { 7916f3e57acSmx205022 uint32_t poll_val; 7926f3e57acSmx205022 struct { 7936f3e57acSmx205022 uint32_t rpi:16; 7946f3e57acSmx205022 uint32_t rpen:1; 7956f3e57acSmx205022 uint32_t resv17_31:15; 7966f3e57acSmx205022 } poll_bits; 7976f3e57acSmx205022 } nge_rx_poll; 7986f3e57acSmx205022 7996f3e57acSmx205022 /* 8006f3e57acSmx205022 * Transmit polling count 8016f3e57acSmx205022 */ 8026f3e57acSmx205022 #define NGE_TX_PCNT 0x114 8036f3e57acSmx205022 union { 8046f3e57acSmx205022 uint32_t cnt_val; 8056f3e57acSmx205022 struct { 8066f3e57acSmx205022 uint32_t pcnt:32; 8076f3e57acSmx205022 } cnt_bits; 8086f3e57acSmx205022 } nge_tx_pcnt; 8096f3e57acSmx205022 8106f3e57acSmx205022 /* 8116f3e57acSmx205022 * Receive polling count 8126f3e57acSmx205022 */ 8136f3e57acSmx205022 #define NGE_RX_PCNT 0x118 8146f3e57acSmx205022 union { 8156f3e57acSmx205022 uint32_t cnt_val; 8166f3e57acSmx205022 struct { 8176f3e57acSmx205022 uint32_t pcnt:32; 8186f3e57acSmx205022 } cnt_bits; 8196f3e57acSmx205022 } nge_rx_pcnt; 8206f3e57acSmx205022 8216f3e57acSmx205022 8226f3e57acSmx205022 /* 8236f3e57acSmx205022 * Current tx's descriptor address 8246f3e57acSmx205022 */ 8256f3e57acSmx205022 #define NGE_TX_CUR_DADR 0x11c 8266f3e57acSmx205022 union { 8276f3e57acSmx205022 uint32_t addr_val; 8286f3e57acSmx205022 struct { 8296f3e57acSmx205022 uint32_t resv0_2:3; 8306f3e57acSmx205022 uint32_t addr:29; 8316f3e57acSmx205022 } addr_bits; 8326f3e57acSmx205022 } nge_tx_cur_addr; 8336f3e57acSmx205022 8346f3e57acSmx205022 /* 8356f3e57acSmx205022 * Current rx's descriptor address 8366f3e57acSmx205022 */ 8376f3e57acSmx205022 #define NGE_RX_CUR_DADR 0x120 8386f3e57acSmx205022 union { 8396f3e57acSmx205022 uint32_t addr_val; 8406f3e57acSmx205022 struct { 8416f3e57acSmx205022 uint32_t resv0_2:3; 8426f3e57acSmx205022 uint32_t addr:29; 8436f3e57acSmx205022 } addr_bits; 8446f3e57acSmx205022 } nge_rx_cur_addr; 8456f3e57acSmx205022 8466f3e57acSmx205022 /* 8476f3e57acSmx205022 * Current tx's data buffer address 8486f3e57acSmx205022 */ 8496f3e57acSmx205022 #define NGE_TX_CUR_PRD0 0x124 8506f3e57acSmx205022 union { 8516f3e57acSmx205022 uint32_t prd0_val; 8526f3e57acSmx205022 struct { 8536f3e57acSmx205022 uint32_t prd0:32; 8546f3e57acSmx205022 } prd0_bits; 8556f3e57acSmx205022 } nge_tx_cur_prd0; 8566f3e57acSmx205022 8576f3e57acSmx205022 /* 8586f3e57acSmx205022 * Current tx's data buffer status 8596f3e57acSmx205022 */ 8606f3e57acSmx205022 #define NGE_TX_CUR_PRD1 0x128 8616f3e57acSmx205022 union { 8626f3e57acSmx205022 uint32_t prd1_val; 8636f3e57acSmx205022 struct { 8646f3e57acSmx205022 uint32_t rebytes:16; 8656f3e57acSmx205022 uint32_t status:16; 8666f3e57acSmx205022 } prd1_bits; 8676f3e57acSmx205022 } nge_tx_cur_prd1; 8686f3e57acSmx205022 8696f3e57acSmx205022 /* 8706f3e57acSmx205022 * Current rx's data buffer address 8716f3e57acSmx205022 */ 8726f3e57acSmx205022 #define NGE_RX_CUR_PRD0 0x12c 8736f3e57acSmx205022 union { 8746f3e57acSmx205022 uint32_t prd0_val; 8756f3e57acSmx205022 struct { 8766f3e57acSmx205022 uint32_t prd0:32; 8776f3e57acSmx205022 }prd0_bits; 8786f3e57acSmx205022 }nge_rx_cur_prd0; 8796f3e57acSmx205022 8806f3e57acSmx205022 /* 8816f3e57acSmx205022 * Current rx's data buffer status 8826f3e57acSmx205022 */ 8836f3e57acSmx205022 #define NGE_RX_CUR_PRD1 0x130 8846f3e57acSmx205022 8856f3e57acSmx205022 /* 8866f3e57acSmx205022 * Next tx's descriptor address 8876f3e57acSmx205022 */ 8886f3e57acSmx205022 #define NGE_TX_NXT_DADR 0x134 8896f3e57acSmx205022 union { 8906f3e57acSmx205022 uint32_t dadr_val; 8916f3e57acSmx205022 struct { 8926f3e57acSmx205022 uint32_t addr:32; 8936f3e57acSmx205022 }addr_bits; 8946f3e57acSmx205022 }nge_tx_nxt_dadr; 8956f3e57acSmx205022 8966f3e57acSmx205022 /* 8976f3e57acSmx205022 * Next rx's descriptor address 8986f3e57acSmx205022 */ 8996f3e57acSmx205022 #define NGE_RX_NXT_DADR 0x138 9006f3e57acSmx205022 union { 9016f3e57acSmx205022 uint32_t dadr_val; 9026f3e57acSmx205022 struct { 9036f3e57acSmx205022 uint32_t addr:32; 9046f3e57acSmx205022 } addr_bits; 9056f3e57acSmx205022 } nge_rx_nxt_dadr; 9066f3e57acSmx205022 9076f3e57acSmx205022 /* 9086f3e57acSmx205022 * Transmit fifo watermark 9096f3e57acSmx205022 */ 9106f3e57acSmx205022 #define NGE_TX_FIFO_WM 0x13c 9116f3e57acSmx205022 #define TX_FIFO_TBFW 0 9126f3e57acSmx205022 #define TX_FIFO_NOB_WM_MII 1 9136f3e57acSmx205022 #define TX_FIFO_NOB_WM_GMII 8 9146f3e57acSmx205022 #define TX_FIFO_DATA_LWM 0x20 9156f3e57acSmx205022 #define TX_FIFO_PRD_LWM 0x8 9166f3e57acSmx205022 #define TX_FIFO_PRD_HWM 0x38 9176f3e57acSmx205022 typedef union _nge_tx_fifo_wm { 9186f3e57acSmx205022 uint32_t wm_val; 9196f3e57acSmx205022 struct { 9206f3e57acSmx205022 uint32_t data_lwm:9; 9216f3e57acSmx205022 uint32_t resv8_11:3; 9226f3e57acSmx205022 uint32_t prd_lwm:6; 9236f3e57acSmx205022 uint32_t uprd_hwm:6; 9246f3e57acSmx205022 uint32_t nbfb_wm:4; 9256f3e57acSmx205022 uint32_t fb_wm:4; 9266f3e57acSmx205022 } wm_bits; 9276f3e57acSmx205022 } nge_tx_fifo_wm; 9286f3e57acSmx205022 9296f3e57acSmx205022 /* 9306f3e57acSmx205022 * Receive fifo watermark 9316f3e57acSmx205022 */ 9326f3e57acSmx205022 #define NGE_RX_FIFO_WM 0x140 9336f3e57acSmx205022 typedef union _nge_rx_fifo_wm { 9346f3e57acSmx205022 uint32_t wm_val; 9356f3e57acSmx205022 struct { 9366f3e57acSmx205022 uint32_t data_hwm:9; 9376f3e57acSmx205022 uint32_t resv9_11:3; 9386f3e57acSmx205022 uint32_t prd_lwm:4; 9396f3e57acSmx205022 uint32_t resv16_17:2; 9406f3e57acSmx205022 uint32_t prd_hwm:4; 9416f3e57acSmx205022 uint32_t resv22_31:10; 9426f3e57acSmx205022 } wm_bits; 9436f3e57acSmx205022 } nge_rx_fifo_wm; 9446f3e57acSmx205022 9456f3e57acSmx205022 /* 9466f3e57acSmx205022 * Chip mode control 9476f3e57acSmx205022 */ 9486f3e57acSmx205022 #define NGE_MODE_CNTL 0x144 9496f3e57acSmx205022 #define DESC_MCP1 0x0 9506f3e57acSmx205022 #define DESC_OFFLOAD 0x1 9516f3e57acSmx205022 #define DESC_HOT 0x2 9526f3e57acSmx205022 #define DESC_RESV 0x3 9536f3e57acSmx205022 #define MACHINE_BUSY 0x0 9546f3e57acSmx205022 #define MACHINE_IDLE 0x1 9556f3e57acSmx205022 typedef union _nge_mode_cntl { 9566f3e57acSmx205022 uint32_t mode_val; 9576f3e57acSmx205022 struct { 9586f3e57acSmx205022 uint32_t txdm:1; 9596f3e57acSmx205022 uint32_t rxdm:1; 9606f3e57acSmx205022 uint32_t dma_dis:1; 9616f3e57acSmx205022 uint32_t dma_status:1; 9626f3e57acSmx205022 uint32_t bm_reset:1; 9636f3e57acSmx205022 uint32_t resv5:1; 9646f3e57acSmx205022 uint32_t vlan_strip:1; /* mcp55 chip only */ 9656f3e57acSmx205022 uint32_t vlan_ins:1; /* mcp55 chip only */ 9666f3e57acSmx205022 uint32_t desc_type:2; 9676f3e57acSmx205022 uint32_t rx_sum_en:1; 9686f3e57acSmx205022 uint32_t tx_prd_cu_en:1; 9696f3e57acSmx205022 uint32_t w64_dis:1; 9706f3e57acSmx205022 uint32_t tx_rcom_en:1; 9716f3e57acSmx205022 uint32_t rx_filter_en:1; 9726f3e57acSmx205022 uint32_t resv15:1; 9736f3e57acSmx205022 uint32_t resv16:1; /* ck804 and mcp51 only */ 9746f3e57acSmx205022 uint32_t resv17:1; /* ck804 and mcp51 only */ 9756f3e57acSmx205022 uint32_t resv18:1; /* ck804 and mcp51 only */ 9766f3e57acSmx205022 uint32_t resv19_21:3; 9776f3e57acSmx205022 uint32_t tx_fetch_prd:1; /* mcp51/mcp55 only */ 9786f3e57acSmx205022 uint32_t rx_fetch_prd:1; /* mcp51/mcp55 only */ 9796f3e57acSmx205022 uint32_t resv24_29:6; 9806f3e57acSmx205022 uint32_t rx_status:1; 9816f3e57acSmx205022 uint32_t tx_status:1; 9826f3e57acSmx205022 } mode_bits; 9836f3e57acSmx205022 } nge_mode_cntl; 9846f3e57acSmx205022 9856f3e57acSmx205022 #define NGE_TX_DADR_HI 0x148 9866f3e57acSmx205022 #define NGE_RX_DADR_HI 0x14c 9876f3e57acSmx205022 9886f3e57acSmx205022 /* 9896f3e57acSmx205022 * Mii interrupt register 9906f3e57acSmx205022 * Note: for mcp55, this is a 32-bit register. 9916f3e57acSmx205022 */ 9926f3e57acSmx205022 #define NGE_MINTR_SRC 0x180 9936f3e57acSmx205022 typedef union _nge_mintr_src { 9946f3e57acSmx205022 uint8_t src_val; 9956f3e57acSmx205022 struct { 9966f3e57acSmx205022 uint8_t mrei:1; 9976f3e57acSmx205022 uint8_t mcc2:1; 9986f3e57acSmx205022 uint8_t mcc1:1; 9996f3e57acSmx205022 uint8_t mapi:1; 10006f3e57acSmx205022 uint8_t mpdi:1; 10016f3e57acSmx205022 uint8_t resv5_7:3; 10026f3e57acSmx205022 } src_bits; 10036f3e57acSmx205022 } nge_mintr_src; 10046f3e57acSmx205022 10056f3e57acSmx205022 /* 10066f3e57acSmx205022 * Mii interrupt mask 10076f3e57acSmx205022 * Note: for mcp55, this is a 32-bit register. 10086f3e57acSmx205022 */ 10096f3e57acSmx205022 #define NGE_MINTR_MASK 0x184 10106f3e57acSmx205022 typedef union _nge_mintr_mask { 10116f3e57acSmx205022 uint8_t mask_val; 10126f3e57acSmx205022 struct { 10136f3e57acSmx205022 uint8_t mrei:1; 10146f3e57acSmx205022 uint8_t mcc2:1; 10156f3e57acSmx205022 uint8_t mcc1:1; 10166f3e57acSmx205022 uint8_t mapi:1; 10176f3e57acSmx205022 uint8_t mpdi:1; 10186f3e57acSmx205022 uint8_t resv5_7:3; 10196f3e57acSmx205022 } mask_bits; 10206f3e57acSmx205022 } nge_mintr_mask; 10216f3e57acSmx205022 10226f3e57acSmx205022 /* 10236f3e57acSmx205022 * Mii control and status 10246f3e57acSmx205022 */ 10256f3e57acSmx205022 #define NGE_MII_CS 0x188 10266f3e57acSmx205022 #define MII_POLL_INTV 0x4 10276f3e57acSmx205022 typedef union _nge_mii_cs { 10286f3e57acSmx205022 uint32_t cs_val; 10296f3e57acSmx205022 struct { 10306f3e57acSmx205022 uint32_t excap:1; 10316f3e57acSmx205022 uint32_t jab_dec:1; 10326f3e57acSmx205022 uint32_t lk_up:1; 10336f3e57acSmx205022 uint32_t ana_cap:1; 10346f3e57acSmx205022 uint32_t rfault:1; 10356f3e57acSmx205022 uint32_t auto_neg:1; 10366f3e57acSmx205022 uint32_t mfps:1; 10376f3e57acSmx205022 uint32_t resv7:1; 10386f3e57acSmx205022 uint32_t exst:1; 10396f3e57acSmx205022 uint32_t hdup_100m_t2:1; 10406f3e57acSmx205022 uint32_t fdup_100m_t2:1; 10416f3e57acSmx205022 uint32_t hdup_10m:1; 10426f3e57acSmx205022 uint32_t fdup_10m:1; 10436f3e57acSmx205022 uint32_t hdup_100m_x:1; 10446f3e57acSmx205022 uint32_t fdup_100m_x:1; 10456f3e57acSmx205022 uint32_t cap_100m_t4:1; 10466f3e57acSmx205022 uint32_t ap_intv:4; 10476f3e57acSmx205022 uint32_t ap_en:1; 10486f3e57acSmx205022 uint32_t resv21_23:3; 10496f3e57acSmx205022 uint32_t ap_paddr:5; 10506f3e57acSmx205022 uint32_t resv29_31:3; 10516f3e57acSmx205022 } cs_bits; 10526f3e57acSmx205022 } nge_mii_cs; 10536f3e57acSmx205022 10546f3e57acSmx205022 /* 10556f3e57acSmx205022 * Mii Clock timer register 10566f3e57acSmx205022 */ 10576f3e57acSmx205022 #define NGE_MII_TM 0x18c 10586f3e57acSmx205022 typedef union _nge_mii_tm { 10596f3e57acSmx205022 uint16_t tm_val; 10606f3e57acSmx205022 struct { 10616f3e57acSmx205022 uint16_t timer_interv:8; 10626f3e57acSmx205022 uint16_t timer_en:1; 10636f3e57acSmx205022 uint16_t resv9_14:6; 10646f3e57acSmx205022 uint16_t timer_status:1; 10656f3e57acSmx205022 } tm_bits; 10666f3e57acSmx205022 } nge_mii_tm; 10676f3e57acSmx205022 10686f3e57acSmx205022 /* 10696f3e57acSmx205022 * Mdio address 10706f3e57acSmx205022 */ 10716f3e57acSmx205022 #define NGE_MDIO_ADR 0x190 10726f3e57acSmx205022 typedef union _nge_mdio_adr { 10736f3e57acSmx205022 uint16_t adr_val; 10746f3e57acSmx205022 struct { 10756f3e57acSmx205022 uint16_t phy_reg:5; 10766f3e57acSmx205022 uint16_t phy_adr:5; 10776f3e57acSmx205022 uint16_t mdio_rw:1; 10786f3e57acSmx205022 uint16_t resv11_14:4; 10796f3e57acSmx205022 uint16_t mdio_clc:1; 10806f3e57acSmx205022 } adr_bits; 10816f3e57acSmx205022 } nge_mdio_adr; 10826f3e57acSmx205022 10836f3e57acSmx205022 /* 10846f3e57acSmx205022 * Mdio data 10856f3e57acSmx205022 */ 10866f3e57acSmx205022 #define NGE_MDIO_DATA 0x194 10876f3e57acSmx205022 10886f3e57acSmx205022 /* 10896f3e57acSmx205022 * Power Management and Control 10906f3e57acSmx205022 */ 10916f3e57acSmx205022 #define NGE_PM_CNTL 0x200 10926f3e57acSmx205022 typedef union _nge_pm_cntl { 10936f3e57acSmx205022 uint32_t cntl_val; 10946f3e57acSmx205022 struct { 10956f3e57acSmx205022 /* 10966f3e57acSmx205022 * mp_en: Magic Packet Enable 10976f3e57acSmx205022 * pm_en: Pattern Match Enable 10986f3e57acSmx205022 * lc_en: Link Change Enable 10996f3e57acSmx205022 */ 11006f3e57acSmx205022 uint32_t mp_en_d0:1; 11016f3e57acSmx205022 uint32_t pm_en_d0:1; 11026f3e57acSmx205022 uint32_t lc_en_d0:1; 11036f3e57acSmx205022 uint32_t resv3:1; 11046f3e57acSmx205022 uint32_t mp_en_d1:1; 11056f3e57acSmx205022 uint32_t pm_en_d1:1; 11066f3e57acSmx205022 uint32_t lc_en_d1:1; 11076f3e57acSmx205022 uint32_t resv7:1; 11086f3e57acSmx205022 uint32_t mp_en_d2:1; 11096f3e57acSmx205022 uint32_t pm_en_d2:1; 11106f3e57acSmx205022 uint32_t lc_en_d2:1; 11116f3e57acSmx205022 uint32_t resv11:1; 11126f3e57acSmx205022 uint32_t mp_en_d3:1; 11136f3e57acSmx205022 uint32_t pm_en_d3:1; 11146f3e57acSmx205022 uint32_t lc_en_d3:1; 11156f3e57acSmx205022 uint32_t resv15:1; 11166f3e57acSmx205022 uint32_t pat_match_en:5; 11176f3e57acSmx205022 uint32_t resv21_23:3; 11186f3e57acSmx205022 uint32_t pat_match_stat:5; 11196f3e57acSmx205022 uint32_t magic_status:1; 11206f3e57acSmx205022 uint32_t netman_status:1; 11216f3e57acSmx205022 uint32_t resv31:1; 11226f3e57acSmx205022 } cntl_bits; 11236f3e57acSmx205022 } nge_pm_cntl; 11246f3e57acSmx205022 11256f3e57acSmx205022 #define NGE_MPT_CRC0 0x204 11266f3e57acSmx205022 #define NGE_PMC_MK00 0x208 11276f3e57acSmx205022 #define NGE_PMC_MK01 0x20C 11286f3e57acSmx205022 #define NGE_PMC_MK02 0x210 11296f3e57acSmx205022 #define NGE_PMC_MK03 0x214 11306f3e57acSmx205022 #define NGE_MPT_CRC1 0x218 11316f3e57acSmx205022 #define NGE_PMC_MK10 0x21c 11326f3e57acSmx205022 #define NGE_PMC_MK11 0x220 11336f3e57acSmx205022 #define NGE_PMC_MK12 0x224 11346f3e57acSmx205022 #define NGE_PMC_MK13 0x228 11356f3e57acSmx205022 #define NGE_MPT_CRC2 0x22c 11366f3e57acSmx205022 #define NGE_PMC_MK20 0x230 11376f3e57acSmx205022 #define NGE_PMC_MK21 0x234 11386f3e57acSmx205022 #define NGE_PMC_MK22 0x238 11396f3e57acSmx205022 #define NGE_PMC_MK23 0x23c 11406f3e57acSmx205022 #define NGE_MPT_CRC3 0x240 11416f3e57acSmx205022 #define NGE_PMC_MK30 0x244 11426f3e57acSmx205022 #define NGE_PMC_MK31 0x248 11436f3e57acSmx205022 #define NGE_PMC_MK32 0x24c 11446f3e57acSmx205022 #define NGE_PMC_MK33 0x250 11456f3e57acSmx205022 #define NGE_MPT_CRC4 0x254 11466f3e57acSmx205022 #define NGE_PMC_MK40 0x258 11476f3e57acSmx205022 #define NGE_PMC_MK41 0x25c 11486f3e57acSmx205022 #define NGE_PMC_MK42 0x260 11496f3e57acSmx205022 #define NGE_PMC_MK43 0x264 11506f3e57acSmx205022 #define NGE_PMC_ALIAS 0x268 11516f3e57acSmx205022 #define NGE_PMCSR_ALIAS 0x26c 11526f3e57acSmx205022 11536f3e57acSmx205022 /* 11546f3e57acSmx205022 * Seeprom control 11556f3e57acSmx205022 */ 11566f3e57acSmx205022 #define NGE_EP_CNTL 0x500 11576f3e57acSmx205022 #define EEPROM_CLKDIV 249 11586f3e57acSmx205022 #define EEPROM_WAITCLK 0x7 11596f3e57acSmx205022 typedef union _nge_cp_cntl { 11606f3e57acSmx205022 uint32_t cntl_val; 11616f3e57acSmx205022 struct { 11626f3e57acSmx205022 uint32_t clkdiv:8; 11636f3e57acSmx205022 uint32_t rom_size:3; 11646f3e57acSmx205022 uint32_t resv11:1; 11656f3e57acSmx205022 uint32_t word_wid:1; 11666f3e57acSmx205022 uint32_t resv13_15:3; 11676f3e57acSmx205022 uint32_t wait_slots:4; 11686f3e57acSmx205022 uint32_t resv20_31:12; 11696f3e57acSmx205022 } cntl_bits; 11706f3e57acSmx205022 } nge_cp_cntl; 11716f3e57acSmx205022 11726f3e57acSmx205022 /* 11736f3e57acSmx205022 * Seeprom cmd control 11746f3e57acSmx205022 */ 11756f3e57acSmx205022 #define NGE_EP_CMD 0x504 11766f3e57acSmx205022 #define SEEPROM_CMD_READ 0x0 11776f3e57acSmx205022 #define SEEPROM_CMD_WRITE_ENABLE 0x1 11786f3e57acSmx205022 #define SEEPROM_CMD_ERASE 0x2 11796f3e57acSmx205022 #define SEEPROM_CMD_WRITE 0x3 11806f3e57acSmx205022 #define SEEPROM_CMD_ERALSE_ALL 0x4 11816f3e57acSmx205022 #define SEEPROM_CMD_WRITE_ALL 0x5 11826f3e57acSmx205022 #define SEEPROM_CMD_WRITE_DIS 0x6 11836f3e57acSmx205022 #define SEEPROM_READY 0x1 11846f3e57acSmx205022 typedef union _nge_ep_cmd { 11856f3e57acSmx205022 uint32_t cmd_val; 11866f3e57acSmx205022 struct { 11876f3e57acSmx205022 uint32_t addr:16; 11886f3e57acSmx205022 uint32_t cmd:3; 11896f3e57acSmx205022 uint32_t resv19_30:12; 11906f3e57acSmx205022 uint32_t sts:1; 11916f3e57acSmx205022 } cmd_bits; 11926f3e57acSmx205022 } nge_ep_cmd; 11936f3e57acSmx205022 11946f3e57acSmx205022 /* 11956f3e57acSmx205022 * Seeprom data register 11966f3e57acSmx205022 */ 11976f3e57acSmx205022 #define NGE_EP_DATA 0x508 11986f3e57acSmx205022 typedef union _nge_ep_data { 11996f3e57acSmx205022 uint32_t data_val; 12006f3e57acSmx205022 struct { 12016f3e57acSmx205022 uint32_t data:16; 12026f3e57acSmx205022 uint32_t resv16_31:16; 12036f3e57acSmx205022 } data_bits; 12046f3e57acSmx205022 } nge_ep_data; 12056f3e57acSmx205022 12066f3e57acSmx205022 /* 12076f3e57acSmx205022 * Power management control 2nd register (since MCP51) 12086f3e57acSmx205022 */ 12096f3e57acSmx205022 #define NGE_PM_CNTL2 0x600 12106f3e57acSmx205022 typedef union _nge_pm_cntl2 { 12116f3e57acSmx205022 uint32_t cntl_val; 12126f3e57acSmx205022 struct { 12136f3e57acSmx205022 uint32_t phy_coma_set:1; 12146f3e57acSmx205022 uint32_t phy_coma_status:1; 12156f3e57acSmx205022 uint32_t resv2_3:2; 12166f3e57acSmx205022 uint32_t resv4:1; 12176f3e57acSmx205022 uint32_t resv5_7:3; 12186f3e57acSmx205022 uint32_t resv8_11:4; 12196f3e57acSmx205022 uint32_t resv12_15:4; 12206f3e57acSmx205022 uint32_t pmt5_en:1; 12216f3e57acSmx205022 uint32_t pmt6_en:1; 12226f3e57acSmx205022 uint32_t pmt7_en:1; 12236f3e57acSmx205022 uint32_t resv19_23:5; 12246f3e57acSmx205022 uint32_t pmt5_status:1; 12256f3e57acSmx205022 uint32_t pmt6_status:1; 12266f3e57acSmx205022 uint32_t pmt7_status:1; 12276f3e57acSmx205022 uint32_t resv27_31:5; 12286f3e57acSmx205022 } cntl_bits; 12296f3e57acSmx205022 } nge_pm_cntl2; 12306f3e57acSmx205022 12316f3e57acSmx205022 12326f3e57acSmx205022 /* 12336f3e57acSmx205022 * ASF RAM 0x800-0xfff 12346f3e57acSmx205022 */ 12356f3e57acSmx205022 12366f3e57acSmx205022 /* 12376f3e57acSmx205022 * Hardware-defined Statistics Block Offsets 12386f3e57acSmx205022 * 12396f3e57acSmx205022 * These are given in the manual as addresses in NIC memory, starting 12406f3e57acSmx205022 * from the NIC statistics area base address of 0x2000; 12416f3e57acSmx205022 */ 12426f3e57acSmx205022 12436f3e57acSmx205022 #define KS_BASE 0x0280 12446f3e57acSmx205022 #define KS_ADDR(x) (((x)-KS_BASE)/sizeof (uint32_t)) 12456f3e57acSmx205022 12466f3e57acSmx205022 typedef enum { 12476f3e57acSmx205022 KS_ifHOutOctets = KS_ADDR(0x0280), 12486f3e57acSmx205022 KS_ifHOutZeroRetranCount, 12496f3e57acSmx205022 KS_ifHOutOneRetranCount, 12506f3e57acSmx205022 KS_ifHOutMoreRetranCount, 12516f3e57acSmx205022 KS_ifHOutColCount, 12526f3e57acSmx205022 KS_ifHOutFifoovCount, 12536f3e57acSmx205022 KS_ifHOutLOCCount, 12546f3e57acSmx205022 KS_ifHOutExDecCount, 12556f3e57acSmx205022 KS_ifHOutRetryCount, 12566f3e57acSmx205022 12576f3e57acSmx205022 KS_ifHInFrameErrCount, 12586f3e57acSmx205022 KS_ifHInExtraOctErrCount, 12596f3e57acSmx205022 KS_ifHInLColErrCount, 12606f3e57acSmx205022 KS_ifHInRuntCount, 12616f3e57acSmx205022 KS_ifHInOversizeErrCount, 12626f3e57acSmx205022 KS_ifHInFovErrCount, 12636f3e57acSmx205022 KS_ifHInFCSErrCount, 12646f3e57acSmx205022 KS_ifHInAlignErrCount, 12656f3e57acSmx205022 KS_ifHInLenErrCount, 12666f3e57acSmx205022 KS_ifHInUniPktsCount, 12676f3e57acSmx205022 KS_ifHInBroadPksCount, 12686f3e57acSmx205022 KS_ifHInMulPksCount, 12696f3e57acSmx205022 KS_STATS_SIZE = KS_ADDR(0x2d0) 12706f3e57acSmx205022 12716f3e57acSmx205022 } nge_stats_offset_t; 12726f3e57acSmx205022 12736f3e57acSmx205022 /* 12746f3e57acSmx205022 * Hardware-defined Statistics Block 12756f3e57acSmx205022 * 12766f3e57acSmx205022 * Another view of the statistic block, as a array and a structure ... 12776f3e57acSmx205022 */ 12786f3e57acSmx205022 12796f3e57acSmx205022 typedef union { 1280da9d0014Sjj146644 uint64_t a[KS_STATS_SIZE]; 12816f3e57acSmx205022 struct { 1282da9d0014Sjj146644 uint64_t OutOctets; 1283da9d0014Sjj146644 uint64_t OutZeroRetranCount; 1284da9d0014Sjj146644 uint64_t OutOneRetranCount; 1285da9d0014Sjj146644 uint64_t OutMoreRetranCount; 1286da9d0014Sjj146644 uint64_t OutColCount; 1287da9d0014Sjj146644 uint64_t OutFifoovCount; 1288da9d0014Sjj146644 uint64_t OutLOCCount; 1289da9d0014Sjj146644 uint64_t OutExDecCount; 1290da9d0014Sjj146644 uint64_t OutRetryCount; 12916f3e57acSmx205022 1292da9d0014Sjj146644 uint64_t InFrameErrCount; 1293da9d0014Sjj146644 uint64_t InExtraOctErrCount; 1294da9d0014Sjj146644 uint64_t InLColErrCount; 1295da9d0014Sjj146644 uint64_t InRuntCount; 1296da9d0014Sjj146644 uint64_t InOversizeErrCount; 1297da9d0014Sjj146644 uint64_t InFovErrCount; 1298da9d0014Sjj146644 uint64_t InFCSErrCount; 1299da9d0014Sjj146644 uint64_t InAlignErrCount; 1300da9d0014Sjj146644 uint64_t InLenErrCount; 1301da9d0014Sjj146644 uint64_t InUniPktsCount; 1302da9d0014Sjj146644 uint64_t InBroadPksCount; 1303da9d0014Sjj146644 uint64_t InMulPksCount; 13046f3e57acSmx205022 } s; 13056f3e57acSmx205022 } nge_hw_statistics_t; 13066f3e57acSmx205022 13076f3e57acSmx205022 /* 13086f3e57acSmx205022 * MII (PHY) registers, beyond those already defined in <sys/miiregs.h> 13096f3e57acSmx205022 */ 13106f3e57acSmx205022 13116f3e57acSmx205022 #define NGE_PHY_NUMBER 32 13126f3e57acSmx205022 #define MII_LP_ASYM_PAUSE 0x0800 13136f3e57acSmx205022 #define MII_LP_PAUSE 0x0400 13146f3e57acSmx205022 13156f3e57acSmx205022 #define MII_100BASE_T4 0x0200 13166f3e57acSmx205022 #define MII_100BASET_FD 0x0100 13176f3e57acSmx205022 #define MII_100BASET_HD 0x0080 13186f3e57acSmx205022 #define MII_10BASET_FD 0x0040 13196f3e57acSmx205022 #define MII_10BASET_HD 0x0020 13206f3e57acSmx205022 13216f3e57acSmx205022 #define MII_ID_MARVELL 0x5043 13226f3e57acSmx205022 #define MII_ID_CICADA 0x03f1 13236f3e57acSmx205022 #define MII_IDL_MASK 0xfc00 13246f3e57acSmx205022 #define MII_AN_LPNXTPG 8 13256f3e57acSmx205022 13266f3e57acSmx205022 13276f3e57acSmx205022 #define MII_IEEE_EXT_STATUS 15 13286f3e57acSmx205022 13296f3e57acSmx205022 /* 13306f3e57acSmx205022 * New bits in the MII_CONTROL register 13316f3e57acSmx205022 */ 13326f3e57acSmx205022 #define MII_CONTROL_1000MB 0x0040 13336f3e57acSmx205022 13346f3e57acSmx205022 /* 13356f3e57acSmx205022 * Bits in the MII_1000BASE_T_CONTROL register 13366f3e57acSmx205022 * 13376f3e57acSmx205022 * The MASTER_CFG bit enables manual configuration of Master/Slave mode 13386f3e57acSmx205022 * (otherwise, roles are automatically negotiated). When this bit is set, 13396f3e57acSmx205022 * the MASTER_SEL bit forces Master mode, otherwise Slave mode is forced. 13406f3e57acSmx205022 */ 13416f3e57acSmx205022 #define MII_1000BASE_T_CONTROL 9 13426f3e57acSmx205022 #define MII_1000BT_CTL_MASTER_CFG 0x1000 /* enable role select */ 13436f3e57acSmx205022 #define MII_1000BT_CTL_MASTER_SEL 0x0800 /* role select bit */ 13446f3e57acSmx205022 #define MII_1000BT_CTL_ADV_FDX 0x0200 13456f3e57acSmx205022 #define MII_1000BT_CTL_ADV_HDX 0x0100 13466f3e57acSmx205022 13476f3e57acSmx205022 /* 13486f3e57acSmx205022 * Bits in the MII_1000BASE_T_STATUS register 13496f3e57acSmx205022 */ 13506f3e57acSmx205022 #define MII_1000BASE_T_STATUS 10 13516f3e57acSmx205022 #define MII_1000BT_STAT_MASTER_FAULT 0x8000 13526f3e57acSmx205022 #define MII_1000BT_STAT_MASTER_MODE 0x4000 13536f3e57acSmx205022 #define MII_1000BT_STAT_LCL_RCV_OK 0x2000 13546f3e57acSmx205022 #define MII_1000BT_STAT_RMT_RCV_OK 0x1000 13556f3e57acSmx205022 #define MII_1000BT_STAT_LP_FDX_CAP 0x0800 13566f3e57acSmx205022 #define MII_1000BT_STAT_LP_HDX_CAP 0x0400 13576f3e57acSmx205022 13586f3e57acSmx205022 #define MII_CICADA_BYPASS_CONTROL MII_VENDOR(2) 13596f3e57acSmx205022 #define CICADA_125MHZ_CLOCK_ENABLE 0x0001 13606f3e57acSmx205022 13616f3e57acSmx205022 #define MII_CICADA_10BASET_CONTROL MII_VENDOR(6) 13626f3e57acSmx205022 #define MII_CICADA_DISABLE_ECHO_MODE 0x2000 13636f3e57acSmx205022 13646f3e57acSmx205022 #define MII_CICADA_EXT_CONTROL MII_VENDOR(7) 13656f3e57acSmx205022 #define MII_CICADA_MODE_SELECT_BITS 0xf000 13666f3e57acSmx205022 #define MII_CICADA_MODE_SELECT_RGMII 0x1000 13676f3e57acSmx205022 #define MII_CICADA_POWER_SUPPLY_BITS 0x0e00 13686f3e57acSmx205022 #define MII_CICADA_POWER_SUPPLY_3_3V 0x0000 13696f3e57acSmx205022 #define MII_CICADA_POWER_SUPPLY_2_5V 0x0200 13706f3e57acSmx205022 13716f3e57acSmx205022 #define MII_CICADA_AUXCTRL_STATUS MII_VENDOR(12) 13726f3e57acSmx205022 #define MII_CICADA_PIN_PRORITY_SETTING 0x0004 13736f3e57acSmx205022 #define MII_CICADA_PIN_PRORITY_DEFAULT 0x0000 13746f3e57acSmx205022 13756f3e57acSmx205022 13766f3e57acSmx205022 #define NGE_REG_SIZE 0xfff 13776f3e57acSmx205022 #define NGE_MII_SIZE 0x20 13786f3e57acSmx205022 #define NGE_SEEROM_SIZE 0x800 13796f3e57acSmx205022 /* 13806f3e57acSmx205022 * Legacy rx's bd which does not support 13816f3e57acSmx205022 * any hardware offload 13826f3e57acSmx205022 */ 13836f3e57acSmx205022 typedef struct _legacy_rx_bd { 13846f3e57acSmx205022 uint32_t host_buf_addr; 13856f3e57acSmx205022 union { 13866f3e57acSmx205022 uint32_t cntl_val; 13876f3e57acSmx205022 struct { 13886f3e57acSmx205022 uint32_t bcnt:16; 13896f3e57acSmx205022 uint32_t end:1; 13906f3e57acSmx205022 uint32_t miss:1; 13916f3e57acSmx205022 uint32_t extra:1; 13926f3e57acSmx205022 uint32_t inten:1; 13936f3e57acSmx205022 uint32_t bam:1; 13946f3e57acSmx205022 uint32_t mam:1; 13956f3e57acSmx205022 uint32_t pam:1; 13966f3e57acSmx205022 uint32_t runt:1; 13976f3e57acSmx205022 uint32_t lcol:1; 13986f3e57acSmx205022 uint32_t max:1; 13996f3e57acSmx205022 uint32_t lfer:1; 14006f3e57acSmx205022 uint32_t crc:1; 14016f3e57acSmx205022 uint32_t ofol:1; 14026f3e57acSmx205022 uint32_t fram:1; 14036f3e57acSmx205022 uint32_t err:1; 14046f3e57acSmx205022 uint32_t own:1; 14056f3e57acSmx205022 } cntl_bits; 14066f3e57acSmx205022 } cntl_status; 14076f3e57acSmx205022 } legacy_rx_bd, *plegacy_rx_bd; 14086f3e57acSmx205022 14096f3e57acSmx205022 /* 14106f3e57acSmx205022 * Stand offload rx's bd which supports hareware checksum 14116f3e57acSmx205022 * for tcp/ip 14126f3e57acSmx205022 */ 14136f3e57acSmx205022 #define CK8G_NO_HSUM 0x0 14146f3e57acSmx205022 #define CK8G_TCP_SUM_ERR 0x1 14156f3e57acSmx205022 #define CK8G_UDP_SUM_ERR 0x2 14166f3e57acSmx205022 #define CK8G_IP_HSUM_ERR 0x3 14176f3e57acSmx205022 #define CK8G_IP_HSUM 0x4 14186f3e57acSmx205022 #define CK8G_TCP_SUM 0x5 14196f3e57acSmx205022 #define CK8G_UDP_SUM 0x6 14206f3e57acSmx205022 #define CK8G_RESV 0x7 14216f3e57acSmx205022 typedef struct _sum_rx_bd { 14226f3e57acSmx205022 uint32_t host_buf_addr; 14236f3e57acSmx205022 union { 14246f3e57acSmx205022 uint32_t cntl_val; 14256f3e57acSmx205022 struct { 14266f3e57acSmx205022 uint32_t bcnt:14; 14276f3e57acSmx205022 uint32_t resv14_29:16; 14286f3e57acSmx205022 uint32_t inten:1; 14296f3e57acSmx205022 uint32_t own:1; 14306f3e57acSmx205022 } control_bits; 14316f3e57acSmx205022 struct { 14326f3e57acSmx205022 uint32_t bcnt:14; 14336f3e57acSmx205022 uint32_t resv14:1; 14346f3e57acSmx205022 uint32_t bam:1; 14356f3e57acSmx205022 uint32_t mam:1; 14366f3e57acSmx205022 uint32_t pam:1; 14376f3e57acSmx205022 uint32_t runt:1; 14386f3e57acSmx205022 uint32_t lcol:1; 14396f3e57acSmx205022 uint32_t max:1; 14406f3e57acSmx205022 uint32_t lfer:1; 14416f3e57acSmx205022 uint32_t crc:1; 14426f3e57acSmx205022 uint32_t ofol:1; 14436f3e57acSmx205022 uint32_t fram:1; 14446f3e57acSmx205022 uint32_t extra:1; 14456f3e57acSmx205022 uint32_t l3_l4_sum:3; 14466f3e57acSmx205022 uint32_t rend:1; 14476f3e57acSmx205022 uint32_t err:1; 14486f3e57acSmx205022 uint32_t own:1; 14496f3e57acSmx205022 } status_bits; 14506f3e57acSmx205022 } cntl_status; 14516f3e57acSmx205022 } sum_rx_bd, *psum_rx_bd; 14526f3e57acSmx205022 /* 14536f3e57acSmx205022 * Hot offload rx's bd which support 64bit access and 14546f3e57acSmx205022 * full-tcp hardware offload 14556f3e57acSmx205022 */ 14566f3e57acSmx205022 typedef struct _hot_rx_bd { 14576f3e57acSmx205022 uint32_t host_buf_addr_hi; 14586f3e57acSmx205022 uint32_t host_buf_addr_lo; 14596f3e57acSmx205022 uint32_t sw_tag; 14606f3e57acSmx205022 union { 14616f3e57acSmx205022 uint32_t cntl_val; 14626f3e57acSmx205022 struct { 14636f3e57acSmx205022 uint32_t bcnt:14; 14646f3e57acSmx205022 uint32_t resv14_29:16; 14656f3e57acSmx205022 uint32_t inten:1; 14666f3e57acSmx205022 uint32_t own:1; 14676f3e57acSmx205022 } control_bits; 14686f3e57acSmx205022 14696f3e57acSmx205022 struct { 14706f3e57acSmx205022 uint32_t bcnt:14; 14716f3e57acSmx205022 uint32_t ctmach_rd:1; 14726f3e57acSmx205022 uint32_t bam:1; 14736f3e57acSmx205022 uint32_t mam:1; 14746f3e57acSmx205022 uint32_t pam:1; 14756f3e57acSmx205022 uint32_t runt:1; 14766f3e57acSmx205022 uint32_t lcol:1; 14776f3e57acSmx205022 uint32_t max:1; 14786f3e57acSmx205022 uint32_t lfer:1; 14796f3e57acSmx205022 uint32_t crc:1; 14806f3e57acSmx205022 uint32_t ofol:1; 14816f3e57acSmx205022 uint32_t fram:1; 14826f3e57acSmx205022 uint32_t extra:1; 14836f3e57acSmx205022 uint32_t l3_l4_sum:3; 14846f3e57acSmx205022 uint32_t rend:1; 14856f3e57acSmx205022 uint32_t err:1; 14866f3e57acSmx205022 uint32_t own:1; 14876f3e57acSmx205022 } status_bits_legacy; 14886f3e57acSmx205022 } cntl_status; 14896f3e57acSmx205022 } hot_rx_bd, *phot_rx_bd; 14906f3e57acSmx205022 14916f3e57acSmx205022 /* 14926f3e57acSmx205022 * Legacy tx's bd which does not support 14936f3e57acSmx205022 * any hardware offload 14946f3e57acSmx205022 */ 14956f3e57acSmx205022 typedef struct _legacy_tx_bd { 14966f3e57acSmx205022 uint32_t host_buf_addr; 14976f3e57acSmx205022 union { 14986f3e57acSmx205022 uint32_t cntl_val; 14996f3e57acSmx205022 struct { 15006f3e57acSmx205022 uint32_t bcnt:16; 15016f3e57acSmx205022 uint32_t end:1; 15026f3e57acSmx205022 uint32_t resv17_23:7; 15036f3e57acSmx205022 uint32_t inten:1; 15046f3e57acSmx205022 uint32_t resv25_30:6; 15056f3e57acSmx205022 uint32_t own:1; 15066f3e57acSmx205022 } control_bits; 15076f3e57acSmx205022 15086f3e57acSmx205022 struct { 15096f3e57acSmx205022 uint32_t bcnt:16; 15106f3e57acSmx205022 uint32_t end:1; 15116f3e57acSmx205022 uint32_t rtry:1; 15126f3e57acSmx205022 uint32_t trc:4; 15136f3e57acSmx205022 uint32_t inten:1; 15146f3e57acSmx205022 uint32_t exdef:1; 15156f3e57acSmx205022 uint32_t def:1; 15166f3e57acSmx205022 uint32_t lcar:1; 15176f3e57acSmx205022 uint32_t lcol:1; 15186f3e57acSmx205022 uint32_t uflo:1; 15196f3e57acSmx205022 uint32_t err:1; 15206f3e57acSmx205022 uint32_t own:1; 15216f3e57acSmx205022 } status_bits; 15226f3e57acSmx205022 } cntl_status; 15236f3e57acSmx205022 } legacy_tx_bd, *plegacy_tx_bd; 15246f3e57acSmx205022 15256f3e57acSmx205022 /* 15266f3e57acSmx205022 * Stand offload tx's bd which supports hareware checksum 15276f3e57acSmx205022 * for tcp/ip 15286f3e57acSmx205022 */ 15296f3e57acSmx205022 typedef struct _sum_tx_bd { 15306f3e57acSmx205022 uint32_t host_buf_addr; 15316f3e57acSmx205022 union { 15326f3e57acSmx205022 uint32_t cntl_val; 15336f3e57acSmx205022 struct { 15346f3e57acSmx205022 uint32_t bcnt:14; 15356f3e57acSmx205022 uint32_t resv14_25:12; 15366f3e57acSmx205022 uint32_t tcp_hsum:1; 15376f3e57acSmx205022 uint32_t ip_hsum:1; 15386f3e57acSmx205022 uint32_t segen:1; 15396f3e57acSmx205022 uint32_t end:1; 15406f3e57acSmx205022 uint32_t inten:1; 15416f3e57acSmx205022 uint32_t own:1; 15426f3e57acSmx205022 } control_sum_bits; 15436f3e57acSmx205022 15446f3e57acSmx205022 struct { 15456f3e57acSmx205022 uint32_t bcnt:14; 15466f3e57acSmx205022 uint32_t mss:14; 15476f3e57acSmx205022 uint32_t segen:1; 15486f3e57acSmx205022 uint32_t end:1; 15496f3e57acSmx205022 uint32_t inten:1; 15506f3e57acSmx205022 uint32_t own:1; 15516f3e57acSmx205022 } control_tso_bits; 15526f3e57acSmx205022 15536f3e57acSmx205022 struct { 15546f3e57acSmx205022 uint32_t bcnt:14; 15556f3e57acSmx205022 uint32_t resv14_17:4; 15566f3e57acSmx205022 uint32_t rtry:1; 15576f3e57acSmx205022 uint32_t trc:4; 15586f3e57acSmx205022 uint32_t inten:1; 15596f3e57acSmx205022 uint32_t exdef:1; 15606f3e57acSmx205022 uint32_t def:1; 15616f3e57acSmx205022 uint32_t lcar:1; 15626f3e57acSmx205022 uint32_t lcol:1; 15636f3e57acSmx205022 uint32_t uflo:1; 15646f3e57acSmx205022 uint32_t end:1; 15656f3e57acSmx205022 uint32_t err:1; 15666f3e57acSmx205022 uint32_t own:1; 15676f3e57acSmx205022 } status_bits; 15686f3e57acSmx205022 } control_status; 15696f3e57acSmx205022 } sum_tx_bd, *psum_tx_bd; 15706f3e57acSmx205022 15716f3e57acSmx205022 /* 15726f3e57acSmx205022 * Hot offload tx's bd which support 64bit access and 15736f3e57acSmx205022 * full-tcp hardware offload 15746f3e57acSmx205022 */ 15756f3e57acSmx205022 15766f3e57acSmx205022 typedef struct _hot_tx_bd { 15776f3e57acSmx205022 uint32_t host_buf_addr_hi; 15786f3e57acSmx205022 uint32_t host_buf_addr_lo; 15796f3e57acSmx205022 union { 15806f3e57acSmx205022 uint32_t parm_val; 15816f3e57acSmx205022 struct { 15826f3e57acSmx205022 uint32_t resv0_15:16; 15836f3e57acSmx205022 uint32_t resv16:1; 15846f3e57acSmx205022 uint32_t resv17:1; 15856f3e57acSmx205022 uint32_t resv18_31:14; 15866f3e57acSmx205022 } parm_bits; 15876f3e57acSmx205022 } hot_parms; 15886f3e57acSmx205022 15896f3e57acSmx205022 union { 15906f3e57acSmx205022 uint32_t cntl_val; 15916f3e57acSmx205022 struct { 15926f3e57acSmx205022 uint32_t bcnt:14; 15936f3e57acSmx205022 uint32_t resv14_25:12; 15946f3e57acSmx205022 uint32_t tcp_hsum:1; 15956f3e57acSmx205022 uint32_t ip_hsum:1; 15966f3e57acSmx205022 uint32_t segen:1; 15976f3e57acSmx205022 uint32_t end:1; 15986f3e57acSmx205022 uint32_t inten:1; 15996f3e57acSmx205022 uint32_t own:1; 16006f3e57acSmx205022 } control_sum_bits; 16016f3e57acSmx205022 16026f3e57acSmx205022 struct { 16036f3e57acSmx205022 uint32_t bcnt:14; 16046f3e57acSmx205022 uint32_t mss:14; 16056f3e57acSmx205022 uint32_t segen:1; 16066f3e57acSmx205022 uint32_t end:1; 16076f3e57acSmx205022 uint32_t inten:1; 16086f3e57acSmx205022 uint32_t own:1; 16096f3e57acSmx205022 } control_tso_bits; 16106f3e57acSmx205022 16116f3e57acSmx205022 struct { 16126f3e57acSmx205022 uint32_t bcnt:14; 16136f3e57acSmx205022 uint32_t resv14_17:4; 16146f3e57acSmx205022 uint32_t rtry:1; 16156f3e57acSmx205022 uint32_t trc:4; 16166f3e57acSmx205022 uint32_t inten:1; 16176f3e57acSmx205022 uint32_t exdef:1; 16186f3e57acSmx205022 uint32_t def:1; 16196f3e57acSmx205022 uint32_t lcar:1; 16206f3e57acSmx205022 uint32_t lcol:1; 16216f3e57acSmx205022 uint32_t uflo:1; 16226f3e57acSmx205022 uint32_t end:1; 16236f3e57acSmx205022 uint32_t err:1; 16246f3e57acSmx205022 uint32_t own:1; 16256f3e57acSmx205022 } status_bits; 16266f3e57acSmx205022 } control_status; 16276f3e57acSmx205022 } hot_tx_bd, *phot_tx_bd; 16286f3e57acSmx205022 16296f3e57acSmx205022 #ifdef __cplusplus 16306f3e57acSmx205022 } 16316f3e57acSmx205022 #endif 16326f3e57acSmx205022 16336f3e57acSmx205022 #endif /* _SYS_NGE_CHIP_H */ 1634