/* We seem to only be interested in the last 128 bytes of the EEPROM */ #define EEPROM_SIZE 128
/* Grab EEPROM contents, needed for direct method. */ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw)
{ struct i2c_msg msg[2];
u8 *eeprom;
u8 iadd[2];
u8 addr;
u16 eepromSize; unsignedint offs; int ret; int mode16 = 0; unsigned pcnt,tcnt;
eeprom = kzalloc(EEPROM_SIZE, GFP_KERNEL); if (!eeprom) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to allocate memory required to read eeprom"); return NULL;
}
trace_eeprom("Value for eeprom addr from controller was 0x%x",
hdw->eeprom_addr);
addr = hdw->eeprom_addr; /* Seems that if the high bit is set, then the *real* eeprom addressisshiftedrightnowbitposition(noticedthisin
newer PVR USB2 hardware) */ if (addr & 0x80) addr >>= 1;
/* FX2 documentation states that a 16bit-addressed eeprom is expectediftheI2Caddressisanoddnumber(yeah,thisis
strange but it's what they do) */
mode16 = (addr & 1);
eepromSize = (mode16 ? 4096 : 256);
trace_eeprom("Examining %d byte eeprom at location 0x%x using %d bit addressing",
eepromSize, addr,
mode16 ? 16 : 8);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.