u16 dcb_i2c_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) { u16 i2c = 0x0000; u16 dcb = dcb_table(bios, ver, hdr, cnt, len); if (dcb) { if (*ver >= 0x15) i2c = nv_ro16(bios, dcb + 2); if (*ver >= 0x30) i2c = nv_ro16(bios, dcb + 4); } if (i2c && *ver >= 0x42) { nv_warn(bios, "ccb %02x not supported\n", *ver); return 0x0000; } if (i2c && *ver >= 0x30) { *ver = nv_ro08(bios, i2c + 0); *hdr = nv_ro08(bios, i2c + 1); *cnt = nv_ro08(bios, i2c + 2); *len = nv_ro08(bios, i2c + 3); } else { *ver = *ver; /* use DCB version */ *hdr = 0; *cnt = 16; *len = 4; } return i2c; }
u16 dcb_outp(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) { u8 hdr, cnt; u16 dcb = dcb_table(bios, ver, &hdr, &cnt, len); if (dcb && idx < cnt) return dcb + hdr + (idx * *len); return 0x0000; }
u16 dcb_conntab(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) { u16 dcb = dcb_table(bios, ver, hdr, cnt, len); if (dcb && *ver >= 0x30 && *hdr >= 0x16) { u16 data = nv_ro16(bios, dcb + 0x14); if (data) { *ver = nv_ro08(bios, data + 0); *hdr = nv_ro08(bios, data + 1); *cnt = nv_ro08(bios, data + 2); *len = nv_ro08(bios, data + 3); return data; } } return 0x0000; }
u32 nvbios_connTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) { u32 dcb = dcb_table(bios, ver, hdr, cnt, len); if (dcb && *ver >= 0x30 && *hdr >= 0x16) { u32 data = nvbios_rd16(bios, dcb + 0x14); if (data) { *ver = nvbios_rd08(bios, data + 0); *hdr = nvbios_rd08(bios, data + 1); *cnt = nvbios_rd08(bios, data + 2); *len = nvbios_rd08(bios, data + 3); return data; } } return 0x00000000; }