[syslinux] pci resource address

Johann Obermayr johann.obermayr at sigmatek.at
Wed Apr 10 10:36:44 PDT 2019


Hello,

we have a own xxx.c32 file. With syslinux 4.07

With this file we read some information from a pci device.

static inline void *pci_get_bar0(pciaddr_t addr)
{
                return (void *)(pci_readl(addr + 0x10) & ~0xf);
}

int fpga_pci_eeprom_init(unsigned char *buf, int size)
{
                int rval;
                pciaddr_t addr;
                void *fpga_addr;
                struct pci_domain *domain;
                struct pci_device *dev;

                domain = pci_scan();
                if (!domain) {
                               DBGPRINT("couldn't find PCI Domain\n");
                               return -1;
                }

                for_each_pci_func3(dev, domain, addr) {
                               /* TODO: should we do more checks on the device? Like class? */
                               if (dev->vendor == OUR_VENDOR_ID) {
                                                DBGPRINT("PCI: Found Sigmatek device = %x\n", dev->product);
                                                fpga_addr = pci_get_bar0(addr);
                                               rval = eeprom_init(fpga_addr, buf, size);

Now we change t syslinux 6.03 with efi64.
With pci_readl(addr + 0x10) we read only 4 byte.
But we need 8 Byte's. In the linux kernel there is a function pci_ioremap_bar.
With this function I get a 64 bit pointer.

How can I get a 64bit pointer on syslinux ?

Thanks
Reagrds
  Johann


More information about the Syslinux mailing list