PCI device configuration after kernel boot - VxWorks

This is a discussion on PCI device configuration after kernel boot - VxWorks ; I have an interesting situation. I have an FPGA that doesn't become a PCI device until after its top.bit is loaded. The top.bit doesn't get downloaded to the FPGA until after the vxWorks kernel has booted. The problem with this ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: PCI device configuration after kernel boot

  1. PCI device configuration after kernel boot

    I have an interesting situation. I have an FPGA that doesn't become a
    PCI device until after its top.bit is loaded. The top.bit doesn't get
    downloaded to the FPGA until after the vxWorks kernel has booted. The
    problem with this is that sysPciAutoCfg() is called in the kernel
    before the FPGA comes up. I am unable to access the FPGA across the
    PCI bus. When I do pciDeviceShow(), the FPGA does show up in the
    list. However, the base addresses of the FPGA are not configured. I
    tried to set the base address of the FPGA to something reasonable
    using pciDeviceConfig(), but that didn't work.


  2. Re: PCI device configuration after kernel boot

    On Aug 15, 3:14 pm, Daniel wrote:
    > I have an interesting situation. I have an FPGA that doesn't become a
    > PCI device until after its top.bit is loaded. The top.bit doesn't get
    > downloaded to the FPGA until after the vxWorks kernel has booted. The
    > problem with this is that sysPciAutoCfg() is called in the kernel
    > before the FPGA comes up. I am unable to access the FPGA across the
    > PCI bus. When I do pciDeviceShow(), the FPGA does show up in the
    > list. However, the base addresses of the FPGA are not configured. I
    > tried to set the base address of the FPGA to something reasonable
    > using pciDeviceConfig(), but that didn't work.


    Calling pciDevConfig() to assign the PCI resources is the right thing
    to do.
    I'm guessing the values you choose as 'something reasonable' were off
    a bit.
    One trick that might help is to warm boot the target after the FPGA is
    up and running.
    If the act of warm booting doesn't reset the FPGA, auto config should
    work the second time.
    Then you could write down the BARs and plug those values into a
    pciDevConfig() call.

    HTH,
    GV



  3. Re: PCI device configuration after kernel boot

    Hi GV, Thanks very much for your suggestion. I am using an x86-based
    board, and I just discovered that the kernel is not calling
    sysPciAutoCfg(). The kernel is depending on the BIOS to configure all
    the PCI devices. I followed your suggestion even though I am warm-
    booting from the BIOS. I was able to get the base address for the
    FPGA, and the value looks reasonable considering the fact that the
    FPGA is behind a PCI-to-PCI bridge. The base address falls in the
    range of the address space for the PCI-to-PCI bridge.

    -Daniel

    On Aug 15, 3:48 pm, gvarndell wrote:
    > On Aug 15, 3:14 pm, Daniel wrote:
    >
    > > I have an interesting situation. I have an FPGA that doesn't become a
    > > PCI device until after its top.bit is loaded. The top.bit doesn't get
    > > downloaded to the FPGA until after the vxWorks kernel has booted. The
    > > problem with this is that sysPciAutoCfg() is called in the kernel
    > > before the FPGA comes up. I am unable to access the FPGA across the
    > > PCI bus. When I do pciDeviceShow(), the FPGA does show up in the
    > > list. However, the base addresses of the FPGA are not configured. I
    > > tried to set the base address of the FPGA to something reasonable
    > > using pciDeviceConfig(), but that didn't work.

    >
    > Calling pciDevConfig() to assign the PCI resources is the right thing
    > to do.
    > I'm guessing the values you choose as 'something reasonable' were off
    > a bit.
    > One trick that might help is to warm boot the target after the FPGA is
    > up and running.
    > If the act of warm booting doesn't reset the FPGA, auto config should
    > work the second time.
    > Then you could write down the BARs and plug those values into a
    > pciDevConfig() call.
    >
    > HTH,
    > GV




  4. Re: PCI device configuration after kernel boot

    My PCI device seemed to work, but when I power-cycled my board, the
    FPGA doesn't work. There's something about what the BIOS is doing in
    the PCI configuration of the FPGA that I am not doing correctly in my
    code. Apparently pciDevConfig() is not enough.

    -Daniel


    On Aug 15, 4:26 pm, Daniel wrote:
    > Hi GV, Thanks very much for your suggestion. I am using an x86-based
    > board, and I just discovered that the kernel is not calling
    > sysPciAutoCfg(). The kernel is depending on the BIOS to configure all
    > the PCI devices. I followed your suggestion even though I am warm-
    > booting from the BIOS. I was able to get the base address for the
    > FPGA, and the value looks reasonable considering the fact that the
    > FPGA is behind a PCI-to-PCI bridge. The base address falls in the
    > range of the address space for the PCI-to-PCI bridge.
    >
    > -Daniel
    >
    > On Aug 15, 3:48 pm, gvarndell wrote:
    >
    > > On Aug 15, 3:14 pm, Daniel wrote:

    >
    > > > I have an interesting situation. I have an FPGA that doesn't become a
    > > > PCI device until after its top.bit is loaded. The top.bit doesn't get
    > > > downloaded to the FPGA until after the vxWorks kernel has booted. The
    > > > problem with this is that sysPciAutoCfg() is called in the kernel
    > > > before the FPGA comes up. I am unable to access the FPGA across the
    > > > PCI bus. When I do pciDeviceShow(), the FPGA does show up in the
    > > > list. However, the base addresses of the FPGA are not configured. I
    > > > tried to set the base address of the FPGA to something reasonable
    > > > using pciDeviceConfig(), but that didn't work.

    >
    > > Calling pciDevConfig() to assign the PCI resources is the right thing
    > > to do.
    > > I'm guessing the values you choose as 'something reasonable' were off
    > > a bit.
    > > One trick that might help is to warm boot the target after the FPGA is
    > > up and running.
    > > If the act of warm booting doesn't reset the FPGA, auto config should
    > > work the second time.
    > > Then you could write down the BARs and plug those values into a
    > > pciDevConfig() call.

    >
    > > HTH,
    > > GV




  5. Re: PCI device configuration after kernel boot

    On Aug 16, 3:56 pm, Daniel wrote:
    > My PCI device seemed to work, but when I power-cycled my board, the
    > FPGA doesn't work. There's something about what the BIOS is doing in
    > the PCI configuration of the FPGA that I am not doing correctly in my
    > code. Apparently pciDevConfig() is not enough.
    >


    Do a pciHeaderShow() on the P2P bridge, both when the FPGA device is
    'working' and when it's not.
    Better yet, use pciConfigTopoShow() if you're using a version of
    vxWorks that has it.
    I'm not sure the BIOS will assign any resources to a P2P with nothing
    behind it.
    You may also have to manually configure the P2P.
    This is just one of hundreds of reasons that PCs shouldn't be used for
    embedded systems.
    Press on, you'll get it.

    HTH,
    GV



  6. Re: PCI device configuration after kernel boot

    Hi GV,

    Thanks again for your valuable suggestions. I finally figured out
    what was wrong between cold booting and warm booting. When I cold
    boot the board, all the devices behind the P2P bridge get assigned
    different base addresses than when I warm boot the board. So now it
    becomes an issue of making sure I can consistently place the base
    address of the FPGA somewhere behind the P2P bridge that the BIOS
    won't ever assign base addresses.

    -Daniel


    On Aug 17, 4:59 am, gvarndell wrote:
    > On Aug 16, 3:56 pm, Daniel wrote:
    >
    > > My PCI device seemed to work, but when I power-cycled my board, the
    > > FPGA doesn't work. There's something about what the BIOS is doing in
    > > the PCI configuration of the FPGA that I am not doing correctly in my
    > > code. Apparently pciDevConfig() is not enough.

    >
    > Do a pciHeaderShow() on the P2P bridge, both when the FPGA device is
    > 'working' and when it's not.
    > Better yet, use pciConfigTopoShow() if you're using a version of
    > vxWorks that has it.
    > I'm not sure the BIOS will assign any resources to a P2P with nothing
    > behind it.
    > You may also have to manually configure the P2P.
    > This is just one of hundreds of reasons that PCs shouldn't be used for
    > embedded systems.
    > Press on, you'll get it.
    >
    > HTH,
    > GV



+ Reply to Thread