cmd_pci.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /*
  2. * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  3. * Andreas Heppel <aheppel@sysgo.de>
  4. *
  5. * (C) Copyright 2002
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7. * Wolfgang Grandegger, DENX Software Engineering, wg@denx.de.
  8. *
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. /*
  28. * PCI routines
  29. */
  30. #include <common.h>
  31. #include <command.h>
  32. #include <asm/processor.h>
  33. #include <asm/io.h>
  34. #include <pci.h>
  35. extern int cmd_get_data_size(char* arg, int default_size);
  36. unsigned char ShortPCIListing = 1;
  37. /*
  38. * Follows routines for the output of infos about devices on PCI bus.
  39. */
  40. void pci_header_show(pci_dev_t dev);
  41. void pci_header_show_brief(pci_dev_t dev);
  42. /*
  43. * Subroutine: pciinfo
  44. *
  45. * Description: Show information about devices on PCI bus.
  46. * Depending on the define CFG_SHORT_PCI_LISTING
  47. * the output will be more or less exhaustive.
  48. *
  49. * Inputs: bus_no the number of the bus to be scanned.
  50. *
  51. * Return: None
  52. *
  53. */
  54. void pciinfo(int BusNum, int ShortPCIListing)
  55. {
  56. int Device;
  57. int Function;
  58. unsigned char HeaderType;
  59. unsigned short VendorID;
  60. pci_dev_t dev;
  61. printf("Scanning PCI devices on bus %d\n", BusNum);
  62. if (ShortPCIListing) {
  63. printf("BusDevFun VendorId DeviceId Device Class Sub-Class\n");
  64. printf("_____________________________________________________________\n");
  65. }
  66. for (Device = 0; Device < PCI_MAX_PCI_DEVICES; Device++) {
  67. HeaderType = 0;
  68. VendorID = 0;
  69. for (Function = 0; Function < PCI_MAX_PCI_FUNCTIONS; Function++) {
  70. /*
  71. * If this is not a multi-function device, we skip the rest.
  72. */
  73. if (Function && !(HeaderType & 0x80))
  74. break;
  75. dev = PCI_BDF(BusNum, Device, Function);
  76. pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID);
  77. if ((VendorID == 0xFFFF) || (VendorID == 0x0000))
  78. continue;
  79. if (!Function) pci_read_config_byte(dev, PCI_HEADER_TYPE, &HeaderType);
  80. if (ShortPCIListing)
  81. {
  82. printf("%02x.%02x.%02x ", BusNum, Device, Function);
  83. pci_header_show_brief(dev);
  84. }
  85. else
  86. {
  87. printf("\nFound PCI device %02x.%02x.%02x:\n",
  88. BusNum, Device, Function);
  89. pci_header_show(dev);
  90. }
  91. }
  92. }
  93. }
  94. static char *pci_classes_str(u8 class)
  95. {
  96. switch (class) {
  97. case PCI_CLASS_NOT_DEFINED:
  98. return "Build before PCI Rev2.0";
  99. break;
  100. case PCI_BASE_CLASS_STORAGE:
  101. return "Mass storage controller";
  102. break;
  103. case PCI_BASE_CLASS_NETWORK:
  104. return "Network controller";
  105. break;
  106. case PCI_BASE_CLASS_DISPLAY:
  107. return "Display controller";
  108. break;
  109. case PCI_BASE_CLASS_MULTIMEDIA:
  110. return "Multimedia device";
  111. break;
  112. case PCI_BASE_CLASS_MEMORY:
  113. return "Memory controller";
  114. break;
  115. case PCI_BASE_CLASS_BRIDGE:
  116. return "Bridge device";
  117. break;
  118. case PCI_BASE_CLASS_COMMUNICATION:
  119. return "Simple comm. controller";
  120. break;
  121. case PCI_BASE_CLASS_SYSTEM:
  122. return "Base system peripheral";
  123. break;
  124. case PCI_BASE_CLASS_INPUT:
  125. return "Input device";
  126. break;
  127. case PCI_BASE_CLASS_DOCKING:
  128. return "Docking station";
  129. break;
  130. case PCI_BASE_CLASS_PROCESSOR:
  131. return "Processor";
  132. break;
  133. case PCI_BASE_CLASS_SERIAL:
  134. return "Serial bus controller";
  135. break;
  136. case PCI_BASE_CLASS_INTELLIGENT:
  137. return "Intelligent controller";
  138. break;
  139. case PCI_BASE_CLASS_SATELLITE:
  140. return "Satellite controller";
  141. break;
  142. case PCI_BASE_CLASS_CRYPT:
  143. return "Cryptographic device";
  144. break;
  145. case PCI_BASE_CLASS_SIGNAL_PROCESSING:
  146. return "DSP";
  147. break;
  148. case PCI_CLASS_OTHERS:
  149. return "Does not fit any class";
  150. break;
  151. default:
  152. return "???";
  153. break;
  154. };
  155. }
  156. /*
  157. * Subroutine: pci_header_show_brief
  158. *
  159. * Description: Reads and prints the header of the
  160. * specified PCI device in short form.
  161. *
  162. * Inputs: dev Bus+Device+Function number
  163. *
  164. * Return: None
  165. *
  166. */
  167. void pci_header_show_brief(pci_dev_t dev)
  168. {
  169. u16 vendor, device;
  170. u8 class, subclass;
  171. pci_read_config_word(dev, PCI_VENDOR_ID, &vendor);
  172. pci_read_config_word(dev, PCI_DEVICE_ID, &device);
  173. pci_read_config_byte(dev, PCI_CLASS_CODE, &class);
  174. pci_read_config_byte(dev, PCI_CLASS_SUB_CODE, &subclass);
  175. printf("0x%.4x 0x%.4x %-23s 0x%.2x\n",
  176. vendor, device,
  177. pci_classes_str(class), subclass);
  178. }
  179. /*
  180. * Subroutine: PCI_Header_Show
  181. *
  182. * Description: Reads the header of the specified PCI device.
  183. *
  184. * Inputs: BusDevFunc Bus+Device+Function number
  185. *
  186. * Return: None
  187. *
  188. */
  189. void pci_header_show(pci_dev_t dev)
  190. {
  191. u8 _byte, header_type;
  192. u16 _word;
  193. u32 _dword;
  194. #define PRINT(msg, type, reg) \
  195. pci_read_config_##type(dev, reg, &_##type); \
  196. printf(msg, _##type)
  197. #define PRINT2(msg, type, reg, func) \
  198. pci_read_config_##type(dev, reg, &_##type); \
  199. printf(msg, _##type, func(_##type))
  200. pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
  201. PRINT (" vendor ID = 0x%.4x\n", word, PCI_VENDOR_ID);
  202. PRINT (" device ID = 0x%.4x\n", word, PCI_DEVICE_ID);
  203. PRINT (" command register = 0x%.4x\n", word, PCI_COMMAND);
  204. PRINT (" status register = 0x%.4x\n", word, PCI_STATUS);
  205. PRINT (" revision ID = 0x%.2x\n", byte, PCI_REVISION_ID);
  206. PRINT2(" class code = 0x%.2x (%s)\n", byte, PCI_CLASS_CODE,
  207. pci_classes_str);
  208. PRINT (" sub class code = 0x%.2x\n", byte, PCI_CLASS_SUB_CODE);
  209. PRINT (" programming interface = 0x%.2x\n", byte, PCI_CLASS_PROG);
  210. PRINT (" cache line = 0x%.2x\n", byte, PCI_CACHE_LINE_SIZE);
  211. PRINT (" latency time = 0x%.2x\n", byte, PCI_LATENCY_TIMER);
  212. PRINT (" header type = 0x%.2x\n", byte, PCI_HEADER_TYPE);
  213. PRINT (" BIST = 0x%.2x\n", byte, PCI_BIST);
  214. PRINT (" base address 0 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_0);
  215. switch (header_type & 0x03) {
  216. case PCI_HEADER_TYPE_NORMAL: /* "normal" PCI device */
  217. PRINT (" base address 1 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_1);
  218. PRINT (" base address 2 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_2);
  219. PRINT (" base address 3 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_3);
  220. PRINT (" base address 4 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_4);
  221. PRINT (" base address 5 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_5);
  222. PRINT (" cardBus CIS pointer = 0x%.8x\n", dword, PCI_CARDBUS_CIS);
  223. PRINT (" sub system vendor ID = 0x%.4x\n", word, PCI_SUBSYSTEM_VENDOR_ID);
  224. PRINT (" sub system ID = 0x%.4x\n", word, PCI_SUBSYSTEM_ID);
  225. PRINT (" expansion ROM base address = 0x%.8x\n", dword, PCI_ROM_ADDRESS);
  226. PRINT (" interrupt line = 0x%.2x\n", byte, PCI_INTERRUPT_LINE);
  227. PRINT (" interrupt pin = 0x%.2x\n", byte, PCI_INTERRUPT_PIN);
  228. PRINT (" min Grant = 0x%.2x\n", byte, PCI_MIN_GNT);
  229. PRINT (" max Latency = 0x%.2x\n", byte, PCI_MAX_LAT);
  230. break;
  231. case PCI_HEADER_TYPE_BRIDGE: /* PCI-to-PCI bridge */
  232. PRINT (" base address 1 = 0x%.8x\n", dword, PCI_BASE_ADDRESS_1);
  233. PRINT (" primary bus number = 0x%.2x\n", byte, PCI_PRIMARY_BUS);
  234. PRINT (" secondary bus number = 0x%.2x\n", byte, PCI_SECONDARY_BUS);
  235. PRINT (" subordinate bus number = 0x%.2x\n", byte, PCI_SUBORDINATE_BUS);
  236. PRINT (" secondary latency timer = 0x%.2x\n", byte, PCI_SEC_LATENCY_TIMER);
  237. PRINT (" IO base = 0x%.2x\n", byte, PCI_IO_BASE);
  238. PRINT (" IO limit = 0x%.2x\n", byte, PCI_IO_LIMIT);
  239. PRINT (" secondary status = 0x%.4x\n", word, PCI_SEC_STATUS);
  240. PRINT (" memory base = 0x%.4x\n", word, PCI_MEMORY_BASE);
  241. PRINT (" memory limit = 0x%.4x\n", word, PCI_MEMORY_LIMIT);
  242. PRINT (" prefetch memory base = 0x%.4x\n", word, PCI_PREF_MEMORY_BASE);
  243. PRINT (" prefetch memory limit = 0x%.4x\n", word, PCI_PREF_MEMORY_LIMIT);
  244. PRINT (" prefetch memory base upper = 0x%.8x\n", dword, PCI_PREF_BASE_UPPER32);
  245. PRINT (" prefetch memory limit upper = 0x%.8x\n", dword, PCI_PREF_LIMIT_UPPER32);
  246. PRINT (" IO base upper 16 bits = 0x%.4x\n", word, PCI_IO_BASE_UPPER16);
  247. PRINT (" IO limit upper 16 bits = 0x%.4x\n", word, PCI_IO_LIMIT_UPPER16);
  248. PRINT (" expansion ROM base address = 0x%.8x\n", dword, PCI_ROM_ADDRESS1);
  249. PRINT (" interrupt line = 0x%.2x\n", byte, PCI_INTERRUPT_LINE);
  250. PRINT (" interrupt pin = 0x%.2x\n", byte, PCI_INTERRUPT_PIN);
  251. PRINT (" bridge control = 0x%.4x\n", word, PCI_BRIDGE_CONTROL);
  252. break;
  253. case PCI_HEADER_TYPE_CARDBUS: /* PCI-to-CardBus bridge */
  254. PRINT (" capabilities = 0x%.2x\n", byte, PCI_CB_CAPABILITY_LIST);
  255. PRINT (" secondary status = 0x%.4x\n", word, PCI_CB_SEC_STATUS);
  256. PRINT (" primary bus number = 0x%.2x\n", byte, PCI_CB_PRIMARY_BUS);
  257. PRINT (" CardBus number = 0x%.2x\n", byte, PCI_CB_CARD_BUS);
  258. PRINT (" subordinate bus number = 0x%.2x\n", byte, PCI_CB_SUBORDINATE_BUS);
  259. PRINT (" CardBus latency timer = 0x%.2x\n", byte, PCI_CB_LATENCY_TIMER);
  260. PRINT (" CardBus memory base 0 = 0x%.8x\n", dword, PCI_CB_MEMORY_BASE_0);
  261. PRINT (" CardBus memory limit 0 = 0x%.8x\n", dword, PCI_CB_MEMORY_LIMIT_0);
  262. PRINT (" CardBus memory base 1 = 0x%.8x\n", dword, PCI_CB_MEMORY_BASE_1);
  263. PRINT (" CardBus memory limit 1 = 0x%.8x\n", dword, PCI_CB_MEMORY_LIMIT_1);
  264. PRINT (" CardBus IO base 0 = 0x%.4x\n", word, PCI_CB_IO_BASE_0);
  265. PRINT (" CardBus IO base high 0 = 0x%.4x\n", word, PCI_CB_IO_BASE_0_HI);
  266. PRINT (" CardBus IO limit 0 = 0x%.4x\n", word, PCI_CB_IO_LIMIT_0);
  267. PRINT (" CardBus IO limit high 0 = 0x%.4x\n", word, PCI_CB_IO_LIMIT_0_HI);
  268. PRINT (" CardBus IO base 1 = 0x%.4x\n", word, PCI_CB_IO_BASE_1);
  269. PRINT (" CardBus IO base high 1 = 0x%.4x\n", word, PCI_CB_IO_BASE_1_HI);
  270. PRINT (" CardBus IO limit 1 = 0x%.4x\n", word, PCI_CB_IO_LIMIT_1);
  271. PRINT (" CardBus IO limit high 1 = 0x%.4x\n", word, PCI_CB_IO_LIMIT_1_HI);
  272. PRINT (" interrupt line = 0x%.2x\n", byte, PCI_INTERRUPT_LINE);
  273. PRINT (" interrupt pin = 0x%.2x\n", byte, PCI_INTERRUPT_PIN);
  274. PRINT (" bridge control = 0x%.4x\n", word, PCI_CB_BRIDGE_CONTROL);
  275. PRINT (" subvendor ID = 0x%.4x\n", word, PCI_CB_SUBSYSTEM_VENDOR_ID);
  276. PRINT (" subdevice ID = 0x%.4x\n", word, PCI_CB_SUBSYSTEM_ID);
  277. PRINT (" PC Card 16bit base address = 0x%.8x\n", dword, PCI_CB_LEGACY_MODE_BASE);
  278. break;
  279. default:
  280. printf("unknown header\n");
  281. break;
  282. }
  283. #undef PRINT
  284. #undef PRINT2
  285. }
  286. /* Convert the "bus.device.function" identifier into a number.
  287. */
  288. static pci_dev_t get_pci_dev(char* name)
  289. {
  290. char cnum[12];
  291. int len, i, iold, n;
  292. int bdfs[3] = {0,0,0};
  293. len = strlen(name);
  294. if (len > 8)
  295. return -1;
  296. for (i = 0, iold = 0, n = 0; i < len; i++) {
  297. if (name[i] == '.') {
  298. memcpy(cnum, &name[iold], i - iold);
  299. cnum[i - iold] = '\0';
  300. bdfs[n++] = simple_strtoul(cnum, NULL, 16);
  301. iold = i + 1;
  302. }
  303. }
  304. strcpy(cnum, &name[iold]);
  305. if (n == 0)
  306. n = 1;
  307. bdfs[n] = simple_strtoul(cnum, NULL, 16);
  308. return PCI_BDF(bdfs[0], bdfs[1], bdfs[2]);
  309. }
  310. static int pci_cfg_display(pci_dev_t bdf, ulong addr, ulong size, ulong length)
  311. {
  312. #define DISP_LINE_LEN 16
  313. ulong i, nbytes, linebytes;
  314. int rc = 0;
  315. if (length == 0)
  316. length = 0x40 / size; /* Standard PCI configuration space */
  317. /* Print the lines.
  318. * once, and all accesses are with the specified bus width.
  319. */
  320. nbytes = length * size;
  321. do {
  322. uint val4;
  323. ushort val2;
  324. u_char val1;
  325. printf("%08lx:", addr);
  326. linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
  327. for (i=0; i<linebytes; i+= size) {
  328. if (size == 4) {
  329. pci_read_config_dword(bdf, addr, &val4);
  330. printf(" %08x", val4);
  331. } else if (size == 2) {
  332. pci_read_config_word(bdf, addr, &val2);
  333. printf(" %04x", val2);
  334. } else {
  335. pci_read_config_byte(bdf, addr, &val1);
  336. printf(" %02x", val1);
  337. }
  338. addr += size;
  339. }
  340. printf("\n");
  341. nbytes -= linebytes;
  342. if (ctrlc()) {
  343. rc = 1;
  344. break;
  345. }
  346. } while (nbytes > 0);
  347. return (rc);
  348. }
  349. static int pci_cfg_write (pci_dev_t bdf, ulong addr, ulong size, ulong value)
  350. {
  351. if (size == 4) {
  352. pci_write_config_dword(bdf, addr, value);
  353. }
  354. else if (size == 2) {
  355. ushort val = value & 0xffff;
  356. pci_write_config_word(bdf, addr, val);
  357. }
  358. else {
  359. u_char val = value & 0xff;
  360. pci_write_config_byte(bdf, addr, val);
  361. }
  362. return 0;
  363. }
  364. static int
  365. pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag)
  366. {
  367. ulong i;
  368. int nbytes;
  369. extern char console_buffer[];
  370. uint val4;
  371. ushort val2;
  372. u_char val1;
  373. /* Print the address, followed by value. Then accept input for
  374. * the next value. A non-converted value exits.
  375. */
  376. do {
  377. printf("%08lx:", addr);
  378. if (size == 4) {
  379. pci_read_config_dword(bdf, addr, &val4);
  380. printf(" %08x", val4);
  381. }
  382. else if (size == 2) {
  383. pci_read_config_word(bdf, addr, &val2);
  384. printf(" %04x", val2);
  385. }
  386. else {
  387. pci_read_config_byte(bdf, addr, &val1);
  388. printf(" %02x", val1);
  389. }
  390. nbytes = readline (" ? ");
  391. if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
  392. /* <CR> pressed as only input, don't modify current
  393. * location and move to next. "-" pressed will go back.
  394. */
  395. if (incrflag)
  396. addr += nbytes ? -size : size;
  397. nbytes = 1;
  398. #ifdef CONFIG_BOOT_RETRY_TIME
  399. reset_cmd_timeout(); /* good enough to not time out */
  400. #endif
  401. }
  402. #ifdef CONFIG_BOOT_RETRY_TIME
  403. else if (nbytes == -2) {
  404. break; /* timed out, exit the command */
  405. }
  406. #endif
  407. else {
  408. char *endp;
  409. i = simple_strtoul(console_buffer, &endp, 16);
  410. nbytes = endp - console_buffer;
  411. if (nbytes) {
  412. #ifdef CONFIG_BOOT_RETRY_TIME
  413. /* good enough to not time out
  414. */
  415. reset_cmd_timeout();
  416. #endif
  417. pci_cfg_write (bdf, addr, size, i);
  418. if (incrflag)
  419. addr += size;
  420. }
  421. }
  422. } while (nbytes);
  423. return 0;
  424. }
  425. /* PCI Configuration Space access commands
  426. *
  427. * Syntax:
  428. * pci display[.b, .w, .l] bus.device.function} [addr] [len]
  429. * pci next[.b, .w, .l] bus.device.function [addr]
  430. * pci modify[.b, .w, .l] bus.device.function [addr]
  431. * pci write[.b, .w, .l] bus.device.function addr value
  432. */
  433. int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  434. {
  435. ulong addr = 0, value = 0, size = 0;
  436. pci_dev_t bdf = 0;
  437. char cmd = 's';
  438. if (argc > 1)
  439. cmd = argv[1][0];
  440. switch (cmd) {
  441. case 'd': /* display */
  442. case 'n': /* next */
  443. case 'm': /* modify */
  444. case 'w': /* write */
  445. /* Check for a size specification. */
  446. size = cmd_get_data_size(argv[1], 4);
  447. if (argc > 3)
  448. addr = simple_strtoul(argv[3], NULL, 16);
  449. if (argc > 4)
  450. value = simple_strtoul(argv[4], NULL, 16);
  451. case 'h': /* header */
  452. if (argc < 3)
  453. goto usage;
  454. if ((bdf = get_pci_dev(argv[2])) == -1)
  455. return 1;
  456. break;
  457. default: /* scan bus */
  458. value = 1; /* short listing */
  459. bdf = 0; /* bus number */
  460. if (argc > 1) {
  461. if (argv[argc-1][0] == 'l') {
  462. value = 0;
  463. argc--;
  464. }
  465. if (argc > 1)
  466. bdf = simple_strtoul(argv[1], NULL, 16);
  467. }
  468. pciinfo(bdf, value);
  469. return 0;
  470. }
  471. switch (argv[1][0]) {
  472. case 'h': /* header */
  473. pci_header_show(bdf);
  474. return 0;
  475. case 'd': /* display */
  476. return pci_cfg_display(bdf, addr, size, value);
  477. case 'n': /* next */
  478. if (argc < 4)
  479. goto usage;
  480. return pci_cfg_modify(bdf, addr, size, value, 0);
  481. case 'm': /* modify */
  482. if (argc < 4)
  483. goto usage;
  484. return pci_cfg_modify(bdf, addr, size, value, 1);
  485. case 'w': /* write */
  486. if (argc < 5)
  487. goto usage;
  488. return pci_cfg_write(bdf, addr, size, value);
  489. }
  490. return 1;
  491. usage:
  492. printf ("Usage:\n%s\n", cmdtp->usage);
  493. return 1;
  494. }
  495. /***************************************************/
  496. U_BOOT_CMD(
  497. pci, 5, 1, do_pci,
  498. "pci - list and access PCI Configuration Space\n",
  499. "[bus] [long]\n"
  500. " - short or long list of PCI devices on bus 'bus'\n"
  501. "pci header b.d.f\n"
  502. " - show header of PCI device 'bus.device.function'\n"
  503. "pci display[.b, .w, .l] b.d.f [address] [# of objects]\n"
  504. " - display PCI configuration space (CFG)\n"
  505. "pci next[.b, .w, .l] b.d.f address\n"
  506. " - modify, read and keep CFG address\n"
  507. "pci modify[.b, .w, .l] b.d.f address\n"
  508. " - modify, auto increment CFG address\n"
  509. "pci write[.b, .w, .l] b.d.f address value\n"
  510. " - write to CFG address\n"
  511. );