Jump to content

Banana Pi Pro /boot script.bin linked with bananapi and sun7i-a20-bananapro.dtb


jobenvil

Recommended Posts

I cannot understand how the drivers (dtb) could be choosen properly for banana pi pro. I download the 4.5 wheezy version for Banana Pi Pro but dmesg shows that the board is a "banana pi BP1-M1":

[    0.000000] Linux version 4.2.3-sunxi (root@production) (gcc version 4.8.2 (Ubuntu/Linaro 4.8.2-16ubuntu4) ) #2 SMP Sun Oct 11 14:12:18 CEST 2015
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Banana Pi BPI-M1

I checked the /boot directory and I see that the script.bin is linked with "bananapi.bin" even inside /boot/bin we can find the "bananapipro.bin" file:

root@bananapi:/boot# ls -ltr
total 7396
-rwxr-xr-x 1 root root 5468416 Oct 11 14:12 vmlinuz-4.2.3-sunxi
-rw-r--r-- 1 root root 1955569 Oct 11 14:12 System.map-4.2.3-sunxi
-rw-r--r-- 1 root root  115484 Oct 11 14:12 config-4.2.3-sunxi
lrwxrwxrwx 1 root root      25 Oct 11 19:10 zImage -> /boot/vmlinuz-4.2.3-sunxi
drwxr-xr-x 2 root root    4096 Oct 11 19:10 dtb
-rw-r--r-- 1 root root    6944 Oct 11 19:10 boot.bmp
-rw-r--r-- 1 root root    1901 Oct 11 19:11 boot.cmd
-rw-r--r-- 1 root root    1973 Oct 11 19:11 boot.scr
drwxr-xr-x 2 root root    4096 Oct 11 19:11 bin
lrwxrwxrwx 1 root root      25 Oct 19 11:23 script.bin -> /boot/bin/bananapi.bin

I modified the link to point to bananapipro.bin, but theoretically this has no sense anymore because with this new kernel we use the dtb files and I see that in dmesg has nothing changed. Is my supposition correct?

 

When I check the boot.cmd:

---------
# Boot loader script to boot with different boot methods for old and new kernel
#--------------------------------------------------------------------------------------------------------------------------------
if ext4load mmc 0 0x00000000 /boot/.next || fatload mmc 0 0x00000000 .next
then
# sunxi mainline kernel
#--------------------------------------------------------------------------------------------------------------------------------
ext4load mmc 0 0x49000000 /boot/dtb/${fdtfile} || fatload mmc 0 0x49000000 /dtb/${fdtfile}
ext4load mmc 0 0x46000000 /boot/zImage || fatload mmc 0 0x46000000 zImage
env set fdt_high ffffffff
bootz 0x46000000 - 0x49000000
#--------------------------------------------------------------------------------------------------------------------------------
else
# sunxi android kernel
#--------------------------------------------------------------------------------------------------------------------------------
ext4load mmc 0 0x43000000 /boot/script.bin || fatload mmc 0 0x43000000 script.bin
ext4load mmc 0 0x48000000 /boot/zImage || fatload mmc 0 0x48000000 zImage
bootz 0x48000000

I cannot understand how the boot process chooses the properly "sun7i-a20-bananapro.dtb" between all the *.dtb files:

...
-rw-r--r-- 1 root root 27637 Oct 11 14:13 sun7i-a20-bananapro.dtb
-rw-r--r-- 1 root root 27261 Oct 11 14:13 sun7i-a20-bananapi-r1.dtb
-rw-r--r-- 1 root root 27902 Oct 11 14:13 sun7i-a20-bananapi-m1-plus.dtb
-rw-r--r-- 1 root root 27145 Oct 11 14:13 sun7i-a20-bananapi.dtb
-rw-r--r-- 1 root root 19291 Oct 11 14:13 sun6i-a31s-cs908.dtb
-rw-r--r-- 1 root root 23022 Oct 11 14:13 sun6i-a31s-bananapi-m2.dtb
...

and how to confirm it with CLI that I'm using the properly .dtb file after every kernel update.

 

Thanks in advance!

Link to comment
Share on other sites

There is one image for all bananas and DTB file is encoded into u-boot.

 

For bananapro you only need to change:

ext4load mmc 0 0x49000000 /boot/dtb/${fdtfile} || fatload mmc 0 0x49000000 /dtb/${fdtfile}

to

ext4load mmc 0 0x49000000 /boot/dtb/sun7i-a20-bananapro.dtb || fatload mmc 0 0x49000000 /dtb/sun7i-a20-bananapro.dtb

and recompile the boot.cmd to boot.scr as stated in file. reboot and you are done.

Link to comment
Share on other sites

There is one image for all bananas and DTB file is encoded into u-boot.

 

For bananapro you only need to change:

ext4load mmc 0 0x49000000 /boot/dtb/${fdtfile} || fatload mmc 0 0x49000000 /dtb/${fdtfile}

to

ext4load mmc 0 0x49000000 /boot/dtb/sun7i-a20-bananapro.dtb || fatload mmc 0 0x49000000 /dtb/sun7i-a20-bananapro.dtb

and recompile the boot.cmd to boot.scr as stated in file. reboot and you are done.

 

 

I got it, shame on me! thanx, thanx!!

and thanx!

 

this looks like much better now:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.2.3-sunxi (root@production) (gcc version 4.8.2 (Ubuntu/Linaro 4.8.2-16ubuntu4) ) #2 SMP S
un Oct 11 14:12:18 CEST 2015
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: LeMaker Banana Pro      <=======================THANKS!!===================================
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 262144
[    0.000000] free_area_init_node: node 0, pgdat c0a2c800, node_mem_map eeef8000

Edited by jobenvil
Link to comment
Share on other sites

Hi.

I have a Banana Pi M1+, and I'm using Armbian_4.5_Bananapi_Debian_jessie_3.4.109.

If I'm not mistaken the M1+ is very similar to PRO version. Also in my case the script.bin is linked with "bananapi.bin", but I have no /boot/dtb folder. Is it a feature available with 4.x kernel images?

I've changed the script.bin to link "bananapipro.bin" and recompiled the boot.cmd to boot.scr. Is it correct?

About this fix for the wi-fi

apt-get install linux-image-banana

do I have to apply it with "bananapi.bin" or "bananapipro.bin"?

 

Thanks in advance.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines