From owner-freebsd-arm@FreeBSD.ORG Mon Aug 18 22:31:37 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7902F66 for ; Mon, 18 Aug 2014 22:31:37 +0000 (UTC) Received: from poczta.toomeek.waw.pl (unknown [IPv6:2001:67c:232c:1000::fd9b:4fb4]) by mx1.freebsd.org (Postfix) with ESMTP id 5FD9F3F2A for ; Mon, 18 Aug 2014 22:31:36 +0000 (UTC) Received: from [192.168.137.1] (afnk156.neoplus.adsl.tpnet.pl [178.42.88.156]) by poczta.toomeek.waw.pl (Postfix) with ESMTPSA id 4F59DC601DD for ; Mon, 18 Aug 2014 18:31:24 -0400 (EDT) Message-ID: <53F27EB9.3090805@toomeek.waw.pl> Date: Tue, 19 Aug 2014 00:31:21 +0200 From: TooMeeK Admin User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "freebsd-arm@freebsd.org" Subject: Re: U-boot for Banana Pi References: <53EE0F93.6060407@toomeek.waw.pl> <53EE23B1.2020403@toomeek.waw.pl> <53EE402D.8000204@toomeek.waw.pl> <20140815214416.GJ60808@cicely7.cicely.de> <53EFCD6C.5000601@toomeek.waw.pl> <53EFD5D5.7010406@toomeek.waw.pl> <53F0E640.5030506@toomeek.waw.pl> <53F14BD7.1050007@fukaumi.org> <53F1A126.1020408@toomeek.waw.pl> <53F1D8FD.9010903@fukaumi.org> In-Reply-To: <53F1D8FD.9010903@fukaumi.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.3.9 (poczta.toomeek.waw.pl [0.0.0.0]); Mon, 18 Aug 2014 18:31:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.98.1 at a8d2ba546e X-Virus-Status: Clean X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 22:31:37 -0000 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@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). 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 >