PLX SDK Linux Support Release Notes March 2013

Contents

1.     About this Release

2.     Supported Platforms

3.     Installing the Package

4.     Configuring for Big Endian and/or 32-bit or 64-bit CPU Platforms

5.     Building User Applications and Libraries

6.     PLX Drivers – Determining Which Driver to Use

7.     PLX Drivers – Building

8.     PLX Drivers – Loading

9.     PLX Drivers -- Known Issues

10.  PLX Drivers – Supporting Devices with Custom Device/Vendor ID

11.  PLX Drivers -- Setup to View Debug Messages

12.  PLX Command-Line Monitor - PlxCm

13.  Useful Debug Tips

14.  Distribution of PLX SDK Components

15.  References

 

Note:    The contents of this document are specific to the Linux Host support provided by PLX.  The PLX SDK Reference Manuals contain additional general information regarding PLX host software.  Although not specific to Linux, much of the information found in these manuals applies to all supported host Operating Systems, including Linux.

About this Release

The PLX Linux host-side support provided supports PLX PCI/PCIe devices in the 9000, 6000, & 8000 series.

Note:    For all PLX devices running in transparent mode, the generic PLX Service driver (PlxSvc) is used.  For PLX endpoint devices (9xxx) and devices configured for Non-transparent mode (6xxx & 8xxx), a device-specific driver is used, e.g. Plx9054, Plx8000_DMA, Plx6000_NT, etc.

Contents:  The following components are included, along with the respective directory:

PlxSdk/Include                                      PLX SDK include files

PlxSdk/PlxApi                                        PLX Host API Library source

PlxSdk/Driver                                        Various PLX device drivers

PlxSdk/Samples                                    Sample applications

PlxSdk/Samples/PlxCm                        A command-line application, which is useful when working with PLX devices

PlxSdk/Makefiles                                   Shared makefile components used to build PLX applications, libraries, and drivers

PlxSdk/Bin                                             Scripts to load, unload, and assist in debug of the driver/module

Supported Platforms

Due to the numerous flavors of Linux, PLX cannot support and test on all platforms.  In order to provide customers with an easy to replicate platform, PLX software is tested with easily-available Linux distributions, primarily Fedora.  Other flavors of Linux should work ok or with minimal porting effort.

Note that PLX only tests with x86 CPU platforms, which are Little Endian.  Although Big Endian is supported, PLX does not have or test with a BE platform.

Installing the Package

To install the Linux support files, use the following steps:

1.     Copy the PLX Linux TAR file to the desired working directory, e.g. the user’s home directory or /usr/linux/src.

2.     If the PLX file contains a .gz extension, the file must first be unzipped, as follows:
       gunzip PlxSdk.tar.gz

3.     Use a TAR file extractor or open a terminal window and type the following command:
       tar -xvf PlxSdk.tar

4.     This will create a folder called PlxSdk with all PLX supplied files and folders inside.

5.     In order to build the files supplied, the shell environment variable PLX_SDK_DIR must be set.  This should be set to the root location of where the PlxSdk folder is created.  This can be set with the export command and may be placed in the shell initialization script (e.g. “.bashrc”) so that it is automatically set when a new terminal session is started.

   Examples:      export PLX_SDK_DIR=$HOME/PlxSdk
                           export PLX_SDK_DIR=/usr/src/PlxSdk

Configuring for Big Endian and/or 32-bit or 64-bit CPU Platforms

PLX only tests the Linux package for Intel x86 compatible platforms.  The PLX makefiles attempt to auto-detect other platforms to set the Big/Little Endian & 32/64-bit options.  If this package is used with an unsupported CPU, the PLX makefile will halt with an error.  To resolve the issue, follow the steps below:

1.     Open PlxSdk/Makefiles/Common.def.

2.     Find the CPU properties section at the top

3.     Add an entry for your architecture & set PLX_CPU_BITS & PLX_CPU_ENDIAN variables accordingly, following the example of existing entries.
  For example:
      ifeq ($(ARCH),mips64)
          PLX_CPU_BITS   = 64
          PLX_CPU_ENDIAN = Big
      endif

Building User Applications and Libraries

To build user-level components (API library or applications), change to the desired component directory and type ‘make’.  Makefiles are included in the package.  Depending upon the installation location, the Makefile environment variables may need to be modified to avoid build errors.

