Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 2015 16:17:34 +0300
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Luiz Otavio O Souza <lists.br@gmail.com>
Cc:        Warner Losh <imp@bsdimp.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, Ian Lepore <ian@freebsd.org>
Subject:   Re: help with coding a loadable kernel module
Message-ID:  <07F11A62-F2A0-404E-B409-6848418A3B29@cs.huji.ac.il>
In-Reply-To: <CAB=2f8xhs9SHCFE6oAUhCS-m_9U2AGEe_520vfAdMaBbE_Ca9A@mail.gmail.com>
References:  <EDB591F5-E056-4E53-9ED2-2A2E571F319C@cs.huji.ac.il> <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> <C6A90444-22F4-4EDF-BE3D-C384F61BB0B4@cs.huji.ac.il> <FCC970B7-EA7C-4378-9B97-8E9B31329D47@bsdimp.com> <8C177A8C-F6B2-43D5-925F-A3C33B6CF577@cs.huji.ac.il> <CAB=2f8xhs9SHCFE6oAUhCS-m_9U2AGEe_520vfAdMaBbE_Ca9A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Apr 18, 2015, at 3:51 AM, Luiz Otavio O Souza <lists.br@gmail.com> =
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?07F11A62-F2A0-404E-B409-6848418A3B29>