| 125 | /* The HP6715b bios assigns the SB600 audio and sata overlapping pci memory regions. Thus preventing |
| 126 | correct operation of both devices. For now we disable audio and zero it's BARs. Long term solution |
| 127 | will require the device to be remapped |
| 128 | */ |
| 129 | static void |
| 130 | ati_fixup_sb600(PCI *pci, int domain, uint8 bus, uint8 device, uint8 function, uint16 deviceId) |
| 131 | { |
| 132 | static uint32 sataBar = 0; |
| 133 | static uint32 audioBar = 0; |
| 135 | switch (deviceId) |
| 136 | { |
| 137 | case 0x4383: //could add subsystem Id check if really paranoid [103c:30c2] |
| 138 | // Read BAR[0] |
| 139 | audioBar = pci->ReadPciConfig(domain, bus, device, function, PCI_base_registers, 4); |
| 140 | audioBar &= PCI_address_memory_32_mask; |
| 141 | dprintf("Found SB600 HD Audio (Azalia) 0x%08lx\n", audioBar); |
| 142 | break; |
| 143 | case 0x4380: |
| 144 | // Read BAR[5] |
| 145 | sataBar = pci->ReadPciConfig(domain, bus, device, function, PCI_base_registers + (5*4), 4); |
| 146 | sataBar &= PCI_address_memory_32_mask; |
| 147 | dprintf("Found SB600 Sata 0x%08lx\n", sataBar); |
| 148 | break; |
| 149 | default: |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | if (audioBar == 0xD0608000 && sataBar == 0xD0609000) |
| 154 | { |
| 155 | dprintf("Disabling SB600 audio bar due to overlapping resources (seen on HP6715b laptop)\n"); |
| 156 | // turn everything off |
| 157 | pci->WritePciConfig(domain, bus, device, function, PCI_command, 2, 0); |
| 158 | pci->WritePciConfig(domain, bus, device, function, PCI_base_registers + 0, 4, 0); |
| 159 | pci->WritePciConfig(domain, bus, device, function, PCI_base_registers + 4, 4, 0); |
| 160 | pci->WritePciConfig(domain, bus, device, function, PCI_base_registers + 8, 4, 0); |
| 161 | pci->WritePciConfig(domain, bus, device, function, PCI_base_registers + 12, 4, 0); |
| 162 | pci->WritePciConfig(domain, bus, device, function, PCI_base_registers + 16, 4, 0); |
| 163 | } |
| 164 | } |
| 165 | |