Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 2015 21:51:40 -0300
From:      Luiz Otavio O Souza <lists.br@gmail.com>
To:        Daniel Braniss <danny@cs.huji.ac.il>
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:  <CAB=2f8xhs9SHCFE6oAUhCS-m_9U2AGEe_520vfAdMaBbE_Ca9A@mail.gmail.com>
In-Reply-To: <8C177A8C-F6B2-43D5-925F-A3C33B6CF577@cs.huji.ac.il>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 17 April 2015 at 11:08, Daniel Braniss  wrote:
>
>> On Apr 17, 2015, at 4:42 PM, Warner Losh wrote:
>>
...
>>
>> 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.
>>
>
> I was afraid of that :-), this FDT stuff is new to me, and so far I was s=
uccessful
> in adding a gpio/led, but grep has not found any spibus.
> any chance for a small template/example ? rpi or bbb would help!
>
> cheers
>         danny

Hi Daniel,

Here is an example of such change for RPi: http://pastie.org/10099132

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.

Once you boot your system you can check your DTS tree with ofwdump -a

Cheers,
Luiz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8xhs9SHCFE6oAUhCS-m_9U2AGEe_520vfAdMaBbE_Ca9A>