From owner-svn-src-head@freebsd.org Thu Nov 5 22:03:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC8FA26436; Thu, 5 Nov 2015 22:03:43 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471011280; Thu, 5 Nov 2015 22:03:43 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA5M3gmn047991; Thu, 5 Nov 2015 22:03:42 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA5M3gFZ047990; Thu, 5 Nov 2015 22:03:42 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201511052203.tA5M3gFZ047990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 5 Nov 2015 22:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290422 - head/sys/arm/at91 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.20 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, 05 Nov 2015 22:03:43 -0000 Author: cognet Date: Thu Nov 5 22:03:42 2015 New Revision: 290422 URL: https://svnweb.freebsd.org/changeset/base/290422 Log: Make if_macb work with FDT. Modified: head/sys/arm/at91/if_macb.c Modified: head/sys/arm/at91/if_macb.c ============================================================================== --- head/sys/arm/at91/if_macb.c Thu Nov 5 22:03:27 2015 (r290421) +++ head/sys/arm/at91/if_macb.c Thu Nov 5 22:03:42 2015 (r290422) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -72,6 +74,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" @@ -1196,6 +1204,11 @@ macbioctl(struct ifnet * ifp, u_long cmd static int macb_probe(device_t dev) { +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "cdns,at32ap7000-macb")) + return (ENXIO); +#endif + device_set_desc(dev, "macb"); return (0); } @@ -1546,7 +1559,11 @@ static driver_t macb_driver = { }; +#ifdef FDT +DRIVER_MODULE(macb, simplebus, macb_driver, macb_devclass, NULL, NULL); +#else DRIVER_MODULE(macb, atmelarm, macb_driver, macb_devclass, 0, 0); +#endif DRIVER_MODULE(miibus, macb, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(macb, miibus, 1, 1, 1); MODULE_DEPEND(macb, ether, 1, 1, 1);