Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2017 12:03:10 +0200
From:      aggaz <aggaz@paranoici.org>
To:        freebsd-arm@freebsd.org
Subject:   FreeBSD 12-CURRENT on OrangePi One
Message-ID:  <8eae97a3-6f3d-2273-31fb-67627ce4bd15@paranoici.org>

next in thread | raw e-mail | index | archive | help
Dear list,

recently I was able to build a working FreeBSD 12-CURRENT image for
OrangePi One by using crochet.

This particular board is partially supported. It uses SoC H3 which is
supported by FreeBSD, and there is a u-boot package available in ports.
However there is no ready-made crochet-specific configuration.

I am going to write here what I did, hoping that someone else will find
this information useful, and hoping that crochet developers are reading
this. I do not have a github account and I can not contact them on that
particular portal.


1. Freebsd and crochet sources.
I am using FreeBSD 12-CURRENT and last crochet, sources of both
downloaded on April 26 2017.


2. OrangePi One config
In crochet, I created a new board, called "OrangePi-One" using the
config from "OrangePi-Plus2E" as a template.
I corrected paths and a little bug on the setup.sh file, which follows:

=========================================================================
% cat setup.sh
KERNCONF=ALLWINNER
UBLDR_LOADADDR=0x42000000
SUNXI_UBOOT="u-boot-orangepi-one"
SUNXI_UBOOT_BIN="u-boot.img"
IMAGE_SIZE=$((1000 * 1000 * 1000 * 2))
TARGET_ARCH=armv6

UBOOT_PATH="/usr/local/share/u-boot/${SUNXI_UBOOT}"

allwinner_partition_image ( ) {
    echo "Installing U-Boot files"
    dd if=${UBOOT_PATH}/u-boot-sunxi-with-spl.bin conv=notrunc,sync
of=/dev/${DISK_MD} bs=1024 seek=8
    dd if=${UBOOT_PATH}/u-boot.img conv=notrunc,sync of=/dev/${DISK_MD}
bs=1024 seek=40
    disk_partition_mbr
    disk_fat_create 32m 16 1m
    disk_ufs_create
}
strategy_add $PHASE_PARTITION_LWW allwinner_partition_image

allwinner_check_uboot ( ) {
    uboot_port_test ${SUNXI_UBOOT} ${SUNXI_UBOOT_BIN}
}
strategy_add $PHASE_CHECK allwinner_check_uboot

strategy_add $PHASE_BUILD_OTHER freebsd_ubldr_build
UBLDR_LOADADDR=${UBLDR_LOADADDR}
strategy_add $PHASE_BOOT_INSTALL freebsd_ubldr_copy_ubldr .

# BeagleBone puts the kernel on the FreeBSD UFS partition.
strategy_add $PHASE_FREEBSD_BOARD_INSTALL board_default_installkernel .
# overlay/etc/fstab mounts the FAT partition at /boot/msdos
strategy_add $PHASE_FREEBSD_BOARD_INSTALL mkdir -p boot/msdos
# ubldr help and config files go on the UFS partition (after boot dir
exists)
strategy_add $PHASE_FREEBSD_BOARD_INSTALL freebsd_ubldr_copy boot
=========================================================================

basically, I am using u-boot for OrangePi One from ports (line 3, 8, 12,
13).
Line 12 was causing problems, same as described by someone else here:
https://github.com/freebsd/crochet/issues/191

I added the parameters "conv=notrunc,sync" and now it works.


4. DTB file
There is no dtb file for OrangePi One.
In a previous attempt, by using old freebsd/crochet sources, I tried to
use the DTB file compiled for OrangePi-Plus2E.
It was working, but it took a lot to boot (I had issues with timers
apparently), and I was not able to use ethernet connection.
Then I tried the DTB from NanoPi-Neo, which is also based on H3 Soc, and
thing seems to work fine.
So now, I basically copied the DTB file /boot/dtb/nanopi-neo.dtb to
/boot/dtb/sun8i-h3-orangepi-one.dtb


5. Issuses
For some reason, I can not use the GrowFS option. At boot I get errors.
The following line is continuously printed and the sistem wont boot.
----
vm_fault: pager read error, pid 1 (init)
----
I will try to grow the partition manually.


For the time being, this is it.
Hope this report is useful, if some developer wish to use my board and
my time to test stuff to make the support of this board more stable, I
am available for testing.

Regards
Aggaz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8eae97a3-6f3d-2273-31fb-67627ce4bd15>