Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device tree compiler binary #311

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Lucassifoni
Copy link

Hello,

This is a draft that I will enhance with details as I make some progress.

I've seen that mount -t configfs none /sys/kernel/config makes the /sys/kernel/config/device-tree/overlays folder appear on this stock raspbian : Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux Raspbian GNU/Linux 10 (buster).

In its current state, this PR adds the dtc binary via BR2_PACKAGE_DTC_PROGRAMS.

It also adds CONFIG_OF_OVERLAY=y, but :

  • this doesn't solve the problem
  • I then learned that this directive is auto-included if CONFIG_OF_CONFIGFS=y is included.

So I'm trying various things to make progress. Thought I'd open the PR to see if someone has an idea.

See : https://github.com/buildroot/buildroot/blob/master/package/dtc/Config.in 

```
config BR2_PACKAGE_DTC_PROGRAMS
	bool "dtc programs"
	help
	  Say 'y' here if you also want the programs on the target:
	    - convert-dtsv0     convert from version 0 to version 1
	    - dtc               the device tree compiler
	    - dtdiff            compare two device trees (needs bash)
	    - fdtdump           print a readable version of a
	                        flat device tree
	    - fdtget            read values from device tree
	    - fdtput            write a property value to a device tree
```
@fhunleth
Copy link
Member

The official Raspberry Pi way is to load overlays via the dtoverlay command. Its source is at https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/dtoverlay. dtoverlay is included in the system and should work. I tested it on other Raspberry Pis. CONFIG_OF_OVERLAY=y isn't needed here since OF_CONFIGFS=y selects it. (This isn't obvious unless you read kernel source or run make linux-menuconfig and look.)

Enabling BR2_PACKAGE_DTC_PROGRAMS=y to compile and load overlays without dtoverlay seems like a good change to me, fwiw.

@Lucassifoni
Copy link
Author

@fhunleth sorry for the lost time. I don't know what exactly failed in my last test, but on-device compilation & loading of an overlay worked this morning, just with the DTC_PROGRAMS line. So I'm resuming work on the DTS loader assistant :^).

@Lucassifoni Lucassifoni marked this pull request as ready for review February 2, 2024 09:32
@Lucassifoni Lucassifoni changed the title [WIP] Device tree compiler and support for configfs Device tree compiler binary Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants