Skip to contentSkip to conversation

Adding Device Tree Overlays for MIPI-CSI2 Camera and libcamera to a buildroot Build

Buildroot [email protected] 2 participants 10 messages May 7, 2025 – May 21, 2025

lore
Share & tools
lore
#0 lore raw

Hi,

Does anyone have any advice on how to add DTOs needed by libcamera to a buildroot build?

We'd like to add Kieran's DTOs

https://git.uk.ideasonboard.com/camera/dt-overlays/src/branch/main/arch/arm64/boot/dts/freescale

to the buildroot default configuration for Debix Model A SBC

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

Ideally we'd also like to add the overlays for the Sony IMX 708 Image Sensor used in the RPi V3 camera but these aren't mainline:

https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/overlays/imx708-overlay.dts
https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/overlays/imx708.dtsi

We're planning to use the Debix Model A SBC or Debix SoM A with SoM A I/O board to prototype a new open source wildlife camera for our work in conservation of tree dwelling endangered dormice

https://new-homes-for-old-friends.cairnwater.com/

then after field studies with the prototype design a custom board for an NXP i.MX 8M Plus SoM.

The analysis for the new open source wildlife camera is here:

https://github.com/William-Robert-Robertson/WildCamera

Will
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

Hi Will!

Am 07.05.25 um 17:41 schrieb [email protected]:

Quoted 6 lines

Does anyone have any advice on how to add DTOs needed by libcamera to a buildroot build?

We'd like to add Kieran's DTOs

https://git.uk.ideasonboard.com/camera/dt-overlays/src/branch/main/arch/ arm64/boot/dts/freescale

Quoted 8 lines

to the buildroot default configuration for Debix Model A SBC

https://github.com/buildroot/buildroot/blob/master/configs/ polyhex_debix_model_a_defconfig

Ideally we'd also like to add the overlays for the Sony IMX 708 Image Sensor used in the RPi V3 camera but these aren't mainline:

https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/ overlays/imx708-overlay.dts
https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/ overlays/imx708.dtsi

You can use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that: Just place the DTSOs in the configured directory (with appropriate structure), and Buildroot will build them automatically. DTBOs will be in ${OUTPUT_DIR}/images. From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

With RPi overlays you'll probably have to adjust the overlays a bit so referenced names fit, etc. You're using a different board, and I've seen cases where DTS for RPi boards from mainline and RPi kernels use different names. But that doesn't change the build process. :-)

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

Will

Quoted 22 lines · Fiona Klute via buildroot

Hi Will!

Am 07.05.25 um 17:41 schrieb [email protected]:

Quoted 6 lines

Does anyone have any advice on how to add DTOs needed by libcamera to a buildroot build?

We'd like to add Kieran's DTOs

https://git.uk.ideasonboard.com/camera/dt-overlays/src/branch/main/arch/ arm64/boot/dts/freescale

Quoted 8 lines

to the buildroot default configuration for Debix Model A SBC

https://github.com/buildroot/buildroot/blob/master/configs/ polyhex_debix_model_a_defconfig

Ideally we'd also like to add the overlays for the Sony IMX 708 Image Sensor used in the RPi V3 camera but these aren't mainline:

https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/ overlays/imx708-overlay.dts
https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/ overlays/imx708.dtsi

You can use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that: Just place the DTSOs in the configured directory (with appropriate structure), and Buildroot will build them automatically. DTBOs will be in ${OUTPUT_DIR}/images. From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

With RPi overlays you'll probably have to adjust the overlays a bit so referenced names fit, etc. You're using a different board, and I've seen cases where DTS for RPi boards from mainline and RPi kernels use different names. But that doesn't change the build process. :-)

Quoted 7 lines

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Am 07.05.25 um 20:31 schrieb [email protected]:

Quoted 5 lines

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

Quoted 3 lines
Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

I'm not familiar with the board, but usually U-Boot will be the right place. On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can. There are a number of options with U-Boot, which one to pick depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

* If you use extlinux.conf, use the "devicetree-overlay" option.
* If you use a boot script, load the overlay and apply it before starting the kernel.
* If you use a FIT image, add the overlay to it and the relevant boot config defined in it.

See also:
https://docs.u-boot.org/en/latest/develop/distro.html (for extlinux.conf)
https://docs.u-boot.org/en/latest/usage/fdt_overlays.html (for the latter 2 options)

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

On the Buildroot side you need to make sure that the DTBOs and adjusted config get included in the image where U-Boot expects them (depending on the boot setup you use), if you need to make adjustments there it'll probably be in a post-build or post-image script, or in the genimage config.

The defconfig seems to put everything into the root partition image, so it might just work, as long as you use the right path in the U-Boot config. Maybe just set BR2_LINUX_KERNEL_CUSTOM_DTS_DIR, build, and see if you end up with a DTBO somewhere in your /boot dir. If yes, adjusting the U-Boot config to use it should be enough. ;-)

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hi Fiona,

Thank you very much - that's an enormous help - I'd have got very confused trying to work that out.

I'll study what you said and the links in detail and take more time to think about it.

Thank you very much again!

Will

Quoted 23 lines · Fiona Klute

Am 07.05.25 um 20:31 schrieb [email protected]:

Quoted 5 lines

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

Quoted 3 lines
Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

I'm not familiar with the board, but usually U-Boot will be the right place. On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can. There are a number of options with U-Boot, which one to pick depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

* If you use extlinux.conf, use the "devicetree-overlay" option.
* If you use a boot script, load the overlay and apply it before starting the kernel.
* If you use a FIT image, add the overlay to it and the relevant boot config defined in it.

See also:
https://docs.u-boot.org/en/latest/develop/distro.html (for extlinux.conf)
https://docs.u-boot.org/en/latest/usage/fdt_overlays.html (for the latter 2 options)

Quoted 8 lines

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

On the Buildroot side you need to make sure that the DTBOs and adjusted config get included in the image where U-Boot expects them (depending on the boot setup you use), if you need to make adjustments there it'll probably be in a post-build or post-image script, or in the genimage config.

The defconfig seems to put everything into the root partition image, so it might just work, as long as you use the right path in the U-Boot config. Maybe just set BR2_LINUX_KERNEL_CUSTOM_DTS_DIR, build, and see if you end up with a DTBO somewhere in your /boot dir. If yes, adjusting the U-Boot config to use it should be enough. ;-)

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Hi Fiona,

Thank you very much!

Quoted 1 line

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

How do I work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is?

I had a look in the defconfig here:

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

It seems to specify other parameters related to BR2_LINUX_KERNEL but not the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR so I got a bit lost trying to work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is and whether it's a directory that already exists or a new directory that I should create myself?

Is BR2_LINUX_KERNEL_CUSTOM_DTS_DIR something that's not already in the defconfig and that I'd have to add to the defconfig?

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.14" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mp-debix-model-a" BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

Quoted 2 lines

On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can.

Yes - that's my understanding as well - my knowledge of this is very limited but I think maybe RPi can do this and maybe NXP's i.MX Linux can do this but I'm not sure whether mainline Linux can do it at the moment.

Quoted 2 lines

There are a number of options with U-Boot, which one to pick
depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

I'd probably want to stick as close as I can to what's there at the moment.

Quoted 1 line

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

I looked in

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

but couldn't work out how to enable overlay support. Is that usually an existing line in the defconfig that should be amended or a new line that should be added?

Thank you very much for all your help!

Will

Quoted 38 lines · On 2025-05-08 08:46, [email protected] wrote:

Hi Fiona,

Thank you very much - that's an enormous help - I'd have got very confused trying to work that out.

I'll study what you said and the links in detail and take more time to think about it.

Thank you very much again!

Will

Quoted 27 lines · Fiona Klute

Am 07.05.25 um 20:31 schrieb [email protected]:

Quoted 5 lines

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

Quoted 3 lines
Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

I'm not familiar with the board, but usually U-Boot will be the right place. On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can. There are a number of options with U-Boot, which one to pick depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

* If you use extlinux.conf, use the "devicetree-overlay" option.
* If you use a boot script, load the overlay and apply it before starting the kernel.
* If you use a FIT image, add the overlay to it and the relevant boot config defined in it.

See also:
https://docs.u-boot.org/en/latest/develop/distro.html (for extlinux.conf)
https://docs.u-boot.org/en/latest/usage/fdt_overlays.html (for the latter 2 options)

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

On the Buildroot side you need to make sure that the DTBOs and adjusted config get included in the image where U-Boot expects them (depending on the boot setup you use), if you need to make adjustments there it'll probably be in a post-build or post-image script, or in the genimage config.

Quoted 8 lines
Quoted 4 lines

The defconfig seems to put everything into the root partition image, so it might just work, as long as you use the right path in the U-Boot config. Maybe just set BR2_LINUX_KERNEL_CUSTOM_DTS_DIR, build, and see if you end up with a DTBO somewhere in your /boot dir. If yes, adjusting the U-Boot config to use it should be enough. ;-)

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Hello!

Quoted 1 line · Will

How do I work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is?

You may create a directory named "dts" inside board/<vendor>/<board_name> (or maybe board/<board_name>), put your device tree files there, inside a vendor subdirectory if that is how the DTS files are laid out in the kernel, then point BR2_LINUX_KERNEL_CUSTOM_DTS_DIR to that "dts" directory. See for example

