add trace
authorRiku Voipio <riku.voipio@nokia.com>
Thu, 12 Mar 2009 16:19:37 +0000 (18:19 +0200)
committerRiku Voipio <riku.voipio@nokia.com>
Thu, 19 Mar 2009 14:25:33 +0000 (16:25 +0200)
hw/tusb6010.c
hw/usb-musb.c

index d6847d0..dfd2824 100644 (file)
 #include "irq.h"
 #include "devices.h"
 
+#define OMAP3_HSUSB_DEBUG
+
+#ifdef OMAP3_HSUSB_DEBUG
+#define TRACE(fmt,...) fprintf(stderr, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
+#else
+#define TRACE(...)
+#endif
+
+
 struct tusb_s {
     int iomemtype[2];
     qemu_irq irq;
@@ -686,9 +695,11 @@ static void tusb_musb_core_intr(void *opaque, int source, int level)
 {
     struct tusb_s *s = (struct tusb_s *) opaque;
     uint16_t otg_status = s->otg_status;
+    TRACE("intr 0x%08x, 0x%08x, 0x%08x", source, level, musb_core_intr_get(s->musb));
 
     switch (source) {
     case musb_set_vbus:
+        TRACE("dealing with VBUS");
         if (level)
             otg_status |= TUSB_DEV_OTG_STAT_VBUS_VALID;
         else
@@ -704,6 +715,7 @@ static void tusb_musb_core_intr(void *opaque, int source, int level)
         break;
 
     case musb_set_session:
+        TRACE("dealing with SESSION");
         /* XXX: only if TUSB_PHY_OTG_CTRL_OTG_SESS_END_EN set?  */
         /* XXX: only if TUSB_PRCM_MNGMT_OTG_SESS_END_EN set?  */
         if (level) {
@@ -719,6 +731,7 @@ static void tusb_musb_core_intr(void *opaque, int source, int level)
 
     case musb_irq_tx:
     case musb_irq_rx:
+        TRACE("rxtx");
         s->usbip_intr = musb_core_intr_get(s->musb);
         /* Fall through.  */
     default:
index 8e1e6eb..7b59e0a 100644 (file)
 #define MGC_M_ULPI_REGCTL_COMPLETE     0x02
 #define MGC_M_ULPI_REGCTL_REG          0x01
 
+#define MUSB_DEBUG
+
+#ifdef MUSB_DEBUG
+#define TRACE(fmt,...) fprintf(stderr, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
+#else
+#define TRACE(...)
+#endif
+
+
 static void musb_attach(USBPort *port, USBDevice *dev);
 
 struct musb_s {
@@ -879,6 +888,7 @@ static void musb_ep_frame_cancel(struct musb_ep_s *ep, int dir)
 static uint8_t musb_busctl_readb(void *opaque, int ep, int addr)
 {
     struct musb_s *s = (struct musb_s *) opaque;
+    TRACE("ADDR = 0x%08x", addr);
 
     switch (addr) {
     /* For USB2.0 HS hubs only */
@@ -1144,6 +1154,7 @@ static uint32_t musb_readb(void *opaque, target_phys_addr_t addr)
     struct musb_s *s = (struct musb_s *) opaque;
     int ep, i;
     uint8_t ret;
+    TRACE("ADDR = 0x%08x", addr);
 
     switch (addr) {
     case MUSB_HDRC_FADDR:
@@ -1201,6 +1212,7 @@ static void musb_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
 {
     struct musb_s *s = (struct musb_s *) opaque;
     int ep;
+    TRACE("ADDR = 0x%08x = %08x", addr, value);
 
     switch (addr) {
     case MUSB_HDRC_FADDR:
@@ -1283,6 +1295,7 @@ static uint32_t musb_readh(void *opaque, target_phys_addr_t addr)
     struct musb_s *s = (struct musb_s *) opaque;
     int ep, i;
     uint16_t ret;
+    TRACE("ADDR = 0x%08x", addr);
 
     switch (addr) {
     case MUSB_HDRC_INTRTX:
@@ -1332,6 +1345,7 @@ static void musb_writeh(void *opaque, target_phys_addr_t addr, uint32_t value)
 {
     struct musb_s *s = (struct musb_s *) opaque;
     int ep;
+    TRACE("ADDR = 0x%08x = %08x", addr, value);
 
     switch (addr) {
     case MUSB_HDRC_INTRTXE:
@@ -1383,6 +1397,7 @@ static uint32_t musb_readw(void *opaque, target_phys_addr_t addr)
     struct musb_s *s = (struct musb_s *) opaque;
     struct musb_ep_s *ep;
     int epnum;
+    TRACE("ADDR = 0x%08x", addr);
 
     switch (addr) {
     case MUSB_HDRC_FIFO ... (MUSB_HDRC_FIFO + 0x3f):
@@ -1412,6 +1427,7 @@ static void musb_writew(void *opaque, target_phys_addr_t addr, uint32_t value)
     struct musb_s *s = (struct musb_s *) opaque;
     struct musb_ep_s *ep;
     int epnum;
+    TRACE("ADDR = 0x%08x = %08x", addr, value);
 
     switch (addr) {
     case MUSB_HDRC_FIFO ... (MUSB_HDRC_FIFO + 0x3f):