cmd_pci.c 17 KB

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