To build the API library, type the following commands in a terminal window:

          prompt> cd PlxSdk/PlxApi

          prompt> make

To build a sample application, type the following commands in a terminal window:

 

          prompt> cd PlxSdk/Samples/ApiTest

          prompt> make

To build a Debug version instead of the default Release version, type the following command in a terminal window:

          prompt> make PLX_DEBUG=1

To see the complete command-line during the build of each component, add ‘V=1’ to the make parameters:

          prompt> make PLX_DEBUG=1 V=1

To clean a build, change to the desired directory and type one of the following commands in a terminal window:

          prompt> make clean              (Removes all object and intermediate build files, but not final image)

          prompt> make cleanall          (Removes all build files, including final image)

 

Note:    When creating makefiles from scratch, please use the supplied PLX makefiles as a reference, especially for any required definitions.  For example, PLX applications or libraries require the compiler definition PLX_LINUX and PLX drivers require the definition PLX_LINUX_DRIVER.  All of these may be found in the file PlxSdk/Makefiles/Common.def.

PLX Drivers – Determining Which Driver to Use

The PLX package contains various drivers to support all PLX chip types.  Refer to the table below to determine which driver to use:

PLX Driver Name

Supported Chips

Source Code Folder

Sample Build Command

Plx6000_NT

6254, 6540, 6466 configured only for Non-transparent mode (NT) operation.

Source.Plx6000_NT

./builddriver 6000n

Plx8000_NT

PLX 8500/8600/8700 port configured only for Non-transparent mode (NT) operation.

Source.Plx8000_NT

./builddriver 8000n

Plx8000_DMA

PLX Switches that contain a DMA function (e.g. 8609, 8613, 8617, 8619)

Source.Plx8000_DMA

./builddriver 8000d

Plx9050
Plx9030
Plx9080
Plx9054
Plx9056
Plx9656
Plx8311

All PLX 9000 & 8311 devices.  Driver source code is shared between all devices, but each individual driver must be built separately.

Source.Plx9000

./builddriver 9030,
./builddriver 9054,
etc.

PlxSvc

Generic driver that supports any PCI/PCIe device in the system.  The Service driver is not attached to any particular device.  It runs as a background service that supports basic access to PCI devices, as well as register and EEPROM access to all PLX 6000 and 8000 series devices, regardless of whether they are configured for transparent or Non-transparent mode.

The Service driver may be loaded in conjunction with any other PLX driver.  It is not required for operation of any device and is typically loaded only for debugging purposes (i.e. register and EEPROM modifications).

Source.PlxSvc

./builddriver Svc

 

PLX Drivers – Building

 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * WARNING * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Kernel 2.6

Kernel 2.6 introduced the Linux kernel build system.  In order to build PLX drivers, or any other drivers for that matter, the Linux build system requires the following:

·Linux kernel development package, which matches the destination kernel version, must be installed

·In some cases, the current running kernel must be configured and built manually

If the PLX driver fails to build, please verify the requirements mentioned above are met.

 

 

The build of drivers involves the use of a PLX-provided script file (builddriver), which is located in the PlxSdk/Driver directory.  This is provided to simplify the build of multiple drivers, which share a common code base.  The builddriver script will build a debug or release version of the driver for a desired PLX chip.  Its usage is as follows:

PLX Linux module build script

PLX Technology, Inc.

 

  Usage: builddriver {Driver} [DebugOption] [CleanOption]

 

     Driver      = 8000n      : PLX 8000 NT-mode driver

                   8000d      : PLX 8000 DMA Controller driver

                   9050       : PLX 9050/9052 driver

                   9030       : PLX 9030 driver

                   9080       : PLX 9080 driver

                   9054       : PLX 9054 driver

                   9056       : PLX 9056 driver

                   9656       : PLX 9656 driver

                   8311       : PLX 8311 driver

                   6000n      : PLX 6254/6540/6466 NT-mode driver

                   Svc        : PLX PCI/PCIe Service driver

 

     DebugOption = <none>     : Build Release build of module

                   'd'        : Build Debug build of module

 

     CleanOption = <none>     : Build the driver

                   'clean'    : Remove intermediate build files

                   'cleanall' : Remove all build files

 

  E.g.: builddriver 9054 d      - Build 9054 module debug version

        builddriver Svc         - Build PlxSvc service module release version

        builddriver 8000n clean - Remove intermediate build files of 8000-NT module

 

