Broadcom 的 PCI/PCIe 软件开发套件安装在 Linux 内核 5.3 上

问题描述 投票:0回答:2

这是关于来自https://www.broadcom.com/products/pcie-switches-bridges/software-dev-kits的PLXsdk 我有一些连接到 PCI 的 NVMe SSD,我正在尝试使用 Broadcom 提供的 PLXSDK 在 Linux Kernel 5.3 中读取和写入该 NVMe 驱动器的 BAR 寄存器,我能够构建驱动程序并将其加载到内核中。但是当我尝试在我的 Gigabyte 主板 PC 上运行给定示例时,它说没有找到这样的设备或驱动程序,错误代码 204, 我正在使用 insmod PlxSvc 加载驱动程序 并在终端 PlxSvc 中使用 lsmod 检查它。 所以,我怀疑我在尝试加载它时是否做错了什么。 谁能告诉我他/她是否尝试过在 Linux 上使用来自 https://www.broadcom.com/products/pcie-switches-bridges/software-dev-kits 的 PLXsdk,对于 Windows,它可以正常工作相同的链接。

linux-kernel sdk driver broadcom nvme
2个回答
0
投票

您需要使用提供的“Bin/Plx_load”脚本来加载此SDK中的驱动程序。该脚本在 /dev/plx 中设置节点,以便使用 PLX API 的应用程序可以与 SDK 驱动程序进行通信。只需使用 insmod 将加载驱动程序,但不会创建任何节点。

请参阅文档文件夹中的 PLX SDK Linux 发行说明。所有的说明和解释都在那里。


0
投票

以 8311 驱动程序为例,以下文件将被复制到 /etc/systemd/system/plxload8311.service 以加载它

#/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

然后使用

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

据我所知 /dev/... 文件是由

创建的
cd Driver
./builddriver 8311
./builddriver 9656
cd ../PlxApi
make clean
make
ls -l /dev/plx*
© www.soinside.com 2019 - 2024. All rights reserved.