From owner-freebsd-arm@freebsd.org Sat Aug 6 03:20:13 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 08377BAF1E2 for ; Sat, 6 Aug 2016 03:20:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6F671D77 for ; Sat, 6 Aug 2016 03:20:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 38so316075068iol.0 for ; Fri, 05 Aug 2016 20:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+CI9MvVmHNXLHh23Y8QksfoIC4xRoVKxQEY3dyO3I1I=; b=yZ8Uw6+3JcerpzqU8G6RobLqEvkrcumuTk2hgHxnUaYdtA7nQ2SE57y2qPfJRpc5Ub 52yLsD3m6BusrpGCzck6iXJ4dNkQx1TAuc+2llOIPeqT/uW3A7nKecrrX1W5refMIeRh PI5SnCDTh6VE0yXh3dsGraVi9cVLkRxZBpmfAnTBECekUy55dusfbxpWDW8x0qIQsg+F 65Q8wLWZifovyvnmDltNF04a2Im/jwKV5eoCLzhuaH1ijijqnzDgCSVezCmVymX8h4FR nxWkOWAH40kZtdezrhhk738bL5GLqovYo0mq9KhHZ+Ea18/q958CD26Rar4yuylRhEF3 OarA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+CI9MvVmHNXLHh23Y8QksfoIC4xRoVKxQEY3dyO3I1I=; b=XbvSjMGIfhWQStRTBMFvsbYYFWPlwA43ns8muSJdyXZsNnj2uCNHIt/w1x6TQP2jiN I/PhGB1b7qiBod7rOhYBDmBk28j2oKZt0QmbRbuT7dpFhtgFeJ/RC9aup2aFgbCMSlRn DyQqWqliCpPS0CAkUKTjjQilhREUDyxAj73wo/gud6C2kUkyLgTGG50rKmGo57i+Zmjq 9q0EYRwhneIvncBofArtNXp/5I+y1WQpvN2eC+AxaBiklIbu485lrC5vCQRfil/Q9w6C ukvMwgZCa/noyXBG57/9kQGi0SDZ2Xl1YzbBqhUN6mSejNYR8K+3YvVyud9AL2OhLMtG qLUQ== X-Gm-Message-State: AEkoouuG47aSBKPrH5mbZFyW9eMNWtTBcCxM23CugBE+reM7cQG/2KyIS0dH5Mwx1T4RtEu4Kjqui7PTKocC1A== X-Received: by 10.107.144.10 with SMTP id s10mr80066169iod.165.1470453612134; Fri, 05 Aug 2016 20:20:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Fri, 5 Aug 2016 20:20:11 -0700 (PDT) In-Reply-To: <20160805134358.GN18406@cicely7.cicely.de> References: <20160805005433.GL18406@cicely7.cicely.de> <20160805134358.GN18406@cicely7.cicely.de> From: Adrian Chadd Date: Fri, 5 Aug 2016 20:20:11 -0700 Message-ID: Subject: Re: out of tree kernel modules (was: compiling modules and FDT define) To: ticso@cicely.de Cc: "freebsd-arm@freebsd.org" , Bernd Walter Content-Type: text/plain; charset=UTF-8 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: Sat, 06 Aug 2016 03:20:13 -0000 Hi, Try adding opt_platform.h to SRCS in the module makefile? You don't need to add it to the tree. You just have to setup your path to point things /at/ a kernel build tree withall the opt_xxx.h in them. here's what I do: #!/bin/sh X_SRCDIR=${X_SRCDIR:="/home/adrian/work/freebsd/head/src/"} X_KERNDIR=${X_KERNDIR:="/home/adrian/work/freebsd/head/obj/usr/home/adrian/work/freebsd/head/src/sys/GERTRUDE/"} X_KMODOWN=${X_KMODOWN:="adrian"} X_KMODGRP=${X_KMODGRP:="adrian"} # This allows for -HEAD includes for net80211 .. env CFLAGS="-I../../../sys/" \ make \ MODULES_OVERRIDE="" \ DEBUG_FLAGS="-g" \ DEBUG_FLAGS="-g" \ KMODDIR="/home/adrian/git/github/erikarn/athp/otus/freebsd/modules/" \ KMODOWN="${X_KMODOWN}" \ KMODGRP="${X_KMODGRP}" \ MAKESYSPATH="${X_SRCDIR}/share/mk" \ SYSDIR="${X_SRCDIR}/sys/" \ KERNBUILDDIR="${X_KERNDIR}" \ KERN_DEBUGDIR="" \ $@ That gets me all the bits I need to be able to run make in module directories and get the correct includes/links setup. -a On 5 August 2016 at 06:43, Bernd Walter wrote: > 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. > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"