From owner-p4-projects@FreeBSD.ORG Mon May 28 14:32:52 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E7071065675; Mon, 28 May 2012 14:32:52 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4EA51065672 for ; Mon, 28 May 2012 14:32:51 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B39D08FC1F for ; Mon, 28 May 2012 14:32:51 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q4SEWpZo052233 for ; Mon, 28 May 2012 14:32:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q4SEWp28052228 for perforce@freebsd.org; Mon, 28 May 2012 14:32:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 28 May 2012 14:32:51 GMT Message-Id: <201205281432.q4SEWp28052228@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 211874 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 14:32:52 -0000 http://p4web.freebsd.org/@@211874?ac=10 Change 211874 by rwatson@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);