Overview

General SROM Format

SROM Board Information

Magic Packet information block

5. Single function ID Block

6. Dual function ID Block

6.1 Func1_HwOptions (offset 14d)

MiscHwOptions (offset 15d)

Func0_HwOptions (offset 17d)

7. CONTROLLER INFO LEAF

7.1 Introduction

.

7.2 21041 INFO LEAF

7.2.1 21041 Info Leaf Format

7.2.2 21041 Media Block Format

7.3 21140 Info Leaf

7.3.1 21140 Info Leaf Format

7.3.2 21140 Info Block Format

7.3.2.1 21140 Compact Format

7.3.2.2 21140 Extended Format

7.3.2.2.1 21140 Extended Format – Block Type 0

7.3.2.2.2 21140 Extended Format – Block Type 1

7.3.2.2.3 21140 Extended Format – Block Type 5

7.4 21142 Info Leaf

7.4.1 21142 Info Leaf Format

7.4.2 21142 Info Block Format

7.4.2.1.1 21142 Extended Format – Block Type 2

7.4.2.1.2 21142 Extended Format – Block Type 3

7.4.2.1.3 21142 Extended Format – Block Type 5

7.5 21143 Info Leaf

7.5.1 21143 Info Leaf Format

7.5.2 21143 Info Block Format

7.5.2.1.1 21143 Extended Format – Block Type 2

7.5.2.1.2 21143 Extended Format – Block Type 3

7.5.2.1.3 21143 Extended Format – Block Type 4

7.5.2.1.4 21143 Extended Format - Block Type 5

7.5.2.1.5 21143 (Rev 4.1 and Above) Extended Format - Block Type 6

Appendix A - SROM_CRC Calculation Algorithm

unsigned short CalcSromCrc(unsigned char *SromData);

#define DATA_LEN 126 // 1024 bits SROM

struct {

unsigned char SromData[DATA_LEN];

unsigned short SromCRC;

} Srom;

main()

{

Srom.SromCRC = CalcSromCrc(&Srom.SromData);

}

unsigned short CalcSromCrc(unsigned char *SromData)

{

#define POLY 0x04C11DB6L

unsigned long crc = 0xFFFFFFFF;

unsigned long FlippedCRC = 0;

unsigned char CurrentByte;

unsigned Index;

unsigned Bit;

unsigned Msb;

int i;

for (Index = 0; Index < DATA_LEN; Index++)

{

CurrentByte = SromData[Index];

for (Bit = 0; Bit < 8; Bit++)

{

Msb = (crc >> 31) & 1;

crc <<= 1;

if (Msb ^ (CurrentByte & 1))

{

crc ^= POLY;

crc |= 0x00000001;

}

CurrentByte >>= 1;

}

}

for (i = 0; i < 32; i++)

{

FlippedCRC <<= 1;

Bit = crc & 1;

crc >>= 1;

FlippedCRC += Bit;

}

crc = FlippedCRC ^ 0xFFFFFFFF;

return (crc & 0xFFFF);

}

Appendix B - ID_BLOCK_CRC Calculation Algorithm

/*

** This program calculates the CRC which sums the Serial ROM ID Block header and the Magic

** Information Block.

** In the case of the ID Block header, this serial ROM header of 9 words is read upon reset of

** the chip. If the CRC result of these 9 words equals 0, it means the data has

** been read correctly.

** In the case of the Magic info block, this data is read by the chip upon entering

** Magic mode. If the CRC result of these 16 words is equal zero, it means the

** data has been read correctly and the chip can enter Magic mode.

**

** CRC is an 8 bit crc. Polynom is x8 + x2 + x1 + 1 .

** Note that contrary to a regular CRC, this CRC is calculated on the data stream

** from MSB 1'st to LSB. This is due to the nature of the SROM data stream

** which flows in this manner.

**

** Predefined SROM header:

**

** WORD# Meaning

** ----------- -----------

** 0 Subsystem vendor ID

** 1 Subsystem ID

** 2 CIS pointer LOW word

** 3 CIS pointer HIGH word

** 4 reserved (value = 0)

** 5 reserved (value = 0)

** 6 reserved (value = 0)

** 7 reserved (value = 0)

** 8 High byte is reserved (value = 0), Low byte = CRC

**

** Predefined Magic block:

**

** WORD# Meaning

** ----------- -----------

** 0 reserved (value = 0)

** 1 reserved (value = 0)

** 2 reserved (value = 0)

** 3 WOL IEEE addr low word

** 4 WOL IEEE addr middle word

** 5 WOL IEEE addr high word

** 6 WOL Command word

** 7 reserved (value = 0)

** 8 reserved (value = 0)

** 9 reserved (value = 0)

** 10 reserved (value = 0)

** 11 reserved (value = 0)

** 12 reserved (value = 0)

** 13 reserved (value = 0)

** 14 reserved (value = 0)

** 15 High byte is reserved (value = 0), Low byte = CRC

*/

main()

