Raspberry Pi SPI device example?

Luiz Otavio O Souza lists.br at gmail.com
Mon Mar 2 23:14:31 UTC 2015


On 2 March 2015 at 08:41, Milan Obuch wrote:
> On Thu, 19 Feb 2015 07:53:42 +0100
> Milan Obuch wrote:
>
> Hello,
>
> I am trying to do something, but no luck yet - it looks like I need
> somehow write into rpi.dtb blob that I added something into kernel.
> Unfortunatelly, none of those five files help in this area, they are
> 'activated' via hints mechanism which does not help me...
>
> Do we have something to shed some light here for me? Also, is it
> possible to boot kernel with verbose logging, but not with some option
> in kernel config and rebuild?
>
> Regards,
> Milan

Milan,

If you have a serial console attached, you can stop the boot while
kernel is being loaded and boot with 'boot -v' for a verbose boot.

Edit the DTS source file (bcm2835.dtsi and/or rpi.dts in
sys/boot/fdt/dts/arm/) and then the DTB will be built as part of the
next kernel build (you can also build it manually in
sys/modules/dtb/rpi).

Here is a patch I'm using to attach a mx25l compatible flash on my RPi
(old patch...):

http://loos.com.br/mx25l-fdt-intr.diff

And the DTS changes:

Index: sys/boot/fdt/dts/rpi.dts
===================================================================
--- sys/boot/fdt/dts/rpi.dts    (revision 253747)
+++ sys/boot/fdt/dts/rpi.dts    (working copy)
@@ -281,6 +281,14 @@
                                broadcom,function = "ALT3";
                        };
                };
+
+               spi0 {
+                       flash0 {
+                               compatible = "flash,mx25l";
+                               spi-chipselect = <0>;
+                       };
+               };
+
                usb {
                        hub {
                                compatible = "usb,hub", "usb,device";


HTH,
Luiz


More information about the freebsd-arm mailing list