This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

eCos device driver hardware address space.


   The particular PCI device I'm working with requires that I map some
range of hardware addresses to a range on a VME bus. I unfortunately do
not know which ranges of hardware addresses are available for this
mapping. The cyg library has a generic manner of setting up these
memory spaces for values located in the config-space of the PCI device.

IE:

cyg_pci_init(); //Initialize PCI.

unsigned int temp, ba, status;

if(cyg_pci_find_device(0x10E3, 0x0000, &uni_pci_dev_id))
{
cyg_pci_get_device_info(uni_pci_dev_id, &uni_pci_dev);

    cyg_pci_write_config_uint32(uni_pci_dev_id, LINT_MAP0, 0x00000000);

    if(cyg_pci_configure_device(&uni_pci_dev))
    {
      /*
      diag_printf("Universe maping:\n");
      for(i = 0; i < 6; i ++)
      {
        diag_printf("  %d: %d:%08X:%08X\n", i,
uni_pci_dev.base_size[i],uni_pci_dev.base_address[i],
uni_pci_dev.base_map[i]);
        }*/
      diag_printf("Universe device found.");

      // Turn latency off
      cyg_pci_write_config_uint32(uni_pci_dev_id, PCI_MISC0, 0);


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]