Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / usb / ehci-dbgp.h
blob62ab3805172da02a80b71b625615424ec44fcb65
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Standalone EHCI usb debug driver
5 * Originally written by:
6 * Eric W. Biederman" <ebiederm@xmission.com> and
7 * Yinghai Lu <yhlu.kernel@gmail.com>
9 * Changes for early/late printk and HW errata:
10 * Jason Wessel <jason.wessel@windriver.com>
11 * Copyright (C) 2009 Wind River Systems, Inc.
15 #ifndef __LINUX_USB_EHCI_DBGP_H
16 #define __LINUX_USB_EHCI_DBGP_H
18 #include <linux/console.h>
19 #include <linux/types.h>
21 /* Appendix C, Debug port ... intended for use with special "debug devices"
22 * that can help if there's no serial console. (nonstandard enumeration.)
24 struct ehci_dbg_port {
25 u32 control;
26 #define DBGP_OWNER (1<<30)
27 #define DBGP_ENABLED (1<<28)
28 #define DBGP_DONE (1<<16)
29 #define DBGP_INUSE (1<<10)
30 #define DBGP_ERRCODE(x) (((x)>>7)&0x07)
31 # define DBGP_ERR_BAD 1
32 # define DBGP_ERR_SIGNAL 2
33 #define DBGP_ERROR (1<<6)
34 #define DBGP_GO (1<<5)
35 #define DBGP_OUT (1<<4)
36 #define DBGP_LEN(x) (((x)>>0)&0x0f)
37 u32 pids;
38 #define DBGP_PID_GET(x) (((x)>>16)&0xff)
39 #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
40 u32 data03;
41 u32 data47;
42 u32 address;
43 #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep))
46 #ifdef CONFIG_EARLY_PRINTK_DBGP
47 extern int early_dbgp_init(char *s);
48 extern struct console early_dbgp_console;
49 #endif /* CONFIG_EARLY_PRINTK_DBGP */
51 struct usb_hcd;
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)
59 return 1; /* Shouldn't this be 0? */
62 static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
64 return -1;
66 #endif
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)
75 return xen_dbgp_reset_prep(hcd);
78 static inline int dbgp_external_startup(struct usb_hcd *hcd)
80 return xen_dbgp_external_startup(hcd);
82 #endif
84 #endif /* __LINUX_USB_EHCI_DBGP_H */