86 lines · c
1/* SPDX-License-Identifier: GPL-2.0+ */2/*3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.4 * All rights reserved.5 *6 * Purpose: Implement functions to access eeprom7 *8 * Author: Jerry Chen9 *10 * Date: Jan 29, 200311 */12 13#ifndef __SROM_H__14#define __SROM_H__15 16/*--------------------- Export Definitions -------------------------*/17 18#define EEP_MAX_CONTEXT_SIZE 25619 20#define CB_EEPROM_READBYTE_WAIT 900 /* us */21 22#define W_MAX_I2CRETRY 0x0fff23 24/* Contents in the EEPROM */25#define EEP_OFS_PAR 0x00 /* physical address */26#define EEP_OFS_ANTENNA 0x1627#define EEP_OFS_RADIOCTL 0x1728#define EEP_OFS_RFTYPE 0x1B /* for select RF */29#define EEP_OFS_MINCHANNEL 0x1C /* Min Channel # */30#define EEP_OFS_MAXCHANNEL 0x1D /* Max Channel # */31#define EEP_OFS_SIGNATURE 0x1E32#define EEP_OFS_ZONETYPE 0x1F33#define EEP_OFS_RFTABLE 0x20 /* RF POWER TABLE */34#define EEP_OFS_PWR_CCK 0x2035#define EEP_OFS_SETPT_CCK 0x2136#define EEP_OFS_PWR_OFDMG 0x2337#define EEP_OFS_SETPT_OFDMG 0x2438#define EEP_OFS_PWR_FORMULA_OST 0x2639#define EEP_OFS_MAJOR_VER 0x2E40#define EEP_OFS_MINOR_VER 0x2F41#define EEP_OFS_CCK_PWR_TBL 0x3042#define EEP_OFS_CCK_PWR_dBm 0x3F43#define EEP_OFS_OFDM_PWR_TBL 0x4044#define EEP_OFS_OFDM_PWR_dBm 0x4F45/*{{ RobertYu: 20041124 */46#define EEP_OFS_SETPT_OFDMA 0x4E47#define EEP_OFS_OFDMA_PWR_TBL 0x5048/*}}*/49#define EEP_OFS_OFDMA_PWR_dBm 0xD250 51/*----------need to remove --------------------*/52#define EEP_OFS_BBTAB_LEN 0x70 /* BB Table Length */53#define EEP_OFS_BBTAB_ADR 0x71 /* BB Table Offset */54#define EEP_OFS_CHECKSUM 0xFF /* reserved area for baseband 28h~78h */55 56#define EEP_I2C_DEV_ID 0x50 /* EEPROM device address on I2C bus */57 58/* Bits in EEP_OFS_ANTENNA */59#define EEP_ANTENNA_MAIN 0x0160#define EEP_ANTENNA_AUX 0x0261#define EEP_ANTINV 0x0462 63/* Bits in EEP_OFS_RADIOCTL */64#define EEP_RADIOCTL_ENABLE 0x8065#define EEP_RADIOCTL_INV 0x0166 67/*--------------------- Export Types ------------------------------*/68 69/*--------------------- Export Macros ------------------------------*/70 71/*--------------------- Export Classes ----------------------------*/72 73/*--------------------- Export Variables --------------------------*/74 75/*--------------------- Export Functions --------------------------*/76 77unsigned char SROMbyReadEmbedded(void __iomem *iobase,78 unsigned char byContntOffset);79 80void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);81 82void SROMvReadEtherAddress(void __iomem *iobase,83 unsigned char *pbyEtherAddress);84 85#endif /* __EEPROM_H__*/86