Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2016 03:03:05 +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: r307089 - head/sys/arm/broadcom/bcm2835
Message-ID:  <201610120303.u9C335Pm061557@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Wed Oct 12 03:03:05 2016
New Revision: 307089
URL: https://svnweb.freebsd.org/changeset/base/307089

Log:
  Make framebuffer driver compatible with upstream DT
  
  - Add compatibility string
  - Add simplebus as possible parent bus

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c	Wed Oct 12 03:00:42 2016	(r307088)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c	Wed Oct 12 03:03:05 2016	(r307089)
@@ -111,6 +111,12 @@ struct bcmsc_softc {
 
 static struct bcmsc_softc bcmsc;
 
+static struct ofw_compat_data compat_data[] = {
+	{"broadcom,bcm2835-fb",		1},
+	{"brcm,bcm2708-fb",		1},
+	{NULL,				0}
+};
+
 static int bcm_fb_probe(device_t);
 static int bcm_fb_attach(device_t);
 static void bcmfb_update_margins(video_adapter_t *adp);
@@ -121,8 +127,9 @@ bcm_fb_probe(device_t dev)
 {
 	int error;
 
-	if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb"))
+	if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
 		return (ENXIO);
+
 	device_set_desc(dev, "BCM2835 framebuffer device");
 	error = sc_probe_unit(device_get_unit(dev), 
 	    device_get_flags(dev) | SC_AUTODETECT_KBD);
@@ -196,6 +203,7 @@ static driver_t bcm_fb_driver = {
 };
 
 DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0);
+DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0);
 
 /*
  * Video driver routines and glue.

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c	Wed Oct 12 03:00:42 2016	(r307088)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c	Wed Oct 12 03:03:05 2016	(r307089)
@@ -65,6 +65,12 @@ struct bcmsc_softc {
 	device_t			dev;
 };
 
+static struct ofw_compat_data compat_data[] = {
+	{"broadcom,bcm2835-fb",		1},
+	{"brcm,bcm2708-fb",		1},
+	{NULL,				0}
+};
+
 static int bcm_fb_probe(device_t);
 static int bcm_fb_attach(device_t);
 
@@ -191,7 +197,8 @@ bcm_fb_sysctl_init(struct bcmsc_softc *s
 static int
 bcm_fb_probe(device_t dev)
 {
-	if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb"))
+
+	if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
 		return (ENXIO);
 
 	device_set_desc(dev, "BCM2835 VT framebuffer driver");
@@ -265,3 +272,4 @@ static driver_t bcm_fb_driver = {
 };
 
 DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0);
+DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0);



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