Load kernel for numato tagus, based on picoevb-rdma kernel

hello

I want to create a DMA communication trhough PCIe between a jetson AGX Xavier and a Numato Tagus card. I previously did a communication between the jetson and picoEVB card using the kernel from this post:

I am trying to do the minimun changes on the kernel to make it work on the tagus card, and I think that this part of the kernel is the part that I need to change (lines 1245-1267):

static const struct pevb_drvdata drvdata_picoevb = {
.num_h2c_chans = 1,
.fpga_ram_size = SZ_64K,
};

static const struct pevb_drvdata drvdata_htg_k800 = {
.num_h2c_chans = 1,
.fpga_ram_size = SZ_2G,
};

#define PCI_ENTRY(sub_dev_id, data)
{
PCI_DEVICE_SUB(
PCI_VENDOR_ID_NVIDIA, 0x0001,
PCI_VENDOR_ID_NVIDIA, sub_dev_id),
.driver_data = (unsigned long)&drvdata_##data,
}

static const struct pci_device_id pevb_pci_ids = {
PCI_ENTRY(0x0001, picoevb),
PCI_ENTRY(0x0002, htg_k800),
{ },
};

I added a new entry for the tagus and a new pevb_drvdata structure, however I am not sure of the ID-s I have to use for my card.

My tagus card has the following IDs:
Vendor ID 10EE
Device ID 7021
Subsystem vendor ID 10EE
Subsystem ID 0007

I tried some conbinations but I still cant load the kernel to run on my tagus card.
Which are the changes on IDs that I have to do for my device? Do I have to modify anything else? Do I have to create a new kernel completely?

I’m not sure if I understood this part. What do you mean by loading the kernel onto your tagus card? you mean the device driver of the tagus card isn’t getting binding with your device?
Also, as a starting point, could you please share the ‘sudo lspci -vv’ and ‘sudo lspci -x’ output of your system? and confirm that you are able to see the tagus getting enumerated?

yes, the driver is not getting binded with my device. I am using a driver made for a picoevb and trying to make the required changes to make it work with my tagus, which I don’t know if is possible, changng the device ID.

I see the tagus enumerated lspci-v (11.7 KB)
lspci-x (546 Bytes)

Hi,
Do you have the /dev/picoevb device node created ?
if not, can you send kernel boot messages?

I’m not sure if the changes you did are connect, could you please try the following change?

static const struct pci_device_id pevb_pci_ids[] = {
	{ PCI_VDEVICE(XILINX,	0x7021) },
	{}
};

I have tried your proposal but it generates an error as the order I believe should be the opposite. However I tried the following and could not see the driver picoevb been used in my tagus device.

static const struct pci_device_id pevb_pci_ids = {
{ PCI_VDEVICE(0x7021, XILINX) },
{}
};

My additions and changes include the following:

static const struct pevb_drvdata_XILINX = {
.num_h2c_chans = 1,
.fpga_ram_size = SZ_64K,
};

#defince PCI_ENTRY(sub_dev_id, data)
{
PCI_DEVICE_SUB(
PCI_VENDOR_ID_NVIDIA, XILINX,
PCI_VENDOR_ID_NVIDIA, sub_dev_id),
.driver_data = (unsigned long) & drvdata_##data,
}

static const struct pci_device_id pevb_pci_ids = {
PCI_ENTRY (0x0001, picoevb),
PCI_ENTRY (0x0002, htg_k800),
PCI_ENTRY (0x7021 ,XILINX),
{ }
};

I know that the last term I use in PCI_ENTRY has to be the same as drvdata_ ,and change them accordingly.

no, the device node is not created. The creation as I understood happens when the binding happens.

I do not know exactly how would you get the kernel boot messages. I did dmesg after I tried to bind the kernel. dmesg (73.9 KB)
Here I see that " loading out-of-tree module taints kernel".