
Hello Pascal,
Am Mittwoch, 3. April 2019, 09:08:57 CEST schrieb Linder Pascal:
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.
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.
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.
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