Ignore:
Timestamp:
2017-10-17T13:11:35Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60af4cdb
Parents:
dbf32b1 (diff), a416d070 (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 mainline

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/adb/cuda_adb/cuda_hw.h

    rdbf32b1 r95c675b  
    3434 */
    3535
    36 #ifndef CUDA_ADB_H_
    37 #define CUDA_ADB_H_
     36#ifndef CUDA_HW_H_
     37#define CUDA_HW_H_
    3838
    39 #include <stddef.h>
    4039#include <stdint.h>
    41 #include <async.h>
    42 #include <fibril_synch.h>
    4340
    44 typedef struct {
     41typedef struct cuda_regs {
    4542        uint8_t b;
    4643        uint8_t pad0[0x1ff];
     
    9087        uint8_t anh;
    9188        uint8_t pad15[0x1ff];
    92 } cuda_t;
     89} cuda_regs_t;
     90
     91/** B register fields */
     92enum {
     93        TREQ    = 0x08,
     94        TACK    = 0x10,
     95        TIP     = 0x20
     96};
     97
     98/** IER register fields */
     99enum {
     100        IER_CLR = 0x00,
     101        IER_SET = 0x80,
     102
     103        SR_INT  = 0x04,
     104        ALL_INT = 0x7f
     105};
     106
     107/** ACR register fields */
     108enum {
     109        SR_OUT  = 0x10
     110};
     111
     112/** Packet types */
     113enum {
     114        PT_ADB  = 0x00,
     115        PT_CUDA = 0x01
     116};
     117
     118/** CUDA packet types */
     119enum {
     120        CPT_AUTOPOLL    = 0x01
     121};
    93122
    94123enum {
    95         CUDA_RCV_BUF_SIZE = 5
     124        ADB_MAX_ADDR    = 16
    96125};
    97 
    98 enum cuda_xfer_state {
    99         cx_listen,
    100         cx_receive,
    101         cx_rcv_end,
    102         cx_send_start,
    103         cx_send
    104 };
    105 
    106 typedef struct {
    107         service_id_t service_id;
    108         async_sess_t *client_sess;
    109 } adb_dev_t;
    110 
    111 typedef struct {
    112         cuda_t *cuda;
    113         uintptr_t cuda_physical;
    114 
    115         uint8_t rcv_buf[CUDA_RCV_BUF_SIZE];
    116         uint8_t snd_buf[CUDA_RCV_BUF_SIZE];
    117         size_t bidx;
    118         size_t snd_bytes;
    119         enum cuda_xfer_state xstate;
    120         fibril_mutex_t dev_lock;
    121 } cuda_instance_t;
    122126
    123127#endif
Note: See TracChangeset for help on using the changeset viewer.