atirage: add ASIC ID for Rage Pro.

This commit is contained in:
Maxim Poliakovski 2021-02-04 19:00:23 +01:00
parent ce70b0f096
commit 3c787a87cd
2 changed files with 20 additions and 3 deletions

View File

@ -29,16 +29,33 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
ATIRage::ATIRage(uint16_t dev_id, uint32_t mem_amount) : PCIDevice("ati-rage") {
uint8_t asic_id;
this->vram_size = mem_amount << 20;
/* allocate video RAM */
this->vram_ptr = new uint8_t[this->vram_size];
/* ATI Rage driver needs to know ASIC ID (manufacturer's internal chip code)
to operate properly */
switch (dev_id) {
case ATI_RAGE_PRO_DEV_ID:
asic_id = 0x5C; // R3B/D/P-A4 fabricated by UMC
break;
default:
asic_id = 0xDD;
LOG_F(WARNING, "ATI Rage: bogus ASIC ID assigned!");
}
/* set up PCI configuration space header */
WRITE_DWORD_LE_A(&this->pci_cfg[0], (dev_id << 16) | ATI_PCI_VENDOR_ID);
WRITE_DWORD_LE_A(&this->pci_cfg[8], 0x0300005C);
WRITE_DWORD_LE_A(&this->pci_cfg[8], (0x030000 << 8) | asic_id);
WRITE_DWORD_LE_A(&this->pci_cfg[0x3C], 0x00080100);
/* stuff default values into chip registers */
WRITE_DWORD_LE_A(&this->block_io_regs[ATI_CONFIG_CHIP_ID],
(asic_id << 24) | dev_id);
/* initialize display identification */
this->disp_id = new DisplayID();
}
@ -167,7 +184,7 @@ const char* ATIRage::get_reg_name(uint32_t reg_offset) {
case ATI_GEN_TEST_CNTL:
reg_name = "GEN_TEST_CNTL";
break;
case ATI_CFG_CHIP_ID:
case ATI_CONFIG_CHIP_ID:
reg_name = "CONFIG_CHIP_ID";
break;
case ATI_CFG_STAT0:

View File

@ -89,7 +89,7 @@ enum {
ATI_GEN_TEST_CNTL = 0x00D0,
ATI_CUSTOM_MACRO_CNTL = 0x00D4,
ATI_CONFIG_CNTL = 0x00DC,
ATI_CFG_CHIP_ID = 0x00E0,
ATI_CONFIG_CHIP_ID = 0x00E0,
ATI_CFG_STAT0 = 0x00E4,
ATI_CRC_SIG = 0x00E8,
ATI_DST_Y_X_ALIAS1 = 0x00F4,