Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset af81980 in mainline


Ignore:
Timestamp:
2011-04-23T00:13:23Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
302a4b6
Parents:
77d10f0
Message:

Add UHCI interrupt pseudocode irq sharing support (kernel does not)

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

Legend:

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

    r77d10f0 raf81980  
    4444#include "hc.h"
    4545
     46#define UHCI_SUPPORTED_INTERRUPTS \
     47    (UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET)
     48
    4649static int hc_init_transfer_lists(hc_t *instance);
    4750static int hc_init_mem_structures(hc_t *instance);
     
    135138                /* Enable all interrupts, but resume interrupt */
    136139                pio_write_16(&instance->registers->usbintr,
    137                     UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET);
     140                    UHCI_SUPPORTED_INTERRUPTS);
    138141        }
    139142
     
    170173        instance->interrupt_code.cmds = instance->interrupt_commands;
    171174        {
     175                /* Read status register */
    172176                instance->interrupt_commands[0].cmd = CMD_PIO_READ_16;
    173177                instance->interrupt_commands[0].dstarg = 1;
     
    175179                    &instance->registers->usbsts;
    176180
    177                 instance->interrupt_commands[1].cmd = CMD_PIO_WRITE_16;
    178                 instance->interrupt_commands[1].value = 0x1f;
    179                 instance->interrupt_commands[1].addr =
     181                /* Test whether we are the interrupt cause */
     182                instance->interrupt_commands[1].cmd = CMD_BTEST;
     183                instance->interrupt_commands[1].value =
     184                    UHCI_SUPPORTED_INTERRUPTS;
     185                instance->interrupt_commands[1].srcarg = 1;
     186                instance->interrupt_commands[1].dstarg = 2;
     187
     188                /* Predicate cleaning and accepting */
     189                instance->interrupt_commands[2].cmd = CMD_PREDICATE;
     190                instance->interrupt_commands[2].value = 2;
     191                instance->interrupt_commands[2].srcarg = 2;
     192
     193                /* Write clean status register */
     194                instance->interrupt_commands[3].cmd = CMD_PIO_WRITE_A_16;
     195                instance->interrupt_commands[3].srcarg = 1;
     196                instance->interrupt_commands[3].addr =
    180197                    &instance->registers->usbsts;
    181198
    182                 instance->interrupt_commands[2].cmd = CMD_ACCEPT;
     199                /* Accept interrupt */
     200                instance->interrupt_commands[4].cmd = CMD_ACCEPT;
     201
    183202                instance->interrupt_code.cmdcount = UHCI_NEEDED_IRQ_COMMANDS;
    184203        }
  • uspace/drv/uhci-hcd/hc.h

    r77d10f0 raf81980  
    9191#define UHCI_DEBUGER_TIMEOUT 5000000
    9292#define UHCI_ALLOWED_HW_FAIL 5
    93 #define UHCI_NEEDED_IRQ_COMMANDS 3
     93#define UHCI_NEEDED_IRQ_COMMANDS 5
    9494
    9595/* Main HC driver structure */
  • uspace/drv/uhci-hcd/pci.c

    r77d10f0 raf81980  
    146146         * write all WC bits in USB legacy register */
    147147        sysarg_t address = 0xc0;
    148         sysarg_t value = 0x8f00;
     148        sysarg_t value = 0xaf00;
    149149
    150150        int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
Note: See TracChangeset for help on using the changeset viewer.