Some examples of using the script are:

prompt> cd PlxSdk/Driver                             (Change to the driver directory)

prompt> ./builddriver 8000n d                       (Build debug version of the 8000 NT driver)

prompt> ./builddriver Svc                              (Build release version of the PLX Service driver)

prompt> ./builddriver 9054 d clean               (Remove intermediate build files only for the debug version of the 9054 driver – does not delete driver binary, Plx9054_dbg.ko)

prompt> ./builddriver 6000 cleanall              (Remove all build files for the 6000 NT driver)

Another script is provided to build all PLX drivers.  You may invoke it as follows

prompt> ./buildalldrivers  (or ‘./buildalldrivers d’ for debug builds)

Both of these scripts will pass command-line arguments to make files.  For example:

prompt> ./buildalldrivers d clean                  Removes debug build intermediate object files only for all drivers

prompt> ./buildalldrivers cleanall                 Removes driver release build files for all drivers

Note:    The “./” before the script names is used to invoke the script in the current directory.  In Unix/Linux, typically, the current directory (“.”) is not in the PATH, by default.

PLX Drivers – Loading

PLX device drivers are implemented as installable modules and scripts are provided to load and unload them.  The scripts are located in the <PlxSdk/Bin> directory and are listed below.  Please use the provided PLX scripts to load/unload drivers instead of the Linux insmod/rmmod utilities.

·Plx_load                Script to load a module

·Plx_unload           Script to unload a module

·startlog                 Sample script which sets up a terminal to display driver debug output

Note:    The scripts may need to be modified to reflect installation paths.  Additionally, these scripts will not work properly unless the user has sufficient right to load/unload modules.  The superuser command (“su”) can be used or login as root.

When loading a PLX driver, the Plx_load script will create the necessary directories and a preset number of device nodes.  By default, a subdirectory called “plx” will be created under the dev file system.  PLX nodes are then created in the /dev/plx directory.  The device node, which is only the driver name (i.e. Plx8000), rather than a node (e.g. Plx8000-1) represents the driver management interface and uses a minor number of FFh (255).  This interface is used by the API to query the driver module and to perform some non-device-specific tasks, such as read a PCI register of an arbitrary PCI device.

 

Example:  A system containing an 8619 device, configured for NT & DMA.

[root] /home/plx>PlxSdk/Bin/Plx_load 8000d d

 

Install: Plx8000_DMA_dbg

  Load module......... Ok (Plx8000_DMA_dbg.ko)

  Verify load......... Ok

  Get major number.... Ok (MajorID = 250)

  Create node path.... Ok (/dev/plx)

  Create nodes........ Ok (/dev/plx/Plx8000_DMA)

 

[root] /home/plx>PlxSdk/Bin/Plx_load 8000n d

 

Install: Plx8000_NT_dbg

  Load module......... Ok (Plx8000_NT_dbg.ko)

  Verify load......... Ok

  Get major number.... Ok (MajorID = 249)

  Create node path.... Ok (/dev/plx already exists)

  Create nodes........ Ok (/dev/plx/Plx8000_NT)

 

[root] /home/plx>ls -l /dev/plx

total 0

crwxrwxrwx 1 root root 250, 255 Mar  6 18:59 Plx8000_DMA

crwxrwxrwx 1 root root 250,   0 Mar  6 18:59 Plx8000_DMA-0

crwxrwxrwx 1 root root 250,   1 Mar  6 18:59 Plx8000_DMA-1

crwxrwxrwx 1 root root 250,  10 Mar  6 18:59 Plx8000_DMA-10

crwxrwxrwx 1 root root 250,  11 Mar  6 18:59 Plx8000_DMA-11

crwxrwxrwx 1 root root 250,  12 Mar  6 18:59 Plx8000_DMA-12

crwxrwxrwx 1 root root 250,  13 Mar  6 18:59 Plx8000_DMA-13

crwxrwxrwx 1 root root 250,  14 Mar  6 18:59 Plx8000_DMA-14

crwxrwxrwx 1 root root 250,  15 Mar  6 18:59 Plx8000_DMA-15

crwxrwxrwx 1 root root 250,  16 Mar  6 18:59 Plx8000_DMA-16

