PERFORCE change 209069 for review

Robert Watson rwatson at FreeBSD.org
Wed Apr 4 14:58:27 UTC 2012


http://p4web.freebsd.org/@@209069?ac=10

Change 209069 by rwatson at rwatson_svr_ctsrd_mipsbuild on 2012/04/04 14:57:28

	Fix two inverted assertions regarding block I/O sizes in the
	Altera SD Card IP Core driver.
	
	Fix an incorrect register offset that led commands to be written
	to the command argument register, causing block load/store
	operations to fail to occur.
	
	With these changes, it is now possibly to load blocks from FreeBSD
	on a CHERI MIPS processor using a 2G SD Card in the Terasic DE-4
	board.  I've not yet tried mounting a file system.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#6 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#6 (text+ko) ====

@@ -208,7 +208,7 @@
 altera_sdcard_write_cmd(struct altera_sdcard_softc *sc, uint16_t cmd)
 {
 
-	bus_write_2(sc->as_res, ALTERA_SDCARD_OFF_CMD_ARG, htole16(cmd));
+	bus_write_2(sc->as_res, ALTERA_SDCARD_OFF_CMD, htole16(cmd));
 }
 
 static void
@@ -216,7 +216,7 @@
     size_t len)
 {
 
-	KASSERT(len > ALTERA_SDCARD_SECTORSIZE,
+	KASSERT(len <= ALTERA_SDCARD_SECTORSIZE,
 	    ("%s: invalid length %ju", __func__, len));
 
 	bus_read_region_1(sc->as_res, ALTERA_SDCARD_OFF_RXTX_BUFFER, data,
@@ -228,7 +228,7 @@
     size_t len)
 {
 
-	KASSERT(len > ALTERA_SDCARD_SECTORSIZE,
+	KASSERT(len <= ALTERA_SDCARD_SECTORSIZE,
 	    ("%s: invalid length %ju", __func__, len));
 
 	bus_write_region_1(sc->as_res, ALTERA_SDCARD_OFF_RXTX_BUFFER, data,


More information about the p4-projects mailing list