• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1HOWTO -->	PCI-Express test scripts for LTP
2	Amit Khanna amit.khanna@intel.com
3			08/20/2004
4
51. About this HOWTO
6
7This document describes the addition of PCI-Express test cases to the existing LTP project.
8These test cases/scripts will enhance the LTP's capability to test PCI-Express devices/drivers.
9
102. Copyright (c) Intel Corporation, 2004
11
123. What is this patch doing?
13
14a. 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
20b. 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
30c. 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
354. Including PCI-Express support into the kernel
36
37By default, the kernel may not enable PCI-Express feature. A kernel
38configuration option must be selected to enable PCI-Express support.
39
40To 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
435. FAQ
44
45Q1. Are there any limitations on using this patch?
46
47A1. If the device supports PCI-Express feature and the PCI-Express feature is enabled in the kernel,
48then only a user will be able to access the PCI-Express space.
49Even if the device doesn't support PCI-Express feature, the traditional PCI-space would still be accessible.
50
51Q2. What is this AER_CAP_ID_VALUE macro defined in tpci.h?
52
53A2. AER_CAP_ID_VALUE represents the value of Advanced Error Reporting Capability ID in the PCI Express config space.
54The default value of this is always same for all PCI-Express devices. i.e. 0x14011.
55In the function "test_read_pci_exp_config" in tpci.c file, it is compared with the value retrieved from a PCI-Express
56capable device. If both the values match that means that the PCI-Express driver is accessing the PCI-Express config space
57SUCCESSFULLY.
58***FINISH***
59