/* Read Vital Product Data (VPD) from the Serial EPROM attached to the Intel bridge.  */
int i2155x_read_vpd(int offset, int size, unsigned char *data)
/* Read Vital Product Data (VPD) from the Serial EPROM attached to the Intel bridge.  */
int i2155x_read_vpd(int offset, int size, unsigned char *data)
{
    int i, n;
    u16 val16;
    for (i = 0; i < size; i++) {
	pci_write_config_word(i2155x.devno, I2155X_VPD_ADDR,
			      offset + i - I2155X_VPD_START);
	for (n = 10000; n > 0; n--) {
	    pci_read_config_word(i2155x.devno, I2155X_VPD_ADDR, &val16);
	    if ((val16 & 0x8000) != 0)
		break;
	    udelay(100);
	}
	if (n == 0) {
	    printf("i2155x_read_vpd: TIMEOUT\n");
	    return -1;
	}
	pci_read_config_byte(i2155x.devno, I2155X_VPD_DATA, &data[i]);
    }
    return i;
}