Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2017 17:07:21 +0200
From:      aggaz <aggaz@paranoici.org>
To:        freebsd-arm@freebsd.org
Subject:   Re: FreeBSD 12-CURRENT on OrangePi One
Message-ID:  <0d94c2c1-6b1f-3da1-9de9-f25c84573029@paranoici.org>

next in thread | raw e-mail | index | archive | help
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: <SanDisk Cruzer Fit> at usbus0
umass0 on uhub0
umass0: <SanDisk Cruzer Fit, class 0/0, rev 2.10/1.00, addr 2> 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<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
awg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 02:81:1c:2e:66:ec
        media: Ethernet none (none <hw-loopback>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0d94c2c1-6b1f-3da1-9de9-f25c84573029>