PERFORCE change 110654 for review

Warner Losh imp at FreeBSD.org
Tue Nov 28 23:09:50 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=110654

Change 110654 by imp at imp_lighthouse on 2006/11/29 05:01:55

	The Program through buffer command takes 4 bytes before the data.
	The continuous array read high frequency takes 5.  Cope.
	
	This makes the spi flash read/write work.

Affected files ...

.. //depot/projects/arm/src/sys/dev/flash/at45d.c#11 edit

Differences ...

==== //depot/projects/arm/src/sys/dev/flash/at45d.c#11 (text+ko) ====

@@ -255,9 +255,9 @@
 	uint8_t buf[4];
 	
 	at45d_get_mfg_info(sc->dev, buf);
-	printf("Reply is %#x %#x %#x %#x\n", buf[0], buf[1], buf[2], buf[3]);
+//	printf("Reply is %#x %#x %#x %#x\n", buf[0], buf[1], buf[2], buf[3]);
 	at45d_wait_for_device_ready(sc->dev);
-	printf("Status is %#x\n", at45d_get_status(sc->dev));
+//	printf("Status is %#x\n", at45d_get_status(sc->dev));
 
 	sc->disk = disk_alloc();
 	sc->disk->d_open = at45d_open;
@@ -324,23 +324,25 @@
 		bioq_remove(&sc->bio_queue, bp);
 		AT45D_UNLOCK(sc);
 		sz = sc->disk->d_sectorsize;
-		printf("Size is %d\n", sz);
 		end = bp->bio_pblkno + (bp->bio_bcount / sz);
 		for (block = bp->bio_pblkno; block < end; block++) {
 			char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz;
-			if (bp->bio_cmd == BIO_READ)
+			if (bp->bio_cmd == BIO_READ) {
 				txBuf[0] = CONTINUOUS_ARRAY_READ_HF;
-			else
+				cmd.tx_cmd_sz = 5;
+				cmd.rx_cmd_sz = 5;
+			} else {
 				txBuf[0] = PROGRAM_THROUGH_BUFFER;
+				cmd.tx_cmd_sz = 4;
+				cmd.rx_cmd_sz = 4;
+			}
 			// XXX only works on certain devices...  Fixme
 			txBuf[1] = ((block >> 5) & 0xFF);
 			txBuf[2] = ((block << 3) & 0xF8);
 			txBuf[3] = 0;
 			txBuf[4] = 0;
 			cmd.tx_cmd = txBuf;
-			cmd.tx_cmd_sz = 5;
 			cmd.rx_cmd = rxBuf;
-			cmd.rx_cmd_sz = 5;
 			cmd.tx_data = vaddr;
 			cmd.tx_data_sz = sz;
 			cmd.rx_data = vaddr;


More information about the p4-projects mailing list