source: rtems/cpukit/libpci/pci_cfg.c @ 358b8543

4.115
Last change on this file since 358b8543 was a31845f7, checked in by Daniel Hellstrom <daniel@…>, on 11/28/11 at 09:11:10

LIBPCI: added PCI layer to cpukit/libpci

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*  PCI Configuration Library
2 *
3 *  COPYRIGHT (c) 2010.
4 *  Cobham Gaisler AB.
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 */
10
11#include <pci/cfg.h>
12
13/* Number of buses. This is set from respective library */
14int pci_bus_cnt = 0;
15
16/* PCI Address assigned to BARs which failed to fit into the PCI Window or
17 * is disabled by any other cause.
18 */
19uint32_t pci_invalid_address = 0;
20
21/* PCI System type. Configuration Library setup this */
22int pci_system_type = PCI_SYSTEM_NONE;
23
24/* PCI Endianness.
25 *
26 * Host driver or BSP must override this be writing here if bus is defined
27 * as non-standard big-endian.
28 */
29int pci_endian = PCI_LITTLE_ENDIAN;
30
31/* Configure PCI devices and bridges, and setup the RAM data structures
32 * describing the PCI devices currently present in the system
33 */
34int pci_config_init(void)
35{
36        if (pci_config_lib_init)
37                return pci_config_lib_init();
38        else
39                return 0;
40}
41
42void pci_config_register(void *config)
43{
44        if (pci_config_lib_register)
45                pci_config_lib_register(config);
46}
47
48/* Return the number of PCI busses available in the system, note that
49 * there are always one bus (bus0) after the PCI library has been
50 * initialized and a driver has been registered.
51 */
52int pci_bus_count(void)
53{
54        return pci_bus_cnt;
55}
Note: See TracBrowser for help on using the repository browser.