View previous topic :: View next topic |
Author |
Message |
Gentoopc Guru

Joined: 25 Dec 2017 Posts: 413
|
Posted: Sat May 26, 2018 10:30 am Post subject: device tree |
|
|
hello, tell me how to bind a device tree to a new compiled kernel? Is it possible to somehow transfer the kernel to an old dtb or need to compile from dts? |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55146 Location: 56N 3W
|
Posted: Sat May 26, 2018 11:21 am Post subject: |
|
|
Gentoopc,
On what system?
e.g. on Raspberry Pi, the dtb is loaded with the kernel and the kernel picks it up as a part of of the initialisation process.
the dtb is its own file so you can mix and match kernel and dtb files. You might not like the results but its very easy.
If you need a dtb, the kernel build process will build it.
Its also possible to merge the dtb into the kernel. Exactly how is system dependent.
There will be a software tool for this. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
Gentoopc Guru

Joined: 25 Dec 2017 Posts: 413
|
Posted: Sat May 26, 2018 6:20 pm Post subject: |
|
|
ls /boot before installing the kernel
Code: |
armbianEnv.txt
armbian_first_run.txt.template
bat
boot.bmp
boot.cmd
boot-desktop.png
boot.scr
config-3.10.107-pine64
dtb
dtb-3.10.107-pine64
dtb-3.10.107-pine64.old
Image
Image-3.10.107-pine64
initrd.img
initrd.img-3.10.107-pine64
System.map-3.10.107-pine64
t.txt
uInitrd
uInitrd-3.10.107-pine64
|
after installing the kernel
Code: |
armbianEnv.txt
armbian_first_run.txt.template
bat
boot.bmp
boot.cmd
boot-desktop.png
boot.scr
config-3.10.107-pine64
config-4.14.43kernelmy
dtb
dtb-3.10.107-pine64
dtb-3.10.107-pine64.old
Image
Image-3.10.107-pine64
initrd.img
initrd.img-3.10.107-pine64
initrd.img-4.14.43kernelmy
System.map-3.10.107-pine64
System.map-4.14.43kernelmy
t2.txt
uInitrd
uInitrd-3.10.107-pine64
uInitrd-4.14.43kernelmy
vmlinuz-4.14.43kernelmy
|
vmlinuz-4.14.43kernelmy-
this is the kernel that I built and on it you can see the link
but what can I do with dtb now?
what should I do next?[/topic][/url][/profile][/bug] |
|
Back to top |
|
 |
Gentoopc Guru

Joined: 25 Dec 2017 Posts: 413
|
Posted: Sat May 26, 2018 6:24 pm Post subject: |
|
|
orange pi win+ |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55146 Location: 56N 3W
|
Posted: Sat May 26, 2018 8:12 pm Post subject: |
|
|
Gentoopc,
The kernel build will have made you a dtb too.
It will be in /usr/src/linux/arch/arm64/boot/dts/... for arm64 or in /usr/src/linux/arch/arm/boot/dts/... for 32 bit.
Mainline kernel support will be patchy to not existent.
There is a reason the vendor kernel is Image-3.10.107-pine64 ... that's based on 3.10.107. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3602
|
Posted: Sat May 26, 2018 11:19 pm Post subject: |
|
|
Raspberrypi-sources comes with default configs and dtbs for a whole lot of different boards.
It did work out of the box for my banana (well, figuring things out took me a while, but it wasn't dtb's fault), if you find a config for your board there, you have a good chance to get it up and running without any modifications. Running defconfig for your boad will set things up for you. You can tweak some modules later, after you have something that at least boots. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55146 Location: 56N 3W
|
Posted: Sun May 27, 2018 7:56 am Post subject: |
|
|
Moved from Gentoo Chat to Gentoo on ARM. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
Gentoopc Guru

Joined: 25 Dec 2017 Posts: 413
|
Posted: Sun May 27, 2018 11:00 am Post subject: |
|
|
Many thanks to you, dear |
|
Back to top |
|
 |
erm67 l33t


Joined: 01 Nov 2005 Posts: 653 Location: EU
|
Posted: Thu May 31, 2018 6:41 am Post subject: |
|
|
The dts binds HW resources to symbolic names that are referenced by drivers in the kernel, sometimes, for obscure reasons ( ) the names are changed by developers, or new symbolic names are added. Of course the change must happen on both sides, in the dtb and the kernel driver. That is why it is always wise to use the dtb specific to a kernel version, if possible of course.
Nice intro to device trees:
slides
https://events.static.linuxfound.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf
video
https://www.youtube.com/watch?v=m_NyYEBxfn8
The drivers in kernel x.y.z expecs to find the symbolic names as defined in the dts that was shipped with it, using a different version might or might not work.
For example using the dtb from kernel 4.4.14 with kernel 4.4.16 on my amlogic S912 board resulted into a non working USB ...... problem solved with the correct dtb (I am also too lazy to update the dtb all the times). _________________ Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia
My fediverse account: @erm67@erm67.dynu.net |
|
Back to top |
|
 |
Gentoopc Guru

Joined: 25 Dec 2017 Posts: 413
|
Posted: Thu May 31, 2018 11:23 am Post subject: |
|
|
erm67 wrote: | The dts binds HW resources to symbolic names that are referenced by drivers in the kernel, sometimes, for obscure reasons ( ) the names are changed by developers, or new symbolic names are added. Of course the change must happen on both sides, in the dtb and the kernel driver. That is why it is always wise to use the dtb specific to a kernel version, if possible of course.
Nice intro to device trees:
slides
https://events.static.linuxfound.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf
video
https://www.youtube.com/watch?v=m_NyYEBxfn8
The drivers in kernel x.y.z expecs to find the symbolic names as defined in the dts that was shipped with it, using a different version might or might not work.
For example using the dtb from kernel 4.4.14 with kernel 4.4.16 on my amlogic S912 board resulted into a non working USB ...... problem solved with the correct dtb (I am also too lazy to update the dtb all the times). |
I do not have dtb in the / arch / arm64 / dts folder
I tried to compile myself but nothing happened |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55146 Location: 56N 3W
|
Posted: Thu May 31, 2018 6:46 pm Post subject: |
|
|
Gentoopc,
I do not have dtb in the / arch / arm64 / dts folder.
That's correct. Code: | /usr/src/linux/arch/arm64/boot/dts $ ls
actions allwinner amd apm broadcom exynos hisilicon Makefile mediatek qcom renesas socionext xilinx
al altera amlogic arm cavium freescale lg marvell nvidia realtek rockchip sprd zte |
The dts older is further divided into CPU vendors.
You have an allwinner CPU.
Code: | $ ls allwinner/
axp803.dtsi sun50i-a64-olinuxino.dts sun50i-a64-sopine.dtsi sun50i-h5-orangepi-pc2.dts sun50i-h6-pine-h64.dts
Makefile sun50i-a64-orangepi-win.dts sun50i-a64-teres-i.dts sun50i-h5-orangepi-prime.dts
sun50i-a64-bananapi-m64.dts sun50i-a64-pine64.dts sun50i-h5.dtsi sun50i-h5-orangepi-zero-plus2.dts
sun50i-a64.dtsi sun50i-a64-pine64-plus.dts sun50i-h5-nanopi-neo2.dts sun50i-h5-orangepi-zero-plus.dts
sun50i-a64-nanopi-a64.dts sun50i-a64-sopine-baseboard.dts sun50i-h5-nanopi-neo-plus2.dts sun50i-h6.dtsi |
The kernel build system should have left several dtb files there.
Pick the one for you CPU. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
|