📄 skgehw.h
字号:
/****************************************************************************** * * Name: skgehw.h * Project: Gigabit Ethernet Adapters, Common Modules * Version: $Revision: 1.56 $ * Date: $Date: 2003/09/23 09:01:00 $ * Purpose: Defines and Macros for the Gigabit Ethernet Adapter Product Family * ******************************************************************************//****************************************************************************** * * (C)Copyright 1998-2002 SysKonnect. * (C)Copyright 2002-2003 Marvell. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The information in this file is provided "AS IS" without warranty. * ******************************************************************************/#ifndef __INC_SKGEHW_H#define __INC_SKGEHW_H#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//* defines ********************************************************************/#define BIT_31 (1UL << 31)#define BIT_30 (1L << 30)#define BIT_29 (1L << 29)#define BIT_28 (1L << 28)#define BIT_27 (1L << 27)#define BIT_26 (1L << 26)#define BIT_25 (1L << 25)#define BIT_24 (1L << 24)#define BIT_23 (1L << 23)#define BIT_22 (1L << 22)#define BIT_21 (1L << 21)#define BIT_20 (1L << 20)#define BIT_19 (1L << 19)#define BIT_18 (1L << 18)#define BIT_17 (1L << 17)#define BIT_16 (1L << 16)#define BIT_15 (1L << 15)#define BIT_14 (1L << 14)#define BIT_13 (1L << 13)#define BIT_12 (1L << 12)#define BIT_11 (1L << 11)#define BIT_10 (1L << 10)#define BIT_9 (1L << 9)#define BIT_8 (1L << 8)#define BIT_7 (1L << 7)#define BIT_6 (1L << 6)#define BIT_5 (1L << 5)#define BIT_4 (1L << 4)#define BIT_3 (1L << 3)#define BIT_2 (1L << 2)#define BIT_1 (1L << 1)#define BIT_0 1L#define BIT_15S (1U << 15)#define BIT_14S (1 << 14)#define BIT_13S (1 << 13)#define BIT_12S (1 << 12)#define BIT_11S (1 << 11)#define BIT_10S (1 << 10)#define BIT_9S (1 << 9)#define BIT_8S (1 << 8)#define BIT_7S (1 << 7)#define BIT_6S (1 << 6)#define BIT_5S (1 << 5)#define BIT_4S (1 << 4)#define BIT_3S (1 << 3)#define BIT_2S (1 << 2)#define BIT_1S (1 << 1)#define BIT_0S 1#define SHIFT31(x) ((x) << 31)#define SHIFT30(x) ((x) << 30)#define SHIFT29(x) ((x) << 29)#define SHIFT28(x) ((x) << 28)#define SHIFT27(x) ((x) << 27)#define SHIFT26(x) ((x) << 26)#define SHIFT25(x) ((x) << 25)#define SHIFT24(x) ((x) << 24)#define SHIFT23(x) ((x) << 23)#define SHIFT22(x) ((x) << 22)#define SHIFT21(x) ((x) << 21)#define SHIFT20(x) ((x) << 20)#define SHIFT19(x) ((x) << 19)#define SHIFT18(x) ((x) << 18)#define SHIFT17(x) ((x) << 17)#define SHIFT16(x) ((x) << 16)#define SHIFT15(x) ((x) << 15)#define SHIFT14(x) ((x) << 14)#define SHIFT13(x) ((x) << 13)#define SHIFT12(x) ((x) << 12)#define SHIFT11(x) ((x) << 11)#define SHIFT10(x) ((x) << 10)#define SHIFT9(x) ((x) << 9)#define SHIFT8(x) ((x) << 8)#define SHIFT7(x) ((x) << 7)#define SHIFT6(x) ((x) << 6)#define SHIFT5(x) ((x) << 5)#define SHIFT4(x) ((x) << 4)#define SHIFT3(x) ((x) << 3)#define SHIFT2(x) ((x) << 2)#define SHIFT1(x) ((x) << 1)#define SHIFT0(x) ((x) << 0)/* * Configuration Space header * Since this module is used for different OS', those may be * duplicate on some of them (e.g. Linux). But to keep the * common source, we have to live with this... */#define PCI_VENDOR_ID 0x00 /* 16 bit Vendor ID */#define PCI_DEVICE_ID 0x02 /* 16 bit Device ID */#define PCI_COMMAND 0x04 /* 16 bit Command */#define PCI_STATUS 0x06 /* 16 bit Status */#define PCI_REV_ID 0x08 /* 8 bit Revision ID */#define PCI_CLASS_CODE 0x09 /* 24 bit Class Code */#define PCI_CACHE_LSZ 0x0c /* 8 bit Cache Line Size */#define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */#define PCI_HEADER_T 0x0e /* 8 bit Header Type */#define PCI_BIST 0x0f /* 8 bit Built-in selftest */#define PCI_BASE_1ST 0x10 /* 32 bit 1st Base address */#define PCI_BASE_2ND 0x14 /* 32 bit 2nd Base address */ /* Byte 0x18..0x2b: reserved */#define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */#define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */#define PCI_BASE_ROM 0x30 /* 32 bit Expansion ROM Base Address */#define PCI_CAP_PTR 0x34 /* 8 bit Capabilities Ptr */ /* Byte 0x35..0x3b: reserved */#define PCI_IRQ_LINE 0x3c /* 8 bit Interrupt Line */#define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */#define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */#define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */ /* Device Dependent Region */#define PCI_OUR_REG_1 0x40 /* 32 bit Our Register 1 */#define PCI_OUR_REG_2 0x44 /* 32 bit Our Register 2 */ /* Power Management Region */#define PCI_PM_CAP_ID 0x48 /* 8 bit Power Management Cap. ID */#define PCI_PM_NITEM 0x49 /* 8 bit Next Item Ptr */#define PCI_PM_CAP_REG 0x4a /* 16 bit Power Management Capabilities */#define PCI_PM_CTL_STS 0x4c /* 16 bit Power Manag. Control/Status */ /* Byte 0x4e: reserved */#define PCI_PM_DAT_REG 0x4f /* 8 bit Power Manag. Data Register */ /* VPD Region */#define PCI_VPD_CAP_ID 0x50 /* 8 bit VPD Cap. ID */#define PCI_VPD_NITEM 0x51 /* 8 bit Next Item Ptr */#define PCI_VPD_ADR_REG 0x52 /* 16 bit VPD Address Register */#define PCI_VPD_DAT_REG 0x54 /* 32 bit VPD Data Register */ /* Byte 0x58..0x59: reserved */#define PCI_SER_LD_CTRL 0x5a /* 16 bit SEEPROM Loader Ctrl (YUKON only) */ /* Byte 0x5c..0xff: reserved *//* * I2C Address (PCI Config) * * Note: The temperature and voltage sensors are relocated on a different * I2C bus. */#define I2C_ADDR_VPD 0xa0 /* I2C address for the VPD EEPROM *//* * Define Bits and Values of the registers *//* PCI_COMMAND 16 bit Command */ /* Bit 15..11: reserved */#define PCI_INT_DIS BIT_10S /* Interrupt INTx# disable (PCI 2.3) */#define PCI_FBTEN BIT_9S /* Fast Back-To-Back enable */#define PCI_SERREN BIT_8S /* SERR enable */#define PCI_ADSTEP BIT_7S /* Address Stepping */#define PCI_PERREN BIT_6S /* Parity Report Response enable */#define PCI_VGA_SNOOP BIT_5S /* VGA palette snoop */#define PCI_MWIEN BIT_4S /* Memory write an inv cycl ena */#define PCI_SCYCEN BIT_3S /* Special Cycle enable */#define PCI_BMEN BIT_2S /* Bus Master enable */#define PCI_MEMEN BIT_1S /* Memory Space Access enable */#define PCI_IOEN BIT_0S /* I/O Space Access enable */#define PCI_COMMAND_VAL (PCI_FBTEN | PCI_SERREN | PCI_PERREN | PCI_MWIEN |\ PCI_BMEN | PCI_MEMEN | PCI_IOEN)/* PCI_STATUS 16 bit Status */#define PCI_PERR BIT_15S /* Parity Error */#define PCI_SERR BIT_14S /* Signaled SERR */#define PCI_RMABORT BIT_13S /* Received Master Abort */#define PCI_RTABORT BIT_12S /* Received Target Abort */ /* Bit 11: reserved */#define PCI_DEVSEL (3<<9) /* Bit 10.. 9: DEVSEL Timing */#define PCI_DEV_FAST (0<<9) /* fast */#define PCI_DEV_MEDIUM (1<<9) /* medium */#define PCI_DEV_SLOW (2<<9) /* slow */#define PCI_DATAPERR BIT_8S /* DATA Parity error detected */#define PCI_FB2BCAP BIT_7S /* Fast Back-to-Back Capability */#define PCI_UDF BIT_6S /* User Defined Features */#define PCI_66MHZCAP BIT_5S /* 66 MHz PCI bus clock capable */#define PCI_NEWCAP BIT_4S /* New cap. list implemented */#define PCI_INT_STAT BIT_3S /* Interrupt INTx# Status (PCI 2.3) */ /* Bit 2.. 0: reserved */#define PCI_ERRBITS (PCI_PERR | PCI_SERR | PCI_RMABORT | PCI_RTABORT |\ PCI_DATAPERR)/* PCI_CLASS_CODE 24 bit Class Code *//* Byte 2: Base Class (02) *//* Byte 1: SubClass (00) *//* Byte 0: Programming Interface (00) *//* PCI_CACHE_LSZ 8 bit Cache Line Size *//* Possible values: 0,2,4,8,16,32,64,128 *//* PCI_HEADER_T 8 bit Header Type */#define PCI_HD_MF_DEV BIT_7S /* 0= single, 1= multi-func dev */#define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal *//* PCI_BIST 8 bit Built-in selftest *//* Built-in Self test not supported (optional) *//* PCI_BASE_1ST 32 bit 1st Base address */#define PCI_MEMSIZE 0x4000L /* use 16 kB Memory Base */#define PCI_MEMBASE_MSK 0xffffc000L /* Bit 31..14: Memory Base Address */#define PCI_MEMSIZE_MSK 0x00003ff0L /* Bit 13.. 4: Memory Size Req. */#define PCI_PREFEN BIT_3 /* Prefetchable */#define PCI_MEM_TYP (3L<<2) /* Bit 2.. 1: Memory Type */#define PCI_MEM32BIT (0L<<1) /* Base addr anywhere in 32 Bit range */#define PCI_MEM1M (1L<<1) /* Base addr below 1 MegaByte */#define PCI_MEM64BIT (2L<<1) /* Base addr anywhere in 64 Bit range */#define PCI_MEMSPACE BIT_0 /* Memory Space Indicator *//* PCI_BASE_2ND 32 bit 2nd Base address */#define PCI_IOBASE 0xffffff00L /* Bit 31.. 8: I/O Base address */#define PCI_IOSIZE 0x000000fcL /* Bit 7.. 2: I/O Size Requirements */ /* Bit 1: reserved */#define PCI_IOSPACE BIT_0 /* I/O Space Indicator *//* PCI_BASE_ROM 32 bit Expansion ROM Base Address */#define PCI_ROMBASE_MSK 0xfffe0000L /* Bit 31..17: ROM Base address */#define PCI_ROMBASE_SIZ (0x1cL<<14) /* Bit 16..14: Treat as Base or Size */#define PCI_ROMSIZE (0x38L<<11) /* Bit 13..11: ROM Size Requirements */ /* Bit 10.. 1: reserved */#define PCI_ROMEN BIT_0 /* Address Decode enable *//* Device Dependent Region *//* PCI_OUR_REG_1 32 bit Our Register 1 */ /* Bit 31..29: reserved */#define PCI_PHY_COMA BIT_28 /* Set PHY to Coma Mode (YUKON only) */#define PCI_TEST_CAL BIT_27 /* Test PCI buffer calib. (YUKON only) */#define PCI_EN_CAL BIT_26 /* Enable PCI buffer calib. (YUKON only) */#define PCI_VIO BIT_25 /* PCI I/O Voltage, 0 = 3.3V, 1 = 5V */#define PCI_DIS_BOOT BIT_24 /* Disable BOOT via ROM */#define PCI_EN_IO BIT_23 /* Mapping to I/O space */#define PCI_EN_FPROM BIT_22 /* Enable FLASH mapping to memory */ /* 1 = Map Flash to memory */ /* 0 = Disable addr. dec */#define PCI_PAGESIZE (3L<<20) /* Bit 21..20: FLASH Page Size */#define PCI_PAGE_16 (0L<<20) /* 16 k pages */#define PCI_PAGE_32K (1L<<20) /* 32 k pages */#define PCI_PAGE_64K (2L<<20) /* 64 k pages */#define PCI_PAGE_128K (3L<<20) /* 128 k pages */ /* Bit 19: reserved */#define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */#define PCI_NOTAR BIT_15 /* No turnaround cycle */#define PCI_FORCE_BE BIT_14 /* Assert all BEs on MR */#define PCI_DIS_MRL BIT_13 /* Disable Mem Read Line */#define PCI_DIS_MRM BIT_12 /* Disable Mem Read Multiple */#define PCI_DIS_MWI BIT_11 /* Disable Mem Write & Invalidate */#define PCI_DISC_CLS BIT_10 /* Disc: cacheLsz bound */#define PCI_BURST_DIS BIT_9 /* Burst Disable */#define PCI_DIS_PCI_CLK BIT_8 /* Disable PCI clock driving */#define PCI_SKEW_DAS (0xfL<<4) /* Bit 7.. 4: Skew Ctrl, DAS Ext */#define PCI_SKEW_BASE 0xfL /* Bit 3.. 0: Skew Ctrl, Base *//* PCI_OUR_REG_2 32 bit Our Register 2 */#define PCI_VPD_WR_THR (0xffL<<24) /* Bit 31..24: VPD Write Threshold */#define PCI_DEV_SEL (0x7fL<<17) /* Bit 23..17: EEPROM Device Select */#define PCI_VPD_ROM_SZ (7L<<14) /* Bit 16..14: VPD ROM Size */ /* Bit 13..12: reserved */#define PCI_PATCH_DIR (0xfL<<8) /* Bit 11.. 8: Ext Patches dir 3..0 */#define PCI_PATCH_DIR_3 BIT_11#define PCI_PATCH_DIR_2 BIT_10#define PCI_PATCH_DIR_1 BIT_9#define PCI_PATCH_DIR_0 BIT_8#define PCI_EXT_PATCHS (0xfL<<4) /* Bit 7.. 4: Extended Patches 3..0 */#define PCI_EXT_PATCH_3 BIT_7#define PCI_EXT_PATCH_2 BIT_6#define PCI_EXT_PATCH_1 BIT_5#define PCI_EXT_PATCH_0 BIT_4#define PCI_EN_DUMMY_RD BIT_3 /* Enable Dummy Read */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -