Changeset 230385c in mainline for uspace/drv/bus/pci/pciintel/pci.c


Ignore:
Timestamp:
2012-01-24T02:41:51Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
690d2e7
Parents:
948911d
Message:

pci: Setup addr port and data port separately.

We will need this for non-pc pci.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/pci/pciintel/pci.c

    r948911d r230385c  
    650650        got_res = true;
    651651       
     652       
     653        assert(hw_resources.count > 1);
     654        assert(hw_resources.resources[0].type == IO_RANGE);
     655        assert(hw_resources.resources[0].res.io_range.size >= 4);
     656       
     657        assert(hw_resources.resources[1].type == IO_RANGE);
     658        assert(hw_resources.resources[1].res.io_range.size >= 4);
     659       
    652660        ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".",
    653661            hw_resources.resources[0].res.io_range.address);
    654        
    655         assert(hw_resources.count > 0);
    656         assert(hw_resources.resources[0].type == IO_RANGE);
    657         assert(hw_resources.resources[0].res.io_range.size == 8);
     662        ddf_msg(LVL_DEBUG, "data_addr = %" PRIx64 ".",
     663            hw_resources.resources[1].res.io_range.address);
    658664       
    659665        bus->conf_io_addr =
    660666            (uint32_t) hw_resources.resources[0].res.io_range.address;
    661        
    662         if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8,
     667        bus->conf_io_data =
     668            (uint32_t) hw_resources.resources[1].res.io_range.address;
     669       
     670        if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 4,
    663671            &bus->conf_addr_port)) {
    664672                ddf_msg(LVL_ERROR, "Failed to enable configuration ports.");
     
    666674                goto fail;
    667675        }
    668         bus->conf_data_port = (char *) bus->conf_addr_port + 4;
     676        if (pio_enable((void *)(uintptr_t)bus->conf_io_data, 4,
     677            &bus->conf_data_port)) {
     678                ddf_msg(LVL_ERROR, "Failed to enable configuration ports.");
     679                rc = EADDRNOTAVAIL;
     680                goto fail;
     681        }
    669682       
    670683        /* Make the bus device more visible. It has no use yet. */
Note: See TracChangeset for help on using the changeset viewer.