Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pciscan not working in ipxe.efi
2016-11-29, 20:31 (This post was last modified: 2016-11-29 20:32 by renato.)
Post: #1
pciscan not working in ipxe.efi
Hi,

I am trying to add a sleep or ifclose command in case I find a pci or network card, all this in my boot menu just before booting.

I am trying something like this:
Code:
:scan pciscan addr || goto scan_done
    #echo Found PCI device ${addr:busdevfn}
    iseq ${pci/${addr}.0.2}:${pci/${addr}.2.2} 8086:ffff && ifclose ||
    goto scan
:scan_done
However, when pciscan attr command is run attr is never set

I am doing something like below instead:
Code:
set addr:uint16 0
:loop
set pci ${pci/${addr}.0.2}:${pci/${addr}.2.2}
iseq ${pci} ffff:ffff || echo ${addr:busdevfn}: ${pci}
inc addr
iseq ${addr} 0xffff || goto loop
works, but it is nasty and takes a while

please advice
Find all posts by this user
Quote this message in a reply
2016-12-12, 10:31
Post: #2
RE: pciscan not working in ipxe.efi
It is quite possible that the pciscan command is not properly implemented in EFI mode yet.

If you do the workaround, do you actually receive proper information that matches the hardware setup of that machine?
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-12-12, 22:29
Post: #3
RE: pciscan not working in ipxe.efi
yes, it takes a couple of seconds but works
Find all posts by this user
Quote this message in a reply
2016-12-12, 22:46
Post: #4
RE: pciscan not working in ipxe.efi
Can confirm ... in EFI mode running
Code:
set addr:uint16 0
pciscan addr
show errno
gives me 0x2c044087 and going to http://ipxe.org/err/2c044087 gives us a bit more info.

Building with hacky patch and DEBUG=pci_cmd,pci determined that ipxe can't enumerate any buses at all.
This happens in pci_find_next
The answer to why can be found at: efi code compared to pcbios code

So pci scaning is not supported in EFI my guess is simply because it will cause issues on initialization, and that there is other (better) methods for doing the device enumeration in EFI mode.

Replacing
Code:
end = PCI_BUSDEVFN ( 0, pci_num_bus(), 0, 0 );
with
Code:
end = PCI_BUSDEVFN ( 0, 0x100, 0, 0 );
in the above linked pci_find_next function and we can start enumerate the pci bus - however i can't tell which other effects this will have in efi mode, so strongly recommend against it.

What we need here is probably a extra code path for in what manner we want enumeration, and for efi mode it can give zero buses on initialization but on pciscan it can actually give the buses - do note that in my test I did not check if the addresses returned was actually valid bus ids.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)