Applying an overlay to a devicetree fails

Hi !

I don’t manage to apply my overlay to the device tree of my BeagleBone Black.

I followed carefully the instructions in u-boot-v2020.04/doc/README.fdt-overlays

In u-boot-v2020.04, I type

=> fdt apply $fdtovaddr
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND

but it doesn’t work.

Here is my overlay but it seems to be right :

/dts-v1/;
/plugin/;

/{
        fragment@0 {
                target = <&pcdev0>;
                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@1 {
                target = <&pcdev1>;
                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@2 {
                target = <&pcdev3>;
                __overlay__ {
                        org,size = <1048>;
                        org,device-serial-num = "PCDEV4XXXXXX";
                };
        };
};

I don’t know what to do and don’t have a lot of experience in device trees unfortunately…

pcdev0, pcdev1 , pcdev3

Do those exist in the base tree?

Regards,

Thx for anwsering @RobertCNelson !

Here is the .dtsi file I included in linux_bbb_5.4/arch/arm/boot/dts/am335x-boneblack.dts :

/ {
        pcdev1: pcdev-1 {
                compatible = "pcdev-E1x","pcdev-A1x";
                org,size = <512>;
                org,device-serial-num = "PCDEV1ABC123";
                org,perm = <0x11>;
        };

        pcdev2: pcdev-2 {
                compatible = "pcdev-B1x";
                org,size = <1024>;
                org,device-serial-num = "PCDEV2ABC456";
                org,perm = <0x11>;
        };

        pcdev3: pcdev-3 {
                compatible = "pcdev-C1x";
                org,size = <256>;
                org,device-serial-num = "PCDEV3ABC789";
                org,perm = <0x11>;
        };

        pcdev4: pcdev-4 {
                compatible = "pcdev-D1x";
                org,size = <2048>;
                org,device-serial-num = "PCDEV4ABC000";
                org,perm = <0x11>;
        };
};

In your overlay you use pcidev0 but looks like the numbering in the main DTS file goes from 1.
I have seen in dts files before where numbering of devices changed from 0 based to 1 based or vice versa

Yes, I deleted pcdev0 in my overlay and now it works !

Thx !