Changeset ab414a6 in mainline


Ignore:
Timestamp:
2011-02-28T20:07:06Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ef0d6d
Parents:
99e6bfb
Message:

Use aaccess routines to disable USB Legacy

Location:
uspace/drv/uhci-hcd
Files:
3 edited

Legend:

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

    r99e6bfb rab414a6  
    3434#include <ddf/driver.h>
    3535#include <ddf/interrupt.h>
     36#include <device/hw_res.h>
     37#include <errno.h>
     38#include <str_error.h>
     39
    3640#include <usb_iface.h>
    3741#include <usb/ddfiface.h>
    38 #include <device/hw_res.h>
    39 
    40 #include <errno.h>
    41 
    4242#include <usb/debug.h>
    4343
     
    9494        usb_log_info("I/O regs at 0x%X (size %zu), IRQ %d.\n",
    9595            io_reg_base, io_reg_size, irq);
     96
     97        ret = pci_disable_legacy(device);
     98        CHECK_RET_FREE_HC_RETURN(ret,
     99            "Failed(%d) disable legacy USB: %s.\n", ret, str_error(ret));
    96100
    97101//      ret = pci_enable_interrupts(device);
  • uspace/drv/uhci-hcd/pci.c

    r99e6bfb rab414a6  
    4040
    4141#include <usb/debug.h>
     42#include <pci_dev_iface.h>
    4243
    4344#include "pci.h"
     
    128129        return enabled ? EOK : EIO;
    129130}
     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  sysarg_t address = 0xc0;
     142        sysarg_t value = 0xb0;
     143
     144        usb_log_warning("phone %d, iface %d(%d), method %d, address %#x, value %#x.\n",
     145            parent_phone,DEV_IFACE_ID(PCI_DEV_IFACE), PCI_DEV_IFACE, IPC_M_CONFIG_SPACE_WRITE_16, address, value);
     146
     147  int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
     148            IPC_M_CONFIG_SPACE_WRITE_16, address, value);
     149        async_hangup(parent_phone);
     150
     151  return rc;
     152}
     153/*----------------------------------------------------------------------------*/
    130154/**
    131155 * @}
  • uspace/drv/uhci-hcd/pci.h

    r99e6bfb rab414a6  
    4040int pci_get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *);
    4141int pci_enable_interrupts(ddf_dev_t *);
     42int pci_disable_legacy(ddf_dev_t *);
    4243
    4344#endif
Note: See TracChangeset for help on using the changeset viewer.