help with coding a loadable kernel module

Daniel Braniss danny at cs.huji.ac.il
Mon Apr 20 14:25:01 UTC 2015


now that I’m ready to connect the hardware, where/how do I configure
the IRQ and RESET pins? I presume in the dts file …
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 <danny at cs.huji.ac.il> wrote:
> 
> 
>> On Apr 18, 2015, at 3:51 AM, Luiz Otavio O Souza <lists.br at gmail.com> wrote:
>> 
>> 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’ll 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 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!
>>> 
>>> 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
> 
> 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’ll submit the driver.
> 
> thanks again,
> 
> 	danny
> 
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"



More information about the freebsd-arm mailing list