Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On 2022-Sep-28, at 20:31, Mark Millard <[email protected]> wrote:

>> . . .
> 
> It looks like that if you remove files/patch-common_usb__storage.c
> and rebuild/install the large output reporting usb reads will not
> happen.
> 

I've included a patch-common_usb__storage.c that comments out
the few high volume debug(...) instances but leaves the rest
in place. A dozen or so lines are still output via this source
file now and I was not sure if any might prove important. So
this way they are present to consider if this file is used
in the build.

===
Mark Millard
marklmi at yahoo.com
patch-common_usb__storage.c (application/octet-stream, 2.6 KB)
--- common/usb_storage.c.orig	2022-04-04 07:31:32.000000000 -0700
+++ common/usb_storage.c	2022-09-28 21:46:42.289455000 -0700
@@ -20,6 +20,8 @@
  * FreeBSD.
  */
 
+#define LOG_DEBUG
+#define DEBUG
 /* Note:
  * Currently only the CBI transport protocoll has been implemented, and it
  * is only tested with a TEAC USB Floppy. Other Massstorages with CBI or CB
@@ -719,7 +721,7 @@
 	dir_in = US_DIRECTION(srb->cmd[0]);
 
 	/* COMMAND phase */
-	debug("COMMAND phase\n");
+	//MMJNK: debug("COMMAND phase\n");
 	result = usb_stor_BBB_comdat(srb, us);
 	if (result < 0) {
 		debug("failed to send CBW status %ld\n",
@@ -736,7 +738,7 @@
 	/* no data, go immediately to the STATUS phase */
 	if (srb->datalen == 0)
 		goto st;
-	debug("DATA phase\n");
+	//MMJNK: debug("DATA phase\n");
 	if (dir_in)
 		pipe = pipein;
 	else
@@ -769,7 +771,7 @@
 st:
 	retry = 0;
 again:
-	debug("STATUS phase\n");
+	//MMJNK: debug("STATUS phase\n");
 	result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,
 				&actlen, USB_CNTL_TIMEOUT*5);
 
@@ -1079,7 +1081,7 @@
 	srb->cmd[7] = ((unsigned char) (blocks >> 8)) & 0xff;
 	srb->cmd[8] = (unsigned char) blocks & 0xff;
 	srb->cmdlen = 12;
-	debug("read10: start %lx blocks %x\n", start, blocks);
+	//MMJNK: debug("read10: start %lx blocks %x\n", start, blocks);
 	return ss->transport(srb, ss);
 }
 
@@ -1149,9 +1151,9 @@
 #if CONFIG_IS_ENABLED(BLK)
 	block_dev = dev_get_uclass_plat(dev);
 	udev = dev_get_parent_priv(dev_get_parent(dev));
-	debug("\nusb_read: udev %d\n", block_dev->devnum);
+	//MMJNK: debug("\nusb_read: udev %d\n", block_dev->devnum);
 #else
-	debug("\nusb_read: udev %d\n", block_dev->devnum);
+	//MMJNK: debug("\nusb_read: udev %d\n", block_dev->devnum);
 	udev = usb_dev_desc[block_dev->devnum].priv;
 	if (!udev) {
 		debug("%s: No device\n", __func__);
@@ -1167,8 +1169,8 @@
 	start = blknr;
 	blks = blkcnt;
 
-	debug("\nusb_read: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n",
-	      block_dev->devnum, start, blks, buf_addr);
+	//MMJNK: debug("\nusb_read: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n",
+	      //MMJNK: block_dev->devnum, start, blks, buf_addr);
 
 	do {
 		/* XXX need some comment here */
@@ -1197,13 +1199,13 @@
 		buf_addr += srb->datalen;
 	} while (blks != 0);
 
-	debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
-	      start, smallblks, buf_addr);
+	//MMJNK: debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
+	      //MMJNK: start, smallblks, buf_addr);
 
 	usb_lock_async(udev, 0);
 	usb_disable_asynch(0); /* asynch transfer allowed */
 	if (blkcnt >= ss->max_xfer_blk)
-		debug("\n");
+		; //MMJNK: debug("\n");
 	return blkcnt;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.