From owner-freebsd-arm@FreeBSD.ORG Mon Apr 20 14:25:01 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4826330D; Mon, 20 Apr 2015 14:25:01 +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 EAB389FB; Mon, 20 Apr 2015 14:25:00 +0000 (UTC) Received: from th-04.cs.huji.ac.il ([132.65.80.125]) by kabab.cs.huji.ac.il with esmtp id 1YkCcx-000HgA-O3; Mon, 20 Apr 2015 17:24:47 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: help with coding a loadable kernel module From: Daniel Braniss In-Reply-To: <07F11A62-F2A0-404E-B409-6848418A3B29@cs.huji.ac.il> Date: Mon, 20 Apr 2015 17:24:46 +0300 Cc: "freebsd-arm@freebsd.org" , Ian Lepore Content-Transfer-Encoding: quoted-printable Message-Id: <62021BE7-5941-4B0C-A74D-01C9AC415AB8@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> <07F11A62-F2A0-404E-B409-6848418A3B29@cs.huji.ac.il> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.2070.6) 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: Mon, 20 Apr 2015 14:25:01 -0000 now that I=E2=80=99m ready to connect the hardware, where/how do I = configure the IRQ and RESET pins? I presume in the dts file =E2=80=A6 I probably have to reserve/define also the SPI lines? If there is some documentation I should read instead, please let me = know. cheers, danny > On Apr 18, 2015, at 4:17 PM, Daniel Braniss = wrote: >=20 >=20 >> 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 >=20 > pending some cosmetics, the driver gets loaded! and a /dev/rfid0 = appears! >=20 > thanks guys, I still have to figure out some magics, and some SPI = MFRC protocol. >=20 > as soon as I have a decent working version i=E2=80=99ll submit the = driver. >=20 > thanks again, >=20 > danny >=20 > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"