PCI/PCIe Software Development Kits from Broadcom installation on Linux Kernel 5.3

1k views Asked by At

It is regarding the PLXsdk from https://www.broadcom.com/products/pcie-switches-bridges/software-dev-kits I have some NVMe SSD connected to PCI, I am trying to read and write the BAR register for that NVMe Drive in Linux Kernel 5.3 usig=ng the PLXSDK provided by Broadcom, I am able to build the driver and load it into Kernel.But when I am trying to run it on my Gigabyte Motherboard PC for the given samples it is saying no such Device or driver found error Code 204, I am using insmod PlxSvc for loading the driver and on checking it with lsmod in terminal PlxSvc is there. So, I am doubting whether I am doing anything wrong while trying to load it. Can anyone tell me if he/she has tried to use PLXsdk from https://www.broadcom.com/products/pcie-switches-bridges/software-dev-kits on Linux, for Windows it is working fine from the same link.

2

There are 2 answers

0
David Janssen On

You need to use the provided "Bin/Plx_load" script to load drivers in this SDK. The script sets up nodes in /dev/plx so that applications using the PLX API can communicate with SDK drivers. Simply using insmod will load the driver but no nodes will be created.

Refer to PLX SDK Linux Release Notes in the Documentation folder. All the instructions & explanations are there.

0
R. J. Mathar On

In the case of the 8311 driver, for example, the following file would be copied to /etc/systemd/system/plxload8311.service to get it loaded

#/etc/system/system/plxload8311.service
#
# $Header$ 

[Unit]
Description=Load PLX drivers

[Service] 
Type=oneshot
RemainAfterExit=yes
# Comment one of these, depending on the hardware.
# Either the PEX 8311 PCIe bridge of http://www.plxtech.com/products/expresslane/pex8311
# or the PCI 9656 board of
# http://www.plxtech.com/products/io/pci9656
Environment=PLXTYPE=8311
Environment=PLX_SDK_DIR=/usr/src/PlxLinux/PlxSdk
ExecStart=/bin/sh -c "cd /usr/src/PlxLinux/PlxSdk/Bin && ./Plx_load 8311"
ExecStop=/bin/sh -c "cd /usr/src/PlxLinux/PlxSdk/Bin && ./Plx_unload 8311"

[Install]
WantedBy=multi-user.target

and then using

if [ -c /dev/plx/Plx8311 ] ; then
                serv=plxload8311
        elif [ -c /dev/plx/Plx9656 ] ; then
                serv=plxload9656
        fi

        if [ ${#serv} -ge 1 ] ; then
                systemctl enable $serv
                systemctl start $serv
  
              cp ${serv}.service /etc/systemd/system
fi

As far as I know the /dev/... files are created by

cd Driver
./builddriver 8311
./builddriver 9656
cd ../PlxApi
make clean
make
ls -l /dev/plx*