1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Standalone EHCI usb debug driver
5 * Originally written by:
9 * Changes for early/late printk and HW errata:
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 {
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)
38 #define DBGP_PID_GET(x) (((x)>>16)&0xff)
39 #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
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 */
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 *);
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)
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 *);
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);
84 #endif /* __LINUX_USB_EHCI_DBGP_H */