From owner-svn-src-head@FreeBSD.ORG Thu Jun 27 00:33:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8849015E; Thu, 27 Jun 2013 00:33:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60BAC190F; Thu, 27 Jun 2013 00:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5R0X9sv024018; Thu, 27 Jun 2013 00:33:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5R0X93J024017; Thu, 27 Jun 2013 00:33:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201306270033.r5R0X93J024017@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 27 Jun 2013 00:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252282 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 00:33:09 -0000 Author: gonzo Date: Thu Jun 27 00:33:08 2013 New Revision: 252282 URL: http://svnweb.freebsd.org/changeset/base/252282 Log: - Request non-cached memory for framebuffer - Properly probe/initialize syscons Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jun 27 00:31:21 2013 (r252281) +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jun 27 00:33:08 2013 (r252282) @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* syscons bits */ +#include +#include + #include #include @@ -49,6 +53,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -395,12 +402,19 @@ am335x_lcd_intr(void *arg) static int am335x_lcd_probe(device_t dev) { + int err; + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) return (ENXIO); device_set_desc(dev, "AM335x LCD controller"); - return (0); + err = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + if (err != 0) + return (err); + + return (BUS_PROBE_DEFAULT); } static int @@ -480,7 +494,7 @@ am335x_lcd_attach(device_t dev) goto fail; err = bus_dmamem_alloc(sc->sc_dma_tag, (void **)&sc->sc_fb_base, - 0, &sc->sc_dma_map); + BUS_DMA_COHERENT, &sc->sc_dma_map); if (err) { device_printf(dev, "cannot allocate framebuffer\n"); @@ -631,6 +645,14 @@ am335x_lcd_attach(device_t dev) PWM_PERIOD, PWM_PERIOD) == 0) sc->sc_backlight = 100; + err = (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); + + if (err) { + device_printf(dev, "failed to attach syscons\n"); + goto fail; + } + am335x_lcd_syscons_setup((vm_offset_t)sc->sc_fb_base, sc->sc_fb_phys, &panel); return (0);