configs/acmesystems_acqua_a5_256mb_defconfig

Regards,

Edgar.

Quoted 83 lines

I had a look in the defconfig here:

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

It seems to specify other parameters related to BR2_LINUX_KERNEL but not the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR so I got a bit lost trying to work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is and whether it's a directory that already exists or a new directory that I should create myself?

Is BR2_LINUX_KERNEL_CUSTOM_DTS_DIR something that's not already in the defconfig and that I'd have to add to the defconfig?

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.14" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mp-debix-model-a" BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

Quoted 2 lines

On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can.

Yes - that's my understanding as well - my knowledge of this is very limited but I think maybe RPi can do this and maybe NXP's i.MX Linux can do this but I'm not sure whether mainline Linux can do it at the moment.

Quoted 2 lines

There are a number of options with U-Boot, which one to pick
depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

I'd probably want to stick as close as I can to what's there at the moment.

Quoted 1 line

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

I looked in

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

but couldn't work out how to enable overlay support. Is that usually an existing line in the defconfig that should be amended or a new line that should be added?

Thank you very much for all your help!

Will

Quoted 42 lines · On 2025-05-08 08:46, [email protected] wrote:

Hi Fiona,

Thank you very much - that's an enormous help - I'd have got very confused trying to work that out.

I'll study what you said and the links in detail and take more time to think about it.

Thank you very much again!

Will

Quoted 31 lines · Fiona Klute

Am 07.05.25 um 20:31 schrieb [email protected]:

Quoted 5 lines

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

Quoted 3 lines
Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

I'm not familiar with the board, but usually U-Boot will be the right place. On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can. There are a number of options with U-Boot, which one to pick depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

* If you use extlinux.conf, use the "devicetree-overlay" option.
* If you use a boot script, load the overlay and apply it before starting the kernel.
* If you use a FIT image, add the overlay to it and the relevant boot config defined in it.

See also:
https://docs.u-boot.org/en/latest/develop/distro.html (for extlinux.conf)
https://docs.u-boot.org/en/latest/usage/fdt_overlays.html (for the latter 2 options)

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

On the Buildroot side you need to make sure that the DTBOs and adjusted config get included in the image where U-Boot expects them (depending on the boot setup you use), if you need to make adjustments there it'll probably be in a post-build or post-image script, or in the genimage config.

The defconfig seems to put everything into the root partition image, so it might just work, as long as you use the right path in the U-Boot config. Maybe just set BR2_LINUX_KERNEL_CUSTOM_DTS_DIR, build, and see if you end up with a DTBO somewhere in your /boot dir. If yes, adjusting the U-Boot config to use it should be enough. ;-)

Best regards,
Fiona

Quoted 8 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw

Hello Edgar!

Thank you very much!

I see that in acmesystems defconfig :-)

https://github.com/buildroot/buildroot/blob/master/configs/acmesystems_acqua_a5_256mb_defconfig

I hadn't understood that I could add lines to the defonfig file.

What's the best way for me to keep my changes separate from the underlying defconfig? Should I write a short config file that inherits the defconfig and applies my changes?

Thank you very much for your help!

Will

Quoted 11 lines · Edgar Bonet

Hello!

Quoted 1 line · Will

How do I work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is?

You may create a directory named "dts" inside board/<vendor>/<board_name> (or maybe board/<board_name>), put your device tree files there, inside a vendor subdirectory if that is how the DTS files are laid out in the kernel, then point BR2_LINUX_KERNEL_CUSTOM_DTS_DIR to that "dts" directory. See for example

Quoted 97 lines

configs/acmesystems_acqua_a5_256mb_defconfig

Regards,

Edgar.

Quoted 91 lines

I had a look in the defconfig here:

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

It seems to specify other parameters related to BR2_LINUX_KERNEL but not the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR so I got a bit lost trying to work out where the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR is and whether it's a directory that already exists or a new directory that I should create myself?

Is BR2_LINUX_KERNEL_CUSTOM_DTS_DIR something that's not already in the defconfig and that I'd have to add to the defconfig?

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.14" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mp-debix-model-a" BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

Quoted 2 lines

On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can.

Yes - that's my understanding as well - my knowledge of this is very limited but I think maybe RPi can do this and maybe NXP's i.MX Linux can do this but I'm not sure whether mainline Linux can do it at the moment.

Quoted 2 lines

There are a number of options with U-Boot, which one to pick
depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

I'd probably want to stick as close as I can to what's there at the moment.

Quoted 1 line

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

I looked in

https://github.com/buildroot/buildroot/blob/master/configs/polyhex_debix_model_a_defconfig

but couldn't work out how to enable overlay support. Is that usually an existing line in the defconfig that should be amended or a new line that should be added?

Thank you very much for all your help!

Will

