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