# NanoPI Neo 3 rockchip rk3328



## xandor (Aug 3, 2020)

Hi All, 

I am trying to boot a FreeBSD image on a NanoPI Neo 3 rockchip with 2 GB ram. I tried to boot from the ROCK64 image but it is not booting. I've tried booting netbsd 9.0 stable and it just boots normally. Unfortunately, I do not have enough knowledge to boot process and order. Other then that it boots off a fat partition first. Can any one help making FreeBSD running on this nice little board?

X.


----------



## JohnnySorocil (Aug 12, 2020)

Where are logs? Do FreeBSD stars to boot and then panic? Did you pass u-boot phase? Are you using right device tree?


----------



## xandor (Aug 18, 2020)

JohnnySorocil said:


> Where are logs? Do FreeBSD stars to boot and then panic? Did you pass u-boot phase? Are you using right device tree?



I got a fresh snapshot FreeBSD-13.0-CURRENT-arm64-aarch64-ROCK64-20200813-r364182.img
I get this from the console:


```
[...FreeBSD...]
U-Boot TPL 2020.07 (Jul 16 2020 - 04:58:08)
data training error
col error
data training error
LPDDR3, 800MHz
BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB
[...]
```
and then, it hangs. There is quite a difference with the netbsd output, notably the detection of LPDDR3 and DDR4 and the size. The correct memory size is 2048MB.


```
[...NetBSD..]
DDR version 1.13 20180428
ID:0x805 N
In
DDR4
786MHz
Bus Width=32 Col=10 Bank=4 Bank Group=2 Row=16 CS=1 Die Bus-Width=16 Size=2048MB
ddrconfig:14
OUT

U-Boot SPL 2017.09-rockchip-ayufan-1060-g56bd958253 (Jun 05 2019 - 09:41:25)
board_init_sdmmc_pwr_en
setup_ddr_param  1
booted from SD
Trying to boot from MMC2
NOTICE:  BL31: v1.3(debug):9d3f591
NOTICE:  BL31: Built : 14:39:02, Jan 17 2018
NOTICE:  BL31:Rockchip release version: v1.3
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
etc. etc.
[...]
```


----------



## alfa (Feb 5, 2021)

xandor said:


> Hi All,
> 
> I am trying to boot a FreeBSD image on a NanoPI Neo 3 rockchip with 2 GB ram. I tried to boot from the ROCK64 image but it is not booting. I've tried booting netbsd 9.0 stable and it just boots normally. Unfortunately, I do not have enough knowledge to boot process and order. Other then that it boots off a fat partition first. Can any one help making FreeBSD running on this nice little board?
> 
> X.



you can try Ganbold's rk3328 based board FreeBSD 13.0 Current image and u-boot

i have orange pi r1 plus board seems like nano pi r2s clone and  they are same rk3328 based boards



			https://people.freebsd.org/~ganbold/FreeBSD-13.0-CURRENT-arm64-aarch64-nanopi-r2s.img.xz
		



			Index of /~ganbold/nanopi-r2s/


----------



## felix (Feb 5, 2021)

You can use last snapshots ISO for ROCK64 and MicroSD as /dev/sdb:


```
wget https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/13.0/FreeBSD-13.0-ALPHA2-arm64-aarch64-ROCK64-20210122-02611ef8ee9-256201.img.xz
xz -d FreeBSD-13.0-ALPHA2-arm64-aarch64-ROCK64-20210122-02611ef8ee9-256201.img.xz
dd if=FreeBSD-13.0-ALPHA2-arm64-aarch64-ROCK64-20210122-02611ef8ee9-256201.img of=/dev/sdb bs=1M status=progress


wget https://mirrors.dotsrc.org/armbian-apt/pool/main/l/linux-u-boot-nanopineo3-current/linux-u-boot-current-nanopineo3_21.02.1_arm64.deb
ar x linux-u-boot-current-nanopineo3_21.02.1_arm64.deb
tar Jxpvf data.tar.xz
x ./
x ./usr/
x ./usr/lib/
x ./usr/lib/linux-u-boot-current-nanopineo3_21.02.1_arm64/
x ./usr/lib/linux-u-boot-current-nanopineo3_21.02.1_arm64/idbloader.bin
x ./usr/lib/linux-u-boot-current-nanopineo3_21.02.1_arm64/trust.bin
x ./usr/lib/linux-u-boot-current-nanopineo3_21.02.1_arm64/uboot.img
x ./usr/lib/u-boot/
x ./usr/lib/u-boot/LICENSE
x ./usr/lib/u-boot/nanopi-r2s-rk3328_defconfig
x ./usr/lib/u-boot/platform_install.sh

cd ./usr/lib/linux-u-boot-current-nanopineo3_21.02.1_arm64/
dd if=idbloader.bin of=/dev/sdb seek=64 conv=notrunc
dd if=uboot.img of=/dev/sdb seek=16384 conv=notrunc
dd if=trust.bin of=/dev/sdb seek=24576 conv=notrunc
```

Boot NanoPI NEO3 from this MicroSD.


----------



## fdebene (Feb 13, 2021)

felix said:


> You can use last snapshots ISO for ROCK64 and MicroSD as /dev/sdb:
> 
> `wget https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/13.0/FreeBSD-13.0-ALPHA2-arm64-aarch64-ROCK64-20210122-02611ef8ee9-256201.img.xz
> xz -d FreeBSD-13.0-ALPHA2-arm64-aarch64-ROCK64-20210122-02611ef8ee9-256201.img.xz
> ...


I can reach my device providing it an ip address via ssh but i don't know the user and pass, would you guys tell me?


----------



## fdebene (Feb 13, 2021)

Maybe a stupid question, do you guys know the image password so I can ssh into my device?


----------



## JohnnySorocil (Feb 13, 2021)

IIRC, there is no password for root on serial console.
Ssh root login is possibly disabled, to enable it login as root (on serial or HDMI/video console), edit /etc/ssh/sshd_config

```
# temporary
PasswordAuthentication yes
PermitRootLogin yes
# when ssh key is generated and transferred:
# PermitRootLogin without-password
```

Restart sshd with `service sshd restart`


----------



## fdebene (Feb 13, 2021)

This is headless system and I don't have a console cable to check what is going on, so logining in is not an option at this point but I am able to reach it via ssh and eventually I've found that all ARM images come with a *freebsd* user and *freebsd* password and *root* and *root* for the su. Thanks anyway.


----------



## RxD (Mar 25, 2021)

I have created simple script for building NEO3 image with ZFS.









						GitHub - robertek/freebsd-nanopi-neo3: FreeBSD image creation for Nanopi NEO3 with zfs root and ssh key auth
					

FreeBSD image creation for Nanopi NEO3 with zfs root and ssh key auth - GitHub - robertek/freebsd-nanopi-neo3: FreeBSD image creation for Nanopi NEO3 with zfs root and ssh key auth




					github.com
				




Actually investigating now several issues. 

1) The USB does not work, there seems to be xhci driver integrated but need to find out why the actual USB port does not work

2) The mmc card is terribly slow, I have similar setup on my backup station with raspberry pi3 and the sdcard is way faster there.


----------



## SanPollo (Apr 20, 2021)

I'm trying to get 13.0-RELEASE working on an Orange Pi R1 Plus as mentioned earlier in the thread. I downloaded the ROCK64 image, then the nanopine deb that felix mentioned. I wrote the FreeBSD image to the sdcard, and then ran the dd commands for idbloader.bin, uboot.img and trust.bin but when I power on the Pi, I just get the following message:


```
U-Boot TPL 2020.10 (Apr 09 2021 - 03:54:54)
data training error
col error
data training error
LPDDR3, 800MHz
BW=16 Col=12 Bk=8 CSO Row=16 CS=1 Die BW=8 Size=4096MB
```

What am I doing wrong? Have the offsets changed for the 'dd' command for the RELEASE image?

Thanks in advance,
SanPollo


----------



## diizzy (Apr 21, 2021)

In order to not make it a mess and a nightmare to maintain there's only support for mainline u-boot and dts files from Linux mainline kernel (in 99.9% of all cases).
Please work with u-boot and linux-arm-kernel team to upstream proper dts files. You can of course work around this but you're on your own as far as support goes.
​


----------



## Szczepan (Apr 21, 2021)

SanPollo said:


> I'm trying to get 13.0-RELEASE working on an Orange Pi R1 Plus as mentioned earlier in the thread. I downloaded the ROCK64 image, then the nanopine deb that felix mentioned. I wrote the FreeBSD image to the sdcard, and then ran the dd commands for idbloader.bin, uboot.img and trust.bin but when I power on the Pi, I just get the following message:
> 
> 
> ```
> ...


