1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Mentor USB OTG Core host controller driver.
5 * Copyright (c) 2008 Texas Instruments
7 * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments
10 #ifndef __MUSB_HCD_H__
11 #define __MUSB_HCD_H__
13 #include "musb_core.h"
14 #ifdef CONFIG_USB_KEYBOARD
15 #include <stdio_dev.h>
16 extern unsigned char new[];
19 #ifndef CONFIG_USB_MUSB_TIMEOUT
20 # define CONFIG_USB_MUSB_TIMEOUT 100000
23 /* This defines the endpoint number used for control transfers */
24 #define MUSB_CONTROL_EP 0
26 /* This defines the endpoint number used for bulk transfer */
28 # define MUSB_BULK_EP 1
31 /* This defines the endpoint number used for interrupt transfer */
32 #define MUSB_INTR_EP 2
34 /* Determine the operating speed of MUSB core */
35 #define musb_ishighspeed() \
36 ((readb(&musbr->power) & MUSB_POWER_HSMODE) \
37 >> MUSB_POWER_HSMODE_SHIFT)
39 /* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
41 /* destination of request */
42 #define RH_INTERFACE 0x01
43 #define RH_ENDPOINT 0x02
47 #define RH_VENDOR 0x40
49 /* Requests: bRequest << 8 | bmRequestType */
50 #define RH_GET_STATUS 0x0080
51 #define RH_CLEAR_FEATURE 0x0100
52 #define RH_SET_FEATURE 0x0300
53 #define RH_SET_ADDRESS 0x0500
54 #define RH_GET_DESCRIPTOR 0x0680
55 #define RH_SET_DESCRIPTOR 0x0700
56 #define RH_GET_CONFIGURATION 0x0880
57 #define RH_SET_CONFIGURATION 0x0900
58 #define RH_GET_STATE 0x0280
59 #define RH_GET_INTERFACE 0x0A80
60 #define RH_SET_INTERFACE 0x0B00
61 #define RH_SYNC_FRAME 0x0C80
62 /* Our Vendor Specific Request */
63 #define RH_SET_EP 0x2000
65 /* Hub port features */
66 #define RH_PORT_CONNECTION 0x00
67 #define RH_PORT_ENABLE 0x01
68 #define RH_PORT_SUSPEND 0x02
69 #define RH_PORT_OVER_CURRENT 0x03
70 #define RH_PORT_RESET 0x04
71 #define RH_PORT_POWER 0x08
72 #define RH_PORT_LOW_SPEED 0x09
74 #define RH_C_PORT_CONNECTION 0x10
75 #define RH_C_PORT_ENABLE 0x11
76 #define RH_C_PORT_SUSPEND 0x12
77 #define RH_C_PORT_OVER_CURRENT 0x13
78 #define RH_C_PORT_RESET 0x14
81 #define RH_C_HUB_LOCAL_POWER 0x00
82 #define RH_C_HUB_OVER_CURRENT 0x01
84 #define RH_DEVICE_REMOTE_WAKEUP 0x00
85 #define RH_ENDPOINT_STALL 0x01
91 /* extern functions */
92 extern int musb_platform_init(void);
93 extern void musb_platform_deinit(void);
95 #endif /* __MUSB_HCD_H__ */