1 /******************************************************************************
5 / Description: ATI Radeon Graphics Chip interface.
7 / Copyright 2001, Carlos Hasan
9 *******************************************************************************/
19 static const char * const C_RADEON_REGISTER_AREA_NAME
= "RadeonRegisters";
20 static const char * const C_RADEON_MEMORY_AREA_NAME
= "RadeonMemory";
21 static const char * const C_RADEON_ROM_AREA_NAME
= "RadeonROM";
24 CRadeonRect::CRadeonRect()
32 CRadeonRect::CRadeonRect(int left
, int top
, int right
, int bottom
)
40 int CRadeonRect::Left() const
45 int CRadeonRect::Top() const
50 int CRadeonRect::Right() const
55 int CRadeonRect::Bottom() const
60 int CRadeonRect::Width() const
62 return fRight
- fLeft
+ 1;
65 int CRadeonRect::Height() const
67 return fBottom
- fTop
+ 1;
70 void CRadeonRect::SetLeft(int value
)
75 void CRadeonRect::SetTop(int value
)
80 void CRadeonRect::SetRight(int value
)
85 void CRadeonRect::SetBottom(int value
)
90 void CRadeonRect::SetTo(int left
, int top
, int right
, int bottom
)
98 void CRadeonRect::MoveTo(int left
, int top
)
100 fRight
+= left
- fLeft
;
101 fBottom
+= top
- fTop
;
102 fLeft
+= left
- fLeft
;
106 void CRadeonRect::ResizeTo(int width
, int height
)
108 fRight
= fLeft
+ width
- 1;
109 fBottom
= fTop
+ height
- 1;
114 CRadeon::CRadeon( const char *dev_name
)
126 PRINT(("CRadeon::CRadeon()\n"));
128 if ((fHandle
= open(dev_name
, O_RDWR
| O_CLOEXEC
)) < 0) {
129 PRINT(("CRadeon::CRadeon() - Can't open kernel driver\n"));
133 radeon_get_private_data gpd
;
135 if (GetDeviceInformation(gpd
) < B_OK
) {
136 PRINT(("CRadeon::CRadeon() - Can't get device information\n"));
141 "Radeon virtual card", gpd
.virtual_card_area
,
142 &fVirtualCardArea
, (void **)&fVirtualCard
);
144 "Radeon shared info", gpd
.shared_info_area
,
145 &fSharedInfoArea
, (void **)&fSharedInfo
);
147 if( fSharedInfo
!= NULL
) {
149 "Radeon regs", fSharedInfo
->regs_area
,
150 &fRegisterArea
, (void **)&fRegister
);
152 "Radeon ROM", fSharedInfo
->ROM_area
,
153 &fROMArea
, (void **)&fROM
);
156 if (fVirtualCard
== NULL
|| fSharedInfo
== NULL
||
157 fROM
== NULL
|| fRegister
== NULL
)
159 PRINT(("CRadeon::CRadeon() - Can't map memory apertures\n"));
163 PRINT(("CRadeon::CRadeon() - ATI Radeon found\n"));
168 PRINT(("CRadeon::~CRadeon()\n"));
170 if( fVirtualCard
!= NULL
)
171 delete_area( fVirtualCardArea
);
173 if( fSharedInfo
!= NULL
)
174 delete_area( fSharedInfoArea
);
176 if (fRegister
!= NULL
)
177 delete_area( fRegisterArea
);
180 delete_area( fROMArea
);
186 status_t
CRadeon::InitCheck() const
190 fRegister
!= NULL
&& fROM
!= NULL
&&
191 fVirtualCard
!= NULL
&& fSharedInfo
!= NULL
) ? B_OK
: B_ERROR
;
194 uint32
CRadeon::VirtualMemoryBase() const
196 return fSharedInfo
->memory
[mt_local
].virtual_addr_start
;
199 int CRadeon::Register(radeon_register index
) const
201 return fRegister
[index
>> 2];
204 void CRadeon::SetRegister(radeon_register index
, int value
)
206 fRegister
[index
>> 2] = value
;
209 int CRadeon::Register(radeon_register index
, int mask
) const
211 return fRegister
[index
>> 2] & mask
;
214 void CRadeon::SetRegister(radeon_register index
, int mask
, int value
)
217 if ((value
& ~mask
) != 0)
218 PRINT(("CRadeon::SetRegister(0x%04x, 0x%08x, 0x%08x)\n", index
, mask
, value
));
221 fRegister
[index
>> 2] = (fRegister
[index
>> 2] & ~mask
) | (value
& mask
);
224 int CRadeon::VIPRegister(int device
, int address
)
229 vr
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
231 vr
.address
= address
;
234 res
= ioctl( fHandle
, RADEON_VIPREAD
, &vr
, sizeof( vr
));
242 void CRadeon::SetVIPRegister(int device
, int address
, int value
)
246 vw
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
248 vw
.address
= address
;
252 ioctl( fHandle
, RADEON_VIPWRITE
, &vw
, sizeof( vw
));
256 int CRadeon::VIPReadFifo(int device
, uint32 address
, uint32 count
, uint8
*buffer
)
258 radeon_vip_fifo_read vr
;
261 vr
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
263 vr
.address
= address
;
268 res
= ioctl( fHandle
, RADEON_VIPFIFOREAD
, &vr
, sizeof( vr
));
276 int CRadeon::VIPWriteFifo(int device
, uint32 address
, uint32 count
, uint8
*buffer
)
278 radeon_vip_fifo_write vw
;
281 vw
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
283 vw
.address
= address
;
288 res
= ioctl( fHandle
, RADEON_VIPFIFOWRITE
, &vw
, sizeof( vw
));
297 int CRadeon::FindVIPDevice( uint32 device_id
)
299 radeon_find_vip_device fvd
;
302 fvd
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
303 fvd
.device_id
= device_id
;
305 res
= ioctl( fHandle
, RADEON_FINDVIPDEVICE
, &fvd
, sizeof( fvd
));
313 shared_info
* CRadeon::GetSharedInfo()
318 void CRadeon::GetPLLParameters(int & refFreq
, int & refDiv
, int & minFreq
, int & maxFreq
, int & xclock
)
320 refFreq
= fSharedInfo
->pll
.ref_freq
;
321 refDiv
= fSharedInfo
->pll
.ref_div
;
322 minFreq
= fSharedInfo
->pll
.min_pll_freq
;
323 maxFreq
= fSharedInfo
->pll
.max_pll_freq
;
324 xclock
= fSharedInfo
->pll
.xclk
;
327 void CRadeon::GetMMParameters(radeon_video_tuner
& tuner
,
328 radeon_video_decoder
& video
,
329 radeon_video_clock
& clock
,
335 unsigned char * fMMTable
= NULL
;
337 PRINT(("CRadeon::GetMMParameters()\n"));
339 if (fSharedInfo
->is_atombios
) {
340 uint16 hdr
= fROM
[0x48] + (fROM
[0x49] << 8);
341 uint16 PCIR
= hdr
+ fROM
[hdr
] + (fROM
[hdr
+ 1] << 8);
342 uint16 hdr2
= fROM
[PCIR
- 4] + (fROM
[PCIR
- 3] << 8);
343 uint16 hmMedia
= fROM
[hdr2
+ 8] + (fROM
[hdr2
+ 9] << 8);
344 if(fROM
[hmMedia
] == 0x14
345 && fROM
[hmMedia
+ 1] == 0x00
346 && fROM
[hmMedia
+ 2] == 0x01
347 && fROM
[hmMedia
+ 3] == 0x01
348 && fROM
[hmMedia
+ 4] == '$'
349 && fROM
[hmMedia
+ 5] == 'M'
350 && fROM
[hmMedia
+ 6] == 'M'
351 && fROM
[hmMedia
+ 7] == 'T') {
352 fMMTable
= &fROM
[hmMedia
+ 8];
353 PRINT(("ATOMBIOS MM Table Signiture found\n"));
355 PRINT(("ATOMBIOS MM Table Not Found\n"));
359 unsigned char *fVideoBIOS
= fROM
+ fROM
[0x48] + (fROM
[0x49] << 8);
360 fMMTable
= fROM
+ fVideoBIOS
[0x38] + (fVideoBIOS
[0x39] << 8) - 2;
362 if (fMMTable
[0] != 0x0c)
364 PRINT(("MM_TABLE invalid size\n"));
369 PRINT(("MM Table Found (non ATOM) \n"));
370 PRINT(("Revision %02x\n", fMMTable
[0]));
371 PRINT(("Size %02x\n", fMMTable
[2]));
378 PRINT(( "MM_TABLE:\n"));
379 const char* names
[] = {
385 "Vid Decoder %02x\n",
386 "..Host config %02x\n",
397 PRINT((names
[i
], fMMTable
[i
]));
401 switch (fMMTable
[0] & 0x1f) {
403 tuner
= C_RADEON_NO_TUNER
;
404 PRINT(("CRadeon::GetMMParameters() No Tuner\n"));
407 tuner
= C_RADEON_FI1236_MK1_NTSC
;
410 tuner
= C_RADEON_FI1236_MK2_NTSC_JAPAN
;
413 tuner
= C_RADEON_FI1216_MK2_PAL_BG
;
416 tuner
= C_RADEON_FI1246_MK2_PAL_I
;
419 tuner
= C_RADEON_FI1216_MF_MK2_PAL_BG_SECAM_L
;
422 tuner
= C_RADEON_FI1236_MK2_NTSC
;
425 tuner
= C_RADEON_FI1256_MK2_SECAM_DK
;
428 tuner
= C_RADEON_FI1236_MK2_NTSC
;
431 tuner
= C_RADEON_FI1216_MK2_PAL_BG
;
434 tuner
= C_RADEON_FI1246_MK2_PAL_I
;
437 tuner
= C_RADEON_FI1216_MK2_PAL_BG_SECAM_L
;
440 tuner
= C_RADEON_FI1236_MK2_NTSC
;
443 tuner
= C_RADEON_TEMIC_FN5AL_PAL_IBGDK_SECAM_DK
;
446 tuner
= C_RADEON_NO_TUNER
;
447 PRINT(("CRadeon::GetMMParameters() No Tuner\n"));
451 switch (fMMTable
[5] & 0x0f) {
453 video
= C_RADEON_NO_VIDEO
;
454 PRINT(("CRadeon::GetMMParameters() No Video\n"));
457 video
= C_RADEON_BT819
;
460 video
= C_RADEON_BT829
;
463 video
= C_RADEON_BT829A
;
466 video
= C_RADEON_SA7111
;
469 video
= C_RADEON_SA7112
;
472 video
= C_RADEON_RAGE_THEATER
;
473 PRINT(("CRadeon::GetMMParameters() Rage Theater\n"));
476 video
= C_RADEON_NO_VIDEO
;
477 PRINT(("CRadeon::GetMMParameters() No Video\n"));
481 switch (fMMTable
[5] & 0xf0) {
486 clock
= C_RADEON_NO_VIDEO_CLOCK
;
487 PRINT(("CRadeon::GetMMParameters() Video No Clock\n"));
490 clock
= C_RADEON_VIDEO_CLOCK_28_63636_MHZ
;
493 clock
= C_RADEON_VIDEO_CLOCK_29_49892_MHZ
;
496 clock
= C_RADEON_VIDEO_CLOCK_27_00000_MHZ
;
499 clock
= C_RADEON_VIDEO_CLOCK_14_31818_MHZ
;
502 clock
= C_RADEON_NO_VIDEO_CLOCK
;
503 PRINT(("CRadeon::GetMMParameters() Video No Clock\n"));
507 for (int port
= 0; port
< 5; port
++) {
508 switch (fMMTable
[7 + port
] & 0x03) {
511 PRINT(("CRadeon::GetMMParameters() Invalid Port\n"));
515 PRINT(("CRadeon::GetMMParameters() Tuner Port\n"));
519 // Front/Rear Composite Input
520 PRINT(("CRadeon::GetMMParameters() Composite Port\n"));
521 compositePort
= (fMMTable
[7 + port
] & 0x04 ? 2 : 1);
524 // Front/Rear SVideo Input
525 PRINT(("CRadeon::GetMMParameters() SVideo Port\n"));
526 svideoPort
= (fMMTable
[7 + port
] & 0x04 ? 6 : 5);
532 status_t
CRadeon::AllocateGraphicsMemory(
533 memory_type_e memory_type
, int32 size
,
534 int32
*offset
, int32
*handle
)
539 am
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
541 am
.memory_type
= mt_local
;
544 res
= ioctl( fHandle
, RADEON_ALLOC_MEM
, &am
);
554 void CRadeon::FreeGraphicsMemory(
555 memory_type_e memory_type
, int32 handle
)
559 fm
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
560 fm
.memory_type
= memory_type
;
564 ioctl( fHandle
, RADEON_FREE_MEM
, &fm
);
567 status_t
CRadeon::DMACopy(
568 uint32 src
, void *target
, size_t size
, bool lock_mem
, bool contiguous
)
572 dc
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
576 dc
.lock_mem
= lock_mem
;
577 dc
.contiguous
= contiguous
;
579 return ioctl( fHandle
, RADEON_DMACOPY
, &dc
);
582 status_t
CRadeon::GetDeviceInformation(radeon_get_private_data
& info
)
584 info
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
586 return ioctl( fHandle
, RADEON_GET_PRIVATE_DATA
, &info
, sizeof( info
));
589 status_t
CRadeon::CloneArea(const char * name
, area_id src_area
,
590 area_id
*cloned_area
, void ** map
)
592 int res
= clone_area( name
, map
, B_ANY_ADDRESS
,
593 B_READ_AREA
| B_WRITE_AREA
, src_area
);
603 status_t
CRadeon::WaitInterrupt(int * mask
, int * sequence
, bigtime_t
* time
, bigtime_t timeout
)
605 radeon_wait_for_cap_irq wvc
;
608 wvc
.magic
= RADEON_PRIVATE_DATA_MAGIC
;
609 wvc
.timeout
= timeout
;
611 status
= ioctl( fHandle
, RADEON_WAIT_FOR_CAP_IRQ
, &wvc
);
613 if( status
== B_OK
) {
614 *mask
= wvc
.int_status
;
615 *sequence
= wvc
.counter
;
616 *time
= wvc
.timestamp
;
623 void CRadeon::PrintToStream()
626 if (ROM(0) == 0x55 && ROM(1) == 0xAA) {
627 for (int offset
= 0; offset
< 128 - 9; offset
++) {
628 if (ROM(offset
+ 0) == '7' &&
629 ROM(offset
+ 1) == '6' &&
630 ROM(offset
+ 2) == '1' &&
631 ROM(offset
+ 3) == '2' &&
632 ROM(offset
+ 4) == '9' &&
633 ROM(offset
+ 5) == '5' &&
634 ROM(offset
+ 6) == '5' &&
635 ROM(offset
+ 7) == '2' &&
636 ROM(offset
+ 8) == '0')
642 unsigned char *fVideoBIOS
= fROM
+ fROM
[0x48] + (fROM
[0x49] << 8);
645 "----------------------------------------------------------------------\n"
646 "ATI RADEON VIDEO BIOS\n"
648 "BIOS Revision: %03d.%03d.%03d%03d.%s\n"
649 "PCI Bus/Device/Function Code: 0x%04x\n"
650 "BIOS Runtime Segment Address: 0x%04x\n"
651 "I/O Base Address: 0x%04x\n"
652 "Subsystem Vendor ID: 0x%04x\n"
653 "Subsystem ID: 0x%04x\n"
654 "Post Vendor ID: 0x%04x\n"
657 // OEM Revision (ID1.ID2.REVISION.CONFIG_FILE)
658 fVideoBIOS
[2], fVideoBIOS
[3],
659 fVideoBIOS
[4], fVideoBIOS
[5],
660 fROM
+ fVideoBIOS
[0x10] + (fVideoBIOS
[0x11] << 8),
662 // PCI bus, device, function code
663 fVideoBIOS
[0x16] + (fVideoBIOS
[0x17] << 8),
666 fVideoBIOS
[0x18] + (fVideoBIOS
[0x19] << 8),
669 fVideoBIOS
[0x1a] + (fVideoBIOS
[0x1b] << 8),
671 // Subsystem Vendor ID, Subsystem ID, Post Vendor ID
672 fVideoBIOS
[0x1c] + (fVideoBIOS
[0x1d] << 8),
673 fVideoBIOS
[0x1e] + (fVideoBIOS
[0x1f] << 8),
674 fVideoBIOS
[0x20] + (fVideoBIOS
[0x21] << 8)
679 unsigned char *fPLL
= fROM
+ fVideoBIOS
[0x30] + (fVideoBIOS
[0x31] << 8);
682 "----------------------------------------------------------------------\n"
683 "ATI RADEON PLL INFORMATION TABLE\n"
685 "External Clock: %g MHz\n"
686 "Reference Frequency: %g MHz\n"
687 "Reference Divisor: %d\n"
688 "Min PLL Frequency: %g MHz\n"
689 "Max PLL Frequency: %g MHz\n"
691 (fPLL
[0x08] + (fPLL
[0x09] << 8)) / 1000.0,
692 (fPLL
[0x0e] + (fPLL
[0x0f] << 8)) / 100.0,
693 fPLL
[0x10] + (fPLL
[0x11] << 8),
694 (fPLL
[0x12] + (fPLL
[0x13] << 8) + (fPLL
[0x14] << 16) + (fPLL
[0x15] << 24)) / 1000.0,
695 (fPLL
[0x12] + (fPLL
[0x16] << 8) + (fPLL
[0x17] << 16) + (fPLL
[0x18] << 24)) / 1000.0));
699 unsigned char * fTVTable
= fROM
+ fVideoBIOS
[0x32] + (fVideoBIOS
[0x33] << 8);
702 "----------------------------------------------------------------------\n"
703 "ATI RADEON TV INFORMATION TABLE\n"
705 "Table Signature: %c%c%c\n"
706 "Table Version: %d\n"
707 "Table Size: %d bytes\n"
709 "TVOut Support: %s\n"
710 "BIOS built-in TV standard: %s\n"
711 "TVOut information: %s, %s MHz\n"
713 "Run time supported TV standard:%s%s%s%s%s%s\n"
714 "Initialization time supported TV standard:%s%s%s%s%s%s\n"
717 // Table signature, version and size
718 fTVTable
[0x00],fTVTable
[0x01], fTVTable
[0x02],
720 fTVTable
[0x04] + ((int) fTVTable
[0x05] << 8),
723 fTVTable
[0x06] == 'N' ? "TVOut chip not found" : "TVOut chip on board",
725 // BIOS built-in initialization TV standard
726 (fTVTable
[0x07] & 0x0f) == 0x01 ? "NTSC" :
727 (fTVTable
[0x07] & 0x0f) == 0x02 ? "PAL" :
728 (fTVTable
[0x07] & 0x0f) == 0x03 ? "PAL-M" :
729 (fTVTable
[0x07] & 0x0f) == 0x04 ? "PAL-60" :
730 (fTVTable
[0x07] & 0x0f) == 0x05 ? "NTSC-J" :
731 (fTVTable
[0x07] & 0x0f) == 0x06 ? "SCART-PAL" : "Reserved",
733 // TV Out information
734 (fTVTable
[0x09] & 0x03) == 0x00 ? "Invalid" :
735 (fTVTable
[0x09] & 0x03) == 0x01 ? "TV off, CRT on" :
736 (fTVTable
[0x09] & 0x03) == 0x02 ? "TV on, CRT off" : "TV on, CRT on",
738 (fTVTable
[0x09] & 0x0c) == 0x00 ? "29.498928713" :
739 (fTVTable
[0x09] & 0x0c) == 0x04 ? "28.63636" :
740 (fTVTable
[0x09] & 0x0c) == 0x08 ? "14.31818" : "27.0",
742 // Runtime supported TV standard
743 (fTVTable
[0x0a] & 0x01) != 0 ? " NTSC" : "",
744 (fTVTable
[0x0a] & 0x02) != 0 ? " PAL" : "",
745 (fTVTable
[0x0a] & 0x04) != 0 ? " PAL-M" : "",
746 (fTVTable
[0x0a] & 0x08) != 0 ? " PAL-60" : "",
747 (fTVTable
[0x0a] & 0x10) != 0 ? " NTSC-J" : "",
748 (fTVTable
[0x0a] & 0x20) != 0 ? " SCART-PAL" : "",
750 // Initialization time supported TV standard
751 (fTVTable
[0x0b] & 0x01) != 0 ? " NTSC" : "",
752 (fTVTable
[0x0b] & 0x02) != 0 ? " PAL" : "",
753 (fTVTable
[0x0b] & 0x04) != 0 ? " PAL-M" : "",
754 (fTVTable
[0x0b] & 0x08) != 0 ? " PAL-60" : "",
755 (fTVTable
[0x0b] & 0x10) != 0 ? " NTSC-J" : "",
756 (fTVTable
[0x0b] & 0x20) != 0 ? " SCART-PAL" : ""
759 // Hardware Configuration Table
760 unsigned char * fHWTable
= fROM
+ fVideoBIOS
[0x36] + (fVideoBIOS
[0x37] << 8);
763 "----------------------------------------------------------------------\n"
764 "ATI RADEON HARDWARE CONFIGURATION TABLE\n"
766 "Table Signature: %c%c%c%c\n"
767 "Table Revision: %d\n"
771 "TVOut Support: %s\n"
772 "Video Out Crystal: %s\n"
773 "ImpactTV Data Port: %s\n"
775 "Video Port Capability:\n"
776 " AMC/DVS0 Video Port: %s\n"
777 " Zoom Video Port: %s\n"
778 " AMC/DVS1 Video Port: %s\n"
779 " VIP 16-bit Video Port: %s\n"
781 "Host Port Configuration: %s\n"
784 // Table Signature, Revision, Size
785 fHWTable
[0x00], fHWTable
[0x01], fHWTable
[0x02], fHWTable
[0x03],
786 fHWTable
[0x04], fHWTable
[0x05],
789 (fHWTable
[0x06] & 0x0f) == 0x00 ? "Normal GP I/O (data=GP_IO2, clock=GP_IO1)" :
790 (fHWTable
[0x06] & 0x0f) == 0x01 ? "ImpacTV GP I/O" :
791 (fHWTable
[0x06] & 0x0f) == 0x02 ? "Dedicated I2C Pin" :
792 (fHWTable
[0x06] & 0x0f) == 0x03 ? "GP I/O (data=GP_IO12, clock=GP_IO13)" :
793 (fHWTable
[0x06] & 0x0f) == 0x04 ? "GP I/O (data=GPIO12, clock=GPIO10)" :
794 (fHWTable
[0x06] & 0x0f) == 0x05 ? "RAGE THEATER I2C Master" :
795 (fHWTable
[0x06] & 0x0f) == 0x06 ? "Rage128 MPP2 Pin" :
796 (fHWTable
[0x06] & 0x0f) == 0x0f ? "No I2C Configuration" : "Reserved",
799 (fHWTable
[0x07] & 0x0f) == 0x00 ? "No TVOut supported" :
800 (fHWTable
[0x07] & 0x0f) == 0x01 ? "ImpactTV1 supported" :
801 (fHWTable
[0x07] & 0x0f) == 0x02 ? "ImpactTV2 supported" :
802 (fHWTable
[0x07] & 0x0f) == 0x03 ? "Improved ImpactTV2 supported" :
803 (fHWTable
[0x07] & 0x0f) == 0x04 ? "RAGE THEATER supported" : "Reserved",
806 (fHWTable
[0x07] & 0x70) == 0x00 ? "TVOut not installed" :
807 (fHWTable
[0x07] & 0x70) == 0x10 ? "28.63636 MHz" :
808 (fHWTable
[0x07] & 0x70) == 0x20 ? "29.49892713 MHz" :
809 (fHWTable
[0x07] & 0x70) == 0x30 ? "27.0 MHz" :
810 (fHWTable
[0x07] & 0x70) == 0x40 ? "14.31818 MHz" : "Reserved",
812 // ImpactTV data port
813 (fHWTable
[0x07] & 0x80) == 0x00 ? "MPP1" : "MPP2",
815 // Video Port Capability
816 (fHWTable
[0x08] & 0x01) == 0x00 ? "Not Supported" : "Supported",
817 (fHWTable
[0x08] & 0x02) == 0x00 ? "Not Supported" : "Supported",
818 (fHWTable
[0x08] & 0x04) == 0x00 ? "Not Supported" : "Supported",
819 (fHWTable
[0x08] & 0x08) == 0x00 ? "Not Supported" : "Supported",
821 // Host Port Configuration
822 (fHWTable
[0x09] & 0x0f) == 0x00 ? "No Host Port" :
823 (fHWTable
[0x09] & 0x0f) == 0x01 ? "MPP Host Port" :
824 (fHWTable
[0x09] & 0x0f) == 0x02 ? "2 bit VIP Host Port" :
825 (fHWTable
[0x09] & 0x0f) == 0x03 ? "4 bit VIP Host Port" :
826 (fHWTable
[0x09] & 0x0f) == 0x04 ? "8 bit VIP Host Port" : "Reserved"
830 unsigned char * fMMTable
= fROM
+ fVideoBIOS
[0x38] + (fVideoBIOS
[0x39] << 8);
833 "----------------------------------------------------------------------\n"
834 "ATI RADEON MULTIMEDIA TABLE\n"
836 "Table Revision: %d\n"
837 "Table Size: %d bytes\n"
841 "Tuner Voltage Regulator: %s\n"
844 "FM Audio Decoder: %s\n"
845 "Audio Scrambling: %s\n"
847 "Product Type: %s, Revision %d\n"
850 "I2S Input Configuration: %s\n"
851 "I2S Output Configuration: %s\n"
852 "I2S Audio Chip: %s\n"
853 "S/PDIF Output Configuration: %s\n"
855 "Video Decoder: %s\n"
856 "Video Standard/Crystal: %s\n"
857 "Video Decoder Host Config: %s\n"
858 "Hardware Teletext: %s\n"
861 " 0: %s, %s (ID %d)\n"
862 " 1: %s, %s (ID %d)\n"
863 " 2: %s, %s (ID %d)\n"
864 " 3: %s, %s (ID %d)\n"
865 " 4: %s, %s (ID %d)\n"
869 fMMTable
[-2], fMMTable
[-1],
872 (fMMTable
[0] & 0x1f) == 0x00 ? "No Tuner" :
873 (fMMTable
[0] & 0x1f) == 0x01 ? "Philips FI1236 MK1 NTSC M/N North America" :
874 (fMMTable
[0] & 0x1f) == 0x02 ? "Philips FI1236 MK2 NTSC M/N Japan" :
876 (fMMTable
[0] & 0x1f) == 0x03 ? "Philips FI1216 MK2 PAL B/G" :
877 (fMMTable
[0] & 0x1f) == 0x04 ? "Philips FI1246 MK2 PAL I" :
878 (fMMTable
[0] & 0x1f) == 0x05 ? "Philips FI1216 MF MK2 PAL B/G, SECAM L/L'" :
879 (fMMTable
[0] & 0x1f) == 0x06 ? "Philips FI1236 MK2 NTSC M/N North America" :
880 (fMMTable
[0] & 0x1f) == 0x07 ? "Philips FI1256 MK2 SECAM D/K" :
881 (fMMTable
[0] & 0x1f) == 0x08 ? "Philips FM1236 MK2 NTSC M/N North America" :
883 (fMMTable
[0] & 0x1f) == 0x09 ? "Philips FI1216 MK2 PAL B/G - External Tuner POD" :
884 (fMMTable
[0] & 0x1f) == 0x0a ? "Philips FI1246 MK2 PAL I - External Tuner POD" :
885 (fMMTable
[0] & 0x1f) == 0x0b ? "Philips FI1216 MF MK2 PAL B/G, SECAM L/L' - External Tuner POD" :
886 (fMMTable
[0] & 0x1f) == 0x0c ? "Philips FI1236 MK2 NTSC M/N North America - External Tuner POD" :
888 (fMMTable
[0] & 0x1f) == 0x0d ? "Temic FN5AL RF3X7595 PAL I/B/G/DK & SECAM DK" :
889 (fMMTable
[0] & 0x1f) == 0x10 ? "Alps TSBH5 NTSC M/N North America" :
890 (fMMTable
[0] & 0x1f) == 0x11 ? "Alps TSC?? NTSC M/N North America" :
891 (fMMTable
[0] & 0x1f) == 0x12 ? "Alps TSCH5 NTSC M/N North America" :
893 (fMMTable
[0] & 0x1f) == 0x1f ? "Unknown Tuner Type" : "Reserved",
895 /* Video Input for Tuner */
896 (fMMTable
[0] & 0xe0) == 0x00 ? "Video Input 0" :
897 (fMMTable
[0] & 0xe0) == 0x20 ? "Video Input 1" :
898 (fMMTable
[0] & 0xe0) == 0x40 ? "Video Input 2" :
899 (fMMTable
[0] & 0xe0) == 0x60 ? "Video Input 3" :
900 (fMMTable
[0] & 0xe0) == 0x80 ? "Video Input 4" : "Reserved",
903 (fMMTable
[3] & 0x03) == 0x00 ? "No Tuner Power down feature" :
904 (fMMTable
[3] & 0x03) == 0x01 ? "Tuner Power down feature" : "Reserved",
906 /* Audio Chip Type */
907 (fMMTable
[1] & 0x0f) == 0x00 ? "Philips TEA5582 NTSC Stereo, no dbx, no volume" :
908 (fMMTable
[1] & 0x0f) == 0x01 ? "Mono with audio mux" :
909 (fMMTable
[1] & 0x0f) == 0x02 ? "Philips TDA9850 NTSC N.A. Stereo, dbx, mux, no volume" :
910 (fMMTable
[1] & 0x0f) == 0x03 ? "Sony CXA2020S Japan NTSC Stereo, mux, no volume" :
911 (fMMTable
[1] & 0x0f) == 0x04 ? "ITT MSP3410D Europe Stereo, volume, internal mux" :
912 (fMMTable
[1] & 0x0f) == 0x05 ? "Crystal CS4236B" :
913 (fMMTable
[1] & 0x0f) == 0x06 ? "Philips TDA9851 NTSC Stereo, volume, no dbx, no mux" :
914 (fMMTable
[1] & 0x0f) == 0x07 ? "ITT MSP3415 (Europe)" :
915 (fMMTable
[1] & 0x0f) == 0x08 ? "ITT MSP3430 (N.A.)" :
916 (fMMTable
[1] & 0x0f) == 0x0f ? "No Audio Chip Installed" : "Reserved",
918 /* FM Audio Decoder */
919 (fMMTable
[3] & 0x30) == 0x00 ? "No FM Audio Decoder" :
920 (fMMTable
[3] & 0x30) == 0x10 ? "FM Audio Decoder (Rohm BA1332F)" : "Reserved",
922 /* Audio Scrambling */
923 (fMMTable
[3] & 0x80) == 0x00 ? "Not Supported" : "Supported",
926 (fMMTable
[1] & 0x10) == 0x00 ? "OEM Product" : "ATI Product",
929 (fMMTable
[1] & 0xe0) >> 5,
932 (fMMTable
[1] & 0x10) == 0x00 ? "<OEM ID>" :
934 fMMTable
[2] == 0x00 ? "ATI Prototype Board" :
935 fMMTable
[2] == 0x01 ? "ATI All in Wonder" :
936 fMMTable
[2] == 0x02 ? "ATI All in Wonder Pro, no MPEG/DVD decoder" :
937 fMMTable
[2] == 0x03 ? "ATI All in Wonder Pro, CD11 or similar MPEG/DVD decoder on MPP" :
938 fMMTable
[2] == 0x04 ? "ATI All in Wonder Plus" :
939 fMMTable
[2] == 0x05 ? "ATI Kitchener Board" :
940 fMMTable
[2] == 0x06 ? "ATI Toronto Board (analog audio)" :
941 fMMTable
[2] == 0x07 ? "ATI TV-Wonder" :
942 fMMTable
[2] == 0x08 ? "ATI Victoria Board (Rage XL plus RAGE THEATER)" : "Reserved"
945 /* I2S Input/Output Configuration */
946 (fMMTable
[4] & 0x01) == 0x00 ? "Not Supported" : "Supported",
947 (fMMTable
[4] & 0x02) == 0x00 ? "Not Supported" : "Supported",
950 (fMMTable
[4] & 0x1c) == 0x00 ? "TDA1309_32Strap" :
951 (fMMTable
[4] & 0x1c) == 0x04 ? "TDA1309_64Strap" :
952 (fMMTable
[4] & 0x1c) == 0x08 ? "ITT MSP3430" :
953 (fMMTable
[4] & 0x1c) == 0x0c ? "ITT MSP3415" : "Reserved",
955 /* S/PDIF Output Config */
956 (fMMTable
[4] & 0x20) == 0x00 ? "Not Supported" : "Supported",
958 /* Video Decoder Type */
959 (fMMTable
[5] & 0x0f) == 0x00 ? "No Video Decoder" :
960 (fMMTable
[5] & 0x0f) == 0x01 ? "Bt819" :
961 (fMMTable
[5] & 0x0f) == 0x02 ? "Bt829" :
962 (fMMTable
[5] & 0x0f) == 0x03 ? "Bt829A" :
963 (fMMTable
[5] & 0x0f) == 0x04 ? "Philips SA7111" :
964 (fMMTable
[5] & 0x0f) == 0x05 ? "Philips SA7112 or SA7112A" :
965 (fMMTable
[5] & 0x0f) == 0x06 ? "RAGE THEATER" : "Reserved",
967 /* Video-In Standard/Crystal */
968 (fMMTable
[5] & 0xf0) == 0x00 ? "NTSC and PAL Crystals installed" :
969 (fMMTable
[5] & 0xf0) == 0x10 ? "NTSC Crystal only" :
970 (fMMTable
[5] & 0xf0) == 0x20 ? "PAL Crystal only" :
971 (fMMTable
[5] & 0xf0) == 0x30 ? "NTSC, PAL, SECAM Ssingle crystal for Bt829 and Bt879" :
972 (fMMTable
[5] & 0xf0) == 0x40 ? "28.63636 MHz Crystal" :
973 (fMMTable
[5] & 0xf0) == 0x50 ? "29.49892713 MHz Crystal" :
974 (fMMTable
[5] & 0xf0) == 0x60 ? "27.0 MHz Crystal" :
975 (fMMTable
[5] & 0xf0) == 0x70 ? "14.31818 MHz Crystal" : "Reserved",
977 /* Video Decoder Host Config */
978 (fMMTable
[6] & 0x07) == 0x00 ? "I2C Device" :
979 (fMMTable
[6] & 0x07) == 0x01 ? "MPP Device" :
980 (fMMTable
[6] & 0x07) == 0x02 ? "2 bits VIP Device" :
981 (fMMTable
[6] & 0x07) == 0x03 ? "4 bits VIP Device" :
982 (fMMTable
[6] & 0x07) == 0x04 ? "8 bits VIP Device" :
983 (fMMTable
[6] & 0x07) == 0x07 ? "PCI Device" : "Reserved",
985 /* Hardware Teletext */
986 (fMMTable
[3] & 0x0c) == 0x00 ? "No Hardware Teletext" :
987 (fMMTable
[3] & 0x0c) == 0x04 ? "Philips SAA5281" : "Reserved",
990 (fMMTable
[7] & 0x03) == 0x00 ? "Unused/Invalid" :
991 (fMMTable
[7] & 0x03) == 0x01 ? "Tuner Input" :
992 (fMMTable
[7] & 0x03) == 0x02 ? "Composite Input" : "S-Video Input",
993 (fMMTable
[7] & 0x04) == 0x00 ? "Front Connector" : "Rear Connector",
994 (fMMTable
[7] & 0x38) >> 3,
997 (fMMTable
[8] & 0x03) == 0x00 ? "Unused/Invalid" :
998 (fMMTable
[8] & 0x03) == 0x01 ? "Tuner Input" :
999 (fMMTable
[8] & 0x03) == 0x02 ? "Composite Input" : "S-Video Input",
1000 (fMMTable
[8] & 0x04) == 0x00 ? "Front Connector" : "Rear Connector",
1001 (fMMTable
[8] & 0x38) >> 3,
1004 (fMMTable
[9] & 0x03) == 0x00 ? "Unused/Invalid" :
1005 (fMMTable
[9] & 0x03) == 0x01 ? "Tuner Input" :
1006 (fMMTable
[9] & 0x03) == 0x02 ? "Composite Input" : "S-Video Input",
1007 (fMMTable
[9] & 0x04) == 0x00 ? "Front Connector" : "Rear Connector",
1008 (fMMTable
[9] & 0x38) >> 3,
1011 (fMMTable
[10] & 0x03) == 0x00 ? "Unused/Invalid" :
1012 (fMMTable
[10] & 0x03) == 0x01 ? "Tuner Input" :
1013 (fMMTable
[10] & 0x03) == 0x02 ? "Composite Input" : "S-Video Input",
1014 (fMMTable
[10] & 0x04) == 0x00 ? "Front Connector" : "Rear Connector",
1015 (fMMTable
[10] & 0x38) >> 3,
1018 (fMMTable
[11] & 0x03) == 0x00 ? "Unused/Invalid" :
1019 (fMMTable
[11] & 0x03) == 0x01 ? "Tuner Input" :
1020 (fMMTable
[11] & 0x03) == 0x02 ? "Composite Input" : "S-Video Input",
1021 (fMMTable
[11] & 0x04) == 0x00 ? "Front Connector" : "Rear Connector",
1022 (fMMTable
[11] & 0x38) >> 3