Quoted 38 lines · On 2025-05-08 08:46, [email protected] wrote:

Hi Fiona,

Thank you very much - that's an enormous help - I'd have got very confused trying to work that out.

I'll study what you said and the links in detail and take more time to think about it.

Thank you very much again!

Will

Quoted 27 lines · Fiona Klute

Am 07.05.25 um 20:31 schrieb [email protected]:

Quoted 5 lines

Hi Fiona,

Thank you very much! That's a big help to know to use BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for that.

What directory structure is needed for the overlays? Just the DTO files in a directory or something more complicated?

It's expected to match the structure of the per-arch dts directory in the kernel source, with vendor directories. The polyhex_debix_model_a_defconfig uses the freescale/imx8mp-debix-model-a DTS, so inside your BR2_LINUX_KERNEL_CUSTOM_DTS_DIR you'll probably need something like freescale/my-camera.dtso (whatever you want to call your DTSOs, the DTBOs will match the source names).

Quoted 3 lines
Quoted 1 line

From there you'll need to adjust the boot process for your board to actually apply the overlay. If you want to send a patch, the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR should be inside the board directory.

Thank you very much. I don't know how to do that. What's the best way to get the boot process to apply the overlay? I'd heard that it can be done by the kernel or by U-Boot but I'm doing this for the first time so I'm not sure what I'm doing.

I'm not familiar with the board, but usually U-Boot will be the right place. On some boards (like RPi) the firmware can also do it (only useful if U-Boot & kernel then use that FDT), last time I checked mainline Linux cannot, but some patched kernels can. There are a number of options with U-Boot, which one to pick depends on how you configure the boot (at a glance the defconfig seems to use extlinux.conf):

* If you use extlinux.conf, use the "devicetree-overlay" option.
* If you use a boot script, load the overlay and apply it before starting the kernel.
* If you use a FIT image, add the overlay to it and the relevant boot config defined in it.

See also:
https://docs.u-boot.org/en/latest/develop/distro.html (for extlinux.conf)
https://docs.u-boot.org/en/latest/usage/fdt_overlays.html (for the latter 2 options)

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

On the Buildroot side you need to make sure that the DTBOs and adjusted config get included in the image where U-Boot expects them (depending on the boot setup you use), if you need to make adjustments there it'll probably be in a post-build or post-image script, or in the genimage config.

Quoted 8 lines
Quoted 4 lines

The defconfig seems to put everything into the root partition image, so it might just work, as long as you use the right path in the U-Boot config. Maybe just set BR2_LINUX_KERNEL_CUSTOM_DTS_DIR, build, and see if you end up with a DTBO somewhere in your /boot dir. If yes, adjusting the U-Boot config to use it should be enough. ;-)

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#8 lore raw

Hi Will!

Am 15.05.25 um 18:11 schrieb [email protected]:

Quoted 7 lines

I see that in acmesystems defconfig :-)

https://github.com/buildroot/buildroot/blob/master/configs/ acmesystems_acqua_a5_256mb_defconfig

I hadn't understood that I could add lines to the defonfig file.

What's the best way for me to keep my changes separate from the underlying defconfig? Should I write a short config file that inherits the defconfig and applies my changes?

The approach I usually use is to create a custom defconfig, and maintain that in an external tree (assuming it's a customized one, not a basic one that could be contributed to Buildroot).

Usually you shouldn't need to modify the defconfig file by hand, instead just use "make nconfig" (or "make menuconfig", etc., whichever you prefer) to adjust your config, change BR2_DEFCONFIG to whatever location you want, and run "make savedefconfig" to create the defconfig file.

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw
In reply to [email protected]

Am 14.05.25 um 19:36 schrieb [email protected]:

Quoted 7 lines
Quoted 1 line

Either way you may have to enable overlay support in the U-Boot build config (if it isn't by default).

I looked in

https://github.com/buildroot/buildroot/blob/master/configs/ polyhex_debix_model_a_defconfig

but couldn't work out how to enable overlay support. Is that usually an existing line in the defconfig that should be amended or a new line that should be added?

U-Boot build config is separate from Buildroot config. In your Buildroot config you can either choose a U-Boot defconfig (part of the U-Boot sources) to use, or set a custom U-Boot (def-)config file to use. There are also make commands to open the U-Boot config editor and save a U-Boot defconfig (same idea as saving a custom Buildroot defconfig). The same applies for the Linux kernel and a few other components. See "Configuration of other components" in the docs, it lists both make commands and config options:
https://nightly.buildroot.org/#_configuration_of_other_components

Mind that I wrote you *may* need to enable device tree overlay support because I don't know all the U-Boot defconfigs, it's very well possible that the one for your board already enables it by default and you don't need to change a thing in that regard.

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot