Re: [U-Boot] [U-Boot-DM] FPGA driver over PCI bus

Hi Max,
On 1 September 2016 at 08:46, Max Ruttenberg mruttenberg@emutechnology.com wrote:
Hi,
(we should probably close down the u-boot-dm list - please use the main one)
I'm find myself clueless in regards to writing a driver for an FPGA over a PCI bus. This U-Boot is running on an NXP t102xrdb board family, if that matters.
The documentation in doc/driver-model/pci-info.txt mentions that I can use a macro named U_BOOT_PCI_DEVICE as alternative to listing my device in a device tree.
I found an example of this in drivers/net/e1000.c, and I tried to follow it as much as was applicable (this is an ethernet driver, which my driver is not).
But when U-Boot starts up, my "bind" function is never called, even though I can tell that my device with the corresponding vendor and device id is detected using the "pci [bus]" command.
I appreciate any help I can get.
Are you starting up PCI? For example, with:
ret = uclass_get_device(UCLASS_PCI, 0, &bus);
If you are, then it should scan the bus and find and bind all the devices, in pci_bind_bus_devices(). You can add DEBUG to the very top of that file to see.
But if you know the device is there, you may as well create a device tree-node for it. See chromebook_link.dts 'pci' node for an example. Then you can request the device directly, and PCI will be started up automatically.
Regards, Simon

Hi Simon,
Are you starting up PCI? For example, with:
ret = uclass_get_device(UCLASS_PCI, 0, &bus);
If you are, then it should scan the bus and find and bind all the devices, in pci_bind_bus_devices(). You can add DEBUG to the very top of that file to see.
But if you know the device is there, you may as well create a device tree-node for it. See chromebook_link.dts 'pci' node for an example. Then you can request the device directly, and PCI will be started up automatically.
I'm not calling uclass_get_device, which could be the source of my troubles. I've made progress by calling pci_find_devices(ids, index) directly in some non-static function and sticking a call to it in my board's misc_init_r() function. Something a clueless person might do. I'll the device tree node pointer because that strikes me as the correct thing to do.
On Fri, Sep 2, 2016 at 6:52 PM, Simon Glass sjg@chromium.org wrote:
Hi Max,
On 1 September 2016 at 08:46, Max Ruttenberg mruttenberg@emutechnology.com wrote:
Hi,
(we should probably close down the u-boot-dm list - please use the main one)
I'm find myself clueless in regards to writing a driver for an FPGA over
a
PCI bus. This U-Boot is running on an NXP t102xrdb board family, if that matters.
The documentation in doc/driver-model/pci-info.txt mentions that I can
use
a macro named U_BOOT_PCI_DEVICE as alternative to listing my device in a device tree.
I found an example of this in drivers/net/e1000.c, and I tried to follow
it
as much as was applicable (this is an ethernet driver, which my driver is not).
But when U-Boot starts up, my "bind" function is never called, even
though
I can tell that my device with the corresponding vendor and device id is detected using the "pci [bus]" command.
I appreciate any help I can get.
Are you starting up PCI? For example, with:
ret = uclass_get_device(UCLASS_PCI, 0, &bus);
If you are, then it should scan the bus and find and bind all the devices, in pci_bind_bus_devices(). You can add DEBUG to the very top of that file to see.
But if you know the device is there, you may as well create a device tree-node for it. See chromebook_link.dts 'pci' node for an example. Then you can request the device directly, and PCI will be started up automatically.
Regards, Simon
participants (2)
-
Max Ruttenberg
-
Simon Glass