diff options
Diffstat (limited to 'drivers/video/matrox/matroxfb_misc.c')
| -rw-r--r-- | drivers/video/matrox/matroxfb_misc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c index a18dd024fc86..d9d3e9f6c08e 100644 --- a/drivers/video/matrox/matroxfb_misc.c +++ b/drivers/video/matrox/matroxfb_misc.c | |||
| @@ -68,6 +68,9 @@ | |||
| 68 | * "David C. Hansen" <haveblue@us.ibm.com> | 68 | * "David C. Hansen" <haveblue@us.ibm.com> |
| 69 | * Fixes | 69 | * Fixes |
| 70 | * | 70 | * |
| 71 | * "Ian Romanick" <idr@us.ibm.com> | ||
| 72 | * Find PInS data in BIOS on PowerPC systems. | ||
| 73 | * | ||
| 71 | * (following author is not in any relation with this code, but his code | 74 | * (following author is not in any relation with this code, but his code |
| 72 | * is included in this driver) | 75 | * is included in this driver) |
| 73 | * | 76 | * |
| @@ -496,10 +499,35 @@ static void parse_bios(unsigned char __iomem* vbios, struct matrox_bios* bd) { | |||
| 496 | get_bios_version(vbios, bd); | 499 | get_bios_version(vbios, bd); |
| 497 | get_bios_output(vbios, bd); | 500 | get_bios_output(vbios, bd); |
| 498 | get_bios_tvout(vbios, bd); | 501 | get_bios_tvout(vbios, bd); |
| 502 | #if defined(__powerpc__) | ||
| 503 | /* On PowerPC cards, the PInS offset isn't stored at the end of the | ||
| 504 | * BIOS image. Instead, you must search the entire BIOS image for | ||
| 505 | * the magic PInS signature. | ||
| 506 | * | ||
| 507 | * This actually applies to all OpenFirmware base cards. Since these | ||
| 508 | * cards could be put in a MIPS or SPARC system, should the condition | ||
| 509 | * be something different? | ||
| 510 | */ | ||
| 511 | for ( pins_offset = 0 ; pins_offset <= 0xFF80 ; pins_offset++ ) { | ||
| 512 | unsigned char header[3]; | ||
| 513 | |||
| 514 | header[0] = readb(vbios + pins_offset); | ||
| 515 | header[1] = readb(vbios + pins_offset + 1); | ||
| 516 | header[2] = readb(vbios + pins_offset + 2); | ||
| 517 | if ( (header[0] == 0x2E) && (header[1] == 0x41) | ||
| 518 | && ((header[2] == 0x40) || (header[2] == 0x80)) ) { | ||
| 519 | printk(KERN_INFO "PInS data found at offset %u\n", | ||
| 520 | pins_offset); | ||
| 521 | get_pins(vbios + pins_offset, bd); | ||
| 522 | break; | ||
| 523 | } | ||
| 524 | } | ||
| 525 | #else | ||
| 499 | pins_offset = readb(vbios + 0x7FFC) | (readb(vbios + 0x7FFD) << 8); | 526 | pins_offset = readb(vbios + 0x7FFC) | (readb(vbios + 0x7FFD) << 8); |
| 500 | if (pins_offset <= 0xFF80) { | 527 | if (pins_offset <= 0xFF80) { |
| 501 | get_pins(vbios + pins_offset, bd); | 528 | get_pins(vbios + pins_offset, bd); |
| 502 | } | 529 | } |
| 530 | #endif | ||
| 503 | } | 531 | } |
| 504 | 532 | ||
| 505 | #define get_u16(x) (le16_to_cpu(get_unaligned((__u16*)(x)))) | 533 | #define get_u16(x) (le16_to_cpu(get_unaligned((__u16*)(x)))) |
| @@ -755,6 +783,8 @@ void matroxfb_read_pins(WPMINFO2) { | |||
| 755 | } | 783 | } |
| 756 | #endif | 784 | #endif |
| 757 | matroxfb_set_limits(PMINFO &ACCESS_FBINFO(bios)); | 785 | matroxfb_set_limits(PMINFO &ACCESS_FBINFO(bios)); |
| 786 | printk(KERN_INFO "PInS memtype = %u\n", | ||
| 787 | (ACCESS_FBINFO(values).reg.opt & 0x1C00) >> 10); | ||
| 758 | } | 788 | } |
| 759 | 789 | ||
| 760 | EXPORT_SYMBOL(matroxfb_DAC_in); | 790 | EXPORT_SYMBOL(matroxfb_DAC_in); |
