Skip to contentSkip to conversation

Board specific files

U-Boot Linder Pascal 3 participants 3 messages Apr 3, 2019 – Apr 16, 2019

lore
Share & tools
lore
#0 lore raw

Hello everyone,

I am new to U-Boot and I am trying to understand what I need to code for using my own board with the bootloader.

The device tree files I have already found under ./arch/arm/dts/. Can I just add my device tree under this directory?

Also, what is the difference between the configuration files under ./configs/ and ./include/configs/? Do I need to add a file in both of the named directories?

If someone knows a well documented guide to add a new board to the mainline, I would be very grateful.

Sincerely,

Pascal Linder

Student Telekommunikation Netzwerke und Sicherheit

Klasse T-3b

#1 lore raw

Hello Pascal,

Am Mittwoch, 3. April 2019, 09:08:57 CEST schrieb Linder Pascal:

Quoted 2 lines

I am new to U-Boot and I am trying to understand what I need to code for using my own board with the bootloader.

Welcome. :-)

I try to describe my view on this, anyone correct me, if something is wrong.

Quoted 2 lines

The device tree files I have already found under ./arch/arm/dts/. Can I just add my device tree under this directory?

Yes. Note: you probably can not just copy a dts file from the Linux Kernel. From what I discovered when adding a new board lately, those files are slightly different.

Quoted 3 lines

Also, what is the difference between the configuration files under ./configs/ and ./include/configs/? Do I need to add a file in both of the named directories?

For setting board options and more, U-Boot uses the Kconfig system from the Linux kernel (adapted to the needs of U-Boot). In the old days everything was set as preprocessor define in a board specific header in ./include/configs but more and more options have been converted over the years.

Today you still need that header in ./include/configs but fewer things are set there with each new U-Boot release.

The files in ./configs/ are default configs for a board to have an initial working ./.config configuration file for that Kconfig approach. Although these defconfigs are not strictly necessary, it's very convenient as a starting point when compiling an image for a board. Some embedded build systems use those defconfigs.

Quoted 2 lines

If someone knows a well documented guide to add a new board to the mainline, I would be very grateful.

I see two steps here. Getting all the things in place for a new board to boot is one, the other one with a different set of challenges is getting that into mainline U-Boot.

For the first I would advise to look into ./README and ./doc/ (keep in mind, information there might be outdated) and read lots of code of other boards, preferably boards with a similar SoC added lately.

For getting your patches into mainline, the guide on submitting patches in the Linux kernel docs [1] mostly applies to U-Boot as well.

Greets
Alex

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html

#2 lore raw
Quoted 21 lines · Alexander Dahl

Hello Pascal,

Am Mittwoch, 3. April 2019, 09:08:57 CEST schrieb Linder Pascal:

Quoted 2 lines

I am new to U-Boot and I am trying to understand what I need to code for using my own board with the bootloader.

Welcome. :-)

I try to describe my view on this, anyone correct me, if something is wrong.

Quoted 2 lines

The device tree files I have already found under ./arch/arm/dts/. Can I just add my device tree under this directory?

Yes. Note: you probably can not just copy a dts file from the Linux Kernel. From what I discovered when adding a new board lately, those files are slightly different.

Quoted 3 lines

Also, what is the difference between the configuration files under ./configs/ and ./include/configs/? Do I need to add a file in both of the named directories?

Quoted 8 lines

For setting board options and more, U-Boot uses the Kconfig system from the Linux kernel (adapted to the needs of U-Boot). In the old days everything was set as preprocessor define in a board specific header in ./include/configs but more and more options have been converted over the years.

Today you still need that header in ./include/configs but fewer things are set there with each new U-Boot release.

There is no documentation which config has to go into the include folder, correct? I had a hard time to figure that out as well.

I suppose the situation here is the same as with DM, where we have boards and drivers which are not yet converted. Do we have a roadmap to convert the legacy configs to the new Kconfig system?

Regards,
Matthias

Quoted 30 lines

The files in ./configs/ are default configs for a board to have an initial working ./.config configuration file for that Kconfig approach. Although these defconfigs are not strictly necessary, it's very convenient as a starting point when compiling an image for a board. Some embedded build systems use those defconfigs.

Quoted 2 lines

If someone knows a well documented guide to add a new board to the mainline, I would be very grateful.

I see two steps here. Getting all the things in place for a new board to boot is one, the other one with a different set of challenges is getting that into mainline U-Boot.

For the first I would advise to look into ./README and ./doc/ (keep in mind, information there might be outdated) and read lots of code of other boards, preferably boards with a similar SoC added lately.

For getting your patches into mainline, the guide on submitting patches in the Linux kernel docs [1] mostly applies to U-Boot as well.

Greets
Alex

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot