| 1 | 517c517
|
|---|
| 2 | <
|
|---|
| 3 | ---
|
|---|
| 4 | >
|
|---|
| 5 | 1033a1034
|
|---|
| 6 | > static int e1kRegWriteEERD (E1KSTATE* pState, uint32_t offset, uint32_t index, uint32_t value);
|
|---|
| 7 | 1084c1085
|
|---|
| 8 | < { 0x00014, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, e1kRegReadUnimplemented, e1kRegWriteUnimplemented, "EERD" , "EEPROM Read" },
|
|---|
| 9 | ---
|
|---|
| 10 | > { 0x00014, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, e1kRegReadDefault , e1kRegWriteEERD , "EERD" , "EEPROM Read" },
|
|---|
| 11 | 2113a2115,2143
|
|---|
| 12 | > * Josh Cornutt - This allows for users to read from the EEPROM
|
|---|
| 13 | > * using the EERD register instead of the 4-wire method.
|
|---|
| 14 | > *
|
|---|
| 15 | > * @param pState The device state structure.
|
|---|
| 16 | > * @param offset Register offset in memory-mapped frame.
|
|---|
| 17 | > * @param index Register index in register array.
|
|---|
| 18 | > * @param value The value to store in the EEPROM.
|
|---|
| 19 | > * @param mask Used to implement partial writes (8 and 16-bit).
|
|---|
| 20 | > * @thread EMT
|
|---|
| 21 | > */
|
|---|
| 22 | > static int e1kRegWriteEERD(E1KSTATE* pState, uint32_t offset, uint32_t index, uint32_t value)
|
|---|
| 23 | > {
|
|---|
| 24 | > // remove the "reserved" section data (and EERD.DONE), if any
|
|---|
| 25 | > value &= ~((0x07 << 5) | (0x07 << 1) | (1 << 4));
|
|---|
| 26 | > pState->auRegs[index] = value;
|
|---|
| 27 | >
|
|---|
| 28 | > // check to see if EERD.START was set
|
|---|
| 29 | > if( value & (1 << 0) )
|
|---|
| 30 | > {
|
|---|
| 31 | > uint8_t ADDR = (uint8_t)((value >> 8) & 0xFF);
|
|---|
| 32 | >
|
|---|
| 33 | > // set the EERD.DONE bit (and give the user the EEPROM data)
|
|---|
| 34 | > pState->auRegs[index] = (((uint32_t)pState->eeprom.eeprom.m_au16Data[ADDR] << 16) | (1 << 4));
|
|---|
| 35 | > }
|
|---|
| 36 | >
|
|---|
| 37 | > return VINF_SUCCESS;
|
|---|
| 38 | > }
|
|---|
| 39 | >
|
|---|
| 40 | > /**
|
|---|