T60 VGAROM Extraction
=====================


Copyright (C) 2021, 2022  Kai Mertens <kmx@posteo.net>  

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License".


Some T60 configurations require an extracted proprietary VGA Option 
ROM. The ROM is to be extracted from memory, as vendor’s BIOS patches 
the VGA Option ROM loaded from chip.

Please compare this information to: [Coreboot VGA Support Page][]


How-to
------


* Start the T60 with vendor’s firmware.

* Run a GNU/Linux Operating System.

* Run `sudo lspci -nnvv` and retrieve PCI IDs (manufacturer and device) 
  for the VGA compatible controller, for instance:

        VGA compatible controller [0300]: RV515/M52 [Mobility Radeon X1300] [1002:7149]

    or
  
        VGA compatible controller [0300]: RV515/M54 [Mobility Radeon X1400] [1002:7145]

    Do not proceed in case `[1002:7149]` or `[1002:7145]` is not your 
    listed ID!

* Copy the VGA Option ROM from memory to file:

    - Note down `<startaddr>` and `<lastaddr>` of the VGA ROM in 
      memory:

            $ sudo cat \
                /proc/iomem | \
                    grep 'Video ROM'

    - Copy the memory area into a file:

            $ sudo dd \
                if=/dev/mem \
                of=pci1002,7149.rom \
                bs=1c \
                skip=$((0x<startaddr>)) \
                count=$((0x<lastaddr>-0x<startaddr>+1))

* Pass that file to `../src/gen-rom-zerocat.sh` by means of switch `--rom-vga`.

* Flash the generated Zerocat ROM.



[Coreboot VGA Support Page]:    https://www.coreboot.org/VGA_support#RECOMMENDED:_Extracting_from_your_vendor_bios_image
