tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Trying to access the Expansion ROM of a video card



Hello All,

I am replying to this thread here, including all that have
participated in the message thread. I do not know if that is
appropriate, or if I should open another thread...

Anyways, I am trying to make the radeon r7 m265 device run on NetBSD
9.2 (amd64). When inspecting the dmesg output, atht ehvery beginning I
have this:

[     1.000000] timecounter: Timecounter "i8254" frequency 1193182 Hz
quality 100
[     1.000003] efi: systbl at pa 8f6bef18
[     1.000003] Acer Aspire E5-551G (V1.08)
[     1.000003] mainbus0 (root)
[     1.000003] ACPI: RSDP 0x000000008FBFE014 000024 (v02 ACRSYS)
[     1.000003] ACPI: XSDT 0x000000008FBFE120 0000C4 (v01 ACRSYS
ACRPRDCT 00000001      01000013)
[     1.000003] ACPI: FACP 0x000000008FBFC000 00010C (v05 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: DSDT 0x000000008FBEB000 00C377 (v01 ACRSYS
ACRPRDCT F0000000 1025 00040000)
[     1.000003] ACPI: FACS 0x000000008FB65000 000040
[     1.000003] ACPI: UEFI 0x000000008FBFD000 000236 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: HPET 0x000000008FBFB000 000038 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: APIC 0x000000008FBFA000 000090 (v03 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: MCFG 0x000000008FBF9000 00003C (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: ASF! 0x000000008FBF8000 0000A5 (v32 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: BOOT 0x000000008FBEA000 000028 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: WDRT 0x000000008FBE9000 000047 (v01 ACRSYS
ACRPRDCT 00000000 1025 00040000)
[     1.000003] ACPI: WDAT 0x000000008FBE8000 0001AC (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: FPDT 0x000000008FBE6000 000044 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: MSDM 0x000000008FBE5000 000055 (v03 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBE4000 000B9C (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBDA000 009AC7 (v02 ACRSYS
ACRPRDCT 00000002 1025 00040000)
[     1.000003] ACPI: CRAT 0x000000008FBD9000 0005A0 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: VFCT 0x000000008FBC9000 00F684 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBC7000 000418 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBC5000 001401 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBC4000 00082B (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: SSDT 0x000000008FBC2000 001138 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: BGRT 0x000000008FBC8000 000038 (v01 ACRSYS
ACRPRDCT 00000001 1025 00040000)
[     1.000003] ACPI: 7 ACPI AML tables successfully acquired and loaded

Here I have an entry that is labeled VFCT. I remembered that the
radeon_bios.c file contained a function that uses VFCT I thought the
rom might be in there, in that table. I have dumped the data using
"apcidump -dt", which I added below.

  VFCT: Length=63108, Revision=1, Checksum=97,
        OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
        Creator ID=1025, Creator Revision=0x40000

        Data={
                 56 46 43 54 84 f6 00 00    01 61 41 43 52 53 59 53
                 41 43 52 50 52 44 43 54    01 00 00 00 31 30 32 35
                 00 00 04 00 32 9b a3 5d    bd c6 cf 49 95 a6 e8 e4
                 2e cd 79 a7 4c 00 00 00    00 00 00 00 00 00 00 00
                 00 00 00 00 00 00 00 00    00 00 00 00 00 00 00 00
                 01 00 00 00 00 00 00 00    02 10 09 13 00 00 00 00
                 01 00 00 00 00 f6 00 00    55 aa 7b e9 19 02 00 00
                 00 00 00 00 00 00 00 00    00 00 00 00 00 00 00 00
                 cc 01 00 00 00 00 49 42    4d 16 fa a1 00 00 00 00
                 00 00 00 00 00 00 00 04    20 37 36 31 32 39 35 35
                 32 30 00 00 00 00 00 00    11 02 00 00 00 00 00 00
                 a6 01 00 00 00 00 00 00    30 33 2f 30 36 2f 31 34
                 2c 30 34 3a 31 34 3a 30    38 00 00 00 e9 0e 03 00
                 e9 1d 03 00 00 00 80 00    00 00 00 00 00 00 00 00
                 00 00 00 00 00 00 00 00    42 52 34 35 33 39 39 2e
                 30 30 31 00 53 50 45 43    54 52 45 00 50 43 49 5f
                 45 58 50 52 45 53 53 00    44 44 52 33 00 0d 0a 42
                 52 34 35 33 39 39 2e 30    30 31 20 53 50 45 43 54
                 52 45 20 44 44 52 33 20    32 30 30 65 2f 20 20 20
                 20 20 20 20 20 20 20 20    20 20 20 20 20 20 20 20
                 20 20 20 20 20 20 20 20    20 20 20 20 20 20 20 20
                 20 20 20 20 20 20 20 20    20 20 20 0d 0a 00 0d 0a
                 20 0d 0a 00 28 43 29 20    31 39 38 38 2d 32 30 31
                 30 2c 20 41 64 76 61 6e    63 65 64 20 4d 69 63 72
                 6f 20 44 65 76 69 63 65    73 2c 20 49 6e 63 2e 00
                 41 54 4f 4d 42 49 4f 53    42 4b 2d 41 4d 44 20 56
                 45 52 30 31 35 2e 30 34    31 2e 30 30 30 2e 30 30
                 32 2e 30 34 35 33 39 39    00 42 52 34 35 33 39 39
                 2e 30 30 31 20 00 31 30    31 34 31 33 31 20 00 32

It looks like this has a bios in it, with the magic header. I tried to
find the acpi_get_table_with_size and acpi_get_table in order to use
these, but could not find the headers that have these. But could not
find these.

Is there documentation on how to read these tables from the ACPI system?

Regards,
Riza

On Fri, Nov 5, 2021 at 2:56 AM Riza Dindir <riza.dindir%gmail.com@localhost> wrote:
>
> Hello All,
>
> As you know I have a laptop that has amd radeon r7 m265 graphics
> device (it seems there are two actually; 0x1002/0x1309 and
> 0x1002/0x6604). My kernel panics when I do enable radeon, not finding
> any ROM.
>
> I am using netbsd 9.2 amd64 and am using UEFI boot.
>
> After reading kern/49964 (which had the same panic with my system -
> radeon_get_bios does not find a bios) I did some testing. Here is what
> I have so far.
>
> The memory at 0xC0000 (size 131072) starts with 0xff 0xff. So this
> means that there is no valid expansion ROM here. This is what I have
> done to get this dump (dd if=/dev/mem of=/tmp/bios bs=1 iseek=786432
> count=131072) and to view it I used (hexdump -C /tmp/bios). If there
> is anything that looks wrong let me know.
>
> Then I have dumped the data on the two PCI devices mentioned above. To
> arrive at these I did use (pcictl pci0 dump -d 1 -f 0 and pcictl pci1
> dump -d 0 -f 0). Here is the outcome.
>
> The device on pci0:1:0 is as such
>
> PCI configuration registers:
>   Common header:
>     0x00: 0x13091002 0x00100007 0x03000000 0x00800010
>
>     Vendor Name: ATI Technologies (0x1002)
>     Device ID: 0x1309
>     Command register: 0x0007
> .....
>  Type 0 ("normal" device) header:
>     0x10: 0xe000000c 0x00000000 0xf000000c 0x00000000
>     0x20: 0x00004001 0xf0b00000 0x00000000 0x08641025
>     0x30: 0xfffe0001 0x00000048 0x00000000 0x00000100
>
>     Base address register at 0x10
>       type: 64-bit prefetchable memory
>       base: 0x00000000e0000000
>     Base address register at 0x18
>       type: 64-bit prefetchable memory
>       base: 0x00000000f0000000
>     Base address register at 0x20
>       type: I/O
>       base: 0x00004000
>     Base address register at 0x24
>       type: 32-bit nonprefetchable memory
>       base: 0xf0b00000
>     Cardbus CIS Pointer: 0x00000000
>     Subsystem vendor ID: 0x1025
>     Subsystem ID: 0x0864
>     Expansion ROM Base Address Register: 0xfffe0001
>       base: 0xfffe0000
>       Expansion ROM Enable: on
>       Validation Status: Validation not supported
>       Validation Details: 0x0
>     Capability list pointer: 0x48
>     Reserved @ 0x38: 0x00000000
>     Maximum Latency: 0x00
>     Minimum Grant: 0x00
>     Interrupt pin: 0x01 (pin A)
>     Interrupt line: 0x00
>
> and for the device on pci1:0:0 has this information
>
> PCI configuration registers:
>   Common header:
>     0x00: 0x66041002 0x00100007 0x03800000 0x00000010
>
>     Vendor Name: ATI Technologies (0x1002)
>     Device ID: 0x6604
>     Command register: 0x0007
> .......
> Type 0 ("normal" device) header:
>     0x10: 0xd000000c 0x00000000 0xf0a00004 0x00000000
>     0x20: 0x00003001 0x00000000 0x00000000 0x086a1025
>     0x30: 0xfffe0000 0x00000048 0x00000000 0x00000100
>
>     Base address register at 0x10
>       type: 64-bit prefetchable memory
>       base: 0x00000000d0000000
>     Base address register at 0x18
>       type: 64-bit nonprefetchable memory
>       base: 0x00000000f0a00000
>     Base address register at 0x20
>       type: I/O
>       base: 0x00003000
>     Base address register at 0x24
>       not implemented
>     Cardbus CIS Pointer: 0x00000000
>     Subsystem vendor ID: 0x1025
>     Subsystem ID: 0x086a
>     Expansion ROM Base Address Register: 0xfffe0000
>       base: 0xfffe0000
>       Expansion ROM Enable: off
>       Validation Status: Validation not supported
>       Validation Details: 0x0
>     Capability list pointer: 0x48
>     Reserved @ 0x38: 0x00000000
>     Maximum Latency: 0x00
>     Minimum Grant: 0x00
>     Interrupt pin: 0x01 (pin A)
>     Interrupt line: 0x00
>
> The ROM in the pci0:1:0 has the PCI ROM enabled but the ROM address is
> not correct i think. Would you have any ideas on where the expansion
> ROM might be found? Whereelse might I look? Since I am using UEFI, can
> this ROM be located in the UEFI boot directories somewhere? Any
> pointers, any information or any ideas would be appreciated.
>
> Thanks in advance.
>
> Best Regards,
> Riza Dindir


Home | Main Index | Thread Index | Old Index