15449c685SForest Bond /* 25449c685SForest Bond * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. 35449c685SForest Bond * All rights reserved. 45449c685SForest Bond * 55449c685SForest Bond * This program is free software; you can redistribute it and/or modify 65449c685SForest Bond * it under the terms of the GNU General Public License as published by 75449c685SForest Bond * the Free Software Foundation; either version 2 of the License, or 85449c685SForest Bond * (at your option) any later version. 95449c685SForest Bond * 105449c685SForest Bond * This program is distributed in the hope that it will be useful, 115449c685SForest Bond * but WITHOUT ANY WARRANTY; without even the implied warranty of 125449c685SForest Bond * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 135449c685SForest Bond * GNU General Public License for more details. 145449c685SForest Bond * 155449c685SForest Bond * You should have received a copy of the GNU General Public License along 165449c685SForest Bond * with this program; if not, write to the Free Software Foundation, Inc., 175449c685SForest Bond * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 185449c685SForest Bond * 195449c685SForest Bond * 205449c685SForest Bond * File: srom.h 215449c685SForest Bond * 225449c685SForest Bond * Purpose: Implement functions to access eeprom 235449c685SForest Bond * 245449c685SForest Bond * Author: Jerry Chen 255449c685SForest Bond * 265449c685SForest Bond * Date: Jan 29, 2003 275449c685SForest Bond */ 285449c685SForest Bond 295449c685SForest Bond #ifndef __SROM_H__ 305449c685SForest Bond #define __SROM_H__ 315449c685SForest Bond 32612822f5SJim Lieb /*--------------------- Export Definitions -------------------------*/ 33612822f5SJim Lieb 345449c685SForest Bond #define EEP_MAX_CONTEXT_SIZE 256 355449c685SForest Bond 360cc5a4f9SKatie Dunne #define CB_EEPROM_READBYTE_WAIT 900 /* us */ 375449c685SForest Bond 385449c685SForest Bond #define W_MAX_I2CRETRY 0x0fff 395449c685SForest Bond 400cc5a4f9SKatie Dunne /* Contents in the EEPROM */ 410cc5a4f9SKatie Dunne #define EEP_OFS_PAR 0x00 /* physical address */ 425449c685SForest Bond #define EEP_OFS_ANTENNA 0x16 435449c685SForest Bond #define EEP_OFS_RADIOCTL 0x17 440cc5a4f9SKatie Dunne #define EEP_OFS_RFTYPE 0x1B /* for select RF */ 450cc5a4f9SKatie Dunne #define EEP_OFS_MINCHANNEL 0x1C /* Min Channel # */ 460cc5a4f9SKatie Dunne #define EEP_OFS_MAXCHANNEL 0x1D /* Max Channel # */ 470cc5a4f9SKatie Dunne #define EEP_OFS_SIGNATURE 0x1E 480cc5a4f9SKatie Dunne #define EEP_OFS_ZONETYPE 0x1F 490cc5a4f9SKatie Dunne #define EEP_OFS_RFTABLE 0x20 /* RF POWER TABLE */ 505449c685SForest Bond #define EEP_OFS_PWR_CCK 0x20 515449c685SForest Bond #define EEP_OFS_SETPT_CCK 0x21 525449c685SForest Bond #define EEP_OFS_PWR_OFDMG 0x23 535449c685SForest Bond #define EEP_OFS_SETPT_OFDMG 0x24 540cc5a4f9SKatie Dunne #define EEP_OFS_PWR_FORMULA_OST 0x26 555449c685SForest Bond #define EEP_OFS_MAJOR_VER 0x2E 565449c685SForest Bond #define EEP_OFS_MINOR_VER 0x2F 575449c685SForest Bond #define EEP_OFS_CCK_PWR_TBL 0x30 585449c685SForest Bond #define EEP_OFS_CCK_PWR_dBm 0x3F 595449c685SForest Bond #define EEP_OFS_OFDM_PWR_TBL 0x40 605449c685SForest Bond #define EEP_OFS_OFDM_PWR_dBm 0x4F 610cc5a4f9SKatie Dunne /*{{ RobertYu: 20041124 */ 625449c685SForest Bond #define EEP_OFS_SETPT_OFDMA 0x4E 635449c685SForest Bond #define EEP_OFS_OFDMA_PWR_TBL 0x50 640cc5a4f9SKatie Dunne /*}}*/ 655449c685SForest Bond #define EEP_OFS_OFDMA_PWR_dBm 0xD2 665449c685SForest Bond 670cc5a4f9SKatie Dunne /*----------need to remove --------------------*/ 680cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_LEN 0x70 /* BB Table Length */ 690cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_ADR 0x71 /* BB Table Offset */ 700cc5a4f9SKatie Dunne #define EEP_OFS_CHECKSUM 0xFF /* reserved area for baseband 28h~78h */ 715449c685SForest Bond 720cc5a4f9SKatie Dunne #define EEP_I2C_DEV_ID 0x50 /* EEPROM device address on I2C bus */ 735449c685SForest Bond 740cc5a4f9SKatie Dunne /* Bits in EEP_OFS_ANTENNA */ 755449c685SForest Bond #define EEP_ANTENNA_MAIN 0x01 765449c685SForest Bond #define EEP_ANTENNA_AUX 0x02 775449c685SForest Bond #define EEP_ANTINV 0x04 785449c685SForest Bond 790cc5a4f9SKatie Dunne /* Bits in EEP_OFS_RADIOCTL */ 805449c685SForest Bond #define EEP_RADIOCTL_ENABLE 0x80 815449c685SForest Bond #define EEP_RADIOCTL_INV 0x01 825449c685SForest Bond 835449c685SForest Bond /*--------------------- Export Types ------------------------------*/ 845449c685SForest Bond 855449c685SForest Bond /*--------------------- Export Macros ------------------------------*/ 865449c685SForest Bond 875449c685SForest Bond /*--------------------- Export Classes ----------------------------*/ 885449c685SForest Bond 895449c685SForest Bond /*--------------------- Export Variables --------------------------*/ 905449c685SForest Bond 915449c685SForest Bond /*--------------------- Export Functions --------------------------*/ 925449c685SForest Bond 934d363024SKatie Dunne unsigned char SROMbyReadEmbedded(void __iomem *dwIoBase, 944d363024SKatie Dunne unsigned char byContntOffset); 955449c685SForest Bond 9616834405SGuillaume Clement void SROMvReadAllContents(void __iomem *dwIoBase, unsigned char *pbyEepromRegs); 975449c685SForest Bond 984d363024SKatie Dunne void SROMvReadEtherAddress(void __iomem *dwIoBase, 994d363024SKatie Dunne unsigned char *pbyEtherAddress); 1005449c685SForest Bond 1010cc5a4f9SKatie Dunne #endif /* __EEPROM_H__*/ 102