D
D
danilus2021-11-23 03:58:05
linux
danilus, 2021-11-23 03:58:05

Where can I find uboot configuration information?

I'm a noob at uboot config, firmware, etc. In my wanderings on the Internet, I found not too detailed or information for too knowledgeable people.

1. I want to know how to configure uboot or at least upgrade defconfig
2. I want to figure out how to run Linux on the board from the bootloader assembly.
3. For a more detailed dive, I want to understand how to configure the bootloader for a conditionally unknown no-name board (although it is actually known). For experiments, I have a tablet on allwiner a10, and orange pi zero 2.
4. While surfing the Internet, I came across such a thing as a "devicetree" or dts file, as I understand it, it is responsible for the hardware of the board and I would like to understand this in more detail.

P.S. I plan to buy a ttl adapter for debugging.
P.P.S. I have not yet decided what I want to do in life, maybe I’ll go to study in this direction in general, please don’t kick too much :D

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2021-11-23
@danilus

I have had some experience with uboot, though for a different OS
. If you have some standard purchase board, then uboot may already have a ready-made config. Usually board manufacturers in the documentation indicate how to build uboot for their board (if they support uboot), or you can google it on the Internet.
If the board is self-made, then take the config closest to your board (you took some reference design of the board as a basis, take this board as a basis), rename it and make the appropriate changes to it.
It happens that along with the config, you need to make changes to dts, they are in uboot in ./arch/<platform name>/dts. The name of the dts used is in the CONFIG_DEFAULT_DEVICE_TREE variable and/or in the CONFIG_OF_LIST in the config file.
A config file is just a set of options that turn into a set of #define instructions on build.
Everything is more complicated with dts. There is a whole language for describing iron.
To build uboot, I recommend the following sequence:
1. Create a separate empty directory for the build. It will be the current directory for all further commands
2. Let the directory where uboot itself is stored in the UBOOT_DIR variable. The processor architecture of your board (eg arm) in the ARCH variable. Cross compiler prefix in CROSS (eg arm-linux-gnueabihf-). The name of the selected defconfig file in the DEFCONFIG variable (you specify the name along with the _defconfig suffix)
3. Clean up the build directory:

make -C $UBOOT_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS distclean

This command is useful during rebuilds in case of configuration changes
4. Preparing the configuration for building:
make -C $UBOOT_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS $DEFCONFIG

5. Building: A few useful things: 1. You can set an additional option for make: It specifies the directory in which the build will take place. This directory will be created by make itself. This can be convenient if you work with several configs at once. 2. A config configurator is built into uboot :) Configuration takes place in text mode using the menu, there are hints for options, etc. When you have created the initial configuration in step 4, issue the command:make -C $UBOOT_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS
make -C $UBOOT_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS menuconfig

Here you can also add the -O option to select the directory with the configuration. After correcting the configuration, do not forget to save it.
Next, you need to give the command:
make -C $UBOOT_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS savedefconfig

It will create a defconfig file in the build directory based on the current configuration. This file can be renamed to <имя платы>_defconfigand placed in the uboot config directory and later used for assembly.
3. In the directory with uboot, issue a command to get a list of possible options. 4. Usually I build uboot under Linux, but the same scheme works well in WSL under Windows. There is a set of cross-compilers in the ports (I used the ubuntu distribution in WSL). Good luck! make help

S
SOTVM, 2021-11-23
@sotvm

First, it would be nice to learn how to google in Yandex))

the first link on your question

619c42c15ee13470573224.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question