103f4a7b6SGanesh Biradar /* SPDX-License-Identifier: GPL-2.0+ */ 25449c685SForest Bond /* 35449c685SForest Bond * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. 45449c685SForest Bond * All rights reserved. 55449c685SForest Bond * 65449c685SForest Bond * Purpose: Implement functions to access eeprom 75449c685SForest Bond * 85449c685SForest Bond * Author: Jerry Chen 95449c685SForest Bond * 105449c685SForest Bond * Date: Jan 29, 2003 115449c685SForest Bond */ 125449c685SForest Bond 135449c685SForest Bond #ifndef __SROM_H__ 145449c685SForest Bond #define __SROM_H__ 155449c685SForest Bond 16612822f5SJim Lieb /*--------------------- Export Definitions -------------------------*/ 17612822f5SJim Lieb 185449c685SForest Bond #define EEP_MAX_CONTEXT_SIZE 256 195449c685SForest Bond 200cc5a4f9SKatie Dunne #define CB_EEPROM_READBYTE_WAIT 900 /* us */ 215449c685SForest Bond 225449c685SForest Bond #define W_MAX_I2CRETRY 0x0fff 235449c685SForest Bond 240cc5a4f9SKatie Dunne /* Contents in the EEPROM */ 250cc5a4f9SKatie Dunne #define EEP_OFS_PAR 0x00 /* physical address */ 265449c685SForest Bond #define EEP_OFS_ANTENNA 0x16 275449c685SForest Bond #define EEP_OFS_RADIOCTL 0x17 280cc5a4f9SKatie Dunne #define EEP_OFS_RFTYPE 0x1B /* for select RF */ 290cc5a4f9SKatie Dunne #define EEP_OFS_MINCHANNEL 0x1C /* Min Channel # */ 300cc5a4f9SKatie Dunne #define EEP_OFS_MAXCHANNEL 0x1D /* Max Channel # */ 310cc5a4f9SKatie Dunne #define EEP_OFS_SIGNATURE 0x1E 320cc5a4f9SKatie Dunne #define EEP_OFS_ZONETYPE 0x1F 330cc5a4f9SKatie Dunne #define EEP_OFS_RFTABLE 0x20 /* RF POWER TABLE */ 345449c685SForest Bond #define EEP_OFS_PWR_CCK 0x20 355449c685SForest Bond #define EEP_OFS_SETPT_CCK 0x21 365449c685SForest Bond #define EEP_OFS_PWR_OFDMG 0x23 375449c685SForest Bond #define EEP_OFS_SETPT_OFDMG 0x24 380cc5a4f9SKatie Dunne #define EEP_OFS_PWR_FORMULA_OST 0x26 395449c685SForest Bond #define EEP_OFS_MAJOR_VER 0x2E 405449c685SForest Bond #define EEP_OFS_MINOR_VER 0x2F 415449c685SForest Bond #define EEP_OFS_CCK_PWR_TBL 0x30 425449c685SForest Bond #define EEP_OFS_CCK_PWR_dBm 0x3F 435449c685SForest Bond #define EEP_OFS_OFDM_PWR_TBL 0x40 445449c685SForest Bond #define EEP_OFS_OFDM_PWR_dBm 0x4F 450cc5a4f9SKatie Dunne /*{{ RobertYu: 20041124 */ 465449c685SForest Bond #define EEP_OFS_SETPT_OFDMA 0x4E 475449c685SForest Bond #define EEP_OFS_OFDMA_PWR_TBL 0x50 480cc5a4f9SKatie Dunne /*}}*/ 495449c685SForest Bond #define EEP_OFS_OFDMA_PWR_dBm 0xD2 505449c685SForest Bond 510cc5a4f9SKatie Dunne /*----------need to remove --------------------*/ 520cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_LEN 0x70 /* BB Table Length */ 530cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_ADR 0x71 /* BB Table Offset */ 540cc5a4f9SKatie Dunne #define EEP_OFS_CHECKSUM 0xFF /* reserved area for baseband 28h~78h */ 555449c685SForest Bond 560cc5a4f9SKatie Dunne #define EEP_I2C_DEV_ID 0x50 /* EEPROM device address on I2C bus */ 575449c685SForest Bond 580cc5a4f9SKatie Dunne /* Bits in EEP_OFS_ANTENNA */ 595449c685SForest Bond #define EEP_ANTENNA_MAIN 0x01 605449c685SForest Bond #define EEP_ANTENNA_AUX 0x02 615449c685SForest Bond #define EEP_ANTINV 0x04 625449c685SForest Bond 630cc5a4f9SKatie Dunne /* Bits in EEP_OFS_RADIOCTL */ 645449c685SForest Bond #define EEP_RADIOCTL_ENABLE 0x80 655449c685SForest Bond #define EEP_RADIOCTL_INV 0x01 665449c685SForest Bond 675449c685SForest Bond /*--------------------- Export Types ------------------------------*/ 685449c685SForest Bond 695449c685SForest Bond /*--------------------- Export Macros ------------------------------*/ 705449c685SForest Bond 715449c685SForest Bond /*--------------------- Export Classes ----------------------------*/ 725449c685SForest Bond 735449c685SForest Bond /*--------------------- Export Variables --------------------------*/ 745449c685SForest Bond 755449c685SForest Bond /*--------------------- Export Functions --------------------------*/ 765449c685SForest Bond 7726f64a6bSVarsha Rao unsigned char SROMbyReadEmbedded(void __iomem *iobase, 784d363024SKatie Dunne unsigned char byContntOffset); 795449c685SForest Bond 8026f64a6bSVarsha Rao void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs); 815449c685SForest Bond 8226f64a6bSVarsha Rao void SROMvReadEtherAddress(void __iomem *iobase, 834d363024SKatie Dunne unsigned char *pbyEtherAddress); 845449c685SForest Bond 850cc5a4f9SKatie Dunne #endif /* __EEPROM_H__*/ 86