diff options
author | Chris Rorvick <chris@rorvick.com> | 2014-11-04 20:18:45 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-07 12:02:37 -0500 |
commit | b9ec1c9da64f0c1d130beb125a916d0725363ec9 (patch) | |
tree | f5c88d4f240c12b8e0055fd22db9e1b60ef24b90 | |
parent | d9a887023076ceed7221c216627a0018ad3b86fa (diff) |
usb: Create separate header for ehci-dbgp
The FUSBH200 and FOTG210 controllers implement sufficiently EHCI-
compatible debug ports to leverage ehci-dbgp from their respective
drivers. Rather than including <linux/usb/ehci_def.h> header, though,
they replicate the necessary declarations in their own headers. Move
the ehci-dbgp stuff into its own header as a first step towards removing
this redundancy.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/linux/usb/ehci-dbgp.h | 84 | ||||
-rw-r--r-- | include/linux/usb/ehci_def.h | 65 |
2 files changed, 86 insertions, 63 deletions
diff --git a/include/linux/usb/ehci-dbgp.h b/include/linux/usb/ehci-dbgp.h new file mode 100644 index 000000000000..796c1cd6f26a --- /dev/null +++ b/include/linux/usb/ehci-dbgp.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Standalone EHCI usb debug driver | ||
3 | * | ||
4 | * Originally written by: | ||
5 | * Eric W. Biederman" <ebiederm@xmission.com> and | ||
6 | * Yinghai Lu <yhlu.kernel@gmail.com> | ||
7 | * | ||
8 | * Changes for early/late printk and HW errata: | ||
9 | * Jason Wessel <jason.wessel@windriver.com> | ||
10 | * Copyright (C) 2009 Wind River Systems, Inc. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_USB_EHCI_DBGP_H | ||
15 | #define __LINUX_USB_EHCI_DBGP_H | ||
16 | |||
17 | #include <linux/console.h> | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | /* Appendix C, Debug port ... intended for use with special "debug devices" | ||
21 | * that can help if there's no serial console. (nonstandard enumeration.) | ||
22 | */ | ||
23 | struct ehci_dbg_port { | ||
24 | u32 control; | ||
25 | #define DBGP_OWNER (1<<30) | ||
26 | #define DBGP_ENABLED (1<<28) | ||
27 | #define DBGP_DONE (1<<16) | ||
28 | #define DBGP_INUSE (1<<10) | ||
29 | #define DBGP_ERRCODE(x) (((x)>>7)&0x07) | ||
30 | # define DBGP_ERR_BAD 1 | ||
31 | # define DBGP_ERR_SIGNAL 2 | ||
32 | #define DBGP_ERROR (1<<6) | ||
33 | #define DBGP_GO (1<<5) | ||
34 | #define DBGP_OUT (1<<4) | ||
35 | #define DBGP_LEN(x) (((x)>>0)&0x0f) | ||
36 | u32 pids; | ||
37 | #define DBGP_PID_GET(x) (((x)>>16)&0xff) | ||
38 | #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok)) | ||
39 | u32 data03; | ||
40 | u32 data47; | ||
41 | u32 address; | ||
42 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | ||
43 | }; | ||
44 | |||
45 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
46 | #include <linux/init.h> | ||
47 | extern int __init early_dbgp_init(char *s); | ||
48 | extern struct console early_dbgp_console; | ||
49 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
50 | |||
51 | struct usb_hcd; | ||
52 | |||
53 | #ifdef CONFIG_XEN_DOM0 | ||
54 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
55 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
56 | #else | ||
57 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
58 | { | ||
59 | return 1; /* Shouldn't this be 0? */ | ||
60 | } | ||
61 | |||
62 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
63 | { | ||
64 | return -1; | ||
65 | } | ||
66 | #endif | ||
67 | |||
68 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
69 | /* Call backs from ehci host driver to ehci debug driver */ | ||
70 | extern int dbgp_external_startup(struct usb_hcd *); | ||
71 | extern int dbgp_reset_prep(struct usb_hcd *); | ||
72 | #else | ||
73 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) | ||
74 | { | ||
75 | return xen_dbgp_reset_prep(hcd); | ||
76 | } | ||
77 | |||
78 | static inline int dbgp_external_startup(struct usb_hcd *hcd) | ||
79 | { | ||
80 | return xen_dbgp_external_startup(hcd); | ||
81 | } | ||
82 | #endif | ||
83 | |||
84 | #endif /* __LINUX_USB_EHCI_DBGP_H */ | ||
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index daec99af5d54..966889a20ea3 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __LINUX_USB_EHCI_DEF_H | 19 | #ifndef __LINUX_USB_EHCI_DEF_H |
20 | #define __LINUX_USB_EHCI_DEF_H | 20 | #define __LINUX_USB_EHCI_DEF_H |
21 | 21 | ||
22 | #include <linux/usb/ehci-dbgp.h> | ||
23 | |||
22 | /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ | 24 | /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ |
23 | 25 | ||
24 | /* Section 2.2 Host Controller Capability Registers */ | 26 | /* Section 2.2 Host Controller Capability Registers */ |
@@ -190,67 +192,4 @@ struct ehci_regs { | |||
190 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | 192 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ |
191 | }; | 193 | }; |
192 | 194 | ||
193 | /* Appendix C, Debug port ... intended for use with special "debug devices" | ||
194 | * that can help if there's no serial console. (nonstandard enumeration.) | ||
195 | */ | ||
196 | struct ehci_dbg_port { | ||
197 | u32 control; | ||
198 | #define DBGP_OWNER (1<<30) | ||
199 | #define DBGP_ENABLED (1<<28) | ||
200 | #define DBGP_DONE (1<<16) | ||
201 | #define DBGP_INUSE (1<<10) | ||
202 | #define DBGP_ERRCODE(x) (((x)>>7)&0x07) | ||
203 | # define DBGP_ERR_BAD 1 | ||
204 | # define DBGP_ERR_SIGNAL 2 | ||
205 | #define DBGP_ERROR (1<<6) | ||
206 | #define DBGP_GO (1<<5) | ||
207 | #define DBGP_OUT (1<<4) | ||
208 | #define DBGP_LEN(x) (((x)>>0)&0x0f) | ||
209 | u32 pids; | ||
210 | #define DBGP_PID_GET(x) (((x)>>16)&0xff) | ||
211 | #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok)) | ||
212 | u32 data03; | ||
213 | u32 data47; | ||
214 | u32 address; | ||
215 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | ||
216 | }; | ||
217 | |||
218 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
219 | #include <linux/init.h> | ||
220 | extern int __init early_dbgp_init(char *s); | ||
221 | extern struct console early_dbgp_console; | ||
222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
223 | |||
224 | struct usb_hcd; | ||
225 | |||
226 | #ifdef CONFIG_XEN_DOM0 | ||
227 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
228 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
229 | #else | ||
230 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
231 | { | ||
232 | return 1; /* Shouldn't this be 0? */ | ||
233 | } | ||
234 | |||
235 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
236 | { | ||
237 | return -1; | ||
238 | } | ||
239 | #endif | ||
240 | |||
241 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
242 | /* Call backs from ehci host driver to ehci debug driver */ | ||
243 | extern int dbgp_external_startup(struct usb_hcd *); | ||
244 | extern int dbgp_reset_prep(struct usb_hcd *hcd); | ||
245 | #else | ||
246 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) | ||
247 | { | ||
248 | return xen_dbgp_reset_prep(hcd); | ||
249 | } | ||
250 | static inline int dbgp_external_startup(struct usb_hcd *hcd) | ||
251 | { | ||
252 | return xen_dbgp_external_startup(hcd); | ||
253 | } | ||
254 | #endif | ||
255 | |||
256 | #endif /* __LINUX_USB_EHCI_DEF_H */ | 195 | #endif /* __LINUX_USB_EHCI_DEF_H */ |