Changeset 78ab6d4 in mainline for uspace/drv/bus/usb/ohci/ohci_regs.h


Ignore:
Timestamp:
2011-07-10T22:45:08Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4d62aa0
Parents:
1f6eb7d
Message:

OHCI: Device access fixes.

Only access Legacy support registers if their presence is indicated.
Fix setting host controller functional state, it's 2 bit value and standard
& and | operators are not enough.
Some comment fixes.

Tested on vbox.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_regs.h

    r1f6eb7d r78ab6d4  
    3636#include <stdint.h>
    3737
     38#define LEGACY_REGS_OFFSET 0x100
     39
    3840/** OHCI memory mapped registers structure */
    3941typedef struct ohci_regs {
    4042        const volatile uint32_t revision;
     43#define R_REVISION_MASK (0x3f)
     44#define R_REVISION_SHIFT (0)
     45#define R_LEGACY_FLAG   (0x80)
     46
    4147        volatile uint32_t control;
    4248#define C_CSBR_MASK (0x3) /* Control-bulk service ratio */
     
    5864#define C_HCFS_SUSPEND     (0x3)
    5965#define C_HCFS_SHIFT       (6)
     66
     67#define C_HCFS_GET(reg) \
     68        ((reg >> C_HCFS_SHIFT) & C_HCFS_MASK)
     69#define C_HCFS_SET(reg, hcfs_state) \
     70do { \
     71        reg = (reg & ~(C_HCFS_MASK << C_HCFS_SHIFT)) \
     72            | ((hcfs_state & C_HCFS_MASK) << C_HCFS_SHIFT); \
     73} while (0)
     74
    6075
    6176#define C_IR  (1 << 8)   /* Interrupt routing, make sure it's 0 */
Note: See TracChangeset for help on using the changeset viewer.