Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2013 00:33:09 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252282 - head/sys/arm/ti/am335x
Message-ID:  <201306270033.r5R0X93J024017@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <vm/vm.h>
 #include <vm/pmap.h>
 
+/* syscons bits */
+#include <sys/fbio.h>
+#include <sys/consio.h>
+
 #include <machine/bus.h>
 
 #include <dev/fdt/fdt_common.h>
@@ -49,6 +53,9 @@ __FBSDID("$FreeBSD$");
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
+#include <dev/fb/fbreg.h>
+#include <dev/syscons/syscons.h>
+
 #include <arm/ti/ti_prcm.h>
 #include <arm/ti/ti_scm.h>
 
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306270033.r5R0X93J024017>