Skip to content
Snippets Groups Projects
Commit 47577594 authored by Laura Rientsma's avatar Laura Rientsma
Browse files

not really functional yet, but trying to loop over flx devices

parent d022ae7f
No related branches found
No related tags found
1 merge request!1Removed vmk180_serial_demo ip core, and use versal_network_device ip instead,...
#
# Makefile to make flxnet kernel modules flxnet_dev and flxnet_target
# Makefile.host to make flxnet kernel modules flxnet_dev and flxnet_pcie
# 29-10-2024
#
# Written for the FLX182 to build the correct target modules
# based on generated makefile from https://gitlab.cern.ch/atlas-tdaq-felix/felix-tdaq-drivers/-/blob/main/rpm/SOURCES/pkgs/generate_dkms_makefile.py?ref_type=heads
#
# Execute command on host server
# cp Makefile.host Makefile
#
obj-m := flxnet_dev.o flxnet_target.o
KERNEL_VERSION := $(shell uname -r)
KERNEL_MODLIB := /lib/modules/$(KERNEL_VERSION)
KERNEL_SOURCES := $(shell test -d $(KERNEL_MODLIB)/source && echo $(KERNEL_MODLIB)/source || echo $(KERNEL_MODLIB)/build)
MY_CFLAGS += -g -DDEBUG
ccflags-y += ${MY_CFLAGS}
CPPFLAGS += -I$(PWD)/../flx -I$(PWD)/.. -DBUILD_64_BIT -DCOMPILE_DRIVER -DDRIVER_ERROR -DDRIVER_DEBUG -DRELEASE_NAME=\"${RELEASE_NAME}\" -DCVSTAG=\"$(CVSTAG)\"
EXTRA_CFLAGS := -I$(PWD)/../flx -I$(PWD)/.. -DBUILD_64_BIT -DCOMPILE_DRIVER -DDRIVER_ERROR -DDRIVER_DEBUG -DRELEASE_NAME=\"${RELEASE_NAME}\" -DCVSTAG=\"$(CVSTAG)\" -DCMEM_RCC_TAG=\"$(CMEM_RCC_TAG)\" -DIO_RCC_TAG=\"$(IO_RCC_TAG)\" -DFLX_TAG=\"$(FLX_TAG)\"
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
obj-m := flxnet_dev.o flxnet_pcie.o
KDIR := $(KERNEL_SOURCES)
PWD := $(shell pwd)
modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers
$(RM) *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.o.d *.mod
\ No newline at end of file
......@@ -46,4 +46,6 @@ struct flxnet_peer {
#define FLX_DEV_MAGIC 0xCECABABAUL
#define MAXCARDS 1 // max number of FLX cards in a server
#endif
......@@ -72,7 +72,7 @@ struct tx_queue {
};
struct tx_queue tx_queue;
struct tx_queue tx_queue; //[MAXCARDS]
static LIST_HEAD(peers);
struct mutex peer_mutex;
......
......@@ -26,9 +26,6 @@
#include "flxnet/flxnet.h"
#define MAXCARDS 8 // max number of FLX cards
extern struct flxnet_peer * flxnet_add_peer(void* __iomem base_address,
int index, struct module *owner);
......@@ -143,7 +140,10 @@ static int configure_pcie_device(struct pci_dev *pdev, int index) {
pr_info("flxnet_pcie: mapping BAR memory");
rv = map_single_bar(fdev, bar_idx);
if (rv < 0) {
goto err_map;
pr_info("flxnet_pcie: disabling PCIe device, no network registred");
pci_disable_device(pdev);
pci_release_region(pdev, bar_idx);
return 0;
} else if (rv < MIN_MMAP_SIZE) {
pr_err("flxnet_pcie: mapped region is too small (%d bytes < %d)",
rv, MIN_MMAP_SIZE);
......@@ -176,7 +176,7 @@ err_map:
pci_release_region(pdev, bar_idx);
err_enable:
pr_err("flxnet_pcie: test pdev 0x%p, err %d", pdev, rv);
pr_err("flxnet_pcie: pdev 0x%p, err %d", pdev, rv);
kfree(fdev);
return rv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment