Allwinner R16(A33) U-Boot Mainline

740 views
Skip to first unread message

Michał Wołowik

unread,
Mar 19, 2018, 6:38:26 AM3/19/18
to linux-sunxi
Hello,

I bought a few days ago BananaPi M2M Magic. Board works somehow with original images downloaded from manufacturer webpage. In the network, I found mainline kernel (https://github.com/BPI-SINOVOIP/BPI-Mainline-kernel) and mainline u-boot (https://github.com/BPI-SINOVOIP/BPI-Mainline-uboot). Everything compiled well. Unfortunately, I'm not able to execute new u-boot on this board.

Many files generated during compilation but without significant one boot0.bin.

After reading Testing chapter from http://linux-sunxi.org/FEL/USBBoot I was able to extract mentioned boot0.bin which works when I write it to SD card. I wrote this boot0.bin using sudo dd if=boot0.bin /dev/sdX bs=1024 seek=8.

My question is which u-boot file (spl or not spl, uboot.img, uboot-spl.img) I should use to start a kernel with fdt. I try to write on SD card many uboot from mainline using sudo dd if=uboot.img /dev/sdX bs=1024 seek=40 but I don't see anything on debug uart (UART 0).

Only what work is 100Mb uboot img taken from official legacy BSP uboot.

I try to make Yocto meta-layer but without working boot section it is impossible.

Thanks for any hints.

Regards

Chen-Yu Tsai

unread,
Mar 19, 2018, 6:43:29 AM3/19/18
to mich...@gmail.com, linux-sunxi
Hi,
If you are using mainline U-boot (and possibly by extension, BPI's mainline
U-boot repo), you are supposed to use the u-boot-sunxi-with-spl.bin file.
This is a concatenated file composed of the SPL (U-boot's boot0.bin if you
will), U-boot proper, and some padding. Write that one to where you would
write boot0.bin.

This is all documented here: http://linux-sunxi.org/Mainline_U-Boot

ChenYu

>
> I try to make Yocto meta-layer but without working boot section it is
> impossible.
>
> Thanks for any hints.
>
> Regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Michał Wołowik

unread,
Mar 19, 2018, 6:58:58 AM3/19/18
to linux-sunxi
Hi Chen-Yu,

thanks for quick answers. If I good understand You, I should write
u-boot-sunxi-with-spl.bin into place where I before writing boot0.bin.
What result I should expect after writing this image, some log on Uartx(0,1,2). How should look uenv.txt file to acquire fdt and kernel? What partitions are needed (BOOT-fat16, rootfs-ext4 are sufficient)?

Thanks
Regards

Michał Wołowik

unread,
Mar 19, 2018, 5:05:34 PM3/19/18
to linux-sunxi
Hi Chen-Yu,

I made a following steps:

1. sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
2. Create two partition boot(fat16 - start from offset 10Mbytes) and root(ext4 - rest after boot)
3. Copy boot.cmd to main directory of boot partition with following content

setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
load mmc 0:1 0x43000000 ${fdtfile} || load mmc 0:1 0x43000000 boot/${fdtfile}
load mmc 0:1 0x42000000 uImage || load mmc 0:1 0x42000000 boot/uImage
bootm 0x42000000 - 0x43000000
4.Copy to boot partition uImage and sun8i-r16-bananapi-m2m.dtb in root folder directory
5. Copy to ext4 all rootfs files using tar -xzcf etc...
6. Make sync to write everything on SD Card

After above operation I just push sdcard to board slot, serial port to UART0 and power on. Untortunatly nothing happen, Uart silent, Led not bliking. What is wrong? u-boot spl is wrong?


Michał Wołowik

unread,
Mar 20, 2018, 10:44:52 AM3/20/18
to linux-sunxi
Finally I'm able to partially execute Uboot

U-Boot SPL 2018.01 (Mar 20 2018 - 13:04:40)
DRAM: 512 MiB

Unfortunatelly, after DRAM... message everythigs stuck

Cheo Fusi

unread,
Sep 22, 2022, 5:56:35 AM9/22/22
to linux-sunxi
Hi,

I get this problem when I use the M2M variant with the A33 chip and no eMMC. With the R16 and and eMMC the boot sequence smooth. I wonder why that is..

Brandon

Reply all
Reply to author
Forward
0 new messages