Page 1 of 1

Device tree overlays in 5.14

Posted: Sat Oct 09, 2021 2:28 pm
by foft
Hi,

I was applying a device tree overlay in kernel 4.19 by mounting configfs, upon which I'd see the device-tree. After upgrading to 5.14 I no longer see this, does anyone know how to do the same thing in 5.14?

Is there a new system to provide configuration to custom modules in Linux 5?

Thanks,

Mark

Re: Device tree overlays in 5.14

Posted: Sat Oct 09, 2021 2:36 pm
by foft
Looks like I need the module linked here:
https://stackoverflow.com/questions/508 ... e-overlays

Re: Device tree overlays in 5.14

Posted: Sun Oct 10, 2021 8:12 pm
by foft
Still struggling to make this work.
The .dts override I had before no longer works. I did manage to apply it but seems to be an issue with how the references work. So I need to reference intc, previous I added an intc block. That needs to no longer work and the right was is to using /plugin/;. However that fails to find intc when I apply the overlay.

One possible lead: Was the dts in the kernel compiled using -@ on the command line?

./dtc -O dtb -o /lib/firmware/minimig.dtbo -@ -b 0 ./minimig.dts
cp /lib/firmware/minimig.dtbo /sys/kernel/config/device-tree/overlays/minimig/dtbo
echo 1 > /sys/kernel/config/device-tree/overlays/minimig/status

359.342349] OF: resolver: no symbols in root of device tree.
[ 359.348096] OF: resolver: overlay phandle fixup failed: -22
[ 359.353711] dtbocfg_overlay_item_create: Failed to apply overlay (ret_val=-22)

Code: Select all

/dts-v1/;
/plugin/;
/{
fragment@0 {
  target-path = "/";
  __overlay__ {
        minimig_irq {
          compatible = "minimig_irq";
          interrupt-parent = <&intc>;
          interrupts = <0 42 1>;
        };
  };
};
};

Re: Device tree overlays in 5.14

Posted: Sun Oct 10, 2021 8:20 pm
by foft
Managed to work around by using an explicit interrupt-parent, it complains then works!

Code: Select all

/dts-v1/;
/plugin/;
/{
fragment@0 {
  target-path = "/";
  __overlay__ {
        minimig_irq {
          compatible = "minimig_irq";
          interrupt-parent = <0x02>;
          interrupts = <0 42 1>;
        };
  };
};
};


Re: Device tree overlays in 5.14

Posted: Sun Oct 10, 2021 8:36 pm
by LamerDeluxe
Thanks for documenting your progress here!