Did you used images from https://mirrors.dotsrc.org/armbian-apt/pool/main/l/linux-u-boot-orangepi-r1plus-current/ ?


----------



## SanPollo (Apr 21, 2021)

I was using the wrong image! Thank you so much, it's booting now. 

Just one question - there are two ethernet ports, and only the "1000M USB Ethernet" port in the diagram is working. The other one isn't recognised by FreeBSD. Do you think this is a hardware issue, or does FreeBSD not have drivers for this NIC? There are no lights on the NIC even when it is plugged into the router.


----------



## alfa (Apr 22, 2021)

SanPollo said:


> I was using the wrong image! Thank you so much, it's booting now.
> 
> Just one question - there are two ethernet ports, and only the "1000M USB Ethernet" port in the diagram is working. The other one isn't recognised by FreeBSD. Do you think this is a hardware issue, or does FreeBSD not have drivers for this NIC? There are no lights on the NIC even when it is plugged into the router.


FreeBSD does not have RTL8153B support yet.








						RTL8153B  Gbit interface not loading FreeBSD 13.0 ALPHA2 installed RK3328 board
					

Hi, i have installed FreeBSD 13.0 ALPHA2 ROCK64 on Orange Pi R1 Plus but RTL8153B is not loading. When i typed ifconfig there is only dwc0 interface(RTL8211E) and also FreeBSD is recognizing double RTL8211 phy devices so that what is the my problem? any help would be appreciated  root@generic:~...




					forums.freebsd.org


----------



## SanPollo (Apr 22, 2021)

alfa said:


> FreeBSD does not have RTL8153B support yet.
> 
> 
> 
> ...


Many thanks alfa. I'll crack on and set it up as an OpenVPN server.


----------



## Szczepan (Jun 8, 2021)

SanPollo said:


> Many thanks alfa. I'll crack on and set it up as an OpenVPN server.


Looking at PR 253374 looks like some support was added - maybe check this out?


----------



## SanPollo (Jun 8, 2021)

Ooh thanks.  The box is at my parents’ in the UK and it’s up and running nicely now with the other NIC. I’ve ordered another Orange Pi (same model) so I will check it out when it arrives.

Thanks again!


----------



## SanPollo (Jul 26, 2021)

Szczepan said:


> Looking at PR 253374 looks like some support was added - maybe check this out?



My other Orange Pi R1 Plus arrived and I set it up. However, I don't think I have much chance of getting the other NIC working as it's USB and FreeBSD doesn't seem to have USB support for this board:


```
root@orangepi:~ # dmesg|grep -i usb
usb_needs_explore_all: no devclass
```

Should I open another thread asking how to get USB working? I plug small capacity USB thumb drives into my SBCs to use as swap (as these boards have limited RAM, and I want to save the SDCARDs from excessive writes) so USB support is quite important to me.


----------

