Ignore:
Timestamp:
Mar 3, 2016, 4:36:24 PM (4 years ago)
Author:
Joel Sherrill <joel@…>
Branches:
master
Children:
c3c57b1
Parents:
36717645
git-author:
Joel Sherrill <joel@…> (03/03/16 16:36:24)
git-committer:
Joel Sherrill <joel@…> (03/10/16 16:30:25)
Message:

Add shared PCI support and enhance pc386 to support non-legacy PCI configuration space

This patch fundamentally results from enhancements to the pc386 BSP
to support systems which do NOT have the legacy PCI BIOS. The
patch adds support for detecting when legacy PCI BIOS is not
present and then using IO space to access to PCI Configuration Space.
This resulted in dynamically selected between two implementations
of PCI and refactoring out the shared methods.

This patch adds shared implementations of pci_bus_count() and
pci_find_device(). Subsequent patches will remove implementations
of these methods in other BSPs where possible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r36717645 rf770fcb  
    3535
    3636/*
     37 * PCI Bus Configuration
     38 */
     39rtems_pci_config_t BSP_pci_configuration = {
     40  (volatile unsigned char*)0,
     41  (volatile unsigned char*)0,
     42  NULL
     43};
     44
     45/*
    3746 * Helper to initialize the PCI Bus
    3847 */
     
    4049{
    4150#if (BSP_IS_EDISON == 0)
    42   int pci_init_retval;
     51  const pci_config_access_functions *pci_accessors;
    4352
    44   pci_init_retval = pci_initialize();
    45   if (pci_init_retval != PCIB_ERR_SUCCESS) {
    46       printk("PCI bus: could not initialize PCI BIOS interface\n");
     53  pci_accessors = pci_bios_initialize();
     54  if (pci_accessors != NULL) {
     55    printk("PCI bus: using PCI BIOS interface\n");
     56    BSP_pci_configuration.pci_functions = pci_accessors;
     57    return;
    4758  }
     59
     60  pci_accessors = pci_io_initialize();
     61  if (pci_accessors != NULL) {
     62    printk("PCI bus: using PCI I/O interface\n");
     63    BSP_pci_configuration.pci_functions = pci_accessors;
     64    return;
     65  }
     66
     67  printk("PCI bus: could not initialize PCI BIOS interface\n");
    4868#endif
    4969}
     
    6585  *edison_wd = 0x11f8;
    6686#endif
    67 
    6887
    6988  /*
Note: See TracChangeset for help on using the changeset viewer.