From owner-freebsd-arm@freebsd.org Sat Jun 24 11:13:42 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FAC9D9C8CA for ; Sat, 24 Jun 2017 11:13:42 +0000 (UTC) (envelope-from jsorocil@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF21D65DD3 for ; Sat, 24 Jun 2017 11:13:41 +0000 (UTC) (envelope-from jsorocil@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id c189so36798411oia.2 for ; Sat, 24 Jun 2017 04:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SZHxnh13y+Gn7rtwooLCWN9QwGABOQ9R5dy9yXM1QaI=; b=t9M3CbBlt+hzoucwdoilg+gNy7xTGMTnZzadjOe2d3ZRIvVlCo5kn5GdX1HZj7CS+8 PA5CIh2rro7Bl65jdHRXBvuJgvORd52GSji7y7mBiWq9rN0FPRfyiTvrMSZLhM8AnskA Q718knulvLEInmkorIHutloJI3mp2WzLmiCYth2JNMRaoN5mMxtvhQU5YYZjUuxP7/gJ asTAtA2FMnMctudCbo1FBHGQnPkgZZ2uwAT+jkruYOpMTmBjI/o3o0+5thJGJwLRoEQT ROc7QC9qhkz71+i2u/0S6pmYtxcrxrcFaZP+qtc4k6qBFOv2EFOtmfts5DqalJ+gzHUL i4Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SZHxnh13y+Gn7rtwooLCWN9QwGABOQ9R5dy9yXM1QaI=; b=iuVppYtkU2T4g+FmI9Iet6qyeKeX5AjGUXjEUTxPugl/NTGOM+ddR/Yo/gKRiI17Hx wYhT1clCmFVmsonGOOXg791pzvJEzsMHyYdQAmMHbdQlM3VN2d6+2hdiqLNhLr27JaDE ks9O+0vhAzxJP2w5UVDC25+sokxSI21Sa/rVrgqasRNuMBnMg/TSBGpoWWhBBvyy7XA+ Qyz1QRljaNSoG3ScHSkJ9ozTif1j9ZvJKaNGSP2IgMhpo6m2JU0hRsc8+5GNuYe90B6s VZH3IY7mI8Yiq65/XarujCMDQXT1A+c2NvVr0hTTqTFIZGWGo7dWd/1qCcfcQiIhuyRu DALw== X-Gm-Message-State: AKS2vOyWl5IkRIcKrhqCon7aUEQQ24icbtu+OfwWJQIIjG9DBUgmtTFl PWrbp4hs8N9ePqHQGmJHXt3qwZhcVGetuOA= X-Received: by 10.202.80.197 with SMTP id e188mr4184375oib.50.1498302820952; Sat, 24 Jun 2017 04:13:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.29.73 with HTTP; Sat, 24 Jun 2017 04:13:40 -0700 (PDT) From: Johnny Sorocil Date: Sat, 24 Jun 2017 13:13:40 +0200 Message-ID: Subject: Orange Pi Zero support To: freebsd-arm@freebsd.org Content-Type: multipart/mixed; boundary="001a113b06da6926fa0552b2cfc0" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jun 2017 11:13:42 -0000 --001a113b06da6926fa0552b2cfc0 Content-Type: text/plain; charset="UTF-8" Hi all! I am trying to run FreeBSD on Orange Pi Zero board (Allwinner H2+ SoC). I have few questions: 1) How to build vanilla u-boot which will be capable booting FreeBSD kernel? I have managed to load ubldr, but not the kernel. 2) How to use newer Linux dts/dtb files? 1) u-boot This is how I built u-boot: git clone git://git.denx.de/u-boot.git cd u-boot git checkout v2017.05 # apply patch so it can be built on FreeBSD (tested on FreeBSD 11.1-BETA1) (in the attachment) gmake ARCH=arm CROSS_COMPILE=arm-none-eabi- orangepi_zero_defconfig gmake -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi- dd if=u-boot-sunxi-with-spl.bin conv=notrunc,sync of=/dev/mmcsd0 bs=1024 seek=8 In the u-boot prompt: fatload mmc 0 0x42000000 ubldr.bin setenv fdtfile sun8i-h3-orangepi-one.dtb go 0x4200000 ubldr will work as expected, but kernel will hang at the start. If I use /usr/local/share/u-boot/u-boot-orangepi-one/u-boot-sunxi-with-spl.bin then the kernel and userland will boot normally. This is tested booting -CURRENT from Jul 22 (git: 57e30b47aab) 2) newer DTS/DTB If I use sun8i-h3-orangepi-one.dtb from FreeBSD source tree then the board will boot fine, but I don't have network. I can also boot normally if the dtb file is rebuilt manually: cd /usr/src/sys/gnu/dts/arm cpp -P -x assembler-with-cpp -I /usr/src/sys/gnu/dts/include -include sun8i-h3-orangepi-plus.dts /dev/null | dtc -O dtb -o ./sun8i-h3-rebuilt.dtb ls -lh sun8i-h3-rebuilt.dtb -rw-r--r-- 1 root wheel 15K Jun 24 13:02 sun8i-h3-rebuilt.dtb But, if dtb files from Armbian (Linux 4.11) are used, kernel will hang: Using DTB from loaded file 'boot/dtb-4.11.3-sun8i/sun8i-h2-plus-orangepi-zero.dtb'. Kernel entry at 0x42200100... Kernel args: -v The same file boots Linux without problems. I don't know why newer dtb files won't work because there is no output on serial console. Any ideas how to make it work? --001a113b06da6926fa0552b2cfc0 Content-Type: text/plain; charset="US-ASCII"; name="uboot_v2017.05.diff" Content-Disposition: attachment; filename="uboot_v2017.05.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j4b37e9x0 ZGlmZiAtLWdpdCBhL2xpYi9iY2guYyBiL2xpYi9iY2guYwppbmRleCBlYzUzNDgzNzc0Li5iNDVj NTA3YzUxIDEwMDY0NAotLS0gYS9saWIvYmNoLmMKKysrIGIvbGliL2JjaC5jCkBAIC02MSw3ICs2 MSwxMSBAQAogI2luY2x1ZGUgPGxpbnV4L2JpdG9wcy5oPgogI2Vsc2UKICNpbmNsdWRlIDxlcnJu by5oPgorI2lmZGVmIF9fRnJlZUJTRF9fCisjaW5jbHVkZSA8bWFjaGluZS9lbmRpYW4uaD4KKyNl bHNlCiAjaW5jbHVkZSA8ZW5kaWFuLmg+CisjZW5kaWYKICNpbmNsdWRlIDxzdGRpbnQuaD4KICNp bmNsdWRlIDxzdGRsaWIuaD4KICNpbmNsdWRlIDxzdHJpbmcuaD4KQEAgLTExMiw3ICsxMTYsNyBA QCBzdHJ1Y3QgZ2ZfcG9seV9kZWcxIHsKIAl1bnNpZ25lZCBpbnQgICBjWzJdOwogfTsKIAotI2lm ZGVmIFVTRV9IT1NUQ0MKKyNpZiBkZWZpbmVkIFVTRV9IT1NUQ0MgJiYgIWRlZmluZWQgX19GcmVl QlNEX18KIHN0YXRpYyBpbnQgZmxzKGludCB4KQogewogCWludCByID0gMzI7Cg== --001a113b06da6926fa0552b2cfc0--