Lines Matching refs:bd
391 static void get_pins(unsigned char __iomem* pins, struct matrox_bios* bd) { in get_pins() argument
398 unsigned char* dst = bd->pins; in get_pins()
413 bd->pins_len = pins_len; in get_pins()
416 unsigned char* dst = bd->pins; in get_pins()
423 bd->pins_len = 0x40; in get_pins()
427 static void get_bios_version(unsigned char __iomem * vbios, struct matrox_bios* bd) { in get_bios_version() argument
439 bd->version.vMaj = (h >> 4) & 0xF; in get_bios_version()
440 bd->version.vMin = h & 0xF; in get_bios_version()
441 bd->version.vRev = readb(vbios + pcir_offset + 0x13); in get_bios_version()
446 bd->version.vMaj = (h >> 4) & 0xF; in get_bios_version()
447 bd->version.vMin = h & 0xF; in get_bios_version()
448 bd->version.vRev = 0; in get_bios_version()
452 static void get_bios_output(unsigned char __iomem* vbios, struct matrox_bios* bd) { in get_bios_output() argument
459 bd->output.state = b; in get_bios_output()
462 static void get_bios_tvout(unsigned char __iomem* vbios, struct matrox_bios* bd) { in get_bios_tvout() argument
466 bd->output.tvout = 0; in get_bios_tvout()
480 bd->output.tvout = 1; in get_bios_tvout()
489 static void parse_bios(unsigned char __iomem* vbios, struct matrox_bios* bd) { in parse_bios() argument
495 bd->bios_valid = 1; in parse_bios()
496 get_bios_version(vbios, bd); in parse_bios()
497 get_bios_output(vbios, bd); in parse_bios()
498 get_bios_tvout(vbios, bd); in parse_bios()
518 get_pins(vbios + pins_offset, bd); in parse_bios()
525 get_pins(vbios + pins_offset, bd); in parse_bios()
531 const struct matrox_bios *bd) in parse_pins1() argument
535 switch (bd->pins[22]) { in parse_pins1()
540 if (get_unaligned_le16(bd->pins + 24)) { in parse_pins1()
541 maxdac = get_unaligned_le16(bd->pins + 24) * 10; in parse_pins1()
544 minfo->values.pll.system = get_unaligned_le16(bd->pins + 28) ? in parse_pins1()
545 get_unaligned_le16(bd->pins + 28) * 10 : 50000; in parse_pins1()
562 const struct matrox_bios *bd) in parse_pins2() argument
565 minfo->limits.system.vcomax = (bd->pins[41] == 0xFF) ? 230000 : ((bd->pins[41] + 100) * 1000); in parse_pins2()
566 minfo->values.reg.mctlwtst = ((bd->pins[51] & 0x01) ? 0x00000001 : 0) | in parse_pins2()
567 ((bd->pins[51] & 0x02) ? 0x00000100 : 0) | in parse_pins2()
568 ((bd->pins[51] & 0x04) ? 0x00010000 : 0) | in parse_pins2()
569 ((bd->pins[51] & 0x08) ? 0x00020000 : 0); in parse_pins2()
570 minfo->values.pll.system = (bd->pins[43] == 0xFF) ? 50000 : ((bd->pins[43] + 100) * 1000); in parse_pins2()
586 const struct matrox_bios *bd) in parse_pins3() argument
589 minfo->limits.system.vcomax = (bd->pins[36] == 0xFF) ? 230000 : ((bd->pins[36] + 100) * 1000); in parse_pins3()
590 minfo->values.reg.mctlwtst = get_unaligned_le32(bd->pins + 48) == 0xFFFFFFFF ? in parse_pins3()
591 0x01250A21 : get_unaligned_le32(bd->pins + 48); in parse_pins3()
593 minfo->values.reg.memrdbk = ((bd->pins[57] << 21) & 0x1E000000) | in parse_pins3()
594 ((bd->pins[57] << 22) & 0x00C00000) | in parse_pins3()
595 ((bd->pins[56] << 1) & 0x000001E0) | in parse_pins3()
596 ( bd->pins[56] & 0x0000000F); in parse_pins3()
597 minfo->values.reg.opt = (bd->pins[54] & 7) << 10; in parse_pins3()
598 minfo->values.reg.opt2 = bd->pins[58] << 12; in parse_pins3()
599 minfo->features.pll.ref_freq = (bd->pins[52] & 0x20) ? 14318 : 27000; in parse_pins3()
616 const struct matrox_bios *bd) in parse_pins4() argument
618 minfo->limits.pixel.vcomax = (bd->pins[ 39] == 0xFF) ? 230000 : bd->pins[ 39] * 4000; in parse_pins4()
619 …minfo->limits.system.vcomax = (bd->pins[ 38] == 0xFF) ? minfo->limits.pixel.vcomax : bd->pins[ 38]… in parse_pins4()
620 minfo->values.reg.mctlwtst = get_unaligned_le32(bd->pins + 71); in parse_pins4()
621 minfo->values.reg.memrdbk = ((bd->pins[87] << 21) & 0x1E000000) | in parse_pins4()
622 ((bd->pins[87] << 22) & 0x00C00000) | in parse_pins4()
623 ((bd->pins[86] << 1) & 0x000001E0) | in parse_pins4()
624 ( bd->pins[86] & 0x0000000F); in parse_pins4()
625 minfo->values.reg.opt = ((bd->pins[53] << 15) & 0x00400000) | in parse_pins4()
626 ((bd->pins[53] << 22) & 0x10000000) | in parse_pins4()
627 ((bd->pins[53] << 7) & 0x00001C00); in parse_pins4()
628 minfo->values.reg.opt3 = get_unaligned_le32(bd->pins + 67); in parse_pins4()
629 minfo->values.pll.system = (bd->pins[ 65] == 0xFF) ? 200000 : bd->pins[ 65] * 4000; in parse_pins4()
630 minfo->features.pll.ref_freq = (bd->pins[ 92] & 0x01) ? 14318 : 27000; in parse_pins4()
648 const struct matrox_bios *bd) in parse_pins5() argument
652 mult = bd->pins[4]?8000:6000; in parse_pins5()
654 minfo->limits.pixel.vcomax = (bd->pins[ 38] == 0xFF) ? 600000 : bd->pins[ 38] * mult; in parse_pins5()
655 …minfo->limits.system.vcomax = (bd->pins[ 36] == 0xFF) ? minfo->limits.pixel.vcomax : bd->pins[ 36]… in parse_pins5()
656 …minfo->limits.video.vcomax = (bd->pins[ 37] == 0xFF) ? minfo->limits.system.vcomax : bd->pins[ 37]… in parse_pins5()
657 minfo->limits.pixel.vcomin = (bd->pins[123] == 0xFF) ? 256000 : bd->pins[123] * mult; in parse_pins5()
658 …minfo->limits.system.vcomin = (bd->pins[121] == 0xFF) ? minfo->limits.pixel.vcomin : bd->pins[121]… in parse_pins5()
659 …minfo->limits.video.vcomin = (bd->pins[122] == 0xFF) ? minfo->limits.system.vcomin : bd->pins[122]… in parse_pins5()
661 minfo->values.pll.video = (bd->pins[ 92] == 0xFF) ? 284000 : bd->pins[ 92] * 4000; in parse_pins5()
662 minfo->values.reg.opt = get_unaligned_le32(bd->pins + 48); in parse_pins5()
663 minfo->values.reg.opt2 = get_unaligned_le32(bd->pins + 52); in parse_pins5()
664 minfo->values.reg.opt3 = get_unaligned_le32(bd->pins + 94); in parse_pins5()
665 minfo->values.reg.mctlwtst = get_unaligned_le32(bd->pins + 98); in parse_pins5()
666 minfo->values.reg.memmisc = get_unaligned_le32(bd->pins + 102); in parse_pins5()
667 minfo->values.reg.memrdbk = get_unaligned_le32(bd->pins + 106); in parse_pins5()
668 minfo->features.pll.ref_freq = (bd->pins[110] & 0x01) ? 14318 : 27000; in parse_pins5()
669 minfo->values.memory.ddr = (bd->pins[114] & 0x60) == 0x20; in parse_pins5()
670 minfo->values.memory.dll = (bd->pins[115] & 0x02) != 0; in parse_pins5()
671 minfo->values.memory.emrswen = (bd->pins[115] & 0x01) != 0; in parse_pins5()
673 if (bd->pins[115] & 4) { in parse_pins5()
683 minfo->max_pixel_clock_panellink = bd->pins[47] * 4000; in parse_pins5()
713 const struct matrox_bios *bd) in matroxfb_set_limits() argument
729 if (!bd->bios_valid) { in matroxfb_set_limits()
733 if (bd->pins_len < 64) { in matroxfb_set_limits()
737 if (bd->pins[0] == 0x2E && bd->pins[1] == 0x41) { in matroxfb_set_limits()
738 pins_version = bd->pins[5]; in matroxfb_set_limits()
746 if (bd->pins_len != pinslen[pins_version - 1]) { in matroxfb_set_limits()
752 return parse_pins1(minfo, bd); in matroxfb_set_limits()
754 return parse_pins2(minfo, bd); in matroxfb_set_limits()
756 return parse_pins3(minfo, bd); in matroxfb_set_limits()
758 return parse_pins4(minfo, bd); in matroxfb_set_limits()
760 return parse_pins5(minfo, bd); in matroxfb_set_limits()