#define BRCM_BDC_NAME "bdc" #define BRCM_BDC_DESC "Broadcom USB Device Controller driver"
#define DMA_ADDR_INVALID (~(dma_addr_t)0)
/* BDC command operation timeout in usec*/ #define BDC_CMD_TIMEOUT 1000 /* BDC controller operation timeout in usec*/ #define BDC_COP_TIMEOUT 500
/* * Maximum size of ep0 response buffer for ch9 requests, * the set_sel request uses 6 so far, the max.
*/ #define EP0_RESPONSE_BUFF 6 /* Start with SS as default */ #define EP0_MAX_PKT_SIZE 512
/* 64 entries in a SRR */ #define NUM_SR_ENTRIES 64
/* Num of bds per table */ #define NUM_BDS_PER_TABLE 64
/* Num of tables in bd list for control,bulk and Int ep */ #define NUM_TABLES 2
/* Num of tables in bd list for Isoch ep */ #define NUM_TABLES_ISOCH 6
/* One BD can transfer max 65536 bytes */ #define BD_MAX_BUFF_SIZE (1 << 16) /* Maximum bytes in one XFR, Refer to BDC spec */ #define MAX_XFR_LEN 16777215
/* defines for Force Header command */ #define DEV_NOTF_TYPE 6 #define FWK_SUBTYPE 1 #define TRA_PACKET 4
/* On disconnect, preserve these bits and clear rest */ #define DEVSTATUS_CLEAR (1 << USB_DEVICE_SELF_POWERED) /* Hardware and software Data structures */
/* Status report in Status report ring(srr) */ struct bdc_sr {
__le32 offset[4];
};
/* bd_table: contiguous bd's in a table */ struct bd_table { struct bdc_bd *start_bd; /* dma address of start bd of table*/
dma_addr_t dma;
};
/* * Each endpoint has a bdl(buffer descriptor list), bdl consists of 1 or more bd * table's chained to each other through a chain bd, every table has equal * number of bds. the software uses bdi(bd index) to refer to particular bd in * the list.
*/ struct bd_list { /* Array of bd table pointers*/ struct bd_table **bd_table_array; /* How many tables chained to each other */ int num_tabs; /* Max_bdi = num_tabs * num_bds_table - 1 */ int max_bdi; /* current enq bdi from sw point of view */ int eqp_bdi; /* current deq bdi from sw point of view */ int hwd_bdi; /* numbers of bds per table */ int num_bds_table;
};
struct bdc_req;
/* Representation of a transfer, one transfer can have multiple bd's */ struct bd_transfer { struct bdc_req *req; /* start bd index */ int start_bdi; /* this will be the next hw dqp when this transfer completes */ int next_hwd_bdi; /* number of bds in this transfer */ int num_bds;
};
/* * Representation of a gadget request, every gadget request is contained * by 1 bd_transfer.
*/ struct bdc_req { struct usb_request usb_req; struct list_head queue; struct bdc_ep *ep; /* only one Transfer per request */ struct bd_transfer bd_xfr; int epnum;
};
/* status report ring(srr), currently one srr is supported for entire system */ struct srr { struct bdc_sr *sr_bds;
u16 eqp_index;
u16 dqp_index;
dma_addr_t dma_addr;
};
/* generic phy */ struct phy **phys; int num_phys; /* num of endpoints for a particular instantiation of IP */ unsignedint num_eps; /* * Array of ep's, it uses the same index covention as bdc hw i.e. * 1 for ep0, 2 for 1out,3 for 1in ....
*/ struct bdc_ep **bdc_ep_array; void __iomem *regs; struct bdc_scratchpad scratchpad;
u32 sp_buff_size; /* current driver supports 1 status ring */ struct srr srr; /* Last received setup packet */ struct usb_ctrlrequest setup_pkt; struct bdc_req ep0_req; struct bdc_req status_req; enum bdc_ep0_state ep0_state; bool delayed_status; bool zlp_needed; bool reinit; bool pullup; /* Bits 0-15 are standard and 16-31 for proprietary information */
u32 devstatus; int irq; void *mem;
u32 dev_addr; /* DMA pools */ struct dma_pool *bd_table_pool;
u8 test_mode; /* array of callbacks for various status report handlers */ void (*sr_handler[2])(struct bdc *, struct bdc_sr *); /* ep0 callback handlers */ void (*sr_xsf_ep0[3])(struct bdc *, struct bdc_sr *); /* ep0 response buffer for ch9 requests like GET_STATUS and SET_SEL */ unsignedchar ep0_response_buff[EP0_RESPONSE_BUFF]; /* * Timer to check if host resumed transfer after bdc sent Func wake * notification packet after a remote wakeup. if not, then resend the * Func Wake packet every 2.5 secs. Refer to USB3 spec section 8.5.6.4
*/ struct delayed_work func_wake_notify; struct clk *clk;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.