Skip to content

Devicetree testing#2845

Closed
k0d wants to merge 2 commits into
adafruit:masterfrom
k0d:devicetree
Closed

Devicetree testing#2845
k0d wants to merge 2 commits into
adafruit:masterfrom
k0d:devicetree

Conversation

@k0d
Copy link
Copy Markdown

@k0d k0d commented May 2, 2020

I'd like to investigate the possibility of using device trees, I've copied in some code from the Zephyr project to test with. So far it's working to read in the flash-size of nucleo_f746zg into mpconfigboard.h.

I believe we can generate linker_files from this, and also replace mpconfigboard.h, mpconfigport.h, and maybe the .mk files as well. Ideally we'd be able to store everything that configures the board in the devicetree files.

This is very much not complete, I'd just like some feedback.

@hierophect @tannewt @ladyada @dhalbert @jepler

@k0d k0d marked this pull request as draft May 2, 2020 18:08
@tannewt
Copy link
Copy Markdown
Member

tannewt commented May 4, 2020

What do you want to use device trees for? I generally find them hard to understand.

@k0d
Copy link
Copy Markdown
Author

k0d commented May 4, 2020

I think the main thing I like about them compared to using toml, xml, json etc is that you can easily reference other nodes. For example gpios = < &gpiob 0x0 0x0 >;

One alternative would be to create some nice data structure in python? Then we don't need to parse it.

The reason I'd like to use a system like this is to avoid having too many places to change when adding a new port/soc/board.

compatible = "arm,dtcm";
reg = < 0x20000000 0x10000 >;
};
pins {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tannewt

I like this kind of syntax for defining the pins...what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like DTS's use of symbols for many things. I'm totally ok with how we do it now because it's much clearer to me.

@tannewt
Copy link
Copy Markdown
Member

tannewt commented May 4, 2020

I think the main thing I like about them compared to using toml, xml, json etc is that you can easily reference other nodes. For example gpios = < &gpiob 0x0 0x0 >;

I think that makes it harder to understand.

One alternative would be to create some nice data structure in python? Then we don't need to parse it.

I think we'll end up with TOML in the long run but it's a very low priority. What we have now is well documented and well understood.

The reason I'd like to use a system like this is to avoid having too many places to change when adding a new port/soc/board.

I don't think we have too many places now. New ports are rare and new boards are well documented and well defined. My main interest with the build system revamp I prototyped is to reduce the duplication of logic between ports and move it to a clearer system.

I don't think that using device trees for configuration is clearer. So, I'm going to close this. Thanks for the proposal!

@tannewt tannewt closed this May 4, 2020
@k0d k0d deleted the devicetree branch May 5, 2020 19:48
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.

2 participants