2

I am trying to create one led driver via device tree in Rpi 3 I had created the dtsi file

/dts-v1/;
/plugin/;
/ {
    compatible = "brcm,bcm2837";
        fragment@0 {
          target = <&leds>;
          __overlay__ {
            driver_01: led {
              label = "led17";
              gpios = <&gpio 17 0>;
            };
          };
        };
};

And included in bcm2837-rpi-3-b.dts adding #include <led_drv.dtsi> to it The location for dts is linux-rpi-4.9.y/arch/arm64/boot/dts/broadcom$

For the sake of checking, i just did

../../../../../scripts/dtc/dtc -@ -I dts -O dtb -o test.dtb bcm2837-rpi-3-b.dts

before adding my own dtsi file But it showed Error:

bcm2837-rpi-3-b.dts:2.1-9 syntax error
FATAL ERROR: Unable to parse input tree

Remember this is before adding anothing, just the downloaded source from official rpi git account

I am a bit confused due to this. Also am I correct on the arm64 part? at arm /... dir, there is no rpi 3 dts, but in arm64 rpi3 dts is there.

However if I do :

../../../../../scripts/dtc/dtc -@ -I dts -O dtb -o led_drv.dtbo led_drv.dtsi

The result shows Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property

But it generates the .dtbo file.

I studied different tutorials , but things are not clear yet. Any suggestion? Not getting the clear view and confused.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.