xref: /openbmc/linux/drivers/staging/vt6655/srom.h (revision 03f4a7b6)
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  * File: srom.h
75449c685SForest Bond  *
85449c685SForest Bond  * Purpose: Implement functions to access eeprom
95449c685SForest Bond  *
105449c685SForest Bond  * Author: Jerry Chen
115449c685SForest Bond  *
125449c685SForest Bond  * Date: Jan 29, 2003
135449c685SForest Bond  */
145449c685SForest Bond 
155449c685SForest Bond #ifndef __SROM_H__
165449c685SForest Bond #define __SROM_H__
175449c685SForest Bond 
18612822f5SJim Lieb /*---------------------  Export Definitions -------------------------*/
19612822f5SJim Lieb 
205449c685SForest Bond #define EEP_MAX_CONTEXT_SIZE    256
215449c685SForest Bond 
220cc5a4f9SKatie Dunne #define CB_EEPROM_READBYTE_WAIT 900     /* us */
235449c685SForest Bond 
245449c685SForest Bond #define W_MAX_I2CRETRY          0x0fff
255449c685SForest Bond 
260cc5a4f9SKatie Dunne /* Contents in the EEPROM */
270cc5a4f9SKatie Dunne #define EEP_OFS_PAR         0x00        /* physical address */
285449c685SForest Bond #define EEP_OFS_ANTENNA     0x16
295449c685SForest Bond #define EEP_OFS_RADIOCTL    0x17
300cc5a4f9SKatie Dunne #define EEP_OFS_RFTYPE      0x1B        /* for select RF */
310cc5a4f9SKatie Dunne #define EEP_OFS_MINCHANNEL  0x1C        /* Min Channel # */
320cc5a4f9SKatie Dunne #define EEP_OFS_MAXCHANNEL  0x1D        /* Max Channel # */
330cc5a4f9SKatie Dunne #define EEP_OFS_SIGNATURE   0x1E
340cc5a4f9SKatie Dunne #define EEP_OFS_ZONETYPE    0x1F
350cc5a4f9SKatie Dunne #define EEP_OFS_RFTABLE     0x20        /* RF POWER TABLE */
365449c685SForest Bond #define EEP_OFS_PWR_CCK     0x20
375449c685SForest Bond #define EEP_OFS_SETPT_CCK   0x21
385449c685SForest Bond #define EEP_OFS_PWR_OFDMG   0x23
395449c685SForest Bond #define EEP_OFS_SETPT_OFDMG 0x24
400cc5a4f9SKatie Dunne #define EEP_OFS_PWR_FORMULA_OST  0x26
415449c685SForest Bond #define EEP_OFS_MAJOR_VER 0x2E
425449c685SForest Bond #define EEP_OFS_MINOR_VER 0x2F
435449c685SForest Bond #define EEP_OFS_CCK_PWR_TBL     0x30
445449c685SForest Bond #define EEP_OFS_CCK_PWR_dBm     0x3F
455449c685SForest Bond #define EEP_OFS_OFDM_PWR_TBL    0x40
465449c685SForest Bond #define EEP_OFS_OFDM_PWR_dBm    0x4F
470cc5a4f9SKatie Dunne /*{{ RobertYu: 20041124 */
485449c685SForest Bond #define EEP_OFS_SETPT_OFDMA         0x4E
495449c685SForest Bond #define EEP_OFS_OFDMA_PWR_TBL       0x50
500cc5a4f9SKatie Dunne /*}}*/
515449c685SForest Bond #define EEP_OFS_OFDMA_PWR_dBm       0xD2
525449c685SForest Bond 
530cc5a4f9SKatie Dunne /*----------need to remove --------------------*/
540cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_LEN   0x70        /* BB Table Length */
550cc5a4f9SKatie Dunne #define EEP_OFS_BBTAB_ADR   0x71        /* BB Table Offset */
560cc5a4f9SKatie Dunne #define EEP_OFS_CHECKSUM    0xFF        /* reserved area for baseband 28h~78h */
575449c685SForest Bond 
580cc5a4f9SKatie Dunne #define EEP_I2C_DEV_ID      0x50        /* EEPROM device address on I2C bus */
595449c685SForest Bond 
600cc5a4f9SKatie Dunne /* Bits in EEP_OFS_ANTENNA */
615449c685SForest Bond #define EEP_ANTENNA_MAIN    0x01
625449c685SForest Bond #define EEP_ANTENNA_AUX     0x02
635449c685SForest Bond #define EEP_ANTINV          0x04
645449c685SForest Bond 
650cc5a4f9SKatie Dunne /* Bits in EEP_OFS_RADIOCTL */
665449c685SForest Bond #define EEP_RADIOCTL_ENABLE 0x80
675449c685SForest Bond #define EEP_RADIOCTL_INV    0x01
685449c685SForest Bond 
695449c685SForest Bond /*---------------------  Export Types  ------------------------------*/
705449c685SForest Bond 
715449c685SForest Bond /*---------------------  Export Macros ------------------------------*/
725449c685SForest Bond 
735449c685SForest Bond /*---------------------  Export Classes  ----------------------------*/
745449c685SForest Bond 
755449c685SForest Bond /*---------------------  Export Variables  --------------------------*/
765449c685SForest Bond 
775449c685SForest Bond /*---------------------  Export Functions  --------------------------*/
785449c685SForest Bond 
7926f64a6bSVarsha Rao unsigned char SROMbyReadEmbedded(void __iomem *iobase,
804d363024SKatie Dunne 				 unsigned char byContntOffset);
815449c685SForest Bond 
8226f64a6bSVarsha Rao void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);
835449c685SForest Bond 
8426f64a6bSVarsha Rao void SROMvReadEtherAddress(void __iomem *iobase,
854d363024SKatie Dunne 			   unsigned char *pbyEtherAddress);
865449c685SForest Bond 
870cc5a4f9SKatie Dunne #endif /* __EEPROM_H__*/
88