Home | History | Annotate | Download | only in tpci_kernel
      1 HOWTO -->	PCI-Express test scripts for LTP
      2 	Amit Khanna amit.khanna (a] intel.com
      3 			08/20/2004
      4 
      5 1. About this HOWTO
      6 
      7 This document describes the addition of PCI-Express test cases to the existing LTP project.
      8 These test cases/scripts will enhance the LTP's capability to test PCI-Express devices/drivers.
      9 
     10 2. Copyright (c) Intel Corporation, 2004
     11 
     12 3. What is this patch doing?
     13 
     14 a. A function "test_find_pci_exp_cap" has been added to the tpci.c file of LTP project.
     15 	(\ltp\testcases\kernel\device-drivers\pci\tpci\tpci.c)
     16 	 This function makes a call to pci_find_capability, which will determine if a device
     17 	 has PCI-Express capability. A PCI Express device function indicates PCI-Express support
     18 	 by implementing the PCI-Express capability structure in its capability list.
     19 
     20 b. A function "test_read_pci_exp_config" has been added to the tpci.c file of LTP project.
     21  	This function calls "pci_config_read" and determines if the PCI-Express enhanced config
     22  	space of the device can be read successfully or not.
     23 
     24 	"pci_config_read" function here reads the Advanced Error Reporting CAP-ID register located
     25 	 at the PCI-Express enhanced config space address 0x100. The value of this register is a READ-ONLY
     26 	 value which is constant on all the PCI-Express devices. If the value read from this register matches with the
     27 	 defined macro AER_CAP_ID_VALUE(in tpci.h) that means that PCI-Express driver is accessing
     28 	 the enhanced config space SUCCESSFULLY.
     29 
     30 c. A user space function 'ki_generic()" is already available in user_tpci.c file of LTP project,
     31    (\ltp\testcases\kernel\device-drivers\pci\user_tpci\user_tpci.c) which will drive the kernel
     32    module tpci to test various pci and pci-express functions (defined & prototyped in tpci.c).
     33 
     34 
     35 4. Including PCI-Express support into the kernel
     36 
     37 By default, the kernel may not enable PCI-Express feature. A kernel
     38 configuration option must be selected to enable PCI-Express support.
     39 
     40 To include PCI-Express support into the kernel requires users to enable PCI-Access mode with
     41 "Any" or "MMCFG" in the "General Setup" menu in the kernel configuration menu.
     42 
     43 5. FAQ
     44 
     45 Q1. Are there any limitations on using this patch?
     46 
     47 A1. If the device supports PCI-Express feature and the PCI-Express feature is enabled in the kernel,
     48 then only a user will be able to access the PCI-Express space.
     49 Even if the device doesn't support PCI-Express feature, the traditional PCI-space would still be accessible.
     50 
     51 Q2. What is this AER_CAP_ID_VALUE macro defined in tpci.h?
     52 
     53 A2. AER_CAP_ID_VALUE represents the value of Advanced Error Reporting Capability ID in the PCI Express config space.
     54 The default value of this is always same for all PCI-Express devices. i.e. 0x14011.
     55 In the function "test_read_pci_exp_config" in tpci.c file, it is compared with the value retrieved from a PCI-Express
     56 capable device. If both the values match that means that the PCI-Express driver is accessing the PCI-Express config space
     57 SUCCESSFULLY.
     58 ***FINISH***
     59