From owner-freebsd-arm@freebsd.org Fri Aug 5 13:44:24 2016 Return-Path: Delivered-To: freebsd-arm@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 7A275BAF9A9 for ; Fri, 5 Aug 2016 13:44:24 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "raven.bwct.de", Issuer "BWCT" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A5915C8 for ; Fri, 5 Aug 2016 13:44:23 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id u75Di57W074119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 5 Aug 2016 15:44:06 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.5/8.14.4) with ESMTP id u75Di03D064936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Aug 2016 15:44:00 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.15.2/8.15.2) with ESMTP id u75DhxsY028399; Fri, 5 Aug 2016 15:43:59 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.15.2/8.15.2/Submit) id u75DhxcJ028398; Fri, 5 Aug 2016 15:43:59 +0200 (CEST) (envelope-from ticso) Date: Fri, 5 Aug 2016 15:43:59 +0200 From: Bernd Walter To: freebsd-arm@freebsd.org Cc: Bernd Walter Subject: out of tree kernel modules (was: compiling modules and FDT define) Message-ID: <20160805134358.GN18406@cicely7.cicely.de> Reply-To: ticso@cicely.de References: <20160805005433.GL18406@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160805005433.GL18406@cicely7.cicely.de> X-Operating-System: FreeBSD cicely7.cicely.de 10.2-RELEASE amd64 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 13:44:24 -0000 On Fri, Aug 05, 2016 at 02:54:34AM +0200, Bernd Walter wrote: > I compile a driver as module and it seems that FDT isn't defined > on a rpi. When compiling kernel with modules you get an opt_platform.h containing #define FDT 1 For my out of tree module all I get is an empty file. I assume that also happens when you just manually compile anything in sys/modules. Do I really need to integrate the driver into the kernel source tree and always compile everything? The symptoms of missing FDT support is subtile, because everything may seem to work, the device probing just accepts more devices than it is supposed to handle. On a side note, the ofw_bus_is_compatible and ofw_bus_search_compatible functions are undocumented. At least they don't have a manpage. My only option was to blindly copy from another driver, without really understanding the differences between those two functions. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.