18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * QLogic qlcnic NIC Driver 48c2ecf20Sopenharmony_ci * Copyright (c) 2009-2013 QLogic Corporation 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef __QLCNIC_HDR_H_ 88c2ecf20Sopenharmony_ci#define __QLCNIC_HDR_H_ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <linux/kernel.h> 118c2ecf20Sopenharmony_ci#include <linux/types.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#include "qlcnic_hw.h" 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* 168c2ecf20Sopenharmony_ci * The basic unit of access when reading/writing control registers. 178c2ecf20Sopenharmony_ci */ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_cienum { 208c2ecf20Sopenharmony_ci QLCNIC_HW_H0_CH_HUB_ADR = 0x05, 218c2ecf20Sopenharmony_ci QLCNIC_HW_H1_CH_HUB_ADR = 0x0E, 228c2ecf20Sopenharmony_ci QLCNIC_HW_H2_CH_HUB_ADR = 0x03, 238c2ecf20Sopenharmony_ci QLCNIC_HW_H3_CH_HUB_ADR = 0x01, 248c2ecf20Sopenharmony_ci QLCNIC_HW_H4_CH_HUB_ADR = 0x06, 258c2ecf20Sopenharmony_ci QLCNIC_HW_H5_CH_HUB_ADR = 0x07, 268c2ecf20Sopenharmony_ci QLCNIC_HW_H6_CH_HUB_ADR = 0x08 278c2ecf20Sopenharmony_ci}; 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* Hub 0 */ 308c2ecf20Sopenharmony_cienum { 318c2ecf20Sopenharmony_ci QLCNIC_HW_MN_CRB_AGT_ADR = 0x15, 328c2ecf20Sopenharmony_ci QLCNIC_HW_MS_CRB_AGT_ADR = 0x25 338c2ecf20Sopenharmony_ci}; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* Hub 1 */ 368c2ecf20Sopenharmony_cienum { 378c2ecf20Sopenharmony_ci QLCNIC_HW_PS_CRB_AGT_ADR = 0x73, 388c2ecf20Sopenharmony_ci QLCNIC_HW_SS_CRB_AGT_ADR = 0x20, 398c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX3_CRB_AGT_ADR = 0x0b, 408c2ecf20Sopenharmony_ci QLCNIC_HW_QMS_CRB_AGT_ADR = 0x00, 418c2ecf20Sopenharmony_ci QLCNIC_HW_SQGS0_CRB_AGT_ADR = 0x01, 428c2ecf20Sopenharmony_ci QLCNIC_HW_SQGS1_CRB_AGT_ADR = 0x02, 438c2ecf20Sopenharmony_ci QLCNIC_HW_SQGS2_CRB_AGT_ADR = 0x03, 448c2ecf20Sopenharmony_ci QLCNIC_HW_SQGS3_CRB_AGT_ADR = 0x04, 458c2ecf20Sopenharmony_ci QLCNIC_HW_C2C0_CRB_AGT_ADR = 0x58, 468c2ecf20Sopenharmony_ci QLCNIC_HW_C2C1_CRB_AGT_ADR = 0x59, 478c2ecf20Sopenharmony_ci QLCNIC_HW_C2C2_CRB_AGT_ADR = 0x5a, 488c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX2_CRB_AGT_ADR = 0x0a, 498c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX4_CRB_AGT_ADR = 0x0c, 508c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX7_CRB_AGT_ADR = 0x0f, 518c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX9_CRB_AGT_ADR = 0x12, 528c2ecf20Sopenharmony_ci QLCNIC_HW_SMB_CRB_AGT_ADR = 0x18 538c2ecf20Sopenharmony_ci}; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci/* Hub 2 */ 568c2ecf20Sopenharmony_cienum { 578c2ecf20Sopenharmony_ci QLCNIC_HW_NIU_CRB_AGT_ADR = 0x31, 588c2ecf20Sopenharmony_ci QLCNIC_HW_I2C0_CRB_AGT_ADR = 0x19, 598c2ecf20Sopenharmony_ci QLCNIC_HW_I2C1_CRB_AGT_ADR = 0x29, 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci QLCNIC_HW_SN_CRB_AGT_ADR = 0x10, 628c2ecf20Sopenharmony_ci QLCNIC_HW_I2Q_CRB_AGT_ADR = 0x20, 638c2ecf20Sopenharmony_ci QLCNIC_HW_LPC_CRB_AGT_ADR = 0x22, 648c2ecf20Sopenharmony_ci QLCNIC_HW_ROMUSB_CRB_AGT_ADR = 0x21, 658c2ecf20Sopenharmony_ci QLCNIC_HW_QM_CRB_AGT_ADR = 0x66, 668c2ecf20Sopenharmony_ci QLCNIC_HW_SQG0_CRB_AGT_ADR = 0x60, 678c2ecf20Sopenharmony_ci QLCNIC_HW_SQG1_CRB_AGT_ADR = 0x61, 688c2ecf20Sopenharmony_ci QLCNIC_HW_SQG2_CRB_AGT_ADR = 0x62, 698c2ecf20Sopenharmony_ci QLCNIC_HW_SQG3_CRB_AGT_ADR = 0x63, 708c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX1_CRB_AGT_ADR = 0x09, 718c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX5_CRB_AGT_ADR = 0x0d, 728c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX6_CRB_AGT_ADR = 0x0e, 738c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX8_CRB_AGT_ADR = 0x11 748c2ecf20Sopenharmony_ci}; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci/* Hub 3 */ 778c2ecf20Sopenharmony_cienum { 788c2ecf20Sopenharmony_ci QLCNIC_HW_PH_CRB_AGT_ADR = 0x1A, 798c2ecf20Sopenharmony_ci QLCNIC_HW_SRE_CRB_AGT_ADR = 0x50, 808c2ecf20Sopenharmony_ci QLCNIC_HW_EG_CRB_AGT_ADR = 0x51, 818c2ecf20Sopenharmony_ci QLCNIC_HW_RPMX0_CRB_AGT_ADR = 0x08 828c2ecf20Sopenharmony_ci}; 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci/* Hub 4 */ 858c2ecf20Sopenharmony_cienum { 868c2ecf20Sopenharmony_ci QLCNIC_HW_PEGN0_CRB_AGT_ADR = 0x40, 878c2ecf20Sopenharmony_ci QLCNIC_HW_PEGN1_CRB_AGT_ADR, 888c2ecf20Sopenharmony_ci QLCNIC_HW_PEGN2_CRB_AGT_ADR, 898c2ecf20Sopenharmony_ci QLCNIC_HW_PEGN3_CRB_AGT_ADR, 908c2ecf20Sopenharmony_ci QLCNIC_HW_PEGNI_CRB_AGT_ADR, 918c2ecf20Sopenharmony_ci QLCNIC_HW_PEGND_CRB_AGT_ADR, 928c2ecf20Sopenharmony_ci QLCNIC_HW_PEGNC_CRB_AGT_ADR, 938c2ecf20Sopenharmony_ci QLCNIC_HW_PEGR0_CRB_AGT_ADR, 948c2ecf20Sopenharmony_ci QLCNIC_HW_PEGR1_CRB_AGT_ADR, 958c2ecf20Sopenharmony_ci QLCNIC_HW_PEGR2_CRB_AGT_ADR, 968c2ecf20Sopenharmony_ci QLCNIC_HW_PEGR3_CRB_AGT_ADR, 978c2ecf20Sopenharmony_ci QLCNIC_HW_PEGN4_CRB_AGT_ADR 988c2ecf20Sopenharmony_ci}; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci/* Hub 5 */ 1018c2ecf20Sopenharmony_cienum { 1028c2ecf20Sopenharmony_ci QLCNIC_HW_PEGS0_CRB_AGT_ADR = 0x40, 1038c2ecf20Sopenharmony_ci QLCNIC_HW_PEGS1_CRB_AGT_ADR, 1048c2ecf20Sopenharmony_ci QLCNIC_HW_PEGS2_CRB_AGT_ADR, 1058c2ecf20Sopenharmony_ci QLCNIC_HW_PEGS3_CRB_AGT_ADR, 1068c2ecf20Sopenharmony_ci QLCNIC_HW_PEGSI_CRB_AGT_ADR, 1078c2ecf20Sopenharmony_ci QLCNIC_HW_PEGSD_CRB_AGT_ADR, 1088c2ecf20Sopenharmony_ci QLCNIC_HW_PEGSC_CRB_AGT_ADR 1098c2ecf20Sopenharmony_ci}; 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci/* Hub 6 */ 1128c2ecf20Sopenharmony_cienum { 1138c2ecf20Sopenharmony_ci QLCNIC_HW_CAS0_CRB_AGT_ADR = 0x46, 1148c2ecf20Sopenharmony_ci QLCNIC_HW_CAS1_CRB_AGT_ADR = 0x47, 1158c2ecf20Sopenharmony_ci QLCNIC_HW_CAS2_CRB_AGT_ADR = 0x48, 1168c2ecf20Sopenharmony_ci QLCNIC_HW_CAS3_CRB_AGT_ADR = 0x49, 1178c2ecf20Sopenharmony_ci QLCNIC_HW_NCM_CRB_AGT_ADR = 0x16, 1188c2ecf20Sopenharmony_ci QLCNIC_HW_TMR_CRB_AGT_ADR = 0x17, 1198c2ecf20Sopenharmony_ci QLCNIC_HW_XDMA_CRB_AGT_ADR = 0x05, 1208c2ecf20Sopenharmony_ci QLCNIC_HW_OCM0_CRB_AGT_ADR = 0x06, 1218c2ecf20Sopenharmony_ci QLCNIC_HW_OCM1_CRB_AGT_ADR = 0x07 1228c2ecf20Sopenharmony_ci}; 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ci/* Floaters - non existent modules */ 1258c2ecf20Sopenharmony_ci#define QLCNIC_HW_EFC_RPMX0_CRB_AGT_ADR 0x67 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci/* This field defines PCI/X adr [25:20] of agents on the CRB */ 1288c2ecf20Sopenharmony_cienum { 1298c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PH = 0, 1308c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PS, 1318c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_MN, 1328c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_MS, 1338c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGR1, 1348c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SRE, 1358c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_NIU, 1368c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_QMN, 1378c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQN0, 1388c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQN1, 1398c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQN2, 1408c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQN3, 1418c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_QMS, 1428c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQS0, 1438c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQS1, 1448c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQS2, 1458c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SQS3, 1468c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGN0, 1478c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGN1, 1488c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGN2, 1498c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGN3, 1508c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGND, 1518c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGNI, 1528c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGS0, 1538c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGS1, 1548c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGS2, 1558c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGS3, 1568c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGSD, 1578c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGSI, 1588c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SN, 1598c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGR2, 1608c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_EG, 1618c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PH2, 1628c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PS2, 1638c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_CAM, 1648c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_CAS0, 1658c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_CAS1, 1668c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_CAS2, 1678c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_C2C0, 1688c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_C2C1, 1698c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_TIMR, 1708c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGR3, 1718c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX1, 1728c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX2, 1738c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX3, 1748c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX4, 1758c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX5, 1768c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX6, 1778c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX7, 1788c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_XDMA, 1798c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_I2Q, 1808c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_ROMUSB, 1818c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_CAS3, 1828c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX0, 1838c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX8, 1848c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_RPMX9, 1858c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_OCM0, 1868c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_OCM1, 1878c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_SMB, 1888c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_I2C0, 1898c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_I2C1, 1908c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_LPC, 1918c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGNC, 1928c2ecf20Sopenharmony_ci QLCNIC_HW_PX_MAP_CRB_PGR0 1938c2ecf20Sopenharmony_ci}; 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define BIT_0 0x1 1968c2ecf20Sopenharmony_ci#define BIT_1 0x2 1978c2ecf20Sopenharmony_ci#define BIT_2 0x4 1988c2ecf20Sopenharmony_ci#define BIT_3 0x8 1998c2ecf20Sopenharmony_ci#define BIT_4 0x10 2008c2ecf20Sopenharmony_ci#define BIT_5 0x20 2018c2ecf20Sopenharmony_ci#define BIT_6 0x40 2028c2ecf20Sopenharmony_ci#define BIT_7 0x80 2038c2ecf20Sopenharmony_ci#define BIT_8 0x100 2048c2ecf20Sopenharmony_ci#define BIT_9 0x200 2058c2ecf20Sopenharmony_ci#define BIT_10 0x400 2068c2ecf20Sopenharmony_ci#define BIT_11 0x800 2078c2ecf20Sopenharmony_ci#define BIT_12 0x1000 2088c2ecf20Sopenharmony_ci#define BIT_13 0x2000 2098c2ecf20Sopenharmony_ci#define BIT_14 0x4000 2108c2ecf20Sopenharmony_ci#define BIT_15 0x8000 2118c2ecf20Sopenharmony_ci#define BIT_16 0x10000 2128c2ecf20Sopenharmony_ci#define BIT_17 0x20000 2138c2ecf20Sopenharmony_ci#define BIT_18 0x40000 2148c2ecf20Sopenharmony_ci#define BIT_19 0x80000 2158c2ecf20Sopenharmony_ci#define BIT_20 0x100000 2168c2ecf20Sopenharmony_ci#define BIT_21 0x200000 2178c2ecf20Sopenharmony_ci#define BIT_22 0x400000 2188c2ecf20Sopenharmony_ci#define BIT_23 0x800000 2198c2ecf20Sopenharmony_ci#define BIT_24 0x1000000 2208c2ecf20Sopenharmony_ci#define BIT_25 0x2000000 2218c2ecf20Sopenharmony_ci#define BIT_26 0x4000000 2228c2ecf20Sopenharmony_ci#define BIT_27 0x8000000 2238c2ecf20Sopenharmony_ci#define BIT_28 0x10000000 2248c2ecf20Sopenharmony_ci#define BIT_29 0x20000000 2258c2ecf20Sopenharmony_ci#define BIT_30 0x40000000 2268c2ecf20Sopenharmony_ci#define BIT_31 0x80000000 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci/* This field defines CRB adr [31:20] of the agents */ 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_MN \ 2318c2ecf20Sopenharmony_ci ((QLCNIC_HW_H0_CH_HUB_ADR << 7) | QLCNIC_HW_MN_CRB_AGT_ADR) 2328c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PH \ 2338c2ecf20Sopenharmony_ci ((QLCNIC_HW_H0_CH_HUB_ADR << 7) | QLCNIC_HW_PH_CRB_AGT_ADR) 2348c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_MS \ 2358c2ecf20Sopenharmony_ci ((QLCNIC_HW_H0_CH_HUB_ADR << 7) | QLCNIC_HW_MS_CRB_AGT_ADR) 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PS \ 2388c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_PS_CRB_AGT_ADR) 2398c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SS \ 2408c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SS_CRB_AGT_ADR) 2418c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX3 \ 2428c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX3_CRB_AGT_ADR) 2438c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_QMS \ 2448c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_QMS_CRB_AGT_ADR) 2458c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQS0 \ 2468c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SQGS0_CRB_AGT_ADR) 2478c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQS1 \ 2488c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SQGS1_CRB_AGT_ADR) 2498c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQS2 \ 2508c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SQGS2_CRB_AGT_ADR) 2518c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQS3 \ 2528c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SQGS3_CRB_AGT_ADR) 2538c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_C2C0 \ 2548c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_C2C0_CRB_AGT_ADR) 2558c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_C2C1 \ 2568c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_C2C1_CRB_AGT_ADR) 2578c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX2 \ 2588c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX2_CRB_AGT_ADR) 2598c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX4 \ 2608c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX4_CRB_AGT_ADR) 2618c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX7 \ 2628c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX7_CRB_AGT_ADR) 2638c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX9 \ 2648c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX9_CRB_AGT_ADR) 2658c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SMB \ 2668c2ecf20Sopenharmony_ci ((QLCNIC_HW_H1_CH_HUB_ADR << 7) | QLCNIC_HW_SMB_CRB_AGT_ADR) 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_NIU \ 2698c2ecf20Sopenharmony_ci ((QLCNIC_HW_H2_CH_HUB_ADR << 7) | QLCNIC_HW_NIU_CRB_AGT_ADR) 2708c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_I2C0 \ 2718c2ecf20Sopenharmony_ci ((QLCNIC_HW_H2_CH_HUB_ADR << 7) | QLCNIC_HW_I2C0_CRB_AGT_ADR) 2728c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_I2C1 \ 2738c2ecf20Sopenharmony_ci ((QLCNIC_HW_H2_CH_HUB_ADR << 7) | QLCNIC_HW_I2C1_CRB_AGT_ADR) 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SRE \ 2768c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_SRE_CRB_AGT_ADR) 2778c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_EG \ 2788c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_EG_CRB_AGT_ADR) 2798c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX0 \ 2808c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX0_CRB_AGT_ADR) 2818c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_QMN \ 2828c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_QM_CRB_AGT_ADR) 2838c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQN0 \ 2848c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_SQG0_CRB_AGT_ADR) 2858c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQN1 \ 2868c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_SQG1_CRB_AGT_ADR) 2878c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQN2 \ 2888c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_SQG2_CRB_AGT_ADR) 2898c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SQN3 \ 2908c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_SQG3_CRB_AGT_ADR) 2918c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX1 \ 2928c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX1_CRB_AGT_ADR) 2938c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX5 \ 2948c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX5_CRB_AGT_ADR) 2958c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX6 \ 2968c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX6_CRB_AGT_ADR) 2978c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_RPMX8 \ 2988c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_RPMX8_CRB_AGT_ADR) 2998c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_CAS0 \ 3008c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_CAS0_CRB_AGT_ADR) 3018c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_CAS1 \ 3028c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_CAS1_CRB_AGT_ADR) 3038c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_CAS2 \ 3048c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_CAS2_CRB_AGT_ADR) 3058c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_CAS3 \ 3068c2ecf20Sopenharmony_ci ((QLCNIC_HW_H3_CH_HUB_ADR << 7) | QLCNIC_HW_CAS3_CRB_AGT_ADR) 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGNI \ 3098c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGNI_CRB_AGT_ADR) 3108c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGND \ 3118c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGND_CRB_AGT_ADR) 3128c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGN0 \ 3138c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGN0_CRB_AGT_ADR) 3148c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGN1 \ 3158c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGN1_CRB_AGT_ADR) 3168c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGN2 \ 3178c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGN2_CRB_AGT_ADR) 3188c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGN3 \ 3198c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGN3_CRB_AGT_ADR) 3208c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGN4 \ 3218c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGN4_CRB_AGT_ADR) 3228c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGNC \ 3238c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGNC_CRB_AGT_ADR) 3248c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGR0 \ 3258c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGR0_CRB_AGT_ADR) 3268c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGR1 \ 3278c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGR1_CRB_AGT_ADR) 3288c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGR2 \ 3298c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGR2_CRB_AGT_ADR) 3308c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGR3 \ 3318c2ecf20Sopenharmony_ci ((QLCNIC_HW_H4_CH_HUB_ADR << 7) | QLCNIC_HW_PEGR3_CRB_AGT_ADR) 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGSI \ 3348c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGSI_CRB_AGT_ADR) 3358c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGSD \ 3368c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGSD_CRB_AGT_ADR) 3378c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGS0 \ 3388c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGS0_CRB_AGT_ADR) 3398c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGS1 \ 3408c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGS1_CRB_AGT_ADR) 3418c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGS2 \ 3428c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGS2_CRB_AGT_ADR) 3438c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGS3 \ 3448c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGS3_CRB_AGT_ADR) 3458c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_PGSC \ 3468c2ecf20Sopenharmony_ci ((QLCNIC_HW_H5_CH_HUB_ADR << 7) | QLCNIC_HW_PEGSC_CRB_AGT_ADR) 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_CAM \ 3498c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_NCM_CRB_AGT_ADR) 3508c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_TIMR \ 3518c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_TMR_CRB_AGT_ADR) 3528c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_XDMA \ 3538c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_XDMA_CRB_AGT_ADR) 3548c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_SN \ 3558c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_SN_CRB_AGT_ADR) 3568c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_I2Q \ 3578c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_I2Q_CRB_AGT_ADR) 3588c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_ROMUSB \ 3598c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_ROMUSB_CRB_AGT_ADR) 3608c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_OCM0 \ 3618c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_OCM0_CRB_AGT_ADR) 3628c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_OCM1 \ 3638c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_OCM1_CRB_AGT_ADR) 3648c2ecf20Sopenharmony_ci#define QLCNIC_HW_CRB_HUB_AGT_ADR_LPC \ 3658c2ecf20Sopenharmony_ci ((QLCNIC_HW_H6_CH_HUB_ADR << 7) | QLCNIC_HW_LPC_CRB_AGT_ADR) 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ci#define QLCNIC_SRE_MISC (QLCNIC_CRB_SRE + 0x0002c) 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_ci#define QLCNIC_I2Q_CLR_PCI_HI (QLCNIC_CRB_I2Q + 0x00034) 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci#define ROMUSB_GLB (QLCNIC_CRB_ROMUSB + 0x00000) 3728c2ecf20Sopenharmony_ci#define ROMUSB_ROM (QLCNIC_CRB_ROMUSB + 0x10000) 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_STATUS (ROMUSB_GLB + 0x0004) 3758c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_SW_RESET (ROMUSB_GLB + 0x0008) 3768c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_PAD_GPIO_I (ROMUSB_GLB + 0x000c) 3778c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_CAS_RST (ROMUSB_GLB + 0x0038) 3788c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_TEST_MUX_SEL (ROMUSB_GLB + 0x0044) 3798c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_PEGTUNE_DONE (ROMUSB_GLB + 0x005c) 3808c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GLB_CHIP_CLK_CTRL (ROMUSB_GLB + 0x00A8) 3818c2ecf20Sopenharmony_ci 3828c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_GPIO(n) (ROMUSB_GLB + 0x60 + (4 * (n))) 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_INSTR_OPCODE (ROMUSB_ROM + 0x0004) 3858c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_ADDRESS (ROMUSB_ROM + 0x0008) 3868c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_WDATA (ROMUSB_ROM + 0x000c) 3878c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_ABYTE_CNT (ROMUSB_ROM + 0x0010) 3888c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_DUMMY_BYTE_CNT (ROMUSB_ROM + 0x0014) 3898c2ecf20Sopenharmony_ci#define QLCNIC_ROMUSB_ROM_RDATA (ROMUSB_ROM + 0x0018) 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_ci/****************************************************************************** 3928c2ecf20Sopenharmony_ci* 3938c2ecf20Sopenharmony_ci* Definitions specific to M25P flash 3948c2ecf20Sopenharmony_ci* 3958c2ecf20Sopenharmony_ci******************************************************************************* 3968c2ecf20Sopenharmony_ci*/ 3978c2ecf20Sopenharmony_ci 3988c2ecf20Sopenharmony_ci/* all are 1MB windows */ 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CRB_WINDOWSIZE 0x00100000 4018c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CRB_WINDOW(A) \ 4028c2ecf20Sopenharmony_ci (QLCNIC_PCI_CRBSPACE + (A)*QLCNIC_PCI_CRB_WINDOWSIZE) 4038c2ecf20Sopenharmony_ci 4048c2ecf20Sopenharmony_ci#define QLCNIC_CRB_NIU QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_NIU) 4058c2ecf20Sopenharmony_ci#define QLCNIC_CRB_SRE QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_SRE) 4068c2ecf20Sopenharmony_ci#define QLCNIC_CRB_ROMUSB \ 4078c2ecf20Sopenharmony_ci QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_ROMUSB) 4088c2ecf20Sopenharmony_ci#define QLCNIC_CRB_EPG QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_EG) 4098c2ecf20Sopenharmony_ci#define QLCNIC_CRB_I2Q QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_I2Q) 4108c2ecf20Sopenharmony_ci#define QLCNIC_CRB_TIMER QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_TIMR) 4118c2ecf20Sopenharmony_ci#define QLCNIC_CRB_I2C0 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_I2C0) 4128c2ecf20Sopenharmony_ci#define QLCNIC_CRB_SMB QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_SMB) 4138c2ecf20Sopenharmony_ci#define QLCNIC_CRB_MAX QLCNIC_PCI_CRB_WINDOW(64) 4148c2ecf20Sopenharmony_ci 4158c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PCIX_HOST QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PH) 4168c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PCIX_HOST2 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PH2) 4178c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_0 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGN0) 4188c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_1 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGN1) 4198c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_2 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGN2) 4208c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_3 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGN3) 4218c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_4 QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_SQS2) 4228c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_D QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGND) 4238c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PEG_NET_I QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PGNI) 4248c2ecf20Sopenharmony_ci#define QLCNIC_CRB_DDR_NET QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_MN) 4258c2ecf20Sopenharmony_ci#define QLCNIC_CRB_QDR_NET QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_SN) 4268c2ecf20Sopenharmony_ci 4278c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PCIX_MD QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_PS) 4288c2ecf20Sopenharmony_ci#define QLCNIC_CRB_PCIE QLCNIC_CRB_PCIX_MD 4298c2ecf20Sopenharmony_ci 4308c2ecf20Sopenharmony_ci#define ISR_INT_VECTOR (QLCNIC_PCIX_PS_REG(PCIX_INT_VECTOR)) 4318c2ecf20Sopenharmony_ci#define ISR_INT_MASK (QLCNIC_PCIX_PS_REG(PCIX_INT_MASK)) 4328c2ecf20Sopenharmony_ci#define ISR_INT_MASK_SLOW (QLCNIC_PCIX_PS_REG(PCIX_INT_MASK)) 4338c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS)) 4348c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK)) 4358c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F1 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F1)) 4368c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F1 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F1)) 4378c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F2 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F2)) 4388c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F2 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F2)) 4398c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F3 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F3)) 4408c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F3 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F3)) 4418c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F4 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F4)) 4428c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F4 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F4)) 4438c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F5 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F5)) 4448c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F5 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F5)) 4458c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F6 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F6)) 4468c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F6 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F6)) 4478c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_STATUS_F7 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_STATUS_F7)) 4488c2ecf20Sopenharmony_ci#define ISR_INT_TARGET_MASK_F7 (QLCNIC_PCIX_PS_REG(PCIX_TARGET_MASK_F7)) 4498c2ecf20Sopenharmony_ci 4508c2ecf20Sopenharmony_ci#define QLCNIC_PCI_OCM0_2M (0x000c0000UL) 4518c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CRBSPACE (0x06000000UL) 4528c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CAMQM (0x04800000UL) 4538c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CAMQM_END (0x04800800UL) 4548c2ecf20Sopenharmony_ci#define QLCNIC_PCI_CAMQM_2M_BASE (0x000ff800UL) 4558c2ecf20Sopenharmony_ci 4568c2ecf20Sopenharmony_ci#define QLCNIC_CRB_CAM QLCNIC_PCI_CRB_WINDOW(QLCNIC_HW_PX_MAP_CRB_CAM) 4578c2ecf20Sopenharmony_ci 4588c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_DDR_NET (0x0000000000000000ULL) 4598c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_DDR_NET_MAX (0x000000000fffffffULL) 4608c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_OCM0 (0x0000000200000000ULL) 4618c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_OCM0_MAX (0x00000002000fffffULL) 4628c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_OCM1 (0x0000000200400000ULL) 4638c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_OCM1_MAX (0x00000002004fffffULL) 4648c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_QDR_NET (0x0000000300000000ULL) 4658c2ecf20Sopenharmony_ci#define QLCNIC_ADDR_QDR_NET_MAX (0x0000000307ffffffULL) 4668c2ecf20Sopenharmony_ci 4678c2ecf20Sopenharmony_ci/* 4688c2ecf20Sopenharmony_ci * Register offsets for MN 4698c2ecf20Sopenharmony_ci */ 4708c2ecf20Sopenharmony_ci#define QLCNIC_MIU_CONTROL (0x000) 4718c2ecf20Sopenharmony_ci#define QLCNIC_MIU_MN_CONTROL (QLCNIC_CRB_DDR_NET+QLCNIC_MIU_CONTROL) 4728c2ecf20Sopenharmony_ci 4738c2ecf20Sopenharmony_ci/* 200ms delay in each loop */ 4748c2ecf20Sopenharmony_ci#define QLCNIC_NIU_PHY_WAITLEN 200000 4758c2ecf20Sopenharmony_ci/* 10 seconds before we give up */ 4768c2ecf20Sopenharmony_ci#define QLCNIC_NIU_PHY_WAITMAX 50 4778c2ecf20Sopenharmony_ci#define QLCNIC_NIU_MAX_GBE_PORTS 4 4788c2ecf20Sopenharmony_ci#define QLCNIC_NIU_MAX_XG_PORTS 2 4798c2ecf20Sopenharmony_ci 4808c2ecf20Sopenharmony_ci#define QLCNIC_NIU_MODE (QLCNIC_CRB_NIU + 0x00000) 4818c2ecf20Sopenharmony_ci#define QLCNIC_NIU_GB_PAUSE_CTL (QLCNIC_CRB_NIU + 0x0030c) 4828c2ecf20Sopenharmony_ci#define QLCNIC_NIU_XG_PAUSE_CTL (QLCNIC_CRB_NIU + 0x00098) 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci#define QLCNIC_NIU_GB_MAC_CONFIG_0(I) \ 4858c2ecf20Sopenharmony_ci (QLCNIC_CRB_NIU + 0x30000 + (I)*0x10000) 4868c2ecf20Sopenharmony_ci#define QLCNIC_NIU_GB_MAC_CONFIG_1(I) \ 4878c2ecf20Sopenharmony_ci (QLCNIC_CRB_NIU + 0x30004 + (I)*0x10000) 4888c2ecf20Sopenharmony_ci 4898c2ecf20Sopenharmony_ci#define MAX_CTL_CHECK 1000 4908c2ecf20Sopenharmony_ci#define TEST_AGT_CTRL (0x00) 4918c2ecf20Sopenharmony_ci 4928c2ecf20Sopenharmony_ci#define TA_CTL_START BIT_0 4938c2ecf20Sopenharmony_ci#define TA_CTL_ENABLE BIT_1 4948c2ecf20Sopenharmony_ci#define TA_CTL_WRITE BIT_2 4958c2ecf20Sopenharmony_ci#define TA_CTL_BUSY BIT_3 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci/* XG Link status */ 4988c2ecf20Sopenharmony_ci#define XG_LINK_UP 0x10 4998c2ecf20Sopenharmony_ci#define XG_LINK_DOWN 0x20 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_ci#define XG_LINK_UP_P3P 0x01 5028c2ecf20Sopenharmony_ci#define XG_LINK_DOWN_P3P 0x02 5038c2ecf20Sopenharmony_ci#define XG_LINK_STATE_P3P_MASK 0xf 5048c2ecf20Sopenharmony_ci#define XG_LINK_STATE_P3P(pcifn, val) \ 5058c2ecf20Sopenharmony_ci (((val) >> ((pcifn) * 4)) & XG_LINK_STATE_P3P_MASK) 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_ci#define P3P_LINK_SPEED_MHZ 100 5088c2ecf20Sopenharmony_ci#define P3P_LINK_SPEED_MASK 0xff 5098c2ecf20Sopenharmony_ci#define P3P_LINK_SPEED_REG(pcifn) \ 5108c2ecf20Sopenharmony_ci (CRB_PF_LINK_SPEED_1 + (((pcifn) / 4) * 4)) 5118c2ecf20Sopenharmony_ci#define P3P_LINK_SPEED_VAL(pcifn, reg) \ 5128c2ecf20Sopenharmony_ci (((reg) >> (8 * ((pcifn) & 0x3))) & P3P_LINK_SPEED_MASK) 5138c2ecf20Sopenharmony_ci 5148c2ecf20Sopenharmony_ci#define QLCNIC_CAM_RAM_BASE (QLCNIC_CRB_CAM + 0x02000) 5158c2ecf20Sopenharmony_ci#define QLCNIC_CAM_RAM(reg) (QLCNIC_CAM_RAM_BASE + (reg)) 5168c2ecf20Sopenharmony_ci#define QLCNIC_ROM_LOCK_ID (QLCNIC_CAM_RAM(0x100)) 5178c2ecf20Sopenharmony_ci#define QLCNIC_PHY_LOCK_ID (QLCNIC_CAM_RAM(0x120)) 5188c2ecf20Sopenharmony_ci#define QLCNIC_CRB_WIN_LOCK_ID (QLCNIC_CAM_RAM(0x124)) 5198c2ecf20Sopenharmony_ci 5208c2ecf20Sopenharmony_ci#define NIC_CRB_BASE (QLCNIC_CAM_RAM(0x200)) 5218c2ecf20Sopenharmony_ci#define NIC_CRB_BASE_2 (QLCNIC_CAM_RAM(0x700)) 5228c2ecf20Sopenharmony_ci#define QLCNIC_REG(X) (NIC_CRB_BASE+(X)) 5238c2ecf20Sopenharmony_ci#define QLCNIC_REG_2(X) (NIC_CRB_BASE_2+(X)) 5248c2ecf20Sopenharmony_ci 5258c2ecf20Sopenharmony_ci#define QLCNIC_CDRP_MAX_ARGS 4 5268c2ecf20Sopenharmony_ci#define QLCNIC_CDRP_ARG(i) (QLCNIC_REG(0x18 + ((i) * 4))) 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ci#define QLCNIC_CDRP_CRB_OFFSET (QLCNIC_REG(0x18)) 5298c2ecf20Sopenharmony_ci#define QLCNIC_SIGN_CRB_OFFSET (QLCNIC_REG(0x28)) 5308c2ecf20Sopenharmony_ci 5318c2ecf20Sopenharmony_ci#define CRB_XG_STATE_P3P (QLCNIC_REG(0x98)) 5328c2ecf20Sopenharmony_ci#define CRB_PF_LINK_SPEED_1 (QLCNIC_REG(0xe8)) 5338c2ecf20Sopenharmony_ci#define CRB_DRIVER_VERSION (QLCNIC_REG(0x2a0)) 5348c2ecf20Sopenharmony_ci 5358c2ecf20Sopenharmony_ci#define CRB_FW_CAPABILITIES_2 (QLCNIC_CAM_RAM(0x12c)) 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci/* 5388c2ecf20Sopenharmony_ci * CrbPortPhanCntrHi/Lo is used to pass the address of HostPhantomIndex address 5398c2ecf20Sopenharmony_ci * which can be read by the Phantom host to get producer/consumer indexes from 5408c2ecf20Sopenharmony_ci * Phantom/Casper. If it is not HOST_SHARED_MEMORY, then the following 5418c2ecf20Sopenharmony_ci * registers will be used for the addresses of the ring's shared memory 5428c2ecf20Sopenharmony_ci * on the Phantom. 5438c2ecf20Sopenharmony_ci */ 5448c2ecf20Sopenharmony_ci 5458c2ecf20Sopenharmony_ci#define qlcnic_get_temp_val(x) ((x) >> 16) 5468c2ecf20Sopenharmony_ci#define qlcnic_get_temp_state(x) ((x) & 0xffff) 5478c2ecf20Sopenharmony_ci#define qlcnic_encode_temp(val, state) (((val) << 16) | (state)) 5488c2ecf20Sopenharmony_ci 5498c2ecf20Sopenharmony_ci/* 5508c2ecf20Sopenharmony_ci * Temperature control. 5518c2ecf20Sopenharmony_ci */ 5528c2ecf20Sopenharmony_cienum { 5538c2ecf20Sopenharmony_ci QLCNIC_TEMP_NORMAL = 0x1, /* Normal operating range */ 5548c2ecf20Sopenharmony_ci QLCNIC_TEMP_WARN, /* Sound alert, temperature getting high */ 5558c2ecf20Sopenharmony_ci QLCNIC_TEMP_PANIC /* Fatal error, hardware has shut down. */ 5568c2ecf20Sopenharmony_ci}; 5578c2ecf20Sopenharmony_ci 5588c2ecf20Sopenharmony_ci 5598c2ecf20Sopenharmony_ci/* Lock IDs for PHY lock */ 5608c2ecf20Sopenharmony_ci#define PHY_LOCK_DRIVER 0x44524956 5618c2ecf20Sopenharmony_ci 5628c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR (0x10100) 5638c2ecf20Sopenharmony_ci#define PCIX_INT_MASK (0x10104) 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci#define PCIX_OCM_WINDOW (0x10800) 5668c2ecf20Sopenharmony_ci#define PCIX_OCM_WINDOW_REG(func) (PCIX_OCM_WINDOW + 0x4 * (func)) 5678c2ecf20Sopenharmony_ci 5688c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS (0x10118) 5698c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F1 (0x10160) 5708c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F2 (0x10164) 5718c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F3 (0x10168) 5728c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F4 (0x10360) 5738c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F5 (0x10364) 5748c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F6 (0x10368) 5758c2ecf20Sopenharmony_ci#define PCIX_TARGET_STATUS_F7 (0x1036c) 5768c2ecf20Sopenharmony_ci 5778c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK (0x10128) 5788c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F1 (0x10170) 5798c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F2 (0x10174) 5808c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F3 (0x10178) 5818c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F4 (0x10370) 5828c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F5 (0x10374) 5838c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F6 (0x10378) 5848c2ecf20Sopenharmony_ci#define PCIX_TARGET_MASK_F7 (0x1037c) 5858c2ecf20Sopenharmony_ci 5868c2ecf20Sopenharmony_ci#define PCIX_MSI_F(i) (0x13000+((i)*4)) 5878c2ecf20Sopenharmony_ci 5888c2ecf20Sopenharmony_ci#define QLCNIC_PCIX_PH_REG(reg) (QLCNIC_CRB_PCIE + (reg)) 5898c2ecf20Sopenharmony_ci#define QLCNIC_PCIX_PS_REG(reg) (QLCNIC_CRB_PCIX_MD + (reg)) 5908c2ecf20Sopenharmony_ci#define QLCNIC_PCIE_REG(reg) (QLCNIC_CRB_PCIE + (reg)) 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_ci#define PCIE_SEM0_LOCK (0x1c000) 5938c2ecf20Sopenharmony_ci#define PCIE_SEM0_UNLOCK (0x1c004) 5948c2ecf20Sopenharmony_ci#define PCIE_SEM_LOCK(N) (PCIE_SEM0_LOCK + 8*(N)) 5958c2ecf20Sopenharmony_ci#define PCIE_SEM_UNLOCK(N) (PCIE_SEM0_UNLOCK + 8*(N)) 5968c2ecf20Sopenharmony_ci 5978c2ecf20Sopenharmony_ci#define PCIE_SETUP_FUNCTION (0x12040) 5988c2ecf20Sopenharmony_ci#define PCIE_SETUP_FUNCTION2 (0x12048) 5998c2ecf20Sopenharmony_ci#define PCIE_MISCCFG_RC (0x1206c) 6008c2ecf20Sopenharmony_ci#define PCIE_TGT_SPLIT_CHICKEN (0x12080) 6018c2ecf20Sopenharmony_ci#define PCIE_CHICKEN3 (0x120c8) 6028c2ecf20Sopenharmony_ci 6038c2ecf20Sopenharmony_ci#define ISR_INT_STATE_REG (QLCNIC_PCIX_PS_REG(PCIE_MISCCFG_RC)) 6048c2ecf20Sopenharmony_ci#define PCIE_MAX_MASTER_SPLIT (0x14048) 6058c2ecf20Sopenharmony_ci 6068c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_NONE 0 6078c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_XG 1 6088c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_GB 2 6098c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_802_3_AP 3 6108c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_AUTO_NEG 4 6118c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_AUTO_NEG_1G 5 6128c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_AUTO_NEG_XG 6 6138c2ecf20Sopenharmony_ci#define QLCNIC_PORT_MODE_ADDR (QLCNIC_CAM_RAM(0x24)) 6148c2ecf20Sopenharmony_ci#define QLCNIC_WOL_PORT_MODE (QLCNIC_CAM_RAM(0x198)) 6158c2ecf20Sopenharmony_ci 6168c2ecf20Sopenharmony_ci#define QLCNIC_WOL_CONFIG_NV (QLCNIC_CAM_RAM(0x184)) 6178c2ecf20Sopenharmony_ci#define QLCNIC_WOL_CONFIG (QLCNIC_CAM_RAM(0x188)) 6188c2ecf20Sopenharmony_ci 6198c2ecf20Sopenharmony_ci#define QLCNIC_PEG_TUNE_MN_PRESENT 0x1 6208c2ecf20Sopenharmony_ci#define QLCNIC_PEG_TUNE_CAPABILITY (QLCNIC_CAM_RAM(0x02c)) 6218c2ecf20Sopenharmony_ci 6228c2ecf20Sopenharmony_ci#define QLCNIC_DMA_WATCHDOG_CTRL (QLCNIC_CAM_RAM(0x14)) 6238c2ecf20Sopenharmony_ci#define QLCNIC_ROM_DEV_INIT_TIMEOUT (0x3e885c) 6248c2ecf20Sopenharmony_ci#define QLCNIC_ROM_DRV_RESET_TIMEOUT (0x3e8860) 6258c2ecf20Sopenharmony_ci 6268c2ecf20Sopenharmony_ci/* Device State */ 6278c2ecf20Sopenharmony_ci#define QLCNIC_DEV_COLD 0x1 6288c2ecf20Sopenharmony_ci#define QLCNIC_DEV_INITIALIZING 0x2 6298c2ecf20Sopenharmony_ci#define QLCNIC_DEV_READY 0x3 6308c2ecf20Sopenharmony_ci#define QLCNIC_DEV_NEED_RESET 0x4 6318c2ecf20Sopenharmony_ci#define QLCNIC_DEV_NEED_QUISCENT 0x5 6328c2ecf20Sopenharmony_ci#define QLCNIC_DEV_FAILED 0x6 6338c2ecf20Sopenharmony_ci#define QLCNIC_DEV_QUISCENT 0x7 6348c2ecf20Sopenharmony_ci 6358c2ecf20Sopenharmony_ci#define QLCNIC_DEV_BADBAD 0xbad0bad0 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci#define QLCNIC_DEV_NPAR_NON_OPER 0 /* NON Operational */ 6388c2ecf20Sopenharmony_ci#define QLCNIC_DEV_NPAR_OPER 1 /* NPAR Operational */ 6398c2ecf20Sopenharmony_ci#define QLCNIC_DEV_NPAR_OPER_TIMEO 30 /* Operational time out */ 6408c2ecf20Sopenharmony_ci 6418c2ecf20Sopenharmony_ci#define QLC_DEV_SET_REF_CNT(VAL, FN) ((VAL) |= (1 << (FN * 4))) 6428c2ecf20Sopenharmony_ci#define QLC_DEV_CLR_REF_CNT(VAL, FN) ((VAL) &= ~(1 << (FN * 4))) 6438c2ecf20Sopenharmony_ci#define QLC_DEV_SET_RST_RDY(VAL, FN) ((VAL) |= (1 << (FN * 4))) 6448c2ecf20Sopenharmony_ci#define QLC_DEV_SET_QSCNT_RDY(VAL, FN) ((VAL) |= (2 << (FN * 4))) 6458c2ecf20Sopenharmony_ci#define QLC_DEV_CLR_RST_QSCNT(VAL, FN) ((VAL) &= ~(3 << (FN * 4))) 6468c2ecf20Sopenharmony_ci 6478c2ecf20Sopenharmony_ci#define QLC_DEV_GET_DRV(VAL, FN) (0xf & ((VAL) >> (FN * 4))) 6488c2ecf20Sopenharmony_ci#define QLC_DEV_SET_DRV(VAL, FN) ((VAL) << (FN * 4)) 6498c2ecf20Sopenharmony_ci 6508c2ecf20Sopenharmony_ci#define QLCNIC_TYPE_NIC 1 6518c2ecf20Sopenharmony_ci#define QLCNIC_TYPE_FCOE 2 6528c2ecf20Sopenharmony_ci#define QLCNIC_TYPE_ISCSI 3 6538c2ecf20Sopenharmony_ci 6548c2ecf20Sopenharmony_ci#define QLCNIC_RCODE_DRIVER_INFO 0x20000000 6558c2ecf20Sopenharmony_ci#define QLCNIC_RCODE_DRIVER_CAN_RELOAD BIT_30 6568c2ecf20Sopenharmony_ci#define QLCNIC_RCODE_FATAL_ERROR BIT_31 6578c2ecf20Sopenharmony_ci#define QLCNIC_FWERROR_PEGNUM(code) ((code) & 0xff) 6588c2ecf20Sopenharmony_ci#define QLCNIC_FWERROR_CODE(code) ((code >> 8) & 0x1fffff) 6598c2ecf20Sopenharmony_ci#define QLCNIC_FWERROR_FAN_FAILURE 0x16 6608c2ecf20Sopenharmony_ci 6618c2ecf20Sopenharmony_ci#define FW_POLL_DELAY (1 * HZ) 6628c2ecf20Sopenharmony_ci#define FW_FAIL_THRESH 2 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_ci#define QLCNIC_RESET_TIMEOUT_SECS 10 6658c2ecf20Sopenharmony_ci#define QLCNIC_INIT_TIMEOUT_SECS 30 6668c2ecf20Sopenharmony_ci#define QLCNIC_RCVPEG_CHECK_RETRY_COUNT 2000 6678c2ecf20Sopenharmony_ci#define QLCNIC_RCVPEG_CHECK_DELAY 10 6688c2ecf20Sopenharmony_ci#define QLCNIC_CMDPEG_CHECK_RETRY_COUNT 60 6698c2ecf20Sopenharmony_ci#define QLCNIC_CMDPEG_CHECK_DELAY 500 6708c2ecf20Sopenharmony_ci#define QLCNIC_HEARTBEAT_PERIOD_MSECS 200 6718c2ecf20Sopenharmony_ci#define QLCNIC_HEARTBEAT_CHECK_RETRY_COUNT 10 6728c2ecf20Sopenharmony_ci 6738c2ecf20Sopenharmony_ci#define QLCNIC_MAX_MC_COUNT 38 6748c2ecf20Sopenharmony_ci#define QLCNIC_MAX_UC_COUNT 512 6758c2ecf20Sopenharmony_ci#define QLCNIC_WATCHDOG_TIMEOUTVALUE 5 6768c2ecf20Sopenharmony_ci 6778c2ecf20Sopenharmony_ci#define ISR_MSI_INT_TRIGGER(FUNC) (QLCNIC_PCIX_PS_REG(PCIX_MSI_F(FUNC))) 6788c2ecf20Sopenharmony_ci#define ISR_LEGACY_INT_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) 6798c2ecf20Sopenharmony_ci 6808c2ecf20Sopenharmony_ci/* 6818c2ecf20Sopenharmony_ci * PCI Interrupt Vector Values. 6828c2ecf20Sopenharmony_ci */ 6838c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F0 0x0080 6848c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F1 0x0100 6858c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F2 0x0200 6868c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F3 0x0400 6878c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F4 0x0800 6888c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F5 0x1000 6898c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F6 0x2000 6908c2ecf20Sopenharmony_ci#define PCIX_INT_VECTOR_BIT_F7 0x4000 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_cistruct qlcnic_legacy_intr_set { 6938c2ecf20Sopenharmony_ci u32 int_vec_bit; 6948c2ecf20Sopenharmony_ci u32 tgt_status_reg; 6958c2ecf20Sopenharmony_ci u32 tgt_mask_reg; 6968c2ecf20Sopenharmony_ci u32 pci_int_reg; 6978c2ecf20Sopenharmony_ci}; 6988c2ecf20Sopenharmony_ci 6998c2ecf20Sopenharmony_ci#define QLCNIC_MSIX_BASE 0x132110 7008c2ecf20Sopenharmony_ci#define QLCNIC_MAX_VLAN_FILTERS 64 7018c2ecf20Sopenharmony_ci 7028c2ecf20Sopenharmony_ci#define FLASH_ROM_WINDOW 0x42110030 7038c2ecf20Sopenharmony_ci#define FLASH_ROM_DATA 0x42150000 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci#define QLCNIC_FW_DUMP_REG1 0x00130060 7068c2ecf20Sopenharmony_ci#define QLCNIC_FW_DUMP_REG2 0x001e0000 7078c2ecf20Sopenharmony_ci#define QLCNIC_FLASH_SEM2_LK 0x0013C010 7088c2ecf20Sopenharmony_ci#define QLCNIC_FLASH_SEM2_ULK 0x0013C014 7098c2ecf20Sopenharmony_ci#define QLCNIC_FLASH_LOCK_ID 0x001B2100 7108c2ecf20Sopenharmony_ci 7118c2ecf20Sopenharmony_ci/* PCI function operational mode */ 7128c2ecf20Sopenharmony_cienum { 7138c2ecf20Sopenharmony_ci QLCNIC_MGMT_FUNC = 0, 7148c2ecf20Sopenharmony_ci QLCNIC_PRIV_FUNC = 1, 7158c2ecf20Sopenharmony_ci QLCNIC_NON_PRIV_FUNC = 2, 7168c2ecf20Sopenharmony_ci QLCNIC_SRIOV_PF_FUNC = 3, 7178c2ecf20Sopenharmony_ci QLCNIC_SRIOV_VF_FUNC = 4, 7188c2ecf20Sopenharmony_ci QLCNIC_UNKNOWN_FUNC_MODE = 5 7198c2ecf20Sopenharmony_ci}; 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_cienum { 7228c2ecf20Sopenharmony_ci QLCNIC_PORT_DEFAULTS = 0, 7238c2ecf20Sopenharmony_ci QLCNIC_ADD_VLAN = 1, 7248c2ecf20Sopenharmony_ci QLCNIC_DEL_VLAN = 2 7258c2ecf20Sopenharmony_ci}; 7268c2ecf20Sopenharmony_ci 7278c2ecf20Sopenharmony_ci#define QLC_DEV_DRV_DEFAULT 0x11111111 7288c2ecf20Sopenharmony_ci 7298c2ecf20Sopenharmony_ci#define LSB(x) ((uint8_t)(x)) 7308c2ecf20Sopenharmony_ci#define MSB(x) ((uint8_t)((uint16_t)(x) >> 8)) 7318c2ecf20Sopenharmony_ci 7328c2ecf20Sopenharmony_ci#define LSW(x) ((uint16_t)((uint32_t)(x))) 7338c2ecf20Sopenharmony_ci#define MSW(x) ((uint16_t)((uint32_t)(x) >> 16)) 7348c2ecf20Sopenharmony_ci 7358c2ecf20Sopenharmony_ci#define LSD(x) ((uint32_t)((uint64_t)(x))) 7368c2ecf20Sopenharmony_ci#define MSD(x) ((uint32_t)((((uint64_t)(x)) >> 16) >> 16)) 7378c2ecf20Sopenharmony_ci 7388c2ecf20Sopenharmony_ci#define QLCNIC_MS_CTRL 0x41000090 7398c2ecf20Sopenharmony_ci#define QLCNIC_MS_ADDR_LO 0x41000094 7408c2ecf20Sopenharmony_ci#define QLCNIC_MS_ADDR_HI 0x41000098 7418c2ecf20Sopenharmony_ci#define QLCNIC_MS_WRTDATA_LO 0x410000A0 7428c2ecf20Sopenharmony_ci#define QLCNIC_MS_WRTDATA_HI 0x410000A4 7438c2ecf20Sopenharmony_ci#define QLCNIC_MS_WRTDATA_ULO 0x410000B0 7448c2ecf20Sopenharmony_ci#define QLCNIC_MS_WRTDATA_UHI 0x410000B4 7458c2ecf20Sopenharmony_ci#define QLCNIC_MS_RDDATA_LO 0x410000A8 7468c2ecf20Sopenharmony_ci#define QLCNIC_MS_RDDATA_HI 0x410000AC 7478c2ecf20Sopenharmony_ci#define QLCNIC_MS_RDDATA_ULO 0x410000B8 7488c2ecf20Sopenharmony_ci#define QLCNIC_MS_RDDATA_UHI 0x410000BC 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci#define QLCNIC_TA_WRITE_ENABLE (TA_CTL_ENABLE | TA_CTL_WRITE) 7518c2ecf20Sopenharmony_ci#define QLCNIC_TA_WRITE_START (TA_CTL_START | TA_CTL_ENABLE | TA_CTL_WRITE) 7528c2ecf20Sopenharmony_ci#define QLCNIC_TA_START_ENABLE (TA_CTL_START | TA_CTL_ENABLE) 7538c2ecf20Sopenharmony_ci 7548c2ecf20Sopenharmony_ci#define QLCNIC_LEGACY_INTR_CONFIG \ 7558c2ecf20Sopenharmony_ci{ \ 7568c2ecf20Sopenharmony_ci { \ 7578c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F0, \ 7588c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS, \ 7598c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK, }, \ 7608c2ecf20Sopenharmony_ci \ 7618c2ecf20Sopenharmony_ci { \ 7628c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F1, \ 7638c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F1, \ 7648c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F1, }, \ 7658c2ecf20Sopenharmony_ci \ 7668c2ecf20Sopenharmony_ci { \ 7678c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F2, \ 7688c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F2, \ 7698c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F2, }, \ 7708c2ecf20Sopenharmony_ci \ 7718c2ecf20Sopenharmony_ci { \ 7728c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F3, \ 7738c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F3, \ 7748c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F3, }, \ 7758c2ecf20Sopenharmony_ci \ 7768c2ecf20Sopenharmony_ci { \ 7778c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F4, \ 7788c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F4, \ 7798c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F4, }, \ 7808c2ecf20Sopenharmony_ci \ 7818c2ecf20Sopenharmony_ci { \ 7828c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F5, \ 7838c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F5, \ 7848c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F5, }, \ 7858c2ecf20Sopenharmony_ci \ 7868c2ecf20Sopenharmony_ci { \ 7878c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F6, \ 7888c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F6, \ 7898c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F6, }, \ 7908c2ecf20Sopenharmony_ci \ 7918c2ecf20Sopenharmony_ci { \ 7928c2ecf20Sopenharmony_ci .int_vec_bit = PCIX_INT_VECTOR_BIT_F7, \ 7938c2ecf20Sopenharmony_ci .tgt_status_reg = ISR_INT_TARGET_STATUS_F7, \ 7948c2ecf20Sopenharmony_ci .tgt_mask_reg = ISR_INT_TARGET_MASK_F7, }, \ 7958c2ecf20Sopenharmony_ci} 7968c2ecf20Sopenharmony_ci 7978c2ecf20Sopenharmony_ci/* NIU REGS */ 7988c2ecf20Sopenharmony_ci 7998c2ecf20Sopenharmony_ci#define _qlcnic_crb_get_bit(var, bit) ((var >> bit) & 0x1) 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci/* 8028c2ecf20Sopenharmony_ci * NIU GB MAC Config Register 0 (applies to GB0, GB1, GB2, GB3) 8038c2ecf20Sopenharmony_ci * 8048c2ecf20Sopenharmony_ci * Bit 0 : enable_tx => 1:enable frame xmit, 0:disable 8058c2ecf20Sopenharmony_ci * Bit 1 : tx_synced => R/O: xmit enable synched to xmit stream 8068c2ecf20Sopenharmony_ci * Bit 2 : enable_rx => 1:enable frame recv, 0:disable 8078c2ecf20Sopenharmony_ci * Bit 3 : rx_synced => R/O: recv enable synched to recv stream 8088c2ecf20Sopenharmony_ci * Bit 4 : tx_flowctl => 1:enable pause frame generation, 0:disable 8098c2ecf20Sopenharmony_ci * Bit 5 : rx_flowctl => 1:act on recv'd pause frames, 0:ignore 8108c2ecf20Sopenharmony_ci * Bit 8 : loopback => 1:loop MAC xmits to MAC recvs, 0:normal 8118c2ecf20Sopenharmony_ci * Bit 16: tx_reset_pb => 1:reset frame xmit protocol blk, 0:no-op 8128c2ecf20Sopenharmony_ci * Bit 17: rx_reset_pb => 1:reset frame recv protocol blk, 0:no-op 8138c2ecf20Sopenharmony_ci * Bit 18: tx_reset_mac => 1:reset data/ctl multiplexer blk, 0:no-op 8148c2ecf20Sopenharmony_ci * Bit 19: rx_reset_mac => 1:reset ctl frames & timers blk, 0:no-op 8158c2ecf20Sopenharmony_ci * Bit 31: soft_reset => 1:reset the MAC and the SERDES, 0:no-op 8168c2ecf20Sopenharmony_ci */ 8178c2ecf20Sopenharmony_ci#define qlcnic_gb_rx_flowctl(config_word) \ 8188c2ecf20Sopenharmony_ci ((config_word) |= 1 << 5) 8198c2ecf20Sopenharmony_ci#define qlcnic_gb_get_rx_flowctl(config_word) \ 8208c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 5) 8218c2ecf20Sopenharmony_ci#define qlcnic_gb_unset_rx_flowctl(config_word) \ 8228c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 5)) 8238c2ecf20Sopenharmony_ci 8248c2ecf20Sopenharmony_ci/* 8258c2ecf20Sopenharmony_ci * NIU GB Pause Ctl Register 8268c2ecf20Sopenharmony_ci */ 8278c2ecf20Sopenharmony_ci 8288c2ecf20Sopenharmony_ci#define qlcnic_gb_set_gb0_mask(config_word) \ 8298c2ecf20Sopenharmony_ci ((config_word) |= 1 << 0) 8308c2ecf20Sopenharmony_ci#define qlcnic_gb_set_gb1_mask(config_word) \ 8318c2ecf20Sopenharmony_ci ((config_word) |= 1 << 2) 8328c2ecf20Sopenharmony_ci#define qlcnic_gb_set_gb2_mask(config_word) \ 8338c2ecf20Sopenharmony_ci ((config_word) |= 1 << 4) 8348c2ecf20Sopenharmony_ci#define qlcnic_gb_set_gb3_mask(config_word) \ 8358c2ecf20Sopenharmony_ci ((config_word) |= 1 << 6) 8368c2ecf20Sopenharmony_ci 8378c2ecf20Sopenharmony_ci#define qlcnic_gb_get_gb0_mask(config_word) \ 8388c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 0) 8398c2ecf20Sopenharmony_ci#define qlcnic_gb_get_gb1_mask(config_word) \ 8408c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 2) 8418c2ecf20Sopenharmony_ci#define qlcnic_gb_get_gb2_mask(config_word) \ 8428c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 4) 8438c2ecf20Sopenharmony_ci#define qlcnic_gb_get_gb3_mask(config_word) \ 8448c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 6) 8458c2ecf20Sopenharmony_ci 8468c2ecf20Sopenharmony_ci#define qlcnic_gb_unset_gb0_mask(config_word) \ 8478c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 0)) 8488c2ecf20Sopenharmony_ci#define qlcnic_gb_unset_gb1_mask(config_word) \ 8498c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 2)) 8508c2ecf20Sopenharmony_ci#define qlcnic_gb_unset_gb2_mask(config_word) \ 8518c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 4)) 8528c2ecf20Sopenharmony_ci#define qlcnic_gb_unset_gb3_mask(config_word) \ 8538c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 6)) 8548c2ecf20Sopenharmony_ci 8558c2ecf20Sopenharmony_ci/* 8568c2ecf20Sopenharmony_ci * NIU XG Pause Ctl Register 8578c2ecf20Sopenharmony_ci * 8588c2ecf20Sopenharmony_ci * Bit 0 : xg0_mask => 1:disable tx pause frames 8598c2ecf20Sopenharmony_ci * Bit 1 : xg0_request => 1:request single pause frame 8608c2ecf20Sopenharmony_ci * Bit 2 : xg0_on_off => 1:request is pause on, 0:off 8618c2ecf20Sopenharmony_ci * Bit 3 : xg1_mask => 1:disable tx pause frames 8628c2ecf20Sopenharmony_ci * Bit 4 : xg1_request => 1:request single pause frame 8638c2ecf20Sopenharmony_ci * Bit 5 : xg1_on_off => 1:request is pause on, 0:off 8648c2ecf20Sopenharmony_ci */ 8658c2ecf20Sopenharmony_ci 8668c2ecf20Sopenharmony_ci#define qlcnic_xg_set_xg0_mask(config_word) \ 8678c2ecf20Sopenharmony_ci ((config_word) |= 1 << 0) 8688c2ecf20Sopenharmony_ci#define qlcnic_xg_set_xg1_mask(config_word) \ 8698c2ecf20Sopenharmony_ci ((config_word) |= 1 << 3) 8708c2ecf20Sopenharmony_ci 8718c2ecf20Sopenharmony_ci#define qlcnic_xg_get_xg0_mask(config_word) \ 8728c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 0) 8738c2ecf20Sopenharmony_ci#define qlcnic_xg_get_xg1_mask(config_word) \ 8748c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit((config_word), 3) 8758c2ecf20Sopenharmony_ci 8768c2ecf20Sopenharmony_ci#define qlcnic_xg_unset_xg0_mask(config_word) \ 8778c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 0)) 8788c2ecf20Sopenharmony_ci#define qlcnic_xg_unset_xg1_mask(config_word) \ 8798c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 3)) 8808c2ecf20Sopenharmony_ci 8818c2ecf20Sopenharmony_ci/* 8828c2ecf20Sopenharmony_ci * NIU XG Pause Ctl Register 8838c2ecf20Sopenharmony_ci * 8848c2ecf20Sopenharmony_ci * Bit 0 : xg0_mask => 1:disable tx pause frames 8858c2ecf20Sopenharmony_ci * Bit 1 : xg0_request => 1:request single pause frame 8868c2ecf20Sopenharmony_ci * Bit 2 : xg0_on_off => 1:request is pause on, 0:off 8878c2ecf20Sopenharmony_ci * Bit 3 : xg1_mask => 1:disable tx pause frames 8888c2ecf20Sopenharmony_ci * Bit 4 : xg1_request => 1:request single pause frame 8898c2ecf20Sopenharmony_ci * Bit 5 : xg1_on_off => 1:request is pause on, 0:off 8908c2ecf20Sopenharmony_ci */ 8918c2ecf20Sopenharmony_ci 8928c2ecf20Sopenharmony_ci/* 8938c2ecf20Sopenharmony_ci * PHY-Specific MII control/status registers. 8948c2ecf20Sopenharmony_ci */ 8958c2ecf20Sopenharmony_ci#define QLCNIC_NIU_GB_MII_MGMT_ADDR_AUTONEG 4 8968c2ecf20Sopenharmony_ci#define QLCNIC_NIU_GB_MII_MGMT_ADDR_PHY_STATUS 17 8978c2ecf20Sopenharmony_ci 8988c2ecf20Sopenharmony_ci/* 8998c2ecf20Sopenharmony_ci * PHY-Specific Status Register (reg 17). 9008c2ecf20Sopenharmony_ci * 9018c2ecf20Sopenharmony_ci * Bit 0 : jabber => 1:jabber detected, 0:not 9028c2ecf20Sopenharmony_ci * Bit 1 : polarity => 1:polarity reversed, 0:normal 9038c2ecf20Sopenharmony_ci * Bit 2 : recvpause => 1:receive pause enabled, 0:disabled 9048c2ecf20Sopenharmony_ci * Bit 3 : xmitpause => 1:transmit pause enabled, 0:disabled 9058c2ecf20Sopenharmony_ci * Bit 4 : energydetect => 1:sleep, 0:active 9068c2ecf20Sopenharmony_ci * Bit 5 : downshift => 1:downshift, 0:no downshift 9078c2ecf20Sopenharmony_ci * Bit 6 : crossover => 1:MDIX (crossover), 0:MDI (no crossover) 9088c2ecf20Sopenharmony_ci * Bits 7-9 : cablelen => not valid in 10Mb/s mode 9098c2ecf20Sopenharmony_ci * 0:<50m, 1:50-80m, 2:80-110m, 3:110-140m, 4:>140m 9108c2ecf20Sopenharmony_ci * Bit 10 : link => 1:link up, 0:link down 9118c2ecf20Sopenharmony_ci * Bit 11 : resolved => 1:speed and duplex resolved, 0:not yet 9128c2ecf20Sopenharmony_ci * Bit 12 : pagercvd => 1:page received, 0:page not received 9138c2ecf20Sopenharmony_ci * Bit 13 : duplex => 1:full duplex, 0:half duplex 9148c2ecf20Sopenharmony_ci * Bits 14-15 : speed => 0:10Mb/s, 1:100Mb/s, 2:1000Mb/s, 3:rsvd 9158c2ecf20Sopenharmony_ci */ 9168c2ecf20Sopenharmony_ci 9178c2ecf20Sopenharmony_ci#define qlcnic_get_phy_speed(config_word) (((config_word) >> 14) & 0x03) 9188c2ecf20Sopenharmony_ci 9198c2ecf20Sopenharmony_ci#define qlcnic_set_phy_speed(config_word, val) \ 9208c2ecf20Sopenharmony_ci ((config_word) |= ((val & 0x03) << 14)) 9218c2ecf20Sopenharmony_ci#define qlcnic_set_phy_duplex(config_word) \ 9228c2ecf20Sopenharmony_ci ((config_word) |= 1 << 13) 9238c2ecf20Sopenharmony_ci#define qlcnic_clear_phy_duplex(config_word) \ 9248c2ecf20Sopenharmony_ci ((config_word) &= ~(1 << 13)) 9258c2ecf20Sopenharmony_ci 9268c2ecf20Sopenharmony_ci#define qlcnic_get_phy_link(config_word) \ 9278c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit(config_word, 10) 9288c2ecf20Sopenharmony_ci#define qlcnic_get_phy_duplex(config_word) \ 9298c2ecf20Sopenharmony_ci _qlcnic_crb_get_bit(config_word, 13) 9308c2ecf20Sopenharmony_ci 9318c2ecf20Sopenharmony_ci#define QLCNIC_NIU_NON_PROMISC_MODE 0 9328c2ecf20Sopenharmony_ci#define QLCNIC_NIU_PROMISC_MODE 1 9338c2ecf20Sopenharmony_ci#define QLCNIC_NIU_ALLMULTI_MODE 2 9348c2ecf20Sopenharmony_ci 9358c2ecf20Sopenharmony_ci#define QLCNIC_PCIE_SEM_TIMEOUT 10000 9368c2ecf20Sopenharmony_ci 9378c2ecf20Sopenharmony_cistruct crb_128M_2M_sub_block_map { 9388c2ecf20Sopenharmony_ci unsigned valid; 9398c2ecf20Sopenharmony_ci unsigned start_128M; 9408c2ecf20Sopenharmony_ci unsigned end_128M; 9418c2ecf20Sopenharmony_ci unsigned start_2M; 9428c2ecf20Sopenharmony_ci}; 9438c2ecf20Sopenharmony_ci 9448c2ecf20Sopenharmony_cistruct crb_128M_2M_block_map{ 9458c2ecf20Sopenharmony_ci struct crb_128M_2M_sub_block_map sub_block[16]; 9468c2ecf20Sopenharmony_ci}; 9478c2ecf20Sopenharmony_ci#endif /* __QLCNIC_HDR_H_ */ 948