From owner-freebsd-arm@FreeBSD.ORG Sat Apr 18 13:17:55 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5B24F41; Sat, 18 Apr 2015 13:17:55 +0000 (UTC) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954AACE1; Sat, 18 Apr 2015 13:17:55 +0000 (UTC) Received: from mbpro2.bs.cs.huji.ac.il ([132.65.179.20]) by kabab.cs.huji.ac.il with esmtp id 1YjSco-0006vr-7q; Sat, 18 Apr 2015 16:17:34 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2090\)) Subject: Re: help with coding a loadable kernel module From: Daniel Braniss In-Reply-To: Date: Sat, 18 Apr 2015 16:17:34 +0300 Cc: Warner Losh , "freebsd-arm@freebsd.org" , Ian Lepore Content-Transfer-Encoding: quoted-printable Message-Id: <07F11A62-F2A0-404E-B409-6848418A3B29@cs.huji.ac.il> References: <20150417080839.GO2743@home.opsec.eu> <9B835088-661C-456E-84A7-47BC1835C0CB@cs.huji.ac.il> <20150417095536.GA38091@gmail.com> <32D7EBD3-813E-4062-8A06-ED8E82BA50DA@cs.huji.ac.il> <1429276417.1182.71.camel@freebsd.org> <8C177A8C-F6B2-43D5-925F-A3C33B6CF577@cs.huji.ac.il> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.2090) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 13:17:56 -0000 > On Apr 18, 2015, at 3:51 AM, Luiz Otavio O Souza = wrote: >=20 > On 17 April 2015 at 11:08, Daniel Braniss wrote: >>=20 >>> On Apr 17, 2015, at 4:42 PM, Warner Losh wrote: >>>=20 > ... >>>=20 >>> If you are using FDT in your system, then you=E2=80=99ll put your = device into the >>> FDT tree below the spibus to create the device_t node in the tree. = When >>> your module is loaded, its probe routine will be called, and you can >>> match based on the compatible string given in the FDT. >>>=20 >>=20 >> I was afraid of that :-), this FDT stuff is new to me, and so far I = was successful >> in adding a gpio/led, but grep has not found any spibus. >> any chance for a small template/example ? rpi or bbb would help! >>=20 >> cheers >> danny >=20 > Hi Daniel, >=20 > Here is an example of such change for RPi: http://pastie.org/10099132 >=20 > The SPI controller node is defined at > sys/boot/fdt/dts/arm/bcm2835.dtsi, but usually the local changes go in > sys/boot/fdt/dts/arm/rpi.dts. >=20 > Once you boot your system you can check your DTS tree with ofwdump -a >=20 > Cheers, > Luiz pending some cosmetics, the driver gets loaded! and a /dev/rfid0 = appears! thanks guys, I still have to figure out some magics, and some SPI MFRC = protocol. as soon as I have a decent working version i=E2=80=99ll submit the = driver. thanks again, danny