Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Standalone EHCI usb debug driver
0004  *
0005  * Originally written by:
0006  *  Eric W. Biederman" <ebiederm@xmission.com> and
0007  *  Yinghai Lu <yhlu.kernel@gmail.com>
0008  *
0009  * Changes for early/late printk and HW errata:
0010  *  Jason Wessel <jason.wessel@windriver.com>
0011  *  Copyright (C) 2009 Wind River Systems, Inc.
0012  *
0013  */
0014 
0015 #ifndef __LINUX_USB_EHCI_DBGP_H
0016 #define __LINUX_USB_EHCI_DBGP_H
0017 
0018 #include <linux/console.h>
0019 #include <linux/types.h>
0020 
0021 /* Appendix C, Debug port ... intended for use with special "debug devices"
0022  * that can help if there's no serial console.  (nonstandard enumeration.)
0023  */
0024 struct ehci_dbg_port {
0025     u32 control;
0026 #define DBGP_OWNER  (1<<30)
0027 #define DBGP_ENABLED    (1<<28)
0028 #define DBGP_DONE   (1<<16)
0029 #define DBGP_INUSE  (1<<10)
0030 #define DBGP_ERRCODE(x) (((x)>>7)&0x07)
0031 #   define DBGP_ERR_BAD 1
0032 #   define DBGP_ERR_SIGNAL  2
0033 #define DBGP_ERROR  (1<<6)
0034 #define DBGP_GO     (1<<5)
0035 #define DBGP_OUT    (1<<4)
0036 #define DBGP_LEN(x) (((x)>>0)&0x0f)
0037     u32 pids;
0038 #define DBGP_PID_GET(x)     (((x)>>16)&0xff)
0039 #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
0040     u32 data03;
0041     u32 data47;
0042     u32 address;
0043 #define DBGP_EPADDR(dev, ep)    (((dev)<<8)|(ep))
0044 };
0045 
0046 #ifdef CONFIG_EARLY_PRINTK_DBGP
0047 extern int early_dbgp_init(char *s);
0048 extern struct console early_dbgp_console;
0049 #endif /* CONFIG_EARLY_PRINTK_DBGP */
0050 
0051 struct usb_hcd;
0052 
0053 #ifdef CONFIG_XEN_DOM0
0054 extern int xen_dbgp_reset_prep(struct usb_hcd *);
0055 extern int xen_dbgp_external_startup(struct usb_hcd *);
0056 #else
0057 static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd)
0058 {
0059     return 1; /* Shouldn't this be 0? */
0060 }
0061 
0062 static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
0063 {
0064     return -1;
0065 }
0066 #endif
0067 
0068 #ifdef CONFIG_EARLY_PRINTK_DBGP
0069 /* Call backs from ehci host driver to ehci debug driver */
0070 extern int dbgp_external_startup(struct usb_hcd *);
0071 extern int dbgp_reset_prep(struct usb_hcd *);
0072 #else
0073 static inline int dbgp_reset_prep(struct usb_hcd *hcd)
0074 {
0075     return xen_dbgp_reset_prep(hcd);
0076 }
0077 
0078 static inline int dbgp_external_startup(struct usb_hcd *hcd)
0079 {
0080     return xen_dbgp_external_startup(hcd);
0081 }
0082 #endif
0083 
0084 #endif /* __LINUX_USB_EHCI_DBGP_H */