Changeset cc44f7e in mainline for uspace/drv/pciintel/pci.c


Ignore:
Timestamp:
2011-02-28T13:04:21Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b5644c, 494eaf7, 51b46f2
Parents:
81c508c (diff), dced52a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

hc and rh work

Support for low speed devices
RH iospace obtained from parent hc driver
proper hc initialization
Debug messages reworked
intelpci adressspace size fix (read the warning)

File:
1 edited

Legend:

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

    r81c508c rcc44f7e  
    320320        /* Get the value of the BAR. */
    321321        val = pci_conf_read_32(fun, addr);
     322
     323#define IO_MASK  (~0x3)
     324#define MEM_MASK (~0xf)
    322325       
    323326        io = (bool) (val & 1);
    324327        if (io) {
    325328                addrw64 = false;
     329                mask = IO_MASK;
    326330        } else {
     331                mask = MEM_MASK;
    327332                switch ((val >> 1) & 3) {
    328333                case 0:
     
    340345        /* Get the address mask. */
    341346        pci_conf_write_32(fun, addr, 0xffffffff);
    342         mask = pci_conf_read_32(fun, addr);
     347        mask &= pci_conf_read_32(fun, addr);
    343348       
    344349        /* Restore the original value. */
     
    659664size_t pci_bar_mask_to_size(uint32_t mask)
    660665{
    661         return ((mask & 0xfffffff0) ^ 0xffffffff) + 1;
     666        size_t size = mask & ~(mask - 1);
     667        return size;
    662668}
    663669
Note: See TracChangeset for help on using the changeset viewer.