From owner-freebsd-arm@freebsd.org Wed May 10 15:07:35 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 1A6C1D66B19 for ; Wed, 10 May 2017 15:07:35 +0000 (UTC) (envelope-from aggaz@paranoici.org) Received: from perdizione.investici.org (perdizione.investici.org [IPv6:2001:41d0:2:33d0::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.autistici.org", Issuer "Autistici/Inventati Certification Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB511003 for ; Wed, 10 May 2017 15:07:34 +0000 (UTC) (envelope-from aggaz@paranoici.org) Received: from [94.23.50.208] (perdizione [94.23.50.208]) (Authenticated sender: aggaz@paranoici.org) by localhost (Postfix) with ESMTPSA id 26E8D12000E; Wed, 10 May 2017 15:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paranoici.org; s=stigmate; t=1494428842; bh=HJa9GKZEpW8hS3WwwlhmwlZQgEP4YX2Z91rFslDaP3w=; h=From:To:Subject:Date; b=X1XkrLQszQiaEPchYS3ZJu/0FyaUVDhVcGXyjmGBRopZ4ZFhw3n1iapwsGDaQqS4z OXlKoKj2FuBCz8y7OzNIDjwxWlzdvxiNec9Eo89oBPR0pzXWwLKfrMQP57ruz/mQlp yqOYrSzTrcIzQwQFVe7mT8R5d4R616YDqpT1qVho= From: aggaz To: freebsd-arm@freebsd.org Subject: Re: FreeBSD 12-CURRENT on OrangePi One Message-ID: <0d94c2c1-6b1f-3da1-9de9-f25c84573029@paranoici.org> Date: Wed, 10 May 2017 17:07:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit 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: Wed, 10 May 2017 15:07:35 -0000 Dear list, I am still playing with FreeBSD/Crochet/OrangePi-One. In my last attempts, I was able to boot FreeBSD by using two dtb files: [nano]: NanoPi-Neo ($FREEBSDSRC/sys/boot/fdt/dts/arm/nanopi-neo.dts) [plus]: OrangePi-Plus-2E ($FREEBSDSRC/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts) Using [nano] I was able to use ethernet but not USB. Using [plus] I was able to use USB but not ethernet. Now, I merged [nano] and [plus] generating a dts file for OrangePi One (lets call it: [one]). Basically, [one] is a copy of [plus], but the lines regarding ethernet interface are from [nano]. In particular, lines 65-78 of [plus] are deleted and lines 53-63 of [nano] are used instead. [one] works fine on my OrangePi One, I used it in the last couple of days, and both ethernet and USB are working. --------------------------------------------------------------------------------------------- ==Other attempts: Before writing file [one], I also tried to use the dts file for OrangePi One from Linux: [linux]: $FREEBSDSRC/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts With this file ethernet does not work, and usb works sporadically. In order to add ethernet, I applyed the patches as described in [1]. To be more specific, I only used the patches written in the following text, copied from the cited blog: #==================================================================== # [v4,04/10] ARM: dts: sun8i-h3: Add dt node for the syscon wget https://patchwork.kernel.org/patch/9365773/raw/ \ -O sun8i-emac-patch-4.patch # [v4,05/10] ARM: dts: sun8i-h3: add sun8i-emac ethernet driver wget https://patchwork.kernel.org/patch/9365757/raw/ \ -O sun8i-emac-patch-5.patch # [v4,07/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI One wget https://patchwork.kernel.org/patch/9365767/raw/ \ -O sun8i-emac-patch-7.patch #==================================================================== The resulting patched file ([patch]) boots. I can see both ethernet and USB, but ethernet never works, and USB works sporadically. To be more specific: When I attach an USB memory to the port, I can mount it 1 time over 5 attempts, and when things do not work I see the following messages in dmesg: #==================================================================== ugen0.2: at usbus0 umass0 on uhub0 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks = 0x8100 umass0:0:0: Attached to scbus0 (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (probe0:umass-sim0:0:0:0): Retrying command (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (probe0:umass-sim0:0:0:0): Retrying command (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (probe0:umass-sim0:0:0:0): Retrying command (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (probe0:umass-sim0:0:0:0): Retrying command (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00 (probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (probe0:umass-sim0:0:0:0): Error 5, Retries exhausted #==================================================================== Regarding ethernet, it does never work, and at boot (using DHCP) I see these messages: #==================================================================== awg0: link state changed to DOWN awg0: link state changed to UP Starting Network: lo0 awg0. lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=21 awg0: flags=8843 metric 0 mtu 1500 options=8000b ether 02:81:1c:2e:66:ec media: Ethernet none (none ) status: active nd6 options=29 Starting devd. Starting dhclient. DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 15 DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 16 DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 14 DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 9 No DHCPOFFERS received. No working leases in persistent database - sleeping. add host 127.0.0.1: gateway lo0 fib 0: route already in table add host ::1: gateway lo0 fib 0: route already in table add net fe80::: gateway ::1 add net ff02::: gateway ::1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 Generating host.conf. Waiting 30s for the default route interface: ............................. #==================================================================== --------------------------------------------------------------------------------------------- ==Work in progress: Now that I have both USB and ethernet, given that the [linux] dts seems to be not working, and given that I was not able to really understand wich dts file is the best one for OrangePi One in the land of Linux, I am inclined to work on [one], because it works and derives from [plus], which was written for a similar board. One of the differences between OrangePi Plus 2E and OrangePi One is the voltage regulator responsible for cpu scaling. I had a look at the values used in the FEX files from Armbian [2] (lines 713-730), and I inserted similar values in the lines 96-97 and 111-121 of [plus]. Things seem to work fine until now, but I really don't know how should I check the correct behavior of cpu-scaling. Moreover, I am not an experienced developer and I am really just putting things together here, so I would like to know if you think I am following the right road. Finally, given that I used a FEX file from Armbian as a reference, and given that I am not sure about the license this file is released with, I do not know what kind of license should I use for my work in progress dts file. I am a beginner here, any kind of help or suggestion is very much appreciated. Regards Aggaz [1] https://blog.christophersmart.com/2016/10/23/building-and-booting-upstream-linux-and-u-boot-for-orange-pi-one-arm-board/ [2] https://github.com/armbian/build/blob/master/config/fex/orangepione.fex