xref: /openbmc/linux/drivers/staging/vt6655/srom.h (revision 26f64a6b)
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  * File: srom.h
165449c685SForest Bond  *
175449c685SForest Bond  * Purpose: Implement functions to access eeprom
185449c685SForest Bond  *
195449c685SForest Bond  * Author: Jerry Chen
205449c685SForest Bond  *
215449c685SForest Bond  * Date: Jan 29, 2003
225449c685SForest Bond  */
235449c685SForest Bond 
245449c685SForest Bond #ifndef __SROM_H__
255449c685SForest Bond #define __SROM_H__
265449c685SForest Bond 
27612822f5SJim Lieb /*---------------------  Export Definitions -------------------------*/
28612822f5SJim Lieb 
295449c685SForest Bond #define EEP_MAX_CONTEXT_SIZE    256
305449c685SForest Bond 
310cc5a4f9SKatie Dunne #define CB_EEPROM_READBYTE_WAIT 900     /* us */
325449c685SForest Bond 
335449c685SForest Bond #define W_MAX_I2CRETRY          0x0fff
345449c685SForest Bond 
350cc5a4f9SKatie Dunne /* Contents in the EEPROM */
360cc5a4f9SKatie Dunne #define EEP_OFS_PAR         0x00        /* physical address */
375449c685SForest Bond #define EEP_OFS_ANTENNA     0x16
385449c685SForest Bond #define EEP_OFS_RADIOCTL    0x17
390cc5a4f9SKatie Dunne #define EEP_OFS_RFTYPE      0x1B        /* for select RF */
400cc5a4f9SKatie Dunne #define EEP_OFS_MINCHANNEL  0x1C        /* Min Channel # */
410cc5a4f9SKatie Dunne #define EEP_OFS_MAXCHANNEL  0x1D        /* Max Channel # */
420cc5a4f9SKatie Dunne #define EEP_OFS_SIGNATURE   0x1E
430cc5a4f9SKatie Dunne #define EEP_OFS_ZONETYPE    0x1F
440cc5a4f9SKatie Dunne #define EEP_OFS_RFTABLE     0x20        /* RF POWER TABLE */
455449c685SForest Bond #define EEP_OFS_PWR_CCK     0x20
465449c685SForest Bond #define EEP_OFS_SETPT_CCK   0x21
475449c685SForest Bond #define EEP_OFS_PWR_OFDMG   0x23
485449c685SForest Bond #define EEP_OFS_SETPT_OFDMG 0x24
490cc5a4f9SKatie Dunne #define EEP_OFS_PWR_FORMULA_OST  0x26
505449c685SForest Bond #define EEP_OFS_MAJOR_VER 0x2E
515449c685SForest Bond #define EEP_OFS_MINOR_VER 0x2F
525449c685SForest Bond #define EEP_OFS_CCK_PWR_TBL     0x30
535449c685SForest Bond #define EEP_OFS_CCK_PWR_dBm     0x3F
545449c685SForest Bond #define EEP_OFS_OFDM_PWR_TBL    0x40
555449c685SForest Bond #define EEP_OFS_OFDM_PWR_dBm    0x4F
560cc5a4f9SKatie Dunne /*{{ RobertYu: 20041124 */
575449c685SForest Bond #define EEP_OFS_SETPT_OFDMA         0x4E
585449c685SForest Bond #define EEP_OFS_OFDMA_PWR_TBL       0x50
590cc5a4f9SKatie Dunne /*}}*/
605449c685SForest Bond #define EEP_OFS_OFDMA_PWR_dBm       0xD2
615449c685SForest Bond 
620cc5a4f9SKatie Dunne /*----------need to remove --------------------*/
630cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_LEN   0x70        /* BB Table Length */
640cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_ADR   0x71        /* BB Table Offset */
650cc5a4f9SKatie Dunne #define EEP_OFS_CHECKSUM    0xFF        /* reserved area for baseband 28h~78h */
665449c685SForest Bond 
670cc5a4f9SKatie Dunne #define EEP_I2C_DEV_ID      0x50        /* EEPROM device address on I2C bus */
685449c685SForest Bond 
690cc5a4f9SKatie Dunne /* Bits in EEP_OFS_ANTENNA */
705449c685SForest Bond #define EEP_ANTENNA_MAIN    0x01
715449c685SForest Bond #define EEP_ANTENNA_AUX     0x02
725449c685SForest Bond #define EEP_ANTINV          0x04
735449c685SForest Bond 
740cc5a4f9SKatie Dunne /* Bits in EEP_OFS_RADIOCTL */
755449c685SForest Bond #define EEP_RADIOCTL_ENABLE 0x80
765449c685SForest Bond #define EEP_RADIOCTL_INV    0x01
775449c685SForest Bond 
785449c685SForest Bond /*---------------------  Export Types  ------------------------------*/
795449c685SForest Bond 
805449c685SForest Bond /*---------------------  Export Macros ------------------------------*/
815449c685SForest Bond 
825449c685SForest Bond /*---------------------  Export Classes  ----------------------------*/
835449c685SForest Bond 
845449c685SForest Bond /*---------------------  Export Variables  --------------------------*/
855449c685SForest Bond 
865449c685SForest Bond /*---------------------  Export Functions  --------------------------*/
875449c685SForest Bond 
8826f64a6bSVarsha Rao unsigned char SROMbyReadEmbedded(void __iomem *iobase,
894d363024SKatie Dunne 				 unsigned char byContntOffset);
905449c685SForest Bond 
9126f64a6bSVarsha Rao void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);
925449c685SForest Bond 
9326f64a6bSVarsha Rao void SROMvReadEtherAddress(void __iomem *iobase,
944d363024SKatie Dunne 			   unsigned char *pbyEtherAddress);
955449c685SForest Bond 
960cc5a4f9SKatie Dunne #endif /* __EEPROM_H__*/
97