crwxrwxrwx 1 root root 250,   2 Mar  6 18:59 Plx8000_DMA-2

crwxrwxrwx 1 root root 250,   3 Mar  6 18:59 Plx8000_DMA-3

crwxrwxrwx 1 root root 250,   4 Mar  6 18:59 Plx8000_DMA-4

crwxrwxrwx 1 root root 250,   5 Mar  6 18:59 Plx8000_DMA-5

crwxrwxrwx 1 root root 250,   6 Mar  6 18:59 Plx8000_DMA-6

crwxrwxrwx 1 root root 250,   7 Mar  6 18:59 Plx8000_DMA-7

crwxrwxrwx 1 root root 250,   8 Mar  6 18:59 Plx8000_DMA-8

crwxrwxrwx 1 root root 250,   9 Mar  6 18:59 Plx8000_DMA-9

crwxrwxrwx 1 root root 249, 255 Mar  6 19:00 Plx8000_NT

crwxrwxrwx 1 root root 249,   0 Mar  6 19:00 Plx8000_NT-0

crwxrwxrwx 1 root root 249,   1 Mar  6 19:00 Plx8000_NT-1

crwxrwxrwx 1 root root 249,  10 Mar  6 19:00 Plx8000_NT-10

crwxrwxrwx 1 root root 249,  11 Mar  6 19:00 Plx8000_NT-11

crwxrwxrwx 1 root root 249,  12 Mar  6 19:00 Plx8000_NT-12

crwxrwxrwx 1 root root 249,  13 Mar  6 19:00 Plx8000_NT-13

crwxrwxrwx 1 root root 249,  14 Mar  6 19:00 Plx8000_NT-14

crwxrwxrwx 1 root root 249,  15 Mar  6 19:00 Plx8000_NT-15

crwxrwxrwx 1 root root 249,  16 Mar  6 19:00 Plx8000_NT-16

crwxrwxrwx 1 root root 249,   2 Mar  6 19:00 Plx8000_NT-2

crwxrwxrwx 1 root root 249,   3 Mar  6 19:00 Plx8000_NT-3

crwxrwxrwx 1 root root 249,   4 Mar  6 19:00 Plx8000_NT-4

crwxrwxrwx 1 root root 249,   5 Mar  6 19:00 Plx8000_NT-5

crwxrwxrwx 1 root root 249,   6 Mar  6 19:00 Plx8000_NT-6

crwxrwxrwx 1 root root 249,   7 Mar  6 19:00 Plx8000_NT-7

crwxrwxrwx 1 root root 249,   8 Mar  6 19:00 Plx8000_NT-8

crwxrwxrwx 1 root root 249,   9 Mar  6 19:00 Plx8000_NT-9

Although there may only be 1 or 2 devices the driver actually loads for, (eg Plx8000_NT-0 & Plx8000_NT-1), the Plx_load script will create 16 nodes by default.  The script may be modified to create additional devices, or a limited number.  Refer to the Plx_load script for details.

PLX Drivers -- Known Issues

Kernel Tainting

In later versions of Linux kernel version 2.4.x, the notion of kernel tainting was introduced.  The motivation behind this is when a module is distributed in binary-only form and it is loaded into the kernel, it becomes difficult for kernel developers to debug a problem, since the module source is not available.  With kernel tainting, the kernel is marked as “tainted” whenever a binary-only module is loaded.  A new macro was introduced, called MODULE_LICENSE, for a module to declare its license agreement.  The module author has the option of selecting between GPL, Proprietary, etc.  If a module does not declare its license agreement, insmod will refuse to load it.

Since distribution of PLX driver source code is not allowed, PLX drivers are marked with a Proprietary license agreement by default.  Although this causes insmod to display a warning regarding tainting of the kernel, it does not affect driver operation.

Module Version Conflict:

When a module is built with Linux kernel X.x.x header files, an attempt to load the module in Linux running kernel Y.y.y will result in a “kernel version mismatch” error generated by insmod.  Since the Linux kernel is constantly evolving, loading an installable module built for one kernel version into another kernel of different version is typically not recommended.  The changes between different kernel versions could result in an unstable system if a module of different version is loaded. The kernel source header files used when building the module, determine the module version.  When RedHat is installed, for example, the kernel source files installed will match the kernel version that the particular RedHat version is running.

