Guide: Find Registers and Values

From Multiboot
Jump to: navigation, search

Little guide to find registers and values: (values shown are for my MacbookPro 3,1, gf8600m gt only)
(Originally written by Cheiffun here).

1) Start EFI shell

2) Find the vga controller: (the -b flag reduces output to one page)

Code:
pci -b

Here you can see all devices, find the display (vga) controller, in my case:

Code:
00 01 00 00

3) Check the device config:

Code:
pci -i 00 01 00 -b

a) On page 1 (in my case) I can see the values for the Command Register (4), the bits (00) I/O space enabled and (02) bus master are set to 1, so nothing to change here.

b) On page 3 (in my case) I can see the values for the Bridge Control Register (3E), the bit (03) VGA Enable is set to 0, this should be 1

4) Set the bit mentioned in 3b):

Code:
mm 0001003E -PCI 8

Explanation:
a) device is on 000100 (see 2))
b) the Bridge Control Register is 3E (see 3b))
c) the VGA Enable bit is (03), so if you imagine an 8 bit register (00001000 = Bit (07) to Bit (00)) and you want to set bit (03) to 1, you have to feed the register with 00001000 binary, which is 8 decimal).

5) Check pci device config again (same code as for 3)) and you should see that the VGA Enable bit (03) in register (3E) is now set to 1.


Additional details from d3vi1:
How do you find the correct PCI bridge for a VGA controller, especially since the MBP has 2 VGA controllers there should be 2 different PCI bridges I assume?
It's quite simple actually. They are allocated in the order in which they are found on Bus 0. So the first PCI bridge in a PCI listing (see below) would give you bus 01. The second PCI Bridge would give you bus 02, etc. You can check the subordinate pci bus using the pci -i command on the bridge in the secondary bus number.

Code:
Shell> pci
  Seg  Bus  Dev  Func
  ---  ---  ---  ----
(SNIP)...(SNIP)
   00   00   0E    00 ==> Bridge Device - PCI/PCI bridge
            Vendor 10DE Device 0D9A Prog Interface 0
   00   00   15    00 ==> Bridge Device - PCI/PCI bridge
            Vendor 10DE Device 0D9B Prog Interface 0
   00   00   16    00 ==> Bridge Device - PCI/PCI bridge
            Vendor 10DE Device 0D9B Prog Interface 0
   00   00   17    00 ==> Bridge Device - PCI/PCI bridge
            Vendor 10DE Device 0D76 Prog Interface 0
   00   01   00    00 ==> Bridge Device - PCI/PCI bridge
            Vendor 104C Device 823E Prog Interface 0
Shell> pci 00 00 0E 00
 PCI Segment 00 Bus 00 Device 0E Func 00 [EFI 00000E0000]

(SNIP)...(SNIP)

Vendor ID(0): 10DE                     Device ID(2): 0D9A

(SNIP)...(SNIP)

(Bus Numbers)  Primary(18)     Secondary(19)   Subordinate(1A)
              ------------------------------------------------------
              00               01               02
Secondary Latency Timer(1B):       00

So any devices connected to 00:0E.00 would be 01:xx.xx.
Any devices connected 00:15.00 would be 02:xx.xx and so forth.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox