PERFORCE change 211874 for review

Robert Watson rwatson at FreeBSD.org
Mon May 28 14:32:52 UTC 2012


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

Change 211874 by rwatson at rwatson_svr_ctsrd_mipsbuild on 2012/05/28 14:32:48

	When we fail to detect the right text frame buffer offset in the
	MTL register, rather than working around it by writing the correct
	offset, fail to attach the MTL driver.  This causes the driver not
	to attach in BERI simulation as we don't have a PISM instantiation
	of the MTL device (as yet).

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#5 edit
.. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_text.c#5 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#5 (text+ko) ====

@@ -141,6 +141,7 @@
 /*
  * Constants to help interpret the text frame buffer.
  */
+#define	TERASIC_MTL_TEXTFRAMEBUF_EXPECTED_ADDR	0x0177000
 #define	TERASIC_MTL_TEXTFRAMEBUF_CHAR_SHIFT	0
 #define	TERASIC_MTL_TEXTFRAMEBUF_ATTR_SHIFT	8
 

==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_text.c#5 (text+ko) ====

@@ -154,32 +154,17 @@
 	bus_write_2(sc->mtl_text_res, offset, v);
 }
 
-/*
- * XXXRW: Work around a feature in which the default address of the text frame
- * buffer is not initialised at reset as expected.
- */
-#define	TERASIC_MTL_TEXT_EXPECTED_ADDR	0x0177000
-static void
-terasic_mtl_text_workaround(struct terasic_mtl_softc *sc)
+int
+terasic_mtl_text_attach(struct terasic_mtl_softc *sc)
 {
 	uint32_t v;
 
 	terasic_mtl_reg_textframebufaddr_get(sc, &v);
-	if (v == TERASIC_MTL_TEXT_EXPECTED_ADDR)
-		return;
-	device_printf(sc->mtl_dev,
-	    "%s: adjusting text frame buffer reg from 0x%x to 0x%x\n",
-	    __func__, v, TERASIC_MTL_TEXT_EXPECTED_ADDR);
-	terasic_mtl_reg_textframebufaddr_set(sc,
-	    TERASIC_MTL_TEXT_EXPECTED_ADDR);
-}
-
-int
-terasic_mtl_text_attach(struct terasic_mtl_softc *sc)
-{
-
-	/* XXXRW: To go away. */
-	terasic_mtl_text_workaround(sc);
+	if (v != TERASIC_MTL_TEXTFRAMEBUF_EXPECTED_ADDR) {
+		device_printf(sc->mtl_dev, "%s: unexpected text frame buffer "
+		    "address (%08x); cannot attach\n", __func__, v);
+		return (ENXIO);
+	}
 
 	sc->mtl_text_cdev = make_dev(&terasic_mtl_text_cdevsw, sc->mtl_unit,
 	    UID_ROOT, GID_WHEEL, 0400, "mtl_text%d", sc->mtl_unit);


More information about the p4-projects mailing list