It is possible to build a single driver for use in multiple kernel versions; however, other issues arise.  This notion is called Versioning and is beyond the scope of this document.  Please refer to other Linux resources regarding the explanation and use of versioning.  By default, PLX drivers do not use versioning.

PlxPci_PhysicalMemoryAllocate() API Call Limitations

The PLX API call PlxPci_PhysicalMemoryAllocate() is used to allocate a physically contiguous page-locked buffer, typically for DMA operations.  In Linux, the maximum size of a single buffer is typically limited to 4MB and is controlled by a kernel definition.  To increase this maximum, the definition must be modified and the kernel must be rebuilt.

On IA64 systems, the max buffer size is typically larger than 4MB; however, attempting to allocate a larger buffer may result in a system crash.  This has been determined to either be a kernel bug or a limitation of the hardware.

PLX Drivers – Supporting Devices with Custom Device/Vendor ID

When a PLX driver is loaded, it probes for specific devices it is responsible for.  When the driver finds such a device, it will perform the necessary steps to claim the device and make it accessible to applications.  The search criteria used is the Device/Vendor ID (PCI configuration register offset 0).  By default, PLX drivers are configured to search only for devices with either a default PLX ID (e.g. 8532_10B5) or Device IDs of PLX Reference Design Kits (RDKs).

When a customer configures the PLX device on an OEM card with a new Device/Vendor ID, by default, the PLX driver will not claim the device.  To register a new custom device ID, the ID must be added to the driver’s list of IDs to search for.  Follow the steps below:

 

·Open the relevant driver’s Driver.c file (e.g. PlxSdk/Driver/Source.Plx8000_NT/Driver.c)

·Find the PCI device table:

// Setup the PCI device table to probe
static struct pci_device_id PlxPciIdTable[] =
{
    // VenID  DevID       SubVenID    SubDevID    Class     ClassMask
    { 0x10B5, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x000000, 0x000000 },
    { 0 } // Required last entry
};
MODULE_DEVICE_TABLE(pci, PlxPciIdTable);

·Add the custom ID to the list

Example:          Custom ID=2309_8086

// Setup the PCI device table to probe
static struct pci_device_id PlxPciIdTable[] =
{
    // VenID  DevID       SubVenID    SubDevID    Class     ClassMask
    { 0x10B5, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x000000, 0x000000 },
    { 0x8086, 0x2309    , PCI_ANY_ID, PCI_ANY_ID, 0x000000, 0x000000 },
    { 0 } // Required last entry
};

·Rebuild the driver

In addition to adding the device ID, the function PlxDispatch_Probe(), found in the same file, may also need modification.

PLX Drivers -- Setup to View Debug Messages

The debug versions of PLX drivers are designed to display numerous messages, which are logged by the kernel log daemon.  These messages can provide useful information in the event of errors or during driver or application development.  These messages are only available with the debug build of the PLX driver.  They are not included in the release build.

In order to view the driver output, PLX has provided the script startlog, which can be found in the <PlxSdk/Bin> directory.  This script will setup a terminal session to display kernel system messages as they are received.  Below is a typical terminal session demonstrating how to load the debug version of a module and start logging to the terminal:

 

Prompt> su
Password: *****

Logged in as root

root> startlog

Stopping current klogd...

Stopping current syslogd...

Starting new syslogd...

Starting log to console...

>>>>> 

 

<**Press Ctrl-z here to move process to background**>

 

 [1]+  Stopped                 startlog

 

root> Plx_load 8000n d

 

Install: Plx8000_NT_dbg

  Load module......... Ok (Plx8000_NT_dbg.ko)

  Verify load......... Ok

  Get major number.... Ok (MajorID = 250)

  Create node path.... Ok (/dev/plx)

  Create nodes........ Ok (/dev/plx/Plx8000_NT)

 

[root] /home/plx>fg         (Brings startlog process to foreground)

 

startlog

Plx8000_NT: <========================================================>

Plx8000_NT: PLX driver v7.00 (32-bit) - built on Mar  6 2013 19:00:03

Plx8000_NT: Supports Linux kernel version 2.6.35.14-106.fc14.i686.PAE

Plx8000_NT: Allocated global driver object (f4f80780)

Plx8000_NT: Registered driver (MajorID = 250)

Plx8000_NT: ACPI Probe - ACPI is v2.0 or higher (rev=2)

