0

I'm looking for any appropriate solution for Device tree writing in raspberry pi

I went through:

  1. basic device driver module loading and unloading
  2. adding a kernel module in kernel source tree so that it can loaded automatically just like predefined kernel modules.

But now i have doubt about how one can write device tree in raspberry-pi for binding a particular driver or module at the booting time phase?

I researched lots of available resources within the Internet but unfortunately I could not find any precise solution that suits my need.

Mehdi
  • 3,795
  • 3
  • 36
  • 65
Jeet Parikh
  • 305
  • 2
  • 8
  • Can you elaborate more on your question? Writing a device tree is not needed for RPi as it's already available. – SD. Jun 07 '18 at 06:43
  • yes,i need to add one node in device tree and according to that, driver which is written by me is need to be loaded at a boot time. in short i want to write a dummy node in device tree and dummy driver for raspberry pi which is loaded at boot time. – Jeet Parikh Jun 07 '18 at 07:05
  • The binding between a DT node and a device driver is by the `compatible` property. See https://stackoverflow.com/questions/26840267/driver-code-in-kernel-module-doesnt-execute – sawdust Jun 07 '18 at 09:00
  • but where should i add this DT node ? i'm using raspberry pi and interested to write demo platform driver. – Jeet Parikh Jun 07 '18 at 10:01

1 Answers1

0

So you just need to add a node in your device tree and set the "compatible" property point to your driver. Check below link for reference.

https://github.com/saiyamd/skeleton-dt-binding/blob/master/skeleton.c

SD.
  • 1,432
  • 22
  • 38