Changeset 8c877b2 in mainline for uspace/drv/uhci-hcd/pci.c


Ignore:
Timestamp:
2011-03-04T13:05:35Z (14 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d49728c
Parents:
dff940f8 (diff), 9a422574 (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:

merge with \usb\development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/pci.c

    rdff940f8 r8c877b2  
    3838#include <devman.h>
    3939#include <device/hw_res.h>
     40
     41#include <usb/debug.h>
     42#include <pci_dev_iface.h>
    4043
    4144#include "pci.h"
     
    8386                                irq = res->res.interrupt.irq;
    8487                                irq_found = true;
     88                                usb_log_debug2("Found interrupt: %d.\n", irq);
    8589                                break;
    8690                        case IO_RANGE:
    87                                 io_address = (uintptr_t)
    88                                     res->res.io_range.address;
     91                                io_address = res->res.io_range.address;
    8992                                io_size = res->res.io_range.size;
     93                                usb_log_debug2("Found io: %llx %zu.\n",
     94                                    res->res.io_range.address, res->res.io_range.size);
    9095                                io_found = true;
    9196                                break;
     
    105110        }
    106111
    107         if (io_reg_address != NULL) {
    108                 *io_reg_address = io_address;
    109         }
    110         if (io_reg_size != NULL) {
    111                 *io_reg_size = io_size;
    112         }
    113         if (irq_no != NULL) {
    114                 *irq_no = irq;
    115         }
     112        *io_reg_address = io_address;
     113        *io_reg_size = io_size;
     114        *irq_no = irq;
    116115
    117116        rc = EOK;
     
    127126            IPC_FLAG_BLOCKING);
    128127        bool enabled = hw_res_enable_interrupt(parent_phone);
     128        async_hangup(parent_phone);
    129129        return enabled ? EOK : EIO;
    130130}
     131/*----------------------------------------------------------------------------*/
     132int pci_disable_legacy(ddf_dev_t *device)
     133{
     134        assert(device);
     135        int parent_phone = devman_parent_device_connect(device->handle,
     136                IPC_FLAG_BLOCKING);
     137        if (parent_phone < 0) {
     138                return parent_phone;
     139        }
     140
     141        /* See UHCI design guide for these values,
     142         * write all WC bits in USB legacy register */
     143        sysarg_t address = 0xc0;
     144        sysarg_t value = 0x8f00;
     145
     146  int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
     147            IPC_M_CONFIG_SPACE_WRITE_16, address, value);
     148        async_hangup(parent_phone);
     149
     150  return rc;
     151}
     152/*----------------------------------------------------------------------------*/
    131153/**
    132154 * @}
Note: See TracChangeset for help on using the changeset viewer.