Other OS

FreeBSD 10.0 on Banana

21 19002
TooMeeK  
Post Last Edited by TooMeeK at 2014-8-12 11:50

Hi,
trying to boot FreeBSD 10.0 kernel on Banana Pi, mainly for pfSense distro port.
It's Cubieboard2 based kernel image.
So far, no luck.
How to pass bootloader options, since my serial console at J11 seems to be read-only (not passing keys as it should be) and I cannot get kernel booting?
cubieboard2-freebsd.png
From the log, it seems that you do not include uEnv.txt or boot.src file to guide the next boot process. I think we need set the environment variable in uEnv.txt or boot.src so that the uboot know where is kernel and where is root file system.

TooMeeK  
Post Last Edited by TooMeeK at 2014-8-12 12:53

Thank You.
I've set eEnv.txt file that shoud load:
fatload mmc 0 0x40200000 kernel; go 0x40200100

however, it seems that this file isn't read from the partition - no change in console log.
I'll try with boot.scr from u-boot-sunxi git, how-to here:
https://linux-sunxi.org/Manual_build_howto#boot.cmd

I've followed this how-to for FreeBSD distro:
https://wiki.freebsd.org/FreeBSD/arm/Cubieboard
UPDATE:
I've missed statement that there are 2 storage devices.. USB flash and SD card.
I'll try to put everything on SD card.

TooMeeK  
Post Last Edited by TooMeeK at 2014-8-12 15:01

I'm in process of building own Banana's kernel config under FreeBSD.
And I need Your help ;)
First question is.. where I can find technical details of device?
As example here - based on Cubieboard2 files - what is addressing for memory?
EDIT:
I've used address space 0x40000000 - 0x00000000 which suppose to be 1024MB, will see.
bananapi-freebsd-kernel.PNG
bananapi-memory-addressing.PNG

Banana Pi memory address is the same as cubieboard2

TooMeeK  
Post Last Edited by TooMeeK at 2014-8-12 18:04

Thanks, kernel is compiled.
Now I just need new u-boot.. tried the latest from there:
ftp://ftp.denx.de/pub/u-boot/
but it fails to compile.

EDIT:
I cannot get any version of u-boot to compile under FreeBSD.
I've tried several ways using both Linux and FreeBSD version of u-boot, none of them worked.
bananapi-freebsd-kernel.PNG
freebsd-uboot-fail.PNG
uboot3.png
uboot2.png
uboot1.png

TooMeeK  
Post Last Edited by TooMeeK at 2014-8-12 22:19

So far, I've stuck here:
pkg install gcc make joe screen htop gsed wget git
set CROSS=/usr/obj/arm.armv6/usr/src/tmp/usr/bin/
echo $CROSS
git clone https://github.com/linux-sunxi/u-boot-sunxi
cd u-boot-sunxi
ln -s /usr/local/bin/gcc /usr/obj/arm.armv6/usr/src/tmp/usr/bin/gcc
gmake -j4 ARCH=arm CROSS_COMPILE=${CROSS} USE_PRIVATE_LIBGCC=yes Bananapi_config
gmake -j4 ARCH=arm CROSS_COMPILE=${CROSS} USE_PRIVATE_LIBGCC=yes

UPDATE:
I was missing this:

pkg install arm-eabi-gcc
ln -s /usr/local/bin/arm-eabi-gcc /usr/local/bin/gcc
ln -s /usr/local/bin/arm-eabi-gcc /usr/obj/arm.armv6/usr/src/tmp/usr/bin/gcc

but still getting error, now about missing sys/mman.h
freebsd-gmake-compilation.PNG
freebsd-gmake-compilation2.PNG
freebsd-gmake-compilation3.PNG

It seems that you lack of many headers.

TooMeeK  
I've posted this problem on FreeBSD ARM mailing lists and got quick answer:
http://lists.freebsd.org/piperma ... -August/008954.html
so I've already have u-boot, I'm proceeding to next step which is preparing SD card for booting using script.bin / eEnv.txt.
Hope it will finally work.

TooMeeK  
Post Last Edited by TooMeeK at 2014-8-13 17:56

Successfully compiled kernel, script.bin, boot.scr and u-boot-sunxi-with-spl.bin.
Now I'm stuck again
See the log.
EDIT:
That's part of my preparing script - u-boot files:
...mount_msdosfs /dev/md0s1 /mnt
cp /usr/obj/arm.armv6/usr/src/sys/BANANAPI/kernel /mnt
cd /usr/src/sunxi-tools
./fex2bin ../sunxi-boards/sys_config/a20/Bananapi.fex script.bin
cp script.bin /mnt
echo "fatload mmc 0 0x40200000 kernel; go 0x40200100" > boot.cmd
/usr/src/u-boot-sunxi/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
dd if=/usr/src/u-boot-sunxi/u-boot-sunxi-with-spl.bin conv=notrunc of=banana.img bs=1024 seek=8

I assume load address is invalid? Or kernel itself?
UPDATE:
Now I know kernel failed to compile. Laughting now.. because of this "resetting cpu".
So long time spent on this and still no results.
Kernel wasn't loaded because:
echo "fatload mmc 0 0x40200000 kernel; go 0x40200100" > boot.cmd

should be replaced by:
echo "fatload mmc 0 0x43000000 script.bin; fatload mmc 0 0x48000000 kernel; go 0x48000000" > boot.cmd
UPDATE:

root@freebsd:/usr/obj/arm.armv6/usr/src/sys/BANANAPI # file kernel
kernel: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
booting-freebsd-kernel.png
freebsd-kernel-boot-failure.png

You have to log in before you can reply Login | Sign Up

Points Rules