{

#define POLY 0x6

#define LEN 9 /* for ID Block */

#define LEN 16 /* for WOL block */

unsigned short DAT[LEN];

int i,Word,n;

char Bit;

unsigned char BitVal;

unsigned char crc;

n=0;

crc = -1;

for (Word=0; Word<LEN; Word++)

for (Bit=15; Bit>=0; Bit--)

{

if ((Word == (LEN-1)) && (Bit == 7))

{

/*

** Insert the correct CRC result into input data stream in place.

*/

DAT[LEN-1] = (DAT[LEN-1] & 0xff00) | (unsigned short)crc;

break;

}

n++;

BitVal = ((DAT[Word] >> Bit) & 1) ^ ((crc >> 7) & 1);

crc = crc << 1;

if (BitVal == 1)

{

crc ^= POLY;

crc |= 0x01;

}

}

Appendix C – CIS pointer setting from SROM

CIS (Card Information Structure) is used in CardBus applications to store card’s information. This information is a structure of bytes used by the system software. This specification defines two ways to store the CIS data (known as Tuples) in CardBus applications:

BOOT ROM

SROM

The CIS pointer register is defined in the PCI configuration space. It has a standard format defined in CardBus specification.

31 28
27 3
2 1 0
ROM Image
Address Space Offset
Address Space Indicator

CIS Pointer Layout (located in PCI config space)

The Address Space Indicator values can be one of two:

2 - CIS data is stored in SROM

7 - CIS data is stored in BOOT ROM

CIS data stored in SROM (Address Space Indicator = 2)

Use this option in case size of CIS data (Tuples) of a single function (Ethernet) or two functions (Ethernet and Modem) can fit in SROM.

To use this option, the SROM CIS Pointer Low bits 2:0 have to be set to 2 (010 binary). Tulpes are read in memory accesses mapped by CBMA base address register. The SROM can be of 1Kbits (128 bytes) or of 4Kbits (512 bytes). CBMA decodes the entire SROMs in memory range offsets of 200h:3FFh from CBMA value.

CardBus CIS Pointer Low & CardBus CIS Pointer High contain the values that are used to construct the CIS pointer register in each function’s configuration space. Each function get its own CIS pointer value. This means that each functions’ CIS data is accessed at different offset in the same SROM. ROM Image number is not used if CIS points to memory space and hence this field’s bits should be zeroed in the SROM.

The CIS pointer register for the Ethernet function is constructed by using the SROM CIS pointer field according to the following drawing:

31 28
27 11 10 3
2 1 0
ROM Image
Address Space Offset
Address Space Indicator
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
SROM CIS Pointer
0 1 0
Low <15:8>

CIS Pointer register (located in PCI configuration space of Ethernet function) layout - SROM application

Note: SROM CIS Pointer Low bits 7:3 are MBZ.

The CIS pointer register for the Modem function is constructed by using the SROM CIS pointer field

according to the following drawing:

31 28
27 11 10 3
2 1 0
ROM Image
Address Space Offset
Address Space Indicator
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
SROM CIS Pointer
0 1 0
High <7:0>

CIS Pointer register (located in PCI configuration space of Modem function) layout - SROM application

Note: - SROM CIS Pointer High bits 15:8 are MBZ.

- If Modem function is disabled (ModemEnable = 0), then SROM CIS Pointer High bits 7:0 are MBZ.

Calculating the value of the CIS pointer field for CIS in SROM

Assume we want to locate the Ethernet CIS block at byte address 90h in the SROM and the Modem CIS block at byte address 128h (both 90h and 128h are above the 80h size of the board info).

Ethernet CIS block Offset within the SROM = 90h

SROM Offset from CBMA = 200h

Ethernet CIS block offset from CBMA = 290h

Configuration Space CIS pointer for Ethernet CIS block:

Offset = 290h = 0000 0000 0000 0000 0000 0010 1001 0000

SROM indicator: 010

The pointer: 0000 0000 0000 0000 0000 0010 1001 0010

Bits<10:3>: 010 1001 0

Modem CIS block Offset within the SROM = 128h

SROM Offset from CBMA = 200h

Modem CIS block offset from CBMA = 328h

Configuration Space CIS pointer for Modem CIS block:

Offset = 328h = 0000 0000 0000 0000 0000 0011 0010 1000

SROM indicator: 010

The pointer: 0000 0000 0000 0000 0000 0011 0010 1010

Bits<10:3>: 011 0010 1

The SROM CIS Pointer field:

0 0 6 | 5 | 5 | 2 | 0 | 2

0000 0000 011 0010 1 010 1001 0 00000 010 = 00655202h

MBZ MBZ Modem CIS Ethernet CIS MBZ SROM

The SROM CIS field the indicates that the Ethernet CIS block is at offset 90h in the SROM and the Modem CIS block is at offset 128h in the SROM is: 00655202h.

CIS data stored in BOOT ROM (Address Space Indicator = 7)

Use this option in case size of CIS data (Tuples) of a single function (Ethernet) or two functions (Ethernet and Modem) is too big to fit in SROM.

To use this option, the SROM CIS Pointer Low bits 2:0 have to be set to 7 (111 binary).

CardBus CIS Pointer Low & CardBus CIS Pointer High contain the values that are used to construct the CIS pointer register in each function’s configuration space. Both functions get same CIS pointer value. This means that both functions’ CIS data is accessed at ‘same’ offset and ‘same’ ROM Image number (from host software point of view). Each function has half of the physical BOOT ROM size. The Ethernet function gets the first half while the Modem function gets the second half of the physical BOOT ROM. The Ethernet or the Modem’s half BOOT ROM is selected by the MSB bit of the BOOT ROM address lines according to its defined size.

The CIS pointer register for each function is constructed by using the SROM CIS pointer field according to the following drawing:

31 28
27 16 15 3
2 1 0
ROM Image
Address Space Offset
Address Space Indicator
SROM CIS Pointer
SROM CIS Pointer
1 1 1
High <15:0>
Low <15:3>

CIS Pointer register (located in PCI configuration space of each function) layout - BOOT ROM application