ehci-dbgp.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #ifndef __LINUX_USB_EHCI_DBGP_H
  14. #define __LINUX_USB_EHCI_DBGP_H
  15. #include <linux/console.h>
  16. #include <linux/types.h>
  17. /* Appendix C, Debug port ... intended for use with special "debug devices"
  18. * that can help if there's no serial console. (nonstandard enumeration.)
  19. */
  20. struct ehci_dbg_port {
  21. u32 control;
  22. #define DBGP_OWNER (1<<30)
  23. #define DBGP_ENABLED (1<<28)
  24. #define DBGP_DONE (1<<16)
  25. #define DBGP_INUSE (1<<10)
  26. #define DBGP_ERRCODE(x) (((x)>>7)&0x07)
  27. # define DBGP_ERR_BAD 1
  28. # define DBGP_ERR_SIGNAL 2
  29. #define DBGP_ERROR (1<<6)
  30. #define DBGP_GO (1<<5)
  31. #define DBGP_OUT (1<<4)
  32. #define DBGP_LEN(x) (((x)>>0)&0x0f)
  33. u32 pids;
  34. #define DBGP_PID_GET(x) (((x)>>16)&0xff)
  35. #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
  36. u32 data03;
  37. u32 data47;
  38. u32 address;
  39. #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep))
  40. };
  41. #ifdef CONFIG_EARLY_PRINTK_DBGP
  42. extern int early_dbgp_init(char *s);
  43. extern struct console early_dbgp_console;
  44. #endif /* CONFIG_EARLY_PRINTK_DBGP */
  45. struct usb_hcd;
  46. #ifdef CONFIG_XEN_DOM0
  47. extern int xen_dbgp_reset_prep(struct usb_hcd *);
  48. extern int xen_dbgp_external_startup(struct usb_hcd *);
  49. #else
  50. static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd)
  51. {
  52. return 1; /* Shouldn't this be 0? */
  53. }
  54. static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
  55. {
  56. return -1;
  57. }
  58. #endif
  59. #ifdef CONFIG_EARLY_PRINTK_DBGP
  60. /* Call backs from ehci host driver to ehci debug driver */
  61. extern int dbgp_external_startup(struct usb_hcd *);
  62. extern int dbgp_reset_prep(struct usb_hcd *);
  63. #else
  64. static inline int dbgp_reset_prep(struct usb_hcd *hcd)
  65. {
  66. return xen_dbgp_reset_prep(hcd);
  67. }
  68. static inline int dbgp_external_startup(struct usb_hcd *hcd)
  69. {
  70. return xen_dbgp_external_startup(hcd);
  71. }
  72. #endif
  73. #endif /* __LINUX_USB_EHCI_DBGP_H */