U-boot for Banana Pi

Ganbold Tsagaankhuu ganbold at gmail.com
Wed Aug 27 12:53:42 UTC 2014


On Tue, Aug 19, 2014 at 6:31 AM, TooMeeK Admin <maps at toomeek.waw.pl> wrote:

> Hello,
>
> thanks Naoki, but.. this is my script's header for SD booting image:
>
> #!/bin/bash
> cd /root/banana
> rm /root/banana/banana.img
> truncate -s 940M banana.img
>
> mdconfig -f banana.img -u0
> gpart create -s mbr md0
> gpart add -b 1m -s 64m -t fat16 md0
> gpart set -a active -i 1 md0
> gpart add -t freebsd md0
> newfs_msdos -F 16 /dev/md0s1
> newfs /dev/md0s2
>
> mount_msdosfs /dev/md0s1 /mnt
> cp /usr/obj/arm.armv6/usr/src/sys/BANANAPI/kernel /mnt
> cd /usr/src/sunxi-tools
> echo "fatload mmc 0 0x40200000 kernel; go 0x40200100" > boot.cmd
> /usr/src/u-boot-bananapi/tools/mkimage -C none -A arm -T script -d
> boot.cmd boot.scr
> cp boot.scr /mnt
> umount /mnt
>
> mdconfig -d -u0
> cd /root/banana
> # Original Banana Pi U-boot loader
> #dd if=/usr/src/u-boot-sunxi/spl/sunxi-spl.bin conv=notrunc of=banana.img
> bs=1024 seek=8
> #dd if=/usr/src/u-boot-sunxi/u-boot.bin conv=notrunc of=banana.img
> bs=1024 seek=40
> # Lemaker's U-boot loader
> dd if=/usr/src/u-boot-bananapi/spl/sunxi-spl.bin conv=notrunc
> of=banana.img bs=1024 seek=8
> dd if=/usr/src/u-boot-bananapi/u-boot.bin conv=notrunc of=banana.img
> bs=1024 seek=40
>
> The script output is similar to this:
>
> root at freebsd:~/banana # bash prepare_boot.sh
> md0 created
> md0s1 added
> active set on md0s1
> md0s2 added
> /dev/md0s1: 130888 sectors in 16361 FAT16 clusters (4096 bytes/cluster)
> BytesPerSec=512 SecPerClust=8 ResSectors=1 FATs=2 RootDirEnts=512
> Media=0xf0 FATsecs=64 SecPerTrack=17 Heads=255 HiddenSecs=0
> HugeSectors=131053
> /dev/md0s2: 875.0MB (1792000 sectors) block size 32768, fragment size 4096
>         using 4 cylinder groups of 218.78MB, 7001 blks, 28032 inodes.
> super-block backups (for fsck -b #) at:
>  192, 448256, 896320, 1344384
> Image Name:
> Created:      Tue Aug 19 02:20:04 2014
> Image Type:   ARM Linux Script (uncompressed)
> Data Size:    55 Bytes = 0.05 kB = 0.00 MB
> Load Address: 00000000
> Entry Point:  00000000
> Contents:
>    Image 0: 47 Bytes = 0.05 kB = 0.00 MB
> 23+1 records in
> 23+1 records out
> 24064 bytes transferred in 0.003972 secs (6058691 bytes/sec)
> 235+1 records in
> 235+1 records out
> 241544 bytes transferred in 0.003128 secs (77224557 bytes/sec)
>
>
> Original Banana Pi U-boot loader output:
>
>
> U-Boot SPL 2014.04-10704-gf625d1d (Aug 16 2014 - 23:44:23)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
> spl: not an uImage at 80
> ### ERROR ### Please RESET the board ###
>
> And Lemaker's:
>
> U-Boot SPL 2014.04-10693-gf954935 (Aug 17 2014 - 21:41:27)
>
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
> spl: not an uImage at 80
> ### ERROR ### Please RESET the board ###
>
> The only way it works is:
> # Cubieboard's 2 U-boot loader from FreeBSD Wiki
>
> dd if=sunxi-spl.bin conv=notrunc of=banana.img bs=1024 seek=8
> dd if=u-boot.bin conv=notrunc of=banana.img bs=1024 seek=32
>
> And according to https://github.com/linux-sunxi/u-boot-sunxi/wiki
> "If using v2013.07 or earlier then the procedure is slightly different
> dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
> dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32"
>
> So it SHOULD be seek=40 and it's not working anyway..
> I suspect wrong U-boot may cause these memory problems too (kernel not
> booting with 1024MB nad 768MB addressed).
>


I've just got Banana PI today, and I confirm that Cubieboard2 kernel works
just fine detecting 1GB RAM and booting to multi user mode. I run recent
Current of course.

Ganbold




>
> Cheers,
> TooMeeK
>
>
>
> W dniu 2014-08-18 12:44, FUKAUMI Naoki pisze:
>
>>
>> On 08/18/2014 03:45 PM, TooMeeK Admin wrote:
>>
>>> I'm working on image, not raw device.
>>> So "conv=notrun" is needed to avoid destroying it completly..
>>>
>>> Note that partitions start outside bootloader, so ~1MB after this data.
>>>
>>
>> please see the number after *seek=*
>>
>>  dd if=/usr/src/u-boot-sunxi/spl/sunxi-spl.bin conv=notrunc of=banana.img
>>>>> bs=1024 seek=8
>>>>> dd if=/usr/src/u-boot-sunxi/u-boot.bin conv=notrunc of=banana.img
>>>>> bs=1024 seek=32
>>>>>
>>>>
>>>> from https://github.com/linux-sunxi/u-boot-sunxi/wiki
>>>>
>>>>  dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
>>>>
>>>> or
>>>>
>>>>  dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
>>>>  dd if=u-boot.img of=/dev/sdX bs=1024 seek=40
>>>>
>>>
>>
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>


More information about the freebsd-arm mailing list