Plx8000_NT: ACPI Probe - 'RSD PTR ' found at 000f0490

Plx8000_NT: ACPI Probe - RSD table at cded1028 has 14 entries

Plx8000_NT: ACPI Probe - FACP table at cded1130

Plx8000_NT: ACPI Probe - APIC table at cdedc410

Plx8000_NT: ACPI Probe - FPDT table at cdedc488

Plx8000_NT: ACPI Probe - MCFG table at cdedc4d0

Plx8000_NT: ACPI Probe - HPET table at cdedc510

Plx8000_NT: ACPI Probe - SSDT table at cdedc548

Plx8000_NT: ACPI Probe - PRAD table at cdedc8b8

Plx8000_NT: ACPI Probe - SPMI table at cdedc978

Plx8000_NT: ACPI Probe - SSDT table at cdedc9b8

Plx8000_NT: ACPI Probe - SSDT table at cdedd360

Plx8000_NT: ACPI Probe - EINJ table at cdeddde8

Plx8000_NT: ACPI Probe - ERST table at cdeddf18

Plx8000_NT: ACPI Probe - HEST table at cdede128

Plx8000_NT: ACPI Probe - BERT table at cdede1d0

Plx8000_NT: ACPI Probe - PCIe ECAM at 00000000_E0000000

Plx8000_NT:    --------------------

Plx8000_NT: Probe: 8619 10B5 [b:01 s:00 f:1]

Plx8000_NT: Probe: -- Unsupported Device --

Plx8000_NT:    --------------------

Plx8000_NT: Probe: 8619 10B5 [b:03 s:00 f:0]

PLX 8000 NT Driver 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

Plx8000_NT: Enabled PCI device

PLX 8000 NT Driver 0000:03:00.0: setting latency timer to 64

Plx8000_NT: Created Device (Plx8000_NT-0)

Plx8000_NT: Start device...

Plx8000_NT:    Resource 00

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 0: DE800000

Plx8000_NT:      Phys Addr: DE800000

Plx8000_NT:      Size     :    20000 (128 KB)

Plx8000_NT:      Property : Non-Prefetchable 32-bit

Plx8000_NT:      Kernel VA: f8cc0000

Plx8000_NT:    Resource 01

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 2: DC000008

Plx8000_NT:      Phys Addr: DC000000

Plx8000_NT:      Size     :   800000 (8192 KB)

Plx8000_NT:      Property : Prefetchable 32-bit

Plx8000_NT:      Kernel VA: fa800000

Plx8000_NT:    Resource 02

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 3: DE000000

Plx8000_NT:      Phys Addr: DE000000

Plx8000_NT:      Size     :   800000 (8192 KB)

Plx8000_NT:      Property : Non-Prefetchable 32-bit

Plx8000_NT:      Kernel VA: fb080000

Plx8000_NT: Device 8619_10B5 = 8619 rev BA

Plx8000_NT: Using PCI BAR 0 (VA=f8cc0000) ==> PLX regs

Plx8000_NT: NT port is Link-side (NT base=11000h)

PLX 8000 NT Driver 0000:03:00.0: irq 54 for MSI/MSI-X

Plx8000_NT: MSI enabled, change IRQ 17 --> 54

Plx8000_NT:    Resource 03

Plx8000_NT:      Type     : Interrupt (MSI)

Plx8000_NT:      IRQ      : 54 [36h]

Plx8000_NT:      MSI Addr : 00000000_FEE0F00C

Plx8000_NT:      MSI Data : 4122

Plx8000_NT: Installed ISR for interrupt

Plx8000_NT:    --------------------

Plx8000_NT: Probe: 8619 10B5 [b:04 s:00 f:0]

PLX 8000 NT Driver 0000:04:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18

Plx8000_NT: Enabled PCI device

PLX 8000 NT Driver 0000:04:00.0: setting latency timer to 64

Plx8000_NT: Created Device (Plx8000_NT-1)

Plx8000_NT: Start device...

Plx8000_NT:    Resource 00

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 0: DEB00000

Plx8000_NT:      Phys Addr: DEB00000

Plx8000_NT:      Size     :    20000 (128 KB)

Plx8000_NT:      Property : Non-Prefetchable 32-bit

Plx8000_NT:      Kernel VA: f9540000

Plx8000_NT:    Resource 01

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 2: DB000008

Plx8000_NT:      Phys Addr: DB000000

Plx8000_NT:      Size     :  1000000 (16384 KB)

Plx8000_NT:      Property : Prefetchable 32-bit

Plx8000_NT:      Kernel VA: fb900000

Plx8000_NT:    Resource 02

Plx8000_NT:      Type     : Memory

Plx8000_NT:      PCI BAR 3: DEA00000

Plx8000_NT:      Phys Addr: DEA00000

Plx8000_NT:      Size     :   100000 (1024 KB)

Plx8000_NT:      Property : Non-Prefetchable 32-bit

Plx8000_NT:      Kernel VA: fc980000

Plx8000_NT: Device 8619_10B5 = 8619 rev BA

Plx8000_NT: Using PCI BAR 0 (VA=f9540000) ==> PLX regs

Plx8000_NT: NT port is Virtual-side (NT base=10000h)

PLX 8000 NT Driver 0000:04:00.0: irq 55 for MSI/MSI-X

Plx8000_NT: MSI enabled, change IRQ 18 --> 55

Plx8000_NT:    Resource 03

Plx8000_NT:      Type     : Interrupt (MSI)

Plx8000_NT:      IRQ      : 55 [37h]

Plx8000_NT:      MSI Addr : 00000000_FEE0F00C

Plx8000_NT:      MSI Data : 412A

Plx8000_NT: Installed ISR for interrupt

Plx8000_NT: Attempt to allocate physical memory (8 Kb)...

Plx8000_NT: Allocated physical memory...

Plx8000_NT:     CPU Phys Addr: 33ee8000

Plx8000_NT:     Bus Phys Addr: 33ee8000

Plx8000_NT:     Kernel VA    : f3ee8000

Plx8000_NT:     Size         :     2000 (8192 bytes)

Plx8000_NT: Added: 2 supported device(s)

Plx8000_NT: ...driver loaded

PLX Command-Line Monitor - PlxCm

In the PLX Linux package, PLX provides a simple command-line utility, which allows easy access to a PLX chip’s registers, configuration EEPROM, and local memory.  The utility is called PLX Command-Line Monitor, or PlxCm, and is located in the sample applications folder, PlxSdk/Samples/PlxCm.  Simply build and run the application once one or more PLX drivers are loaded.

For those familiar with the legacy PLXMon for DOS, PlxCm is very similar.  Although the help system is limited, typing help will provide the list of available commands.  Some useful ones are provided below.

·         PCR [offset [value]]          Display the PCI register at offset.  If value is provided, write it to the specified offset.

·         LCR [offset [value]]           Display the Local register at offset.  If value is provided, write it to the specified offset.

·         RTR [offset [value]]           Display the Run-time register at offset.  If value is provided, write it to the specified offset.

·         DMA [offset [value]]          Display the DMA register at offset.  If value is provided, write it to the specified offset.

·         MQR [offset [value]]          Display the Message Queue register at offset.  If value is provided, write it to the specified offset.

·         EEP [offset [value]]          Display the EEPROM value at offset.  If value is provided, write it to the specified offset.

Note:   Although PLX periodically updates PlxCm, there is no guarantee of future enhancements or features.  The complete source code is provided for those who wish to use it as a reference or modify it to their needs.

Useful Debug Tips

Once the PLX driver is loaded successfully, it is possible to view some system files to verify claiming of resources.  In the case of resources, the registered PLX driver name (e.g. “Plx8000”) will be listed as the owner.  The commands are provided below.

·         cat /proc/bus/pci/devices (cat /proc/pci now deprecated in newer kernels)
Displays the PCI devices in the system along with the memory and I/O spaces

·         cat /proc/devices
Lists the currently loaded Character and Block modules/drivers

·         cat /proc/ioports
Lists I/O ports and the owners

·         cat /proc/iomem
Lists Memory ranges and the owners

·         cat /proc/interrupts
Lists interrupt resources and the owners

·         lsmod 
Lists all currently loaded kernel modules

·         dmesg 
Displays kernel debug output at any time

Note:    For memory, I/O port, and interrupt resources, a device must actually be selected for the PLX driver to claim resources.  The PLX driver considers a device as “Stopped” if it is not in use and “Started” when an application opens/selects it.  A device is selected with the PlxPci_DeviceOpen API call.  A device is “Started” by the driver at this time and resources will be claimed.  One of the sample applications can be executed, for example, to select a device.

Distribution of PLX SDK Components

PLX Software License Agreement

This section is meant for OEM customers who have written applications with PLX software and intend to ship it with their product.  The PLX SDK is provided under a proprietary PLX license.  Specific SDK components are provided under the GNU Lesser General Public License (LGPL) version 2 and are permitted to be distributed.  The standard GPL allows for free distribution of the source code of these SDK components.  The LGPL allows for the same distribution rights, but also removes the restriction that all other source code comprising the product must be provided.  This allows OEM vendors to protect portions of their OEM software and still ship PLX SDK source code under LGPL.

GPL:     http://www.gnu.org/licenses/#GPL

LGPL:   http://www.gnu.org/licenses/lgpl.html

PLX SDK Distribution Restrictions

The following restrictions apply to the distribution of PLX software:

·         The complete SDK package may not be distributed

·         Applications, utilities, or tools provided by PLX, such as PLXMon or the PLX Device Editor, may not be distributed

·         Documentation written by PLX to explain PLX software architecture or design or PLX reference documentation may not be distributed.

·         PLX software may only be used in conjunction with designs containing a PLX device.

·         PLX provides no warranty for distributed PLX SDK components and will not support end-users who have received PLX SDK components from OEM vendors.  End users must be made aware that PLX is not responsible for support of the OEM product.

PLX Components Allowed for Distribution under LGPL

PLX allows distribution of the following components required for OEM software to function properly and utilize the PLX chip through the PLX API.

·         Any scripts needed to install the software and/or load modules.

·         PLX driver source code may be distributed.

·         PLX API library source code may be distributed.

·         PLX header files may be distributed

Note: The distributable SDK components mentioned above must be distributed independently from all other non-distributable PLX SDK components.

References

·         Linux Device Drivers, 2nd Edition, Alessandro Rubini & Jonathan Corbet, June 2001, http://www.oreilly.com/catalog/linuxdrive2

·         Linux Device Drivers, 3rd Edition, Alessandro Rubini, Jonathan Corbet, & Greg Kroah-Hartman, February 2005, http://www.oreilly.com/catalog/linuxdrive3

·         The Linux Source Cross-Reference, http://lxr.linux.no

·         The Linux Kernel Archives, http://www.kernel.org

·         The Linux Kernel Mailing List, http://www.tux.org/lkml

·         RedHat, http://www.redhat.com

·         The Fedora Project, http://fedora.redhat.com

·         The Community ENTerprise Operating System (CentOS)http://www.centos.org

·         SGI Technical Publications Libraryhttp://techpubs.sgi.com

PCI8系列 PCI9系列 PCI9054 linux驱动程序 PLX SDK Samples ================================================================ ABOUT This document provides a brief description of the samples included in the PLX SDK. Please refer to the source code in each sample & the PLX SDK User's Manual for additional details. The PLX samples are intended to demonstrate use of the PLX API. The samples are not intended for debug or real world applications, although they can be extended to complex applications. They should be treated as a reference for writing custom software that utilizes the PLX API. Not all samples work with all PLX devices. The PLX API supports numerous PLX chip families in PCI/PCIe, including 6000-series PCI-to-PCI bridges, 9000-series PCI-to-Local bus bridges, & 8000-series PCI/PCIe bridges & switches. Some samples are provided only for specific chip families. SAMPLES - ApiTest Simple application that calls various PLX APIs for a selected device & verifies return codes & parameters. The API calls made depend upon the type of device selected. - DSlave Demonstrates how to read/write from a PLX 9000 PCI BAR space using the PLX API/driver to perform the data transer. This operation is often referred to as "Direct Slave". - DSlave_BypassApi Similar to the 'DSlave' sample, except this sample uses the PLX API only to map a PCI BAR space directly to the application's virtual space. The application can then directly access the space via simple memory dereferencing, bypassing the PLX API/driver & resulting in greater performance, especially for small transfers. The application is responsible for initializing the BAR space, such as setup of translation/remap registers. - LocalToPciInt [9000-series & 8311] Demonstrates how to wait for a generic Local-to-PCI interrupt using the PLX Notification API. - NT_DmaTest [8000-series switches with DMA & NT support] Demonstrates using the DMA engine in a PLX 8000 switch to transfer